diff options
Diffstat (limited to 'src/lib/netlist')
342 files changed, 132189 insertions, 27018 deletions
diff --git a/src/lib/netlist/.clang-tidy b/src/lib/netlist/.clang-tidy new file mode 100644 index 00000000000..4cc0f1a6ac6 --- /dev/null +++ b/src/lib/netlist/.clang-tidy @@ -0,0 +1,14 @@ +Checks: '-misc-non-private-member-variables-in-classes' +WarningsAsErrors: '' +HeaderFilterRegex: '' +AnalyzeTemporaryDtors: true +FormatStyle: none +CheckOptions: + - key: misc-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: '1' + - key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic + value: '1' + - key: readability-magic-numbers.IgnoredIntegerValues + value: '0;1;2;3;4;5;6;7;8;9;' + - key: cppcoreguidelines-avoid-magic-numbers.IgnoredIntegerValues + value: '0;1;2;3;4;5;6;7;8;9;' diff --git a/src/lib/netlist/.gitignore b/src/lib/netlist/.gitignore index 6021502dade..ec2a4e8336e 100644 --- a/src/lib/netlist/.gitignore +++ b/src/lib/netlist/.gitignore @@ -3,3 +3,26 @@ build/obj/* buildVS/Release/* buildVS/x64/* buildVS/.vs/* +nltool +nlwav +nltool.html +nltool.js +nltool.wasm +nlwav.html +nlwav.js +nlwav.wasm + +# Windows executables +*.exe + +# Local doxygen binaries +doxygen +doxyindexer +doxysearch.cgi + +# nltool/nlwav output files +*.log +*.wav + +# VS 2019 +*.user
\ No newline at end of file diff --git a/src/lib/netlist/FAQ.md b/src/lib/netlist/FAQ.md new file mode 100644 index 00000000000..b8a7dc8b5eb --- /dev/null +++ b/src/lib/netlist/FAQ.md @@ -0,0 +1,152 @@ +# The netlist FAQ + +## Glossary + +BTANB: Bugs That Aren't Bugs. Bugs in the hardware (or software) that are +faithfully emulated, therefore not a bug in the emulator. + +## General + +### Have you considered maybe supporting part randomization in the netlist core? + +Yes I did. And decided against it. Which features? Forced randomness - will this +be different at every restart? And it would require another parameter per device +(specification, e.g. for resistors 5%, 10%, 20%). This would cause more cache +usage. + +And I am convinced we would see more BTANBs. + +### How do frontiers work? + +Frontiers divides a netlist into sub netlists, i.e. a number of smaller netlists. +Frontiers work best if you have a low impedance to high impedance transition. +This is best illustrated by an example. Consider the following mixing stage + + R1 + S1 >-----1RRRR2---------+ + | + R2 | + S2 >-----1RRRR2---------+----------> Out + | + R + R3 R + R + | + GND + +With `OPTIMIZE_FRONTIER(R2.2, R3, R2)` this becomes: + + R1 + S1 >-----1RRRR2--------------------------------+ + | + ########################## | + R2 # R2 # | + S2 >-----1RRRR2-----+-->AnIn AnOut>--RRRR------+----------> Out + # | # | + # R # R + # R R3 # R3 R + # R # R + # | # | + # GND Frontier # GND + # # + ########################## + +As a result, provided there are no other connections between the parts +generating S1 and S2 the "S2 part" will now have a separate solver. + +The size (aka number of nets) of the solver for S1 will be smaller. +The size of the solver for S2 and the rest of the circuit will be smaller +as well. + +Frontiers assume that there is little to no feedback from the "out" terminal to the "in" +terminal. This is a safe assumption if the "in" terminal e.g. is connected to an +op-amp output (typically < 500 Ohm) and R2 in the example above is in the 10 KOhm range. + +## MAME specific + +### Is there an example of a netlist that takes input from an AY-8910/2 and handles it? + +There are quite a few: + +- nl_kidniki.cpp +- nl_konami.cpp +- 1942.cpp + +Basically the AY8910 driver has to be configured to push resistor values to the +input stream. The konami drivers (scramble, frogger and friends) do that and +should be used as a reference. 1942 connects outputs and may be an even better example. + +## Models + +### Is there are JFET model? + +No, there is currently no JFET model in netlist. They are close to depletion +mode MOSFETs with very low gate capacitance so you may try a generic n-mosfet +with a negative trigger voltage. Example: + + MOSFET(Q21, "NMOS(VTO=-1.0)") + +Writing an analog model is a very time-consuming task. The simplified model above should +deliver reasonable results. + +## Operational Amplifiers + +### What's UGF? Would like to understand this black magic a little better. :) + +UGF = Unity Gain Frequency, usually identical to gain-bandwidth product for +op-amps. The idea is that the an op-amp's open-loop gain (its amplification +factor when used without any negative feedback) is proportional to the +frequency of its input signal. For slowly-varying, near-DC signals, this gain +will be extremely high (in this case, a gain of 10000 at 1 Hz), which is part +of what makes an op-amp effective. In practice the op-amp's actual gain will +be limited by whatever negative feedback is applied, but its open-loop gain +is a key quantity in computing its actual response. Because the op-amp is +limited in how fast it can respond to its input, its open-loop gain will +drop as the frequency of the input signal rises, eventually falling to a +gain of 1 (output = input) at the unity gain frequency. In this case +couriersud set the unity gain frequency is 10 kHz, which is much lower than +reality, in order to make the op-amp response in the oscillators slower and +easier for the netlist solver to handle without using very small time steps. +According to Texas Instruments, the TL084's actual gain-bandwidth product +(remember, this is the same as the UGF) is typically 3 MHz. + +## Documentation + +### What is the preferred documentation format? + +The preferred documentation for devices is to use the netlist documentation format. +This will ensure that the devices are properly documented in the Doxygen +documentation created by `make doc` + +An example entry is given here: + + //- Identifier: SN74LS629_DIP + //- Title: SN74LS629 VOLTAGE-CONTROLLED OSCILLATORS + //- Description: Please add a detailed description + //- FIXME: Missing description + //- + //- Pinalias: 2FC,1FC,1RNG,1CX1,1CX2,1ENQ,1Y,OSC_GND,GND,2Y,2ENQ,2CX2,2CX1,2RNG,OSC_VCC,VCC + //- Package: DIP + //- Param: A.CAP + //- Capacitor value of capacitor connected to 1CX1 and 1CX2 pins + //- Param: B.CAP + //- Capacitor value of capacitor connected to 2CX1 and 2CX2 pins + //- Limitations: + //- The capacitor inputs are NC. Capacitor values need to be specified as + //- ``` + //- SN74LS629_DIP(X) + //- PARAM(X.A.CAP, CAP_U(1)) + //- PARAM(X.B.CAP, CAP_U(2)) + //- ``` + //- + //- Example: 74ls629.cpp,74ls629_example + //- + //- FunctionTable: + //- http://pdf.datasheetcatalog.com/datasheets/400/335051_DS.pdf + //- + static NETLIST_START(SN74LS629_DIP) +{ + +If you add an example in the examples folder this will be included in the +documentation as well. + diff --git a/src/lib/netlist/adding_devices.md b/src/lib/netlist/adding_devices.md new file mode 100644 index 00000000000..808ce9a2568 --- /dev/null +++ b/src/lib/netlist/adding_devices.md @@ -0,0 +1,82 @@ +# Adding devices to netlist + +There are basically two kind of devices you can add to netlist: + +- coded devices. These can be found in the devices and analog folder. Typically +these are logic or elementary (i.e. resistor, capacitor) devices. +- netlist language devices. These are found in the macro folder structure. +Typically these are dip layouts or devices consisting of elementary devices. A good +example are operational amplifier models or VCOs. + +In prior netlist releases (<=0.13.0) it was cumbersome to add devices. You had to make +sure to add references and code in a number of different locations. + +All necessary header files are now created automatically. + +## Stand alone compilation + +### Coded devices + +Just add your device code (e.g. nld_device.cpp) into the devices folder. + +Switch to the `build` directory + +`cd build` + +and type + +`make generated` + +to create all the infrastructure code. + +### Macro devices + +Place the device code (e.g. nlmod_device.cpp) into macro/modules. + +Switch to the `build` directory + +`cd build` + +and type + +`make generated` + +to create all the infrastructure code. + +## Visual Studio build + +You need to add the files manually to the Visual Studio solution. + +## MAME integration + +In addition to the the steps above you have to add your code additions to the +`scripts/src/netlist.lua` file. + +Make sure to + +```sh +cd src/lib/netlist/build +make generated +``` + +to (re)create the necessary files in the `generated` directory. + +## Background + +### What does `make generated` do? + +`make generated` calls three python scripts: + +- `create_devinc.py` +- `create_lib_entries.py` +- `create_modules.py` + +which create the following files in the `generated` directory: + +- `nld_devinc.h` +- `lib_entries.hxx` +- `nlm_modules_lib.cpp` + +The information contained in these files in the past had to be included in various places +and files previously. Since the information can be extracted programmatically the +manual process now was replaced. diff --git a/src/lib/netlist/analog/nld_bjt.cpp b/src/lib/netlist/analog/nld_bjt.cpp index 3d954504264..2152f8f431a 100644 --- a/src/lib/netlist/analog/nld_bjt.cpp +++ b/src/lib/netlist/analog/nld_bjt.cpp @@ -1,446 +1,574 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_bjt.c - * - */ -#include "netlist/solver/nld_solver.h" -#include "netlist/nl_setup.h" +#include "nl_base.h" #include "nlid_twoterm.h" +#include "solver/nld_solver.h" -#include <cmath> +// Names +// spell-checker: words Ebers, Moll -namespace netlist -{ -namespace analog -{ - using constants = plib::constants<nl_double>; +// FIXME: Remove QBJT_switch - no more use +namespace netlist::analog +{ class diode { public: - diode() : m_Is(1e-15), m_VT(0.0258), m_VT_inv(1.0 / m_VT) {} - diode(const nl_double Is, const nl_double n) + diode() + : m_Is(nlconst::np_Is()) + , m_VT(nlconst::np_VT()) + , m_VT_inv(plib::reciprocal(m_VT)) + { + } + + diode(nl_fptype Is, nl_fptype n) + : m_Is(Is) + , m_VT(nlconst::np_VT(n)) + , m_VT_inv(plib::reciprocal(m_VT)) { - m_Is = Is; - m_VT = 0.0258 * n; - m_VT_inv = 1.0 / m_VT; } - void set(const nl_double Is, const nl_double n) + void set(nl_fptype Is, nl_fptype n) noexcept { m_Is = Is; - m_VT = 0.0258 * n; - m_VT_inv = 1.0 / m_VT; + m_VT = nlconst::np_VT(n); + m_VT_inv = plib::reciprocal(m_VT); + } + nl_fptype I(nl_fptype V) const noexcept + { + return m_Is * plib::exp(V * m_VT_inv) - m_Is; + } + nl_fptype g(nl_fptype V) const noexcept + { + return m_Is * m_VT_inv * plib::exp(V * m_VT_inv); + } + nl_fptype V(nl_fptype I) const noexcept + { + return plib::log1p(I / m_Is) * m_VT; + } // log1p(x)=log(1.0 + x) + nl_fptype gI(nl_fptype I) const noexcept + { + return m_VT_inv * (I + m_Is); } - nl_double I(const nl_double V) const { return m_Is * std::exp(V * m_VT_inv) - m_Is; } - nl_double g(const nl_double V) const { return m_Is * m_VT_inv * std::exp(V * m_VT_inv); } - nl_double V(const nl_double I) const { return std::log1p(I / m_Is) * m_VT; } // log1p(x)=log(1.0 + x) - nl_double gI(const nl_double I) const { return m_VT_inv * (I + m_Is); } private: - nl_double m_Is; - nl_double m_VT; - nl_double m_VT_inv; + nl_fptype m_Is; + nl_fptype m_VT; + nl_fptype m_VT_inv; }; // ----------------------------------------------------------------------------- // nld_Q - Base classes // ----------------------------------------------------------------------------- - /*! Class representing the bjt model parameters. - * - * This is the model representation of the bjt model. Typically, SPICE uses - * the following parameters. A "Y" in the first column indicates that the - * parameter is actually used in netlist. - * - * | NL? | name | parameter | units | default | example | area | - * |:---:|------|-----------------------------------------------------------------------|-------|---------:|----------------:|:----:| - * | Y | IS | transport saturation current | A | 1E-016 | 1E-015 | * | - * | Y | BF | ideal maximum forward beta | - | 100 | 100 | | - * | Y | NF | forward current emission coefficient | - | 1 | 1 | | - * | | VAF | forward Early voltage | V | infinite | 200 | | - * | | IKF | corner for forward beta high current roll-off | A | infinite | 0.01 | * | - * | | ISE | B-E leakage saturation current | A | 0 | 0.0000000000001 | * | - * | | NE | B-E leakage emission coefficient | - | 1.5 | 2 | | - * | Y | BR | ideal maximum reverse beta | - | 1 | 0.1 | | - * | Y | NR | reverse current emission coefficient | - | 1 | 1 | | - * | | VAR | reverse Early voltage | V | infinite | 200 | | - * | | IKR | corner for reverse beta high current roll-off | A | infinite | 0.01 | * | - * | | ISC | leakage saturation current | A | 0 | 8 | | - * | | NC | leakage emission coefficient | - | 2 | 1.5 | | - * | | RB | zero bias base resistance | | 0 | 100 | * | - * | | IRB | current where base resistance falls halfway to its min value | A | infinite | 0.1 | * | - * | | RBM | minimum base resistance at high currents | | RB | 10 | * | - * | | RE | emitter resistance | | 0 | 1 | * | - * | | RC | collector resistance | | 0 | 10 | * | - * | Y | CJE | B-E zero-bias depletion capacitance | F | 0 | 2pF | * | - * | | VJE | B-E built-in potential | V | 0.75 | 0.6 | | - * | | MJE | B-E junction exponential factor | - | 0.33 | 0.33 | | - * | | TF | ideal forward transit time | sec | 0 | 0.1ns | | - * | | XTF | coefficient for bias dependence of TF | - | 0 | | | - * | | VTF | voltage describing VBC dependence of TF | V | infinite | | | - * | | ITF | high-current parameter for effect on TF | A | 0 | | * | - * | | PTF | excess phase at freq=1.0/(TF*2PI) Hz | deg | 0 | | | - * | Y | CJC | B-C zero-bias depletion capacitance | F | 0 | 2pF | * | - * | | VJC | B-C built-in potential | V | 0.75 | 0.5 | | - * | | MJC | B-C junction exponential factor | - | 0.33 | 0.5 | | - * | | XCJC | fraction of B-C depletion capacitance connected to internal base node | - | 1 | | | - * | | TR | ideal reverse transit time | sec | 0 | 10ns | | - * | | CJS | zero-bias collector-substrate capacitance | F | 0 | 2pF | * | - * | | VJS | substrate junction built-in potential | V | 0.75 | | | - * | | MJS | substrate junction exponential factor | - | 0 | 0.5 | | - * | | XTB | forward and reverse beta temperature exponent | - | 0 | | | - * | | EG | energy gap for temperature effect on IS | eV | 1.11 | | | - * | | XTI | temperature exponent for effect on IS | - | 3 | | | - * | | KF | flicker-noise coefficient | - | 0 | | | - * | | AF | flicker-noise exponent | - | 1 | | | - * | | FC | coefficient for forward-bias depletion capacitance formula | - | 0.5 | | | - * | | TNOM | Parameter measurement temperature | C | 27 | 50 | | - * */ - - class bjt_model_t : public param_model_t + enum class bjt_type + { + BJT_NPN, + BJT_PNP + }; + + /// \brief Class representing the bjt model parameters + /// + /// This is the model representation of the bjt model. Typically, SPICE + /// uses the following parameters. A "Y" in the first column indicates that + /// the parameter is actually used in netlist. + /// + /// | NL? | name | parameter | units | default | example | area | xxx + /// |:---:|------|-----------------------------------------------------------------------|-------|---------:|----------------:|:----:| xxx + /// | Y | IS | transport saturation current | A | 1E-016 | 1E-015 | * | xxx + /// | Y | BF | ideal maximum forward beta | - | 100 | 100 | | + /// | Y | NF | forward current emission coefficient | - | 1 | 1 | | + /// | | VAF | forward Early voltage | V | infinite | 200 | | + /// | | IKF | corner for forward beta high current roll-off | A | infinite | 0.01 | * | + /// | | ISE | B-E leakage saturation current | A | 0 | 0.0000000000001 | * | + /// | | NE | B-E leakage emission coefficient | - | 1.5 | 2 | | + /// | Y | BR | ideal maximum reverse beta | - | 1 | 0.1 | | + /// | Y | NR | reverse current emission coefficient | - | 1 | 1 | | + /// | | VAR | reverse Early voltage | V | infinite | 200 | | + /// | | IKR | corner for reverse beta high current roll-off | A | infinite | 0.01 | * | + /// | | ISC | leakage saturation current | A | 0 | 8 | | + /// | | NC | leakage emission coefficient | - | 2 | 1.5 | | + /// | | RB | zero bias base resistance | | 0 | 100 | * | + /// | | IRB | current where base resistance falls halfway to its min value | A | infinite | 0.1 | * | + /// | | RBM | minimum base resistance at high currents | | RB | 10 | * | + /// | | RE | emitter resistance | | 0 | 1 | * | + /// | | RC | collector resistance | | 0 | 10 | * | + /// | Y | CJE | B-E zero-bias depletion capacitance | F | 0 | 2pF | * | + /// | | VJE | B-E built-in potential | V | 0.75 | 0.6 | | + /// | | MJE | B-E junction exponential factor | - | 0.33 | 0.33 | | + /// | | TF | ideal forward transit time | sec | 0 | 0.1ns | | + /// | | XTF | coefficient for bias dependence of TF | - | 0 | | | + /// | | VTF | voltage describing VBC dependence of TF | V | infinite | | | + /// | | ITF | high-current parameter for effect on TF | A | 0 | | * | + /// | | PTF | excess phase at freq=1.0/(TF*2PI) Hz | deg | 0 | | | + /// | Y | CJC | B-C zero-bias depletion capacitance | F | 0 | 2pF | * | + /// | | VJC | B-C built-in potential | V | 0.75 | 0.5 | | + /// | | MJC | B-C junction exponential factor | - | 0.33 | 0.5 | | + /// | | XCJC | fraction of B-C depletion capacitance connected to internal base node | - | 1 | | | + /// | | TR | ideal reverse transit time | sec | 0 | 10ns | | + /// | | CJS | zero-bias collector-substrate capacitance | F | 0 | 2pF | * | + /// | | VJS | substrate junction built-in potential | V | 0.75 | | | + /// | | MJS | substrate junction exponential factor | - | 0 | 0.5 | | + /// | | XTB | forward and reverse beta temperature exponent | - | 0 | | | + /// | | EG | energy gap for temperature effect on IS | eV | 1.11 | | | + /// | | XTI | temperature exponent for effect on IS | - | 3 | | | + /// | | KF | flicker-noise coefficient | - | 0 | | | + /// | | AF | flicker-noise exponent | - | 1 | | | + /// | | FC | coefficient for forward-bias depletion capacitance formula | - | 0.5 | | | + /// | | TNOM | Parameter measurement temperature | C | 27 | 50 | | + /// + + class bjt_model_t { public: - bjt_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_IS (*this, "IS") - , m_BF (*this, "BF") - , m_NF (*this, "NF") - , m_BR (*this, "BR") - , m_NR (*this, "NR") - , m_CJE(*this, "CJE") - , m_CJC(*this, "CJC") - {} - - value_t m_IS; //!< transport saturation current - value_t m_BF; //!< ideal maximum forward beta - value_t m_NF; //!< forward current emission coefficient - value_t m_BR; //!< ideal maximum reverse beta - value_t m_NR; //!< reverse current emission coefficient - value_t m_CJE; //!< B-E zero-bias depletion capacitance - value_t m_CJC; //!< B-C zero-bias depletion capacitance + bjt_model_t(param_model_t &model) + : m_type((model.type() == "NPN") ? bjt_type::BJT_NPN + : bjt_type::BJT_PNP) + , m_IS(model, "IS") + , m_BF(model, "BF") + , m_NF(model, "NF") + , m_BR(model, "BR") + , m_NR(model, "NR") + , m_CJE(model, "CJE") + , m_CJC(model, "CJC") + { + } + bjt_type m_type; + param_model_t::value_t m_IS; //!< transport saturation current + param_model_t::value_t m_BF; //!< ideal maximum forward beta + param_model_t::value_t m_NF; //!< forward current emission coefficient + param_model_t::value_t m_BR; //!< ideal maximum reverse beta + param_model_t::value_t m_NR; //!< reverse current emission coefficient + param_model_t::value_t m_CJE; //!< B-E zero-bias depletion capacitance + param_model_t::value_t m_CJC; //!< B-C zero-bias depletion capacitance }; - // Have a common start for transistors + // ----------------------------------------------------------------------------- + // nld_QBJT_switch + // ----------------------------------------------------------------------------- - NETLIB_OBJECT(QBJT) + // + // + - C + // B ----VVV----+ | + // | | + // Rb Rc + // Rb Rc + // Rb Rc + // | | + // +----+----+ + // | + // E + // + + class nld_QBJT_switch : public base_device_t { public: - enum q_type { - BJT_NPN, - BJT_PNP - }; + nld_QBJT_switch(constructor_param_t data) + : base_device_t(data) + , m_model(*this, "MODEL", "NPN") + , m_bjt_model(m_model) + , m_RB(*this, "m_RB", NETLIB_DELEGATE(terminal_handler)) + , m_RC(*this, "m_RC", NETLIB_DELEGATE(terminal_handler)) + , m_BC(*this, "m_BC", NETLIB_DELEGATE(terminal_handler)) + , m_gB(nlconst::cgmin()) + , m_gC(nlconst::cgmin()) + , m_V(nlconst::zero()) + , m_state_on(*this, "m_state_on", 0U) + { + register_sub_alias("B", m_RB.P()); + register_sub_alias("E", m_RB.N()); + register_sub_alias("C", m_RC.P()); - NETLIB_CONSTRUCTOR_EX(QBJT, pstring model = "NPN") - , m_model(*this, "MODEL", model) - , m_qtype(BJT_NPN) + connect(m_RB.N(), m_RC.N()); + connect(m_RB.P(), m_BC.P()); + connect(m_RC.P(), m_BC.N()); + } + + NETLIB_RESETI(); + NETLIB_HANDLERI(terminal_handler) { + auto *solver(m_RB.solver()); + if (solver != nullptr) + solver->solve_now(); + else + m_RC.solver()->solve_now(); } NETLIB_IS_DYNAMIC(true) - //NETLIB_RESETI(); - NETLIB_UPDATEI(); - - q_type qtype() const { return m_qtype; } - bool is_qtype(q_type atype) const { return m_qtype == atype; } - void set_qtype(q_type atype) { m_qtype = atype; } - protected: + NETLIB_UPDATE_PARAMI(); + NETLIB_UPDATE_TERMINALSI(); - bjt_model_t m_model; private: - q_type m_qtype; + param_model_t m_model; + bjt_model_t m_bjt_model; + NETLIB_NAME(two_terminal) m_RB; + NETLIB_NAME(two_terminal) m_RC; + NETLIB_NAME(two_terminal) m_BC; + + nl_fptype m_gB; // base conductance / switch on + nl_fptype m_gC; // collector conductance / switch on + nl_fptype m_V; // internal voltage source + state_var<unsigned> m_state_on; }; // ----------------------------------------------------------------------------- - // nld_QBJT_switch + // nld_three_terminal // ----------------------------------------------------------------------------- + // + // PIN1 C + // P1_P2 | + // +----N 3T P----+ + // | | + // | N + // Pin2 --+ 3T P0_P1 + // B | P + // | | + // +----N 3T P----+ + // P0_P2 | + // Pin0 E + // + + struct mna2 + { + using row = std::array<nl_fptype, 3>; + std::array<row, 2> arr; + }; + + struct mna3 + { + using row = std::array<nl_fptype, 4>; + std::array<row, 3> arr; + const row &operator[](std::size_t i) const { return arr[i]; } + }; - /* - * + - C - * B ----VVV----+ | - * | | - * Rb Rc - * Rb Rc - * Rb Rc - * | | - * +----+----+ - * | - * E - */ - - NETLIB_OBJECT_DERIVED(QBJT_switch, QBJT) + class nld_three_terminal : public base_device_t { - NETLIB_CONSTRUCTOR_DERIVED(QBJT_switch, QBJT) - , m_RB(*this, "m_RB", true) - , m_RC(*this, "m_RC", true) - , m_BC(*this, "m_BC", true) - , m_gB(1e-9) - , m_gC(1e-9) - , m_V(0.0) - , m_state_on(*this, "m_state_on", 0) + public: + nld_three_terminal(constructor_param_t data, + std::array<pstring, 3> pins) + : base_device_t(data) + , m_P0_P2(*this, "m_P1_P3", NETLIB_DELEGATE(terminal_handler)) + , m_P1_P2(*this, "m_P2_P3", NETLIB_DELEGATE(terminal_handler)) + , m_P0_P1(*this, "m_P1_P2", NETLIB_DELEGATE(terminal_handler)) { - register_subalias("B", m_RB.m_P); - register_subalias("E", m_RB.m_N); - register_subalias("C", m_RC.m_P); + register_sub_alias(pins[0], m_P0_P2.P()); // Emitter - row 1 + register_sub_alias(pins[1], m_P1_P2.P()); // Collector- row 2 + register_sub_alias(pins[2], m_P0_P2.N()); // Base -row 3 - connect(m_RB.m_N, m_RC.m_N); - connect(m_RB.m_P, m_BC.m_P); - connect(m_RC.m_P, m_BC.m_N); + connect(m_P0_P2.P(), m_P0_P1.P()); + connect(m_P0_P2.N(), m_P1_P2.N()); + connect(m_P1_P2.P(), m_P0_P1.N()); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_UPDATE_PARAMI(); - NETLIB_UPDATE_TERMINALSI(); + NETLIB_RESETI() + { + if (m_P0_P2.solver() == nullptr && m_P1_P2.solver() == nullptr) + throw nl_exception(MF_DEVICE_FRY_1(this->name())); + } - private: - nld_twoterm m_RB; - nld_twoterm m_RC; - nld_twoterm m_BC; + NETLIB_HANDLERI(terminal_handler) + { + auto *solver(m_P0_P2.solver()); + if (solver != nullptr) + solver->solve_now(); + else + m_P1_P2.solver()->solve_now(); + } - nl_double m_gB; // base conductance / switch on - nl_double m_gC; // collector conductance / switch on - nl_double m_V; // internal voltage source - state_var<unsigned> m_state_on; + template <int PIN1, int PIN2> + nl_fptype delta_V() const noexcept + { + static_assert(PIN1 >= 0 && PIN2 >= 0 && PIN1 <= 2 && PIN2 <= 2, + "out of bounds pin number"); + static constexpr const int sel = PIN1 * 10 + PIN2; + if constexpr (sel == 0) + return 0.0; + else if constexpr (sel == 1) // P0 P1 + return m_P0_P1.deltaV(); + else if constexpr (sel == 2) // P0 P2 + return m_P0_P2.deltaV(); + else if constexpr (sel == 10) // P1 P0 + return -m_P0_P1.deltaV(); + else if constexpr (sel == 11) // P1 P1 + return 0.0; + else if constexpr (sel == 12) // P1 P2 + return m_P1_P2.deltaV(); + else if constexpr (sel == 20) // P2 P0 + return -m_P0_P2.deltaV(); + else if constexpr (sel == 21) // P2 P1 + return -m_P1_P2.deltaV(); + else if constexpr (sel == 22) // P2 P2 + return 0.0; + } + + void set_mat_ex(double xee, double xec, double xeb, double xIe, + double xce, double xcc, double xcb, double xIc, + double xbe, double xbc, double xbb, double xIb) + { + using row2 = std::array<nl_fptype, 3>; + // rows 0 and 2 + m_P0_P2.set_mat({ + row2{xee, xeb, xIe}, + row2{xbe, xbb, xIb} + }); + // rows 1 and 2 + m_P1_P2.set_mat({ + row2{xcc, xcb, xIc}, + row2{xbc, 0, 0 } + }); + // rows 0 and 1 + m_P0_P1.set_mat({ + row2{0, xec, 0}, + row2{xce, 0, 0} + }); + } + + void set_mat_ex(const mna3 &m) + { + using row2 = std::array<nl_fptype, 3>; + // rows 0 and 2 + m_P0_P2.set_mat({ + row2{m[0][0], m[0][2], m[0][3]}, + row2{m[2][0], m[2][2], m[2][3]} + }); + // rows 1 and 2 + m_P1_P2.set_mat({ + row2{m[1][1], m[1][2], m[1][3]}, + row2{m[2][1], 0, 0 } + }); + // rows 0 and 1 + m_P0_P1.set_mat({ + row2{0, m[0][1], 0}, + row2{m[1][0], 0, 0} + }); + } private: + nld_two_terminal m_P0_P2; // gee, gec - gee, gce - gee, gee - gec | Ie + nld_two_terminal m_P1_P2; // gcc, gce - gcc, gec - gcc, gcc - gce | Ic + nld_two_terminal m_P0_P1; // 0, -gec, -gcc, 0 | 0 }; // ----------------------------------------------------------------------------- // nld_QBJT_EB // ----------------------------------------------------------------------------- - - NETLIB_OBJECT_DERIVED(QBJT_EB, QBJT) + class nld_QBJT_EB : public nld_three_terminal { + enum pins + { + E = 0, + C = 1, + B = 2 + }; + public: - NETLIB_CONSTRUCTOR_DERIVED(QBJT_EB, QBJT) + nld_QBJT_EB(constructor_param_t data) + : nld_three_terminal(data, {"E", "C", "B"}) + , m_model(*this, "MODEL", "NPN") + , m_bjt_model(m_model) , m_gD_BC(*this, "m_D_BC") , m_gD_BE(*this, "m_D_BE") - , m_D_CB(*this, "m_D_CB", true) - , m_D_EB(*this, "m_D_EB", true) - , m_D_EC(*this, "m_D_EC", true) , m_alpha_f(0) , m_alpha_r(0) { - register_subalias("E", m_D_EB.m_P); // Cathode - register_subalias("B", m_D_EB.m_N); // Anode - - register_subalias("C", m_D_CB.m_P); // Cathode - - connect(m_D_EB.m_P, m_D_EC.m_P); - connect(m_D_EB.m_N, m_D_CB.m_N); - connect(m_D_CB.m_P, m_D_EC.m_N); - - if (m_model.m_CJE > 0.0) + if (m_bjt_model.m_CJE > nlconst::zero()) { - create_and_register_subdevice("m_CJE", m_CJE); + create_and_register_sub_device(*this, "m_CJE", m_CJE); connect("B", "m_CJE.1"); connect("E", "m_CJE.2"); } - if (m_model.m_CJC > 0.0) + if (m_bjt_model.m_CJC > nlconst::zero()) { - create_and_register_subdevice("m_CJC", m_CJC); + create_and_register_sub_device(*this, "m_CJC", m_CJC); connect("B", "m_CJC.1"); connect("C", "m_CJC.2"); } - } protected: - NETLIB_RESETI(); - NETLIB_UPDATEI(); + + NETLIB_IS_DYNAMIC(true) + NETLIB_UPDATE_PARAMI(); NETLIB_UPDATE_TERMINALSI(); private: + param_model_t m_model; + bjt_model_t m_bjt_model; generic_diode<diode_e::BIPOLAR> m_gD_BC; generic_diode<diode_e::BIPOLAR> m_gD_BE; + nl_fptype m_alpha_f; + nl_fptype m_alpha_r; - nld_twoterm m_D_CB; // gcc, gce - gcc, gec - gcc, gcc - gce | Ic - nld_twoterm m_D_EB; // gee, gec - gee, gce - gee, gee - gec | Ie - nld_twoterm m_D_EC; // 0, -gec, -gcc, 0 | 0 - - nl_double m_alpha_f; - nl_double m_alpha_r; - - NETLIB_SUBXX(analog, C) m_CJE; - NETLIB_SUBXX(analog, C) m_CJC; + NETLIB_SUB_UPTR(analog, C) m_CJE; + NETLIB_SUB_UPTR(analog, C) m_CJC; }; - - // ---------------------------------------------------------------------------------------- - // nld_Q - // ---------------------------------------------------------------------------------------- - - NETLIB_UPDATE(QBJT) - { - // netlist().solver()->schedule1(); - } - // ---------------------------------------------------------------------------------------- // nld_QBJT_switch // ---------------------------------------------------------------------------------------- - NETLIB_RESET(QBJT_switch) { - NETLIB_NAME(QBJT)::reset(); + if (m_RB.solver() == nullptr && m_RC.solver() == nullptr) + throw nl_exception(MF_DEVICE_FRY_1(this->name())); - m_state_on = 0; + static constexpr const auto zero(nlconst::zero()); - m_RB.set_G_V_I(exec().gmin(), 0.0, 0.0); - m_RC.set_G_V_I(exec().gmin(), 0.0, 0.0); + m_state_on = 0; - m_BC.set_G_V_I(exec().gmin() / 10.0, 0.0, 0.0); + m_RB.set_G_V_I(exec().gmin(), zero, zero); + m_RC.set_G_V_I(exec().gmin(), zero, zero); + m_BC.set_G_V_I(exec().gmin() / nlconst::magic(10.0), zero, zero); } - NETLIB_UPDATE(QBJT_switch) + NETLIB_UPDATE_PARAM(QBJT_switch) { - if (!m_RB.m_P.net().isRailNet()) - m_RB.m_P.solve_now(); // Basis - else if (!m_RB.m_N.net().isRailNet()) - m_RB.m_N.solve_now(); // Emitter - else if (!m_RC.m_P.net().isRailNet()) - m_RC.m_P.solve_now(); // Collector - } + nl_fptype IS = m_bjt_model.m_IS; + nl_fptype BF = m_bjt_model.m_BF; + nl_fptype NF = m_bjt_model.m_NF; + // nl_fptype VJE = m_bjt_model.dValue("VJE", 0.75); + nl_fptype alpha = BF / (nlconst::one() + BF); +#if 0 + diode d(IS, NF); - NETLIB_UPDATE_PARAM(QBJT_switch) - { - nl_double IS = m_model.m_IS; - nl_double BF = m_model.m_BF; - nl_double NF = m_model.m_NF; - //nl_double VJE = m_model.dValue("VJE", 0.75); + // Assume 5mA Collector current for switch operation - set_qtype((m_model.type() == "NPN") ? BJT_NPN : BJT_PNP); + const auto cc(nlconst::magic(0.005)); + m_V = d.V(cc / alpha); - nl_double alpha = BF / (1.0 + BF); + // Base current is 0.005 / beta + // as a rough estimate, we just scale the conductance down - diode d(IS, NF); + m_gB = plib::reciprocal((m_V / (cc / BF))); + + // m_gB = d.gI(0.005 / alpha); + + if (m_gB < exec().gmin()) + m_gB = exec().gmin(); + m_gC = d.gI(cc); // very rough estimate +#else + // diode d(IS, NF); // Assume 5mA Collector current for switch operation - m_V = d.V(0.005 / alpha); + const auto cc(nlconst::magic(0.005)); + // Get voltage across diode + // m_V = d.V(cc / alpha); + m_V = plib::log1p((cc / alpha) / IS) * nlconst::np_VT(NF); - /* Base current is 0.005 / beta - * as a rough estimate, we just scale the conductance down */ + // Base current is 0.005 / beta + // as a rough estimate, we just scale the conductance down - m_gB = 1.0 / (m_V/(0.005 / BF)); + m_gB = plib::reciprocal((m_V / (cc / BF))); - //m_gB = d.gI(0.005 / alpha); + // m_gB = d.gI(0.005 / alpha); if (m_gB < exec().gmin()) m_gB = exec().gmin(); - m_gC = d.gI(0.005); // very rough estimate + + // m_gC = d.gI(cc); // very rough estimate + m_gC = plib::reciprocal(nlconst::np_VT(NF)) * (cc + IS); +#endif } NETLIB_UPDATE_TERMINALS(QBJT_switch) { - const nl_double m = (is_qtype( BJT_NPN) ? 1 : -1); + const nl_fptype m = (m_bjt_model.m_type == bjt_type::BJT_NPN) + ? nlconst::one() + : -nlconst::one(); - const unsigned new_state = (m_RB.deltaV() * m > m_V ) ? 1 : 0; + const unsigned new_state = (m_RB.deltaV() * m > m_V) ? 1 : 0; if (m_state_on ^ new_state) { - const nl_double gb = new_state ? m_gB : exec().gmin(); - const nl_double gc = new_state ? m_gC : exec().gmin(); - const nl_double v = new_state ? m_V * m : 0; + const auto zero(nlconst::zero()); + const nl_fptype gb = new_state ? m_gB : exec().gmin(); + const nl_fptype gc = new_state ? m_gC : exec().gmin(); + const nl_fptype v = new_state ? m_V * m : zero; - m_RB.set_G_V_I(gb, v, 0.0); - m_RC.set_G_V_I(gc, 0.0, 0.0); + m_RB.set_G_V_I(gb, v, zero); + m_RC.set_G_V_I(gc, zero, zero); m_state_on = new_state; } } - // ---------------------------------------------------------------------------------------- // nld_Q - Ebers Moll // ---------------------------------------------------------------------------------------- - - NETLIB_UPDATE(QBJT_EB) - { - if (!m_D_EB.m_P.net().isRailNet()) - m_D_EB.m_P.solve_now(); // Basis - else if (!m_D_EB.m_N.net().isRailNet()) - m_D_EB.m_N.solve_now(); // Emitter - else - m_D_CB.m_N.solve_now(); // Collector - } - NETLIB_RESET(QBJT_EB) { - NETLIB_NAME(QBJT)::reset(); + nld_three_terminal::reset(); + if (m_CJE) { m_CJE->reset(); - m_CJE->m_C.setTo(m_model.m_CJE); + m_CJE->set_cap_embedded(m_bjt_model.m_CJE); } if (m_CJC) { m_CJC->reset(); - m_CJC->m_C.setTo(m_model.m_CJC); + m_CJC->set_cap_embedded(m_bjt_model.m_CJC); } - } NETLIB_UPDATE_TERMINALS(QBJT_EB) { - const nl_double polarity = (qtype() == BJT_NPN ? 1.0 : -1.0); - - m_gD_BE.update_diode(-m_D_EB.deltaV() * polarity); - m_gD_BC.update_diode(-m_D_CB.deltaV() * polarity); - - const nl_double gee = m_gD_BE.G(); - const nl_double gcc = m_gD_BC.G(); - const nl_double gec = m_alpha_r * gcc; - const nl_double gce = m_alpha_f * gee; - const nl_double sIe = -m_gD_BE.I() + m_alpha_r * m_gD_BC.I(); - const nl_double sIc = m_alpha_f * m_gD_BE.I() - m_gD_BC.I(); - const nl_double Ie = (sIe + gee * m_gD_BE.Vd() - gec * m_gD_BC.Vd()) * polarity; - const nl_double Ic = (sIc - gce * m_gD_BE.Vd() + gcc * m_gD_BC.Vd()) * polarity; + const nl_fptype polarity(m_bjt_model.m_type == bjt_type::BJT_NPN + ? nlconst::one() + : -nlconst::one()); + + m_gD_BE.update_diode(delta_V<pins::B, pins::E>() * polarity); + m_gD_BC.update_diode(delta_V<pins::B, pins::C>() * polarity); + + const nl_fptype gee = m_gD_BE.G(); + const nl_fptype gcc = m_gD_BC.G(); + const nl_fptype gec = m_alpha_r * gcc; + const nl_fptype gce = m_alpha_f * gee; + const nl_fptype sIe = -m_gD_BE.I() + m_alpha_r * m_gD_BC.I(); + const nl_fptype sIc = m_alpha_f * m_gD_BE.I() - m_gD_BC.I(); + const nl_fptype Ie = (sIe + gee * m_gD_BE.Vd() - gec * m_gD_BC.Vd()) + * polarity; + const nl_fptype Ic = (sIc - gce * m_gD_BE.Vd() + gcc * m_gD_BC.Vd()) + * polarity; // "Circuit Design", page 174 - - m_D_EB.set_mat( gee, gec - gee, -Ie, - gce - gee, gee - gec, Ie); - m_D_CB.set_mat( gcc, gce - gcc, -Ic, - gec - gcc, gcc - gce, Ic); - m_D_EC.set_mat( 0, -gec, 0, - -gce, 0, 0); + using r = mna3::row; + set_mat_ex(mna3{ + r{gee, -gec, gec - gee, -Ie }, + r{-gce, gcc, gce - gcc, -Ic }, + r{gce - gee, gec - gcc, gcc + gee - gce - gec, Ie + Ic} + }); } - NETLIB_UPDATE_PARAM(QBJT_EB) { - nl_double IS = m_model.m_IS; - nl_double BF = m_model.m_BF; - nl_double NF = m_model.m_NF; - nl_double BR = m_model.m_BR; - nl_double NR = m_model.m_NR; - //nl_double VJE = m_model.dValue("VJE", 0.75); - - set_qtype((m_model.type() == "NPN") ? BJT_NPN : BJT_PNP); - - m_alpha_f = BF / (1.0 + BF); - m_alpha_r = BR / (1.0 + BR); - - m_gD_BE.set_param(IS / m_alpha_f, NF, exec().gmin(), constants::T0()); - m_gD_BC.set_param(IS / m_alpha_r, NR, exec().gmin(), constants::T0()); + nl_fptype IS = m_bjt_model.m_IS; + nl_fptype BF = m_bjt_model.m_BF; + nl_fptype NF = m_bjt_model.m_NF; + nl_fptype BR = m_bjt_model.m_BR; + nl_fptype NR = m_bjt_model.m_NR; + // nl_fptype VJE = m_m_bjt_model.dValue("VJE", 0.75); + + m_alpha_f = BF / (nlconst::one() + BF); + m_alpha_r = BR / (nlconst::one() + BR); + + m_gD_BE.set_param(IS / m_alpha_f, NF, exec().gmin(), nlconst::T0()); + m_gD_BC.set_param(IS / m_alpha_r, NR, exec().gmin(), nlconst::T0()); } -} // namespace analog +} // namespace netlist::analog -namespace devices { +namespace netlist::devices +{ NETLIB_DEVICE_IMPL_NS(analog, QBJT_EB, "QBJT_EB", "MODEL") NETLIB_DEVICE_IMPL_NS(analog, QBJT_switch, "QBJT_SW", "MODEL") -} // namespace devices - -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/analog/nld_bjt.h b/src/lib/netlist/analog/nld_bjt.h deleted file mode 100644 index 3a8478f19f7..00000000000 --- a/src/lib/netlist/analog/nld_bjt.h +++ /dev/null @@ -1,25 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_bjt.h - * - */ - -#ifndef NLD_BJT_H_ -#define NLD_BJT_H_ - -#include "netlist/nl_setup.h" - -// ----------------------------------------------------------------------------- -// Macros -// ----------------------------------------------------------------------------- - -#define QBJT_SW(name, model) \ - NET_REGISTER_DEV(QBJT_SW, name) \ - NETDEV_PARAMI(name, MODEL, model) - -#define QBJT_EB(name, model) \ - NET_REGISTER_DEV(QBJT_EB, name) \ - NETDEV_PARAMI(name, MODEL, model) - -#endif /* NLD_BJT_H_ */ diff --git a/src/lib/netlist/analog/nld_fourterm.h b/src/lib/netlist/analog/nld_fourterm.h deleted file mode 100644 index 66c47c0be29..00000000000 --- a/src/lib/netlist/analog/nld_fourterm.h +++ /dev/null @@ -1,30 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_fourterm.h - * - */ - -#ifndef NLD_FOURTERM_H_ -#define NLD_FOURTERM_H_ - - -#include "netlist/nl_setup.h" - -// ---------------------------------------------------------------------------------------- -// Macros -// ---------------------------------------------------------------------------------------- - -#define VCCS(name) \ - NET_REGISTER_DEV(VCCS, name) - -#define CCCS(name) \ - NET_REGISTER_DEV(CCCS, name) - -#define VCVS(name) \ - NET_REGISTER_DEV(VCVS, name) - -#define LVCCS(name) \ - NET_REGISTER_DEV(LVCCS, name) - -#endif /* NLD_FOURTERM_H_ */ diff --git a/src/lib/netlist/analog/nld_generic_models.h b/src/lib/netlist/analog/nld_generic_models.h index 1edc4abd320..d8df599a511 100644 --- a/src/lib/netlist/analog/nld_generic_models.h +++ b/src/lib/netlist/analog/nld_generic_models.h @@ -1,21 +1,27 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_generic_models.h - * - */ #ifndef NLD_GENERIC_MODELS_H_ #define NLD_GENERIC_MODELS_H_ -#include "netlist/nl_base.h" -#include "netlist/nl_setup.h" +/// +/// \file nld_generic_models.h +/// -#include <cmath> +#include "core/state_var.h" +#include "nl_base.h" -namespace netlist -{ -namespace analog +// +// Set to 0 to use a linearized diode model in the range exceeding +// maximum dissipation. The intention is to have a faster +// convergence. On selected circuits (LM3900 trapezoidal) this is +// observable and has a 10% impact. +// FIXME: More research needed +// + +#define USE_TEXTBOOK_DIODE (1) + +namespace netlist::analog { // ----------------------------------------------------------------------------- @@ -37,15 +43,15 @@ namespace analog class generic_capacitor<capacitor_e::VARIABLE_CAPACITY> { public: - generic_capacitor(device_t &dev, const pstring &name) - : m_h(dev, name + ".m_h", 0.0) - , m_c(dev, name + ".m_c", 0.0) - , m_v(dev, name + ".m_v", 0.0) - , m_gmin(0.0) + generic_capacitor(core_device_t &dev, const pstring &name) + : m_h(dev, name + ".m_h", nlconst::zero()) + , m_c(dev, name + ".m_c", nlconst::zero()) + , m_v(dev, name + ".m_v", nlconst::zero()) + , m_gmin(nlconst::zero()) { } - capacitor_e type() const { return capacitor_e::VARIABLE_CAPACITY; } + static capacitor_e type() noexcept { return capacitor_e::VARIABLE_CAPACITY; } // Circuit Simulation, page 284, 5.360 // q(un+1) - q(un) = int(un, un+1, C(U)) = (C0+C1)/2 * (un+1-un) @@ -54,35 +60,39 @@ namespace analog // so that G depends on un+1 only and Ieq on un only. // In both cases, i = G * un+1 + Ieq - nl_double G(nl_double cap) const + nl_fptype G(nl_fptype cap) const noexcept { //return m_h * cap + m_gmin; - return m_h * 0.5 * (cap + m_c) + m_gmin; + return m_h * nlconst::half() * (cap + m_c) + m_gmin; //return m_h * cap + m_gmin; } - nl_double Ieq(nl_double cap, nl_double v) const + nl_fptype Ieq(nl_fptype cap, [[maybe_unused]] nl_fptype v) const noexcept { - plib::unused_var(v); //return -m_h * 0.5 * ((cap + m_c) * m_v + (cap - m_c) * v) ; - return -m_h * 0.5 * (cap + m_c) * m_v; + return -m_h * nlconst::half() * (cap + m_c) * m_v; //return -m_h * cap * m_v; } - void timestep(nl_double cap, nl_double v, nl_double step) + void time_step(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept { - m_h = 1.0 / step; + m_h = plib::reciprocal(step); m_c = cap; m_v = v; } - void setparams(nl_double gmin) { m_gmin = gmin; } + void restore_state() noexcept + { + // no state used + } + + void set_params(nl_fptype gmin) noexcept { m_gmin = gmin; } private: - state_var<double> m_h; - state_var<double> m_c; - state_var<double> m_v; - nl_double m_gmin; + state_var<nl_fptype> m_h; + state_var<nl_fptype> m_c; + state_var<nl_fptype> m_v; + nl_fptype m_gmin; }; // "Circuit simulation", page 274 @@ -91,33 +101,107 @@ namespace analog { public: generic_capacitor(device_t &dev, const pstring &name) - : m_h(dev, name + ".m_h", 0.0) - , m_v(dev, name + ".m_v", 0.0) - , m_gmin(0.0) + : m_h(dev, name + ".m_h", nlconst::zero()) + , m_v(dev, name + ".m_v", nlconst::zero()) + , m_gmin(nlconst::zero()) { } - capacitor_e type() const { return capacitor_e::CONSTANT_CAPACITY; } - nl_double G(nl_double cap) const { return cap * m_h + m_gmin; } - nl_double Ieq(nl_double cap, nl_double v) const + static capacitor_e type() noexcept { return capacitor_e::CONSTANT_CAPACITY; } + nl_fptype G(nl_fptype cap) const noexcept { return cap * m_h + m_gmin; } + nl_fptype Ieq(nl_fptype cap, [[maybe_unused]] nl_fptype v) const noexcept { - plib::unused_var(v); return - G(cap) * m_v; } - void timestep(nl_double cap, nl_double v, nl_double step) + void time_step([[maybe_unused]] nl_fptype cap, nl_fptype v, nl_fptype step) noexcept { - plib::unused_var(cap); - m_h = 1.0 / step; + m_h = plib::reciprocal(step); m_v = v; } - void setparams(nl_double gmin) { m_gmin = gmin; } + void setparams(nl_fptype gmin) noexcept { m_gmin = gmin; } + private: + state_var<nl_fptype> m_h; + state_var<nl_fptype> m_v; + nl_fptype m_gmin; + }; + +#if (NL_USE_BACKWARD_EULER) + // Constant model for constant capacitor model + // Backward Euler + // "Circuit simulation", page 274 + struct generic_capacitor_const + { + public: + generic_capacitor_const( /*[[maybe_unused]]*/ core_device_t &dev, /*[[maybe_unused]]*/ const pstring &name) + : m_gmin(nlconst::zero()) + { + // gcc 7.2 (mingw) and 7.5 (ubuntu) don't accept maybe_unused here + plib::unused_var(dev, name); + } + + // Returns { G, Ieq } + std::pair<nl_fptype, nl_fptype> time_step(nl_fptype cap, nl_fptype v, nl_fptype step) const noexcept + { + const nl_fptype h(plib::reciprocal(step)); + const nl_fptype G(cap * h + m_gmin); + return { G, - G * v }; + } + void restore_state() noexcept + { + // this one has no state + } + void set_parameters(nl_fptype gmin) noexcept { m_gmin = gmin; } private: - state_var<nl_double> m_h; - state_var<double> m_v; - nl_double m_gmin; + nl_fptype m_gmin; }; +#else + // Constant model for constant capacitor model + // Trapezoidal + // "Circuit simulation", page 278 + struct generic_capacitor_const + { + public: + generic_capacitor_const([[maybe_unused]] core_device_t &dev, [[maybe_unused]] const pstring &name) + : m_gmin(nlconst::zero()) + , m_vn(0) + , m_in(0) + , m_trn(0.0) + { + } + // Returns { G, Ieq } + std::pair<nl_fptype, nl_fptype> time_step(nl_fptype cap, nl_fptype v, nl_fptype step) noexcept + { + const nl_fptype h(plib::reciprocal(step)); + if (m_trn == 0.0) + { + const nl_fptype G(cap * h + m_gmin); + m_vn = v; + m_trn = h; + return { G, - G * v }; + } + const nl_fptype Gn = nlconst::two() * cap * m_trn; + const nl_fptype inp1 = Gn * v - (m_in + Gn * m_vn); + const nl_fptype G(nlconst::two() * cap * h); + const nl_fptype Ieq(inp1 + G * v); + m_in = inp1; + m_vn = v; + m_trn = h; + return { G + m_gmin, -Ieq }; + } + void restore_state() noexcept + { + // this one has no state + } + void set_parameters(nl_fptype gmin) noexcept { m_gmin = gmin; } + private: + nl_fptype m_gmin; + nl_fptype m_vn; + nl_fptype m_in; + nl_fptype m_trn; + }; +#endif // ----------------------------------------------------------------------------- // A generic diode model to be used in other devices (Diode, BJT ...) // ----------------------------------------------------------------------------- @@ -132,39 +216,58 @@ namespace analog class generic_diode { public: - generic_diode(device_t &dev, const pstring &name) - : m_Vd(dev, name + ".m_Vd", 0.7) - , m_Id(dev, name + ".m_Id", 0.0) - , m_G(dev, name + ".m_G", 1e-15) - , m_Vt(0.0) - , m_Vmin(0.0) // not used in MOS model - , m_Is(0.0) - , m_logIs(0.0) - , m_n(0.0) - , m_gmin(1e-15) - , m_VtInv(0.0) - , m_Vcrit(0.0) - , m_name(name) + generic_diode() + : m_Vd(nlconst::diode_start_voltage()) + , m_Id(nlconst::zero()) + , m_G(nlconst::cgminalt()) + , m_Vt(nlconst::zero()) + , m_Vmin(nlconst::zero()) // not used in MOS model + , m_Is(nlconst::zero()) + , m_logIs(nlconst::zero()) + , m_gmin(nlconst::cgminalt()) + , m_VtInv(nlconst::zero()) + , m_Vcrit(nlconst::zero()) { - set_param(1e-15, 1, 1e-15, 300.0); + set_param( + nlconst::np_Is() + , nlconst::one() + , nlconst::cgminalt() + , nlconst::T0()); } - void update_diode(const nl_double nVd) + generic_diode(core_device_t &dev, const pstring &name) + : generic_diode() + { + dev.state().save(dev, m_Vd, dev.name(), name + ".m_Vd"); + dev.state().save(dev, m_Id, dev.name(), name + ".m_Id"); + dev.state().save(dev, m_G, dev.name(), name + ".m_G"); + } + // Basic math + // + // I(V) = f(V) + // + // G(V) = df/dV(V) + // + // Ieq(V) = I(V) - V * G(V) + // + // + void update_diode(nl_fptype nVd) noexcept { - nl_double IseVDVt(0.0); - if (TYPE == diode_e::BIPOLAR) { - //printf("%s: %g %g\n", m_name.c_str(), nVd, (double) m_Vd); +#if USE_TEXTBOOK_DIODE if (nVd > m_Vcrit) { - const nl_double d = std::min(1e100, nVd - m_Vd); - const nl_double a = std::abs(d) * m_VtInv; - m_Vd = m_Vd + (d < 0 ? -1.0 : 1.0) * std::log1p(a) * m_Vt; + // if the old voltage is less than zero and new is above + // make sure we move enough so that matrix and current + // changes. + const nl_fptype old = std::max(nlconst::zero(), m_Vd); + const nl_fptype d = std::min(+fp_constants<nl_fptype>::DIODE_MAXDIFF(), nVd - old); + const nl_fptype a = plib::abs(d) * m_VtInv; + m_Vd = old + plib::signum(d) * plib::log1p(a) * m_Vt; } else - m_Vd = std::max(-1e100, nVd); - //m_Vd = nVd; + m_Vd = std::max(-fp_constants<nl_fptype>::DIODE_MAXDIFF(), nVd); if (m_Vd < m_Vmin) { @@ -173,73 +276,108 @@ namespace analog } else { - IseVDVt = std::exp(m_logIs + m_Vd * m_VtInv); + const auto IseVDVt = plib::exp(m_logIs + m_Vd * m_VtInv); m_Id = IseVDVt - m_Is; m_G = IseVDVt * m_VtInv + m_gmin; } +#else + //printf("%s: %g %g\n", m_name.c_str(), nVd, (nl_fptype) m_Vd); + m_Vd = nVd; + if (nVd > m_Vcrit) + { + m_Id = m_Icrit_p_Is - m_Is + (m_Vd - m_Vcrit) * m_Icrit_p_Is * m_VtInv; + m_G = m_Icrit_p_Is * m_VtInv + m_gmin; + } + else if (m_Vd < m_Vmin) + { + m_G = m_gmin; + //m_Id = m_Imin + (m_Vd - m_Vmin) * m_gmin; + //m_Imin = m_gmin * m_Vt - m_Is; + m_Id = (m_Vd - m_Vmin + m_Vt) * m_gmin - m_Is; + } + else + { + const auto IseVDVt = plib::exp(m_logIs + m_Vd * m_VtInv); + m_Id = IseVDVt - m_Is; + m_G = IseVDVt * m_VtInv + m_gmin; + } +#endif } else if (TYPE == diode_e::MOS) { - if (nVd < constants::zero()) + m_Vd = nVd; + if (nVd < nlconst::zero()) { - m_Vd = nVd; m_G = m_Is * m_VtInv + m_gmin; m_Id = m_G * m_Vd; } - else /* log stepping should already be done in mosfet */ + else // log stepping should already be done in mosfet { - m_Vd = nVd; - IseVDVt = std::exp(std::min(300.0, m_logIs + m_Vd * m_VtInv)); + const auto IseVDVt = plib::exp(std::min(+fp_constants<nl_fptype>::DIODE_MAXVOLT(), m_logIs + m_Vd * m_VtInv)); m_Id = IseVDVt - m_Is; m_G = IseVDVt * m_VtInv + m_gmin; } } } - void set_param(const nl_double Is, const nl_double n, nl_double gmin, nl_double temp) + void set_param(nl_fptype Is, nl_fptype n, nl_fptype gmin, nl_fptype temp) noexcept { m_Is = Is; - m_logIs = std::log(Is); - m_n = n; + m_logIs = plib::log(Is); m_gmin = gmin; - m_Vt = m_n * temp * constants::k_b() / constants::Q_e(); - - m_Vmin = -5.0 * m_Vt; + m_Vt = nlconst::np_VT(n, temp); + m_VtInv = plib::reciprocal(m_Vt); + +#if USE_TEXTBOOK_DIODE + m_Vmin = nlconst::diode_min_cutoff_mult() * m_Vt; + // Vcrit : f(V) has smallest radius of curvature rho(V) == min(rho(v)) + m_Vcrit = m_Vt * plib::log(m_Vt / m_Is / nlconst::sqrt2()); +#else + m_Vmin = plib::log(m_gmin * m_Vt / m_Is) * m_Vt; + //m_Imin = plib::exp(m_logIs + m_Vmin * m_VtInv) - m_Is; + //m_Imin = m_gmin * m_Vt - m_Is; + // Fixme: calculate max dissipation voltage - use use 0.5 (500mW) here for typical diode + // P = V * I = V * (Is*exp(V/Vt) - Is) + // P ~= V * I = V * Is*exp(V/Vt) + // ln(P/Is) = ln(V)+V/Vt ~= V - 1 + V/vt + // V = (1+ln(P/Is))/(1 + 1/Vt) + + m_Vcrit = (nlconst::one() + plib::log(nlconst::half() / m_Is)) / (nlconst::one() + m_VtInv); + //printf("Vcrit: %f\n", m_Vcrit); + m_Icrit_p_Is = plib::exp(m_logIs + m_Vcrit * m_VtInv); + //m_Icrit = plib::exp(m_logIs + m_Vcrit * m_VtInv) - m_Is; +#endif - m_Vcrit = m_Vt * std::log(m_Vt / m_Is / constants::sqrt2()); - m_VtInv = constants::one() / m_Vt; - //printf("%g %g\n", m_Vmin, m_Vcrit); } + nl_fptype I() const noexcept { return m_Id; } + nl_fptype G() const noexcept { return m_G; } + nl_fptype Ieq() const noexcept { return (m_Id - m_Vd * m_G); } + nl_fptype Vd() const noexcept { return m_Vd; } - nl_double I() const { return m_Id; } - nl_double G() const { return m_G; } - nl_double Ieq() const { return (m_Id - m_Vd * m_G); } - nl_double Vd() const { return m_Vd; } - - /* owning object must save those ... */ + // owning object must save those ... private: - state_var<nl_double> m_Vd; - state_var<nl_double> m_Id; - state_var<nl_double> m_G; - - nl_double m_Vt; - nl_double m_Vmin; - nl_double m_Is; - nl_double m_logIs; - nl_double m_n; - nl_double m_gmin; - - nl_double m_VtInv; - nl_double m_Vcrit; - - pstring m_name; + nl_fptype m_Vd; + nl_fptype m_Id; + nl_fptype m_G; + + nl_fptype m_Vt; + nl_fptype m_Vmin; + nl_fptype m_Is; + nl_fptype m_logIs; + nl_fptype m_gmin; + + nl_fptype m_VtInv; + nl_fptype m_Vcrit; +#if !USE_TEXTBOOK_DIODE + //nl_fptype m_Imin; + nl_fptype m_Icrit_p_Is; +#endif }; -} // namespace analog -} // namespace netlist +} // namespace netlist::analog -#endif /* NLD_GENERIC_MODELS_H_ */ +#endif // NLD_GENERIC_MODELS_H_ diff --git a/src/lib/netlist/analog/nld_mosfet.cpp b/src/lib/netlist/analog/nld_mosfet.cpp index c66cec291f6..63911ceb02f 100644 --- a/src/lib/netlist/analog/nld_mosfet.cpp +++ b/src/lib/netlist/analog/nld_mosfet.cpp @@ -1,193 +1,168 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_mosfet.cpp - * - * Formulas in here based on the following Sources: - * - * https://www.imperial.ac.uk/pls/portallive/docs/1/7292573.PDF - * http://www3.imperial.ac.uk/pls/portallive/docs/1/56133736.PDF - * https://people.rit.edu/lffeee/SPICE_MOSFET_Model_Intro.pdf - * https://people.rit.edu/lffeee/SPICE.pdf - * http://web.mit.edu/course/6/6.012/SPR98/www/lectures/S98_Lecture10.pdf - * http://homepages.rpi.edu/~sawyes/Models_review.pdf - * http://jaco.ec.t.kanazawa-u.ac.jp/edu/mix/pdf/3.pdf - * - * Farid N. Naim, Circuit Simulation (Wiley-IEEE Press, 2010). - * Stefan Jahn, Michael Margraf, Vincent Habchi and Raimund Jacob, "Qucs Technical Papers" (2007) - * - */ - -#include "netlist/solver/nld_solver.h" -#include "netlist/nl_setup.h" + +// Names +// spell-checker: words Farid, Naim, Jahn, Margraf, Habchi, Raimund, Qucs +// +// Specific technical terms +// spell-checker: words Cgso, Cgdo, Cgbo, Cjsw, Mjsw, Ucrit, Uexp, Utra, Neff, Tnom, capval, Udsat, Utst + +/// +/// \file nld_mosfet.cpp +/// +/// Formulas in here based on the following Sources: +/// +/// https:///www.imperial.ac.uk/pls/portallive/docs/1/7292573.PDF +/// http://www3.imperial.ac.uk/pls/portallive/docs/1/56133736.PDF +/// https://people.rit.edu/lffeee/SPICE_MOSFET_Model_Intro.pdf +/// https://people.rit.edu/lffeee/SPICE.pdf +/// http://web.mit.edu/course/6/6.012/SPR98/www/lectures/S98_Lecture10.pdf +/// http://homepages.rpi.edu/~sawyes/Models_review.pdf +/// http://jaco.ec.t.kanazawa-u.ac.jp/edu/mix/pdf/3.pdf +/// +/// Farid N. Naim, Circuit Simulation (Wiley-IEEE Press, 2010). +/// Stefan Jahn, Michael Margraf, Vincent Habchi and Raimund Jacob, "Qucs +/// Technical Papers" (2007) +/// + +#include "../nl_setup.h" #include "nlid_twoterm.h" -#include <cmath> +#include "solver/nld_solver.h" -#define BODY_CONNECTED_TO_SOURCE (1) +#define BODY_CONNECTED_TO_SOURCE (1) -namespace netlist -{ -namespace analog +namespace netlist::analog { - using constants = plib::constants<nl_double>; - - // ----------------------------------------------------------------------------- - // nld_FET - Base classes - // ----------------------------------------------------------------------------- - - /*! Class representing the nmos/pmos model paramers. - * - * This is the model representation of the nmos model. - * - * Netlist has an additional parameter caller CAPMOD: - * - * CAPMOD=0: Capacitance model disabled - * CAPMOD=2: Meyer capacitance model - * - * Typically, SPICE uses the following parameters. A "Y" in the first - * column indicates that the parameter is actually used in netlist. - * - * | NL? |Name | Description|Units |Default |Example | - * |:---:|------|-----------------------------------------------------------------------|-------|---------:|----------------:| - * | Y |Vto | Zero-bias threshold voltage | V | 0 | 1 | - * | Y |Kp | Transconductance parameter | A/V² | 0.00002 | 0.00003 | - * | Y |Gamma | Bulk threshold parameter | V^½ | 0 | 0.37 | - * | Y |Phi | Surface inversion potential | V | 0.6 | 0.65 | - * | Y |Lambda| Channel-length modulation (level 1 and 2 only) | 1/V | 0 | 0.02 | - * | |Rd | Drain ohmic resistance |W|0|1| - * | |Rs | Source ohmic resistance |W|0|1| - * | |Cbd | Zero-bias B-D junction capacitance |F|0|20f| - * | |Cbs | Zero-bias B-S junction capacitance |F|0|20f| - * | Y |Is | Bulk junction saturation current |A|0.00000000000001|1E-015| - * | Y |N | Bulk diode emission coefficient |-|1|* - * | |Pb | Bulk junction potential |V|0.8|0.87|8| - * | Y |Cgso | Gate-source overlap capacitance per meter channel width |F/m|0|0.00000000004| - * | Y |Cgdo | Gate-drain overlap capacitance per meter channel width |F/m|0|0.00000000004|* - * | Y |Cgbo | Gate-bulk overlap capacitance per meter channel width |F/m|0|0.0000000002|* - * | |Rsh | Drain and source diffusion sheet resistance |W|0|10|* - * | |Cj | Zero-bias bulk junction bottom capacitance per square meter of junction area|F/m²|0|0.0002|* - * | |Mj | Bulk junction bottom grading coefficient |-|0.5|0.5|* - * | |Cjsw | Zero-bias bulk junction sidewall capacitance per meter of junction perimeter|F/m|0|1p|* - * | |Mjsw | Bulk junction sidewall grading coefficient |-|.50 level 1 .33 level 2,3|| - * | |Js | Bulk junction saturation current per square-meter of junction area|A/m|0|0.00000001| - * | Y |Tox | Oxide thickness |m|0.0000001|0.0000001| - * | Y |Nsub | Substrate doping |1/cm³|0|4000000000000000| - * | |Nss | Surface state density |1/cm²|0|10000000000| - * | |Nfs | Fast surface state |1/cm²|0|10000000000|* - * | |TPG | Type of gate material: +1 opp. to substrate -1 same as substrate 0 Al gate|-|1| - * | |Xj | Metallurgical junction depth |m|0|1µ|* - * | Y |Ld | Lateral diffusion |m|0|0.8µ| - * | Y |Uo | Surface mobility |cm²/V/s|600|700| - * | |Ucrit | Critical field for mobility degradation (level 2 only) |V/cm|10000|10000| - * | |Uexp | Critical field exponent in mobility degradation (level 2 only) |-|0|0.1| - * | |Utra | Transverse field coefficient (level 2 only) |-|0|0.3|* - * | |Vmax | Maximum carrier drift velocity (levels 2 & 3 only) |m/s|0|50000| - * | |Neff | Total channel-charge exponent (level 2 only) |-|1|5| - * | |Kf | Flicker noise coefficient |-|0|1E-026| - * | |Af | Flicker noise exponent |-|1|1.2| - * | |Fc | Coefficient for forward-bias depletion capacitance formula |-|0.5| - * | |Delta | Width effect on threshold voltage(levels 2 and 3) |-|0|1| - * | |Theta | Mobility modulation (level 3 only) |-|0|0.1| - * | |Eta | Static feedback (level 3 only) |-|0|1| - * | |Kappa | Saturation field (level 3 only) |0.2|0.5| - * | |Tnom | Parameter measurement temperature |ºC|27|50|| - * | Y |L | Length scaling |-|100e-6|| - * | Y |W | Width scaling |-|100e-6|| - * */ - - class fet_model_t : public param_model_t + using constants = plib::constants<nl_fptype>; + + /// \brief Class representing the nmos/pmos model parameters. + /// + /// This is the model representation of the nmos model. + /// + /// Netlist has an additional parameter caller CAPMOD: + /// + /// CAPMOD=0: Capacitance model disabled + /// CAPMOD=2: Meyer capacitance model + /// + /// Typically, SPICE uses the following parameters. A "Y" in the first + /// column indicates that the parameter is actually used in netlist. + /// + /// |NL? |Name | Description|Units |Default |Example | + /// |:---:|------|-----------------------------------------------------------------------|-------|---------:|----------------:| + /// | Y |Vto | Zero-bias threshold voltage | V | 0 | 1 | + /// | Y |Kp | Transconductance parameter | A/V² | 0.00002 | 0.00003 | + /// | Y |Gamma | Bulk threshold parameter | V^½ | 0 | 0.37 | + /// | Y |Phi | Surface inversion potential | V | 0.6 | 0.65 | + /// | Y |Lambda| Channel-length modulation (level 1 and 2 only) | 1/V | 0 | 0.02 | + /// | |Rd | Drain ohmic resistance |W|0|1| + /// | |Rs | Source ohmic resistance |W|0|1| + /// | |Cbd | Zero-bias B-D junction capacitance |F|0|20f| + /// | |Cbs | Zero-bias B-S junction capacitance |F|0|20f| + /// | Y |Is | Bulk junction saturation current |A|0.00000000000001|1E-015| + /// | Y |N | Bulk diode emission coefficient |-|1|*| + /// | |Pb | Bulk junction potential |V|0.8|0.87| + /// | Y |Cgso | Gate-source overlap capacitance per meter channel width |F/m|0|0.00000000004| + /// | Y |Cgdo | Gate-drain overlap capacitance per meter channel width |F/m|0|0.00000000004*| + /// | Y |Cgbo | Gate-bulk overlap capacitance per meter channel width |F/m|0|0.0000000002*| + /// | |Rsh | Drain and source diffusion sheet resistance |W|0|10*| + /// | |Cj | Zero-bias bulk junction bottom capacitance per square meter of junction area|F/m²|0|0.0002*| + /// | |Mj | Bulk junction bottom grading coefficient |-|0.5|0.5*| + /// | |Cjsw | Zero-bias bulk junction sidewall capacitance per meter of junction perimeter|F/m|0|1p*| + /// | |Mjsw | Bulk junction sidewall grading coefficient |-|.50 level 1 .33 level 2,3|| + /// | |Js | Bulk junction saturation current per square-meter of junction area|A/m|0|0.00000001| + /// | Y |Tox | Oxide thickness |m|0.0000001|0.0000001| + /// | Y |Nsub | Substrate doping |1/cm³|0|4000000000000000| + /// | |Nss | Surface state density |1/cm²|0|10000000000| + /// | |Nfs | Fast surface state |1/cm²|0|10000000000*| + /// | |TPG | Type of gate material: +1 opp. to substrate -1 same as substrate |Al gate|-|1| + /// | |Xj | Metallurgical junction depth |m|0|1µ*| + /// | Y |Ld | Lateral diffusion |m|0|0.8µ| + /// | Y |Uo | Surface mobility |cm²/V/s|600|700| + /// | |Ucrit | Critical field for mobility degradation (level 2 only) |V/cm|10000|10000| + /// | |Uexp | Critical field exponent in mobility degradation (level 2 only) |-|0|0.1| + /// | |Utra | Transverse field coefficient (level 2 only) |-|0|0.3*| + /// | |Vmax | Maximum carrier drift velocity (levels 2 & 3 only) |m/s|0|50000| + /// | |Neff | Total channel-charge exponent (level 2 only) |-|1|5| + /// | |Kf | Flicker noise coefficient |-|0|1E-026| + /// | |Af | Flicker noise exponent |-|1|1.2| + /// | |Fc | Coefficient for forward-bias depletion capacitance formula |-|0.5|| + /// | |Delta | Width effect on threshold voltage(levels 2 and 3) |-|0|1| + /// | |Theta | Mobility modulation (level 3 only) |-|0|0.1| + /// | |Eta | Static feedback (level 3 only) |-|0|1| + /// | |Kappa | Saturation field (level 3 only) |-|0.2|0.5| + /// | |Tnom | Parameter measurement temperature |ºC|27|50| + /// | Y |L | Length scaling |-|100e-6|| + /// | Y |W | Width scaling |-|100e-6|| + /// + + class fet_model_t { public: - fet_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_VTO(*this, "VTO") - , m_N(*this, "N") - , m_ISS(*this, "IS") // Haven't seen a model using ISS / ISD - , m_ISD(*this, "IS") - , m_LD(*this, "LD") - , m_L(*this, "L") - , m_W(*this, "W") - , m_TOX(*this, "TOX") - , m_KP(*this, "KP") - , m_UO(*this, "UO") - , m_PHI(*this, "PHI") - , m_NSUB(*this, "NSUB") - , m_GAMMA(*this, "GAMMA") - , m_LAMBDA(*this, "LAMBDA") - , m_RD(*this, "RD") - , m_RS(*this, "RS") - , m_CGSO(*this, "CGSO") - , m_CGDO(*this, "CGDO") - , m_CGBO(*this, "CGBO") - , m_CAPMOD(*this, "CAPMOD") - {} - - value_t m_VTO; //!< Threshold voltage [V] - value_t m_N; //!< Bulk diode emission coefficient - value_t m_ISS; //!< Body diode saturation current - value_t m_ISD; //!< Body diode saturation current - value_t m_LD; //!< Lateral diffusion [m] - value_t m_L; //!< Length scaling - value_t m_W; //!< Width scaling - value_t m_TOX; //!< Oxide thickness - value_t m_KP; //!< Transconductance parameter [A/V²] - value_t m_UO; //!< Surface mobility [cm²/V/s] - value_t m_PHI; //!< Surface inversion potential [V] - value_t m_NSUB; //!< Substrate doping [1/cm³] - value_t m_GAMMA; //!< Bulk threshold parameter [V^½] - value_t m_LAMBDA; //!< Channel-length modulation [1/V] - value_t m_RD; //!< Drain ohmic resistance - value_t m_RS; //!< Source ohmic resistance - value_t m_CGSO; //!< Gate-source overlap capacitance per meter channel width - value_t m_CGDO; //!< Gate-drain overlap capacitance per meter channel width - value_t m_CGBO; //!< Gate-bulk overlap capacitance per meter channel width - value_base_t<int> m_CAPMOD; //!< Capacitance model (0=no model 2=Meyer) - }; - - // Have a common start for mosfets - - NETLIB_OBJECT(FET) - { - public: - enum q_type { - FET_NMOS, - FET_PMOS - }; - - NETLIB_CONSTRUCTOR(FET) - , m_model(*this, "MODEL", "NMOS") - , m_qtype(FET_NMOS) + fet_model_t(param_model_t &model) + : m_VTO(model, "VTO") + , m_N(model, "N") + , m_ISS(model, "IS") // Haven't seen a model using ISS / ISD + , m_ISD(model, "IS") + , m_LD(model, "LD") + , m_L(model, "L") + , m_W(model, "W") + , m_TOX(model, "TOX") + , m_KP(model, "KP") + , m_UO(model, "UO") + , m_PHI(model, "PHI") + , m_NSUB(model, "NSUB") + , m_GAMMA(model, "GAMMA") + , m_LAMBDA(model, "LAMBDA") + , m_RD(model, "RD") + , m_RS(model, "RS") + , m_CGSO(model, "CGSO") + , m_CGDO(model, "CGDO") + , m_CGBO(model, "CGBO") + , m_CAPMOD(model, "CAPMOD") { } - NETLIB_IS_DYNAMIC(true) - - //NETLIB_RESETI(); - NETLIB_UPDATEI() { } - - q_type qtype() const { return m_qtype; } - bool is_qtype(q_type atype) const { return m_qtype == atype; } - void set_qtype(q_type atype) { m_qtype = atype; } - protected: - - fet_model_t m_model; - private: - q_type m_qtype; + param_model_t::value_t m_VTO; //!< Threshold voltage [V] + param_model_t::value_t m_N; //!< Bulk diode emission coefficient + param_model_t::value_t m_ISS; //!< Body diode saturation current + param_model_t::value_t m_ISD; //!< Body diode saturation current + param_model_t::value_t m_LD; //!< Lateral diffusion [m] + param_model_t::value_t m_L; //!< Length scaling + param_model_t::value_t m_W; //!< Width scaling + param_model_t::value_t m_TOX; //!< Oxide thickness + param_model_t::value_t m_KP; //!< Transconductance parameter [A/V²] + param_model_t::value_t m_UO; //!< Surface mobility [cm²/V/s] + param_model_t::value_t m_PHI; //!< Surface inversion potential [V] + param_model_t::value_t m_NSUB; //!< Substrate doping [1/cm³] + param_model_t::value_t m_GAMMA; //!< Bulk threshold parameter [V^½] + param_model_t::value_t m_LAMBDA; //!< Channel-length modulation [1/V] + param_model_t::value_t m_RD; //!< Drain ohmic resistance + param_model_t::value_t m_RS; //!< Source ohmic resistance + param_model_t::value_t m_CGSO; //!< Gate-source overlap capacitance per + //!< meter channel width + param_model_t::value_t m_CGDO; //!< Gate-drain overlap capacitance per + //!< meter channel width + param_model_t::value_t m_CGBO; //!< Gate-bulk overlap capacitance per + //!< meter channel width + param_model_t::value_base_t<int> m_CAPMOD; //!< Capacitance model (0=no + //!< model 2=Meyer) }; // ----------------------------------------------------------------------------- - // nld_QBJT_EB + // nld_MOSFET // ----------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(MOSFET, FET) + class nld_MOSFET : public base_device_t { public: - NETLIB_CONSTRUCTOR_DERIVED(MOSFET, FET) - , m_DG(*this, "m_DG", true) - , m_SG(*this, "m_SG", true) - , m_SD(*this, "m_SD", true) + nld_MOSFET(constructor_param_t data) + : base_device_t(data) + , m_model(*this, "MODEL", "NMOS") + , m_DG(*this, "m_DG", NETLIB_DELEGATE(terminal_handler)) + , m_SG(*this, "m_SG", NETLIB_DELEGATE(terminal_handler)) + , m_SD(*this, "m_SD", NETLIB_DELEGATE(terminal_handler)) , m_D_BD(*this, "m_D_BD") #if (!BODY_CONNECTED_TO_SOURCE) , m_D_BS(*this, "m_D_BS") @@ -195,144 +170,183 @@ namespace analog , m_cap_gb(*this, "m_cap_gb") , m_cap_gs(*this, "m_cap_gs") , m_cap_gd(*this, "m_cap_gd") - , m_phi(0.0) - , m_gamma(0.0) - , m_vto(0.0) - , m_beta(0.0) - , m_lambda(0.0) - , m_Leff(0.0) - , m_CoxWL(0.0) - , m_polarity(qtype() == FET_NMOS ? 1.0 : -1.0) - , m_Cgb(0.0) - , m_Cgs(0.0) - , m_Cgd(0.0) - , m_capmod(2) - , m_Vgs(*this, "m_Vgs", 0.0) - , m_Vgd(*this, "m_Vgd", 0.0) - { - register_subalias("S", m_SG.m_P); // Source - register_subalias("G", m_SG.m_N); // Gate + , m_phi(nlconst::zero()) + , m_gamma(nlconst::zero()) + , m_vto(nlconst::zero()) + , m_beta(nlconst::zero()) + , m_lambda(nlconst::zero()) + , m_Leff(nlconst::zero()) + , m_CoxWL(nlconst::zero()) + // S, m_polarity(qtype() == FET_NMOS ? nlconst::one() : -nlconst::one()) + , m_Cgb(nlconst::zero()) + , m_Cgs(nlconst::zero()) + , m_Cgd(nlconst::zero()) + , m_capacitor_model(2) + , m_Vgs(*this, "m_Vgs", nlconst::zero()) + , m_Vgd(*this, "m_Vgd", nlconst::zero()) + , m_model_acc(m_model) + { + register_sub_alias("S", m_SG.P()); // Source + register_sub_alias("G", m_SG.N()); // Gate - register_subalias("D", m_DG.m_P); // Drain + register_sub_alias("D", m_DG.P()); // Drain - connect(m_SG.m_P, m_SD.m_P); - connect(m_SG.m_N, m_DG.m_N); - connect(m_DG.m_P, m_SD.m_N); + connect(m_SG.P(), m_SD.P()); + connect(m_SG.N(), m_DG.N()); + connect(m_DG.P(), m_SD.N()); - set_qtype((m_model.type() == "NMOS_DEFAULT") ? FET_NMOS : FET_PMOS); - m_polarity = qtype() == FET_NMOS ? 1.0 : -1.0; + m_polarity = (m_model.type() == "NMOS_DEFAULT" ? nlconst::one() + : -nlconst::one()); - m_capmod = m_model.m_CAPMOD; - // printf("capmod %d %g %g\n", m_capmod, (double)m_model.m_VTO, m_polarity); - nl_assert_always(m_capmod == 0 || m_capmod == 2, "Error: CAPMODEL invalid value for " + m_model.name()); + m_capacitor_model = m_model_acc.m_CAPMOD; + //# printf("capmod %d %g %g\n", m_capacitor_model, (nl_fptype)m_model_acc.m_VTO, m_polarity); + nl_assert_always(m_capacitor_model == 0 || m_capacitor_model == 2, + "Error: CAPMODEL invalid value"); - /* - * From http://ltwiki.org/LTspiceHelp/LTspiceHelp/M_MOSFET.htm : - * - * VTO, KP, LAMBDA, PHI and GAMMA. These parameters are computed - * if the process parameters(NSUB, TOX,...) are given, but - * user-specified values always override. - * - * But couldn't find a formula for lambda anywhere - * - */ + // + // From http://ltwiki.org/LTspiceHelp/LTspiceHelp/M_MOSFET.htm : + // + // VTO, KP, LAMBDA, PHI and GAMMA. These parameters are + // computed if the process parameters(NSUB, TOX,...) are given, + // but user-specified values always override. + // + // But couldn't find a formula for lambda anywhere + // - m_lambda = m_model.m_LAMBDA; // FIXME: m_lambda only set once + m_lambda = m_model_acc.m_LAMBDA; // FIXME: m_lambda only set once // calculate effective channel length - m_Leff = m_model.m_L - 2 * m_model.m_LD; - nl_assert_always(m_Leff > 0.0, "Effective Lateral diffusion would be negative for model " + m_model.name()); + m_Leff = m_model_acc.m_L - 2 * m_model_acc.m_LD; + nl_assert_always( + m_Leff > nlconst::zero(), + "Effective Lateral diffusion would be negative for model"); - nl_double Cox = (m_model.m_TOX > 0.0) ? (constants::eps_SiO2() * constants::eps_0() / m_model.m_TOX) : 0.0; + nl_fptype Cox = (m_model_acc.m_TOX > nlconst::zero()) + ? (constants::eps_SiO2() * constants::eps_0() + / m_model_acc.m_TOX) + : nlconst::zero(); // calculate DC transconductance coefficient - if (m_model.m_KP > 0) - m_beta = m_model.m_KP * m_model.m_W / m_Leff; - else if (Cox > 0 && m_model.m_UO > 0) - m_beta = m_model.m_UO * 1e-4 * Cox * m_model.m_W / m_Leff; + if (m_model_acc.m_KP > nlconst::zero()) + m_beta = m_model_acc.m_KP * m_model_acc.m_W / m_Leff; + else if (Cox > nlconst::zero() + && m_model_acc.m_UO > nlconst::zero()) + m_beta = m_model_acc.m_UO * nlconst::magic(1e-4) * Cox + * m_model_acc.m_W / m_Leff; else - m_beta = 2e-5 * m_model.m_W / m_Leff; + m_beta = nlconst::magic(2e-5) * m_model_acc.m_W / m_Leff; - //FIXME::UT can disappear - const double Vt = constants::T0() * constants::k_b() / constants::Q_e(); + // FIXME::UT can disappear + const nl_fptype Vt = constants::T0() * constants::k_b() + / constants::Q_e(); // calculate surface potential if not given - if (m_model.m_PHI > 0.0) - m_phi = m_model.m_PHI; - else if (m_model.m_NSUB > 0.0) + if (m_model_acc.m_PHI > nlconst::zero()) + m_phi = m_model_acc.m_PHI; + else if (m_model_acc.m_NSUB > nlconst::zero()) { - nl_assert_always(m_model.m_NSUB * 1e6 >= constants::NiSi(), "Error calculating phi for model " + m_model.name()); - m_phi = 2 * Vt * std::log (m_model.m_NSUB * 1e6 / constants::NiSi()); + nl_assert_always(m_model_acc.m_NSUB * nlconst::magic(1e6) + >= constants::NiSi(), + "Error calculating phi for model"); + m_phi = nlconst::two() * Vt + * plib::log(m_model_acc.m_NSUB * nlconst::magic(1e6) + / constants::NiSi()); } else - m_phi = 0.6; + m_phi = nlconst::magic(0.6); // calculate bulk threshold if not given - if (m_model.m_GAMMA > 0.0) - m_gamma = m_model.m_GAMMA; + if (m_model_acc.m_GAMMA > nlconst::zero()) + m_gamma = m_model_acc.m_GAMMA; else { - if (Cox > 0.0 && m_model.m_NSUB > 0) - m_gamma = std::sqrt (2.0 * constants::Q_e() * constants::eps_Si() * constants::eps_0() * m_model.m_NSUB * 1e6) / Cox; + if (Cox > nlconst::zero() + && m_model_acc.m_NSUB > nlconst::zero()) + m_gamma = plib::sqrt( + nlconst::two() * constants::Q_e() + * constants::eps_Si() * constants::eps_0() + * m_model_acc.m_NSUB * nlconst::magic(1e6)) + / Cox; else - m_gamma = 0.0; + m_gamma = nlconst::zero(); } - m_vto = m_model.m_VTO; - if(m_vto != 0.0) + m_vto = m_model_acc.m_VTO; + // FIXME zero conversion + if (m_vto == nlconst::zero()) log().warning(MW_MOSFET_THRESHOLD_VOLTAGE(m_model.name())); - /* FIXME: VTO if missing may be calculated from TPG, NSS and temperature. Usually models - * specify VTO so skip this here. - */ + // FIXME: VTO if missing may be calculated from TPG, NSS and + // temperature. Usually models specify VTO so skip this here. - m_CoxWL = Cox * m_model.m_W * m_Leff; + m_CoxWL = Cox * m_model_acc.m_W * m_Leff; - //printf("Cox: %g\n", m_Cox); + //#printf("Cox: %g\n", m_Cox); } - NETLIB_IS_TIMESTEP(true || m_capmod != 0) + NETLIB_IS_DYNAMIC(true) + NETLIB_IS_TIMESTEP(true || m_capacitor_model != 0) NETLIB_TIMESTEPI() { - if (m_capmod != 0) + if (m_capacitor_model != 0) { - //const nl_double Ugd = -m_DG.deltaV() * m_polarity; // Gate - Drain - //const nl_double Ugs = -m_SG.deltaV() * m_polarity; // Gate - Source - const nl_double Ugd = m_Vgd; // Gate - Drain - const nl_double Ugs = m_Vgs; // Gate - Source - const nl_double Ubs = 0.0; // Bulk - Source == 0 if connected - const nl_double Ugb = Ugs - Ubs; - - m_cap_gb.timestep(m_Cgb, Ugb, step); - m_cap_gs.timestep(m_Cgs, Ugs, step); - m_cap_gd.timestep(m_Cgd, Ugd, step); + if (ts_type == detail::time_step_type::FORWARD) + { + //#const nl_nl_fptype Ugd = -m_DG.deltaV() * m_polarity; // Gate - Drain + //#const nl_nl_fptype Ugs = -m_SG.deltaV() * m_polarity; // Gate - Source + const nl_fptype Ugd = m_Vgd; // Gate - Drain + const nl_fptype Ugs = m_Vgs; // Gate - Source + const nl_fptype Ubs = nlconst::zero(); // Bulk - Source == 0 + // if connected + const nl_fptype Ugb = Ugs - Ubs; + + m_cap_gb.time_step(m_Cgb, Ugb, step); + m_cap_gs.time_step(m_Cgs, Ugs, step); + m_cap_gd.time_step(m_Cgd, Ugd, step); + } + else + { + m_cap_gb.restore_state(); + m_cap_gs.restore_state(); + m_cap_gd.restore_state(); + } } } protected: - NETLIB_RESETI() { - NETLIB_NAME(FET)::reset(); // Bulk diodes - m_D_BD.set_param(m_model.m_ISD, m_model.m_N, exec().gmin(), constants::T0()); - #if (!BODY_CONNECTED_TO_SOURCE) - m_D_BS.set_param(m_model.m_ISS, m_model.m_N, exec().gmin(), constants::T0()); - #endif + m_D_BD.set_param(m_model_acc.m_ISD, m_model_acc.m_N, exec().gmin(), + constants::T0()); +#if (!BODY_CONNECTED_TO_SOURCE) + m_D_BS.set_param(m_model_acc.m_ISS, m_model_acc.m_N, exec().gmin(), + constants::T0()); +#endif } - NETLIB_UPDATEI(); + NETLIB_HANDLERI(terminal_handler) + { + // only called if connected to a rail net ==> notify the solver to + // recalculate + auto *solv(m_SG.solver()); + if (solv != nullptr) + solv->solve_now(); + else + m_DG.solver()->solve_now(); + } NETLIB_UPDATE_PARAMI(); NETLIB_UPDATE_TERMINALSI(); private: + param_model_t m_model; - nld_twoterm m_DG; - nld_twoterm m_SG; - nld_twoterm m_SD; + NETLIB_NAME(two_terminal) m_DG; + NETLIB_NAME(two_terminal) m_SG; + NETLIB_NAME(two_terminal) m_SD; generic_diode<diode_e::MOS> m_D_BD; #if (!BODY_CONNECTED_TO_SOURCE) @@ -343,83 +357,94 @@ namespace analog generic_capacitor<capacitor_e::VARIABLE_CAPACITY> m_cap_gs; generic_capacitor<capacitor_e::VARIABLE_CAPACITY> m_cap_gd; - nl_double m_phi; - nl_double m_gamma; - nl_double m_vto; - nl_double m_beta; - nl_double m_lambda; + nl_fptype m_phi; + nl_fptype m_gamma; + nl_fptype m_vto; + nl_fptype m_beta; + nl_fptype m_lambda; - /* used in capacitance calculation */ - nl_double m_Leff; - nl_double m_CoxWL; - nl_double m_polarity; + // used in capacitance calculation + nl_fptype m_Leff; + nl_fptype m_CoxWL; + nl_fptype m_polarity; - /* capacitance values */ + // capacitance values - nl_double m_Cgb; - nl_double m_Cgs; - nl_double m_Cgd; + nl_fptype m_Cgb; + nl_fptype m_Cgs; + nl_fptype m_Cgd; - int m_capmod; - state_var<nl_double> m_Vgs; - state_var<nl_double> m_Vgd; + int m_capacitor_model; + state_var<nl_fptype> m_Vgs; + state_var<nl_fptype> m_Vgd; + fet_model_t m_model_acc; - void set_cap(generic_capacitor<capacitor_e::VARIABLE_CAPACITY> cap, - nl_double capval, nl_double V, - nl_double &g11, nl_double &g12, nl_double &g21, nl_double &g22, - nl_double &I1, nl_double &I2) + void set_cap(generic_capacitor<capacitor_e::VARIABLE_CAPACITY> &cap, + nl_fptype capval, nl_fptype V, nl_fptype &g11, + nl_fptype &g12, nl_fptype &g21, nl_fptype &g22, + nl_fptype &I1, nl_fptype &I2) const { - const nl_double I = cap.Ieq(capval, V) * m_polarity; - const nl_double G = cap.G(capval); - g11 += G; g12 -= G; g21 -= G; g22 += G; - I1 -= I; I2 += I; - //printf("Cap: %g\n", capval); + const nl_fptype I = cap.Ieq(capval, V) * m_polarity; + const nl_fptype G = cap.G(capval); + g11 += G; + g12 -= G; + g21 -= G; + g22 += G; + I1 -= I; + I2 += I; + // printf("Cap: %g\n", capval); } - void calculate_caps(nl_double Vgs, nl_double Vgd, nl_double Vth, - nl_double &Cgs, nl_double &Cgd, nl_double &Cgb) + void + calculate_caps(nl_fptype Vgs, nl_fptype Vgd, nl_fptype Vth, + nl_fptype &Cgs, nl_fptype &Cgd, nl_fptype &Cgb) const { - nl_double Vctrl = Vgs - Vth * m_polarity; + nl_fptype Vctrl = Vgs - Vth * m_polarity; // Cut off - now further differentiated into 3 different formulas // Accumulation if (Vctrl <= -m_phi) { Cgb = m_CoxWL; - Cgs = 0.0; - Cgd = 0.0; + Cgs = nlconst::zero(); + Cgd = nlconst::zero(); } - else if (Vctrl <= -m_phi / 2.0) + else if (Vctrl <= -m_phi / nlconst::two()) { Cgb = -Vctrl * m_CoxWL / m_phi; - Cgs = 0.0; - Cgd = 0.0; + Cgs = nlconst::zero(); + Cgd = nlconst::zero(); } // Depletion else if (Vctrl <= 0) { Cgb = -Vctrl * m_CoxWL / m_phi; - Cgs = Vctrl * m_CoxWL * (4.0 / 3.0) / m_phi + (2.0 / 3.0) * m_CoxWL; - Cgd = 0.0; + Cgs = Vctrl * m_CoxWL * nlconst::fraction(4.0, 3.0) / m_phi + + nlconst::two_thirds() * m_CoxWL; + Cgd = nlconst::zero(); } else { - const nl_double Vdsat = Vctrl; - const nl_double Vds = Vgs - Vgd; + const nl_fptype Vdsat = Vctrl; + const nl_fptype Vds = Vgs - Vgd; // saturation if (Vdsat <= Vds) { - Cgb = 0; - Cgs = (2.0 / 3.0) * m_CoxWL; - Cgd = 0; + Cgb = nlconst::zero(); + Cgs = nlconst::two_thirds() * m_CoxWL; + Cgd = nlconst::zero(); } else { // linear - const nl_double Sqr1 = std::pow(Vdsat - Vds, 2); - const nl_double Sqr2 = std::pow(2.0 * Vdsat - Vds, 2); + const auto Sqr1(plib::narrow_cast<nl_fptype>( + plib::pow(Vdsat - Vds, 2))); + const auto Sqr2(plib::narrow_cast<nl_fptype>( + plib::pow(nlconst::two() * Vdsat - Vds, 2))); Cgb = 0; - Cgs = m_CoxWL * (1.0 - Sqr1 / Sqr2) * (2.0 / 3.0); - Cgd = m_CoxWL * (1.0 - Vdsat * Vdsat / Sqr2) * (2.0 / 3.0); + Cgs = m_CoxWL * (nlconst::one() - Sqr1 / Sqr2) + * nlconst::two_thirds(); + Cgd = m_CoxWL * (nlconst::one() - Vdsat * Vdsat / Sqr2) + * nlconst::two_thirds(); } } } @@ -429,36 +454,33 @@ namespace analog // MOSFET // ---------------------------------------------------------------------------------------- - NETLIB_UPDATE(MOSFET) - { - if (!m_SG.m_P.net().isRailNet()) - m_SG.m_P.solve_now(); // Basis - else if (!m_SG.m_N.net().isRailNet()) - m_SG.m_N.solve_now(); // Emitter - else - m_DG.m_N.solve_now(); // Collector - } - NETLIB_UPDATE_TERMINALS(MOSFET) { - nl_double Vgd = -m_DG.deltaV() * m_polarity; // Gate - Drain - nl_double Vgs = -m_SG.deltaV() * m_polarity; // Gate - Source + nl_fptype Vgd = -m_DG.deltaV() * m_polarity; // Gate - Drain + nl_fptype Vgs = -m_SG.deltaV() * m_polarity; // Gate - Source // limit step sizes - const nl_double k = 3.5; // see "Circuit Simulation", page 185 - nl_double d = (Vgs - m_Vgs); - Vgs = m_Vgs + 1.0/k * (d < 0 ? -1.0 : 1.0) * std::log1p(k * std::abs(d)); + const nl_fptype k = nlconst::magic(3.5); // see "Circuit Simulation", + // page 185 + nl_fptype d = (Vgs - m_Vgs); + Vgs = m_Vgs + + plib::reciprocal(k) * plib::signum(d) + * plib::log1p(k * plib::abs(d)); d = (Vgd - m_Vgd); - Vgd = m_Vgd + 1.0/k * (d < 0 ? -1.0 : 1.0) * std::log1p(k * std::abs(d)); + Vgd = m_Vgd + + plib::reciprocal(k) * plib::signum(d) + * plib::log1p(k * plib::abs(d)); m_Vgs = Vgs; m_Vgd = Vgd; - const nl_double Vbs = 0.0; // Bulk - Source == 0 if connected - //const nl_double Vbd = m_SD.deltaV() * m_polarity; // Bulk - Drain = Source - Drain - const nl_double Vds = Vgs - Vgd; - const nl_double Vbd = -Vds; // Bulk - Drain = Source - Drain + const nl_fptype Vbs = nlconst::zero(); // Bulk - Source == 0 if + // connected + // const nl_nl_fptype Vbd = m_SD.deltaV() * m_polarity; // Bulk - Drain + // = Source - Drain + const nl_fptype Vds = Vgs - Vgd; + const nl_fptype Vbd = -Vds; // Bulk - Drain = Source - Drain #if (!BODY_CONNECTED_TO_SOURCE) m_D_BS.update_diode(Vbs); @@ -467,135 +489,176 @@ namespace analog // Are we in forward mode ? // in backward mode, just swap source and drain - const bool is_forward = Vds >= 0; + const bool is_forward = Vds >= nlconst::zero(); // calculate Vth - const nl_double Vbulk = is_forward ? Vbs : Vbd; - const nl_double phi_m_Vbulk = (m_phi > Vbulk) ? std::sqrt(m_phi - Vbulk) : 0.0; - const nl_double Vth = m_vto * m_polarity + m_gamma * (phi_m_Vbulk - std::sqrt(m_phi)); + const nl_fptype Vbulk = is_forward ? Vbs : Vbd; + const nl_fptype phi_m_Vbulk = (m_phi > Vbulk) + ? plib::sqrt(m_phi - Vbulk) + : nlconst::zero(); + const nl_fptype Vth = m_vto * m_polarity + + m_gamma * (phi_m_Vbulk - plib::sqrt(m_phi)); + + const nl_fptype Vctrl = (is_forward ? Vgs : Vgd) - Vth; - const nl_double Vctrl = (is_forward ? Vgs : Vgd) - Vth; + nl_fptype Ids(0); + nl_fptype gm(0); + nl_fptype gds(0); + nl_fptype gmb(0); - nl_double Ids, gm, gds, gmb; - const nl_double absVds = std::abs(Vds); + const nl_fptype absVds = plib::abs(Vds); - if (Vctrl <= 0.0) + if (Vctrl <= nlconst::zero()) { // cutoff region - Ids = 0.0; - gm = 0.0; - gds = 0.0; - gmb = 0.0; + Ids = nlconst::zero(); + gm = nlconst::zero(); + gds = nlconst::zero(); + gmb = nlconst::zero(); } else { - const nl_double beta = m_beta * (1.0 + m_lambda * absVds); + const nl_fptype beta = m_beta + * (nlconst::one() + m_lambda * absVds); if (Vctrl <= absVds) { // saturation region - Ids = beta * Vctrl * Vctrl / 2.0; - gm = beta * Vctrl; - gds = m_lambda * m_beta * Vctrl * Vctrl / 2.0; + Ids = beta * Vctrl * Vctrl / nlconst::two(); + gm = beta * Vctrl; + gds = m_lambda * m_beta * Vctrl * Vctrl / nlconst::two(); } else { // linear region - Ids = beta * absVds * (Vctrl - absVds / 2); - gm = beta * absVds; - gds = beta * (Vctrl - absVds) + m_lambda * m_beta * absVds * (Vctrl - absVds / 2.0); + Ids = beta * absVds * (Vctrl - absVds / nlconst::two()); + gm = beta * absVds; + gds = beta * (Vctrl - absVds) + + m_lambda * m_beta * absVds + * (Vctrl - absVds / nlconst::two()); } - // backgate transconductance - const nl_double bgtc = (phi_m_Vbulk != 0.0) ? (m_gamma / phi_m_Vbulk / 2.0) : 0.0; + // back gate transconductance + const nl_fptype bgtc = (phi_m_Vbulk != nlconst::zero()) + ? (m_gamma / phi_m_Vbulk + / nlconst::two()) + : nlconst::zero(); gmb = gm * bgtc; } // FIXME: these are needed to compute capacitance - // nl_double Udsat = pol * std::max (Utst, 0.0); + // nl_fptype Udsat = pol * std::max (Utst, 0.0); // Uon = pol * Vth; // compute bulk diode equivalent currents - const nl_double IeqBD = m_D_BD.Ieq(); - const nl_double gbd = m_D_BD.G(); + const nl_fptype IeqBD = m_D_BD.Ieq(); + const nl_fptype gbd = m_D_BD.G(); #if (!BODY_CONNECTED_TO_SOURCE) - const nl_double IeqBS = m_D_BS.Ieq(); - const nl_double gbs = m_D_BS.G(); + const nl_fptype IeqBS = m_D_BS.Ieq(); + const nl_fptype gbs = m_D_BS.G(); #else - const nl_double IeqBS = 0.0; - const nl_double gbs = 0.0; + const nl_fptype IeqBS = nlconst::zero(); + const nl_fptype gbs = nlconst::zero(); #endif // exchange controlling nodes if necessary - const nl_double gsource = is_forward ? (gm + gmb) : 0; - const nl_double gdrain = is_forward ? 0.0 : (gm + gmb); + const nl_fptype gate_source = is_forward ? (gm + gmb) : nlconst::zero(); + const nl_fptype gate_drain = is_forward ? nlconst::zero() : (gm + gmb); - const nl_double IeqDS = (is_forward) ? - Ids - gm * Vgs - gmb * Vbs - gds * Vds - : -Ids - gm * Vgd - gmb * Vbd - gds * Vds; + const nl_fptype IeqDS = (is_forward) + ? Ids - gm * Vgs - gmb * Vbs - gds * Vds + : -Ids - gm * Vgd - gmb * Vbd - gds * Vds; // IG = 0 - nl_double IG = 0.0; - nl_double ID = (+IeqBD - IeqDS) * m_polarity; - nl_double IS = (+IeqBS + IeqDS) * m_polarity; - nl_double IB = (-IeqBD - IeqBS) * m_polarity; - - nl_double gGG = 0.0; - nl_double gGD = 0.0; - nl_double gGS = 0.0; - nl_double gGB = 0.0; - - nl_double gDG = gm; - nl_double gDD = gds + gbd - gdrain; - const nl_double gDS = -gds - gsource; - const nl_double gDB = gmb - gbd; - - nl_double gSG = -gm; - const nl_double gSD = -gds + gdrain; - nl_double gSS = gbs + gds + gsource; - const nl_double gSB = -gbs - gmb; - - nl_double gBG = 0.0; - const nl_double gBD = -gbd; - const nl_double gBS = -gbs; - nl_double gBB = gbs + gbd; - - if (m_capmod != 0) + nl_fptype IG = nlconst::zero(); + nl_fptype ID = (+IeqBD - IeqDS) * m_polarity; + nl_fptype IS = (+IeqBS + IeqDS) * m_polarity; + nl_fptype IB = (-IeqBD - IeqBS) * m_polarity; + + nl_fptype gGG = nlconst::zero(); + nl_fptype gGD = nlconst::zero(); + nl_fptype gGS = nlconst::zero(); + nl_fptype gGB = nlconst::zero(); + + nl_fptype gDG = gm; + nl_fptype gDD = gds + gbd - gate_drain; + const nl_fptype gDS = -gds - gate_source; + const nl_fptype gDB = gmb - gbd; + + nl_fptype gSG = -gm; + const nl_fptype gSD = -gds + gate_drain; + nl_fptype gSS = gbs + gds + gate_source; + const nl_fptype gSB = -gbs - gmb; + + nl_fptype gBG = nlconst::zero(); + const nl_fptype gBD = -gbd; + const nl_fptype gBS = -gbs; + nl_fptype gBB = gbs + gbd; + + if (m_capacitor_model != 0) { - const nl_double Vgb = Vgs - Vbs; + const nl_fptype Vgb = Vgs - Vbs; if (is_forward) calculate_caps(Vgs, Vgd, Vth, m_Cgs, m_Cgd, m_Cgb); else calculate_caps(Vgd, Vgs, Vth, m_Cgd, m_Cgs, m_Cgb); - set_cap(m_cap_gb, m_Cgb + m_model.m_CGBO * m_Leff, Vgb, gGG, gGB, gBG, gBB, IG, IB); - set_cap(m_cap_gs, m_Cgs + m_model.m_CGSO * m_model.m_W, Vgs, gGG, gGS, gSG, gSS, IG, IS); - set_cap(m_cap_gd, m_Cgd + m_model.m_CGDO * m_model.m_W, Vgd, gGG, gGD, gDG, gDD, IG, ID); + set_cap(m_cap_gb, m_Cgb + m_model_acc.m_CGBO * m_Leff, Vgb, gGG, + gGB, gBG, gBB, IG, IB); + set_cap(m_cap_gs, m_Cgs + m_model_acc.m_CGSO * m_model_acc.m_W, Vgs, + gGG, gGS, gSG, gSS, IG, IS); + set_cap(m_cap_gd, m_Cgd + m_model_acc.m_CGDO * m_model_acc.m_W, Vgd, + gGG, gGD, gDG, gDD, IG, ID); } // Source connected to body, Diode S-B shorted! - const nl_double gSSBB = gSS + gBB + gBS + gSB; - + const nl_fptype gSSBB = gSS + gBB + gBS + gSB; + const auto zero(nlconst::zero()); // S G - m_SG.set_mat( gSSBB, gSG + gBG, +(IS + IB), // S - gGS + gGB, gGG, IG ); // G + m_SG.set_mat(gSSBB, gSG + gBG, +(IS + IB), // S + gGS + gGB, gGG, IG); // G // D G - m_DG.set_mat( gDD, gDG, +ID, // D - gGD, 0.0, 0.0 ); // G + m_DG.set_mat(gDD, gDG, +ID, // D + gGD, zero, zero); // G // S D - m_SD.set_mat( 0.0, gSD + gBD, 0.0, // S - gDS + gDB, 0.0, 0.0); // D + m_SD.set_mat(zero, gSD + gBD, zero, // S + gDS + gDB, zero, zero); // D + + /// | + /// | D S G I + /// | + /// | D gDD gDS + gDB gDG ID + /// + /// | S gSD + gBD gSSBB gSG + gBG IS+IB + /// + /// | G gGD gGS + gGB gGG IG + /// | + /// | forward=yes, bulk diode=no, backgate transconductance=no + /// | IG = 0, gGG = 0, gGS, gGB =0, gGD=0l + /// gDD=gds + gbd=gds + /// gSD+gBD=-gds + gmb - gbd = -gds + /// + /// | D S G I + /// | + /// | D gDD gDS + gDB gDG ID + /// + /// | S gSD + gBD gSSBB gSG + gBG IS+IB + /// + /// | G 0 0 0 0 + /// | + /// | + /// | + /// | + /// | + /// | } - NETLIB_UPDATE_PARAM(MOSFET) - { - } + NETLIB_UPDATE_PARAM(MOSFET) {} -} // namespace analog +} // namespace netlist::analog -namespace devices { +namespace netlist::devices +{ NETLIB_DEVICE_IMPL_NS(analog, MOSFET, "MOSFET", "MODEL") -} // namespace devices - -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/analog/nld_mosfet.h b/src/lib/netlist/analog/nld_mosfet.h deleted file mode 100644 index 32011d709d8..00000000000 --- a/src/lib/netlist/analog/nld_mosfet.h +++ /dev/null @@ -1,21 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_mosfet.h - * - */ - -#ifndef NLD_MOSFET_H_ -#define NLD_MOSFET_H_ - -#include "netlist/nl_setup.h" - -// ----------------------------------------------------------------------------- -// Macros -// ----------------------------------------------------------------------------- - -#define MOSFET(name, model) \ - NET_REGISTER_DEV(MOSFET, name) \ - NETDEV_PARAMI(name, MODEL, model) - -#endif /* NLD_MOSFET_H_ */ diff --git a/src/lib/netlist/analog/nld_opamps.cpp b/src/lib/netlist/analog/nld_opamps.cpp index 24f239e9455..b7e4ebfa762 100644 --- a/src/lib/netlist/analog/nld_opamps.cpp +++ b/src/lib/netlist/analog/nld_opamps.cpp @@ -1,128 +1,133 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_opamps.c - * - */ - -#include "nld_opamps.h" -#include "netlist/nl_base.h" -#include "netlist/nl_errstr.h" + +#include "nl_base.h" +#include "nl_errstr.h" #include "nlid_fourterm.h" #include "nlid_twoterm.h" -#include <cmath> +// +// Set to 1 to model output impedance as a series resistor. +// The default is that the VCVS already has an internal impedance. +// This needs more investigation. +// +#define TEST_ALT_OUTPUT (0) namespace netlist { namespace analog { - /* - * Type = 0: Impedance changer - * 1; Idealized opamp - * 2; opamp with first pole - * 3: opamp with first pole + output limit - * 4: opamp with input stage, first pole + output limit - * - * Type 1 parameters: - * FPF = frequency of first pole in Hz (ony used for open-loop gain) - * UGF = unity gain frequency in Hz (only used for open-loop gain) - * RI = input resistance in Ohms - * RO = output resistance in Ohms - * - * Type 3 parameters: - * VLH = high supply rail minus high output swing in V - * VLL = low output swing minus low supply rail in V - * FPF = frequency of first pole in Hz - * UGF = unity gain frequency (transition frequency) in Hz - * SLEW = unity gain slew rate in V/s - * RI = input resistance in Ohms - * RO = output resistance in Ohms - * DAB = Differential Amp Bias ~ op amp's total quiescent current. - * - * .model abc OPAMP(VLH=2.0 VLL=0.2 FPF=5 UGF=10k SLEW=0.6u RI=1000k RO=50 DAB=0.002) - * - * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm - * - * */ - - /*! Class representing the opamp model parameters. - * The opamp model was designed based on designs from - * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm. - * Currently 2 different types are supported: Type 1 and Type 3. Type 1 - * is less complex and should run faster than Type 3. - * - * This is an extension to the traditional SPICE approach which - * assumes that you will be using an manufacturer model. These models may - * have copyrights incompatible with the netlist license. Thus they may not - * be suitable for certain implementations of netlist. - * - * For the typical use cases in low frequency (< 100 KHz) applications at - * which netlist is targeted, this model is certainly suitable. All parameters - * can be determined from a typical opamp datasheet. - * - * |Type|name |parameter |units|default| example| - * |:--:|:-----|:----------------------------------------------|:----|------:|-------:| - * | 3 |TYPE |Model Type, 1 and 3 are supported | | | | - * |1,3 |FPF |frequency of first pole |Hz | |100 | - * | 3 |SLEW |unity gain slew rate |V/s | | 1| - * |1,3 |RI |input resistance |Ohm | |1M | - * |1,3 |RO |output resistance |Ohm | |50 | - * |1,3 |UGF |unity gain frequency (transition frequency) |Hz | |1000 | - * | 3 |VLL |low output swing minus low supply rail |V | |1.5 | - * | 3 |VLH |high supply rail minus high output swing |V | |1.5 | - * | 3 |DAB |Differential Amp Bias - total quiescent current|A | |0.001 | - */ - - class opamp_model_t : public param_model_t + + /// \brief Class representing the opamp model parameters. + /// + /// The opamp model was designed based on designs from + /// http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm. + /// Currently 2 different types are supported: Type 1 and Type 3. Type 1 + /// is less complex and should run faster than Type 3. + /// + /// This is an extension to the traditional SPICE approach which + /// assumes that you will be using an manufacturer model. These models may + /// have copyrights incompatible with the netlist license. Thus they may not + /// be suitable for certain implementations of netlist. + /// + /// For the typical use cases in low frequency (< 100 KHz) applications at + /// which netlist is targeted, this model is certainly suitable. All parameters + /// can be determined from a typical opamp datasheet. + /// + /// |Type|name |parameter |units|default| example| + /// |:--:|:-----|:----------------------------------------------|:----|------:|-------:| + /// | 3 |TYPE |Model Type, 1 and 3 are supported | | | | + /// |1,3 |FPF |frequency of first pole |Hz | |100 | + /// | 3 |SLEW |unity gain slew rate |V/s | | 1| + /// |1,3 |RI |input resistance |Ohm | |1M | + /// |1,3 |RO |output resistance |Ohm | |50 | + /// |1,3 |UGF |unity gain frequency (transition frequency) |Hz | |1000 | + /// | 3 |VLL |low output swing minus low supply rail |V | |1.5 | + /// | 3 |VLH |high supply rail minus high output swing |V | |1.5 | + /// | 3 |DAB |Differential Amp Bias - total quiescent current|A | |0.001 | + /// + /// + /// Type = 0: Impedance changer + /// 1; Idealized opamp + /// 2; opamp with first pole + /// 3: opamp with first pole + output limit + /// 4: opamp with input stage, first pole + output limit + /// + /// Type 1 parameters: + /// FPF = frequency of first pole in Hz (ony used for open-loop gain) + /// UGF = unity gain frequency in Hz (only used for open-loop gain) + /// RI = input resistance in Ohms + /// RO = output resistance in Ohms + /// + /// Type 3 parameters: + /// VLH = high supply rail minus high output swing in V + /// VLL = low output swing minus low supply rail in V + /// FPF = frequency of first pole in Hz + /// UGF = unity gain frequency (transition frequency) in Hz + /// SLEW = unity gain slew rate in V/s + /// RI = input resistance in Ohms + /// RO = output resistance in Ohms + /// DAB = Differential Amp Bias ~ op amp's total quiescent current. + /// + /// .model abc OPAMP(VLH=2.0 VLL=0.2 FPF=5 UGF=10k SLEW=0.6u RI=1000k RO=50 DAB=0.002) + /// + /// http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + /// + /// + class opamp_model_t { public: - opamp_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_TYPE(*this, "TYPE") - , m_FPF(*this, "FPF") - , m_SLEW(*this, "SLEW") - , m_RI(*this, "RI") - , m_RO(*this, "RO") - , m_UGF(*this, "UGF") - , m_VLL(*this, "VLL") - , m_VLH(*this, "VLH") - , m_DAB(*this, "DAB") + opamp_model_t(param_model_t &model) + : m_TYPE(model, "TYPE") + , m_FPF(model, "FPF") + , m_SLEW(model, "SLEW") + , m_RI(model, "RI") + , m_RO(model, "RO") + , m_UGF(model, "UGF") + , m_VLL(model, "VLL") + , m_VLH(model, "VLH") + , m_DAB(model, "DAB") {} - value_t m_TYPE; //!< Model Type, 1 and 3 are supported - value_t m_FPF; //!< frequency of first pole - value_t m_SLEW; //!< unity gain slew rate - value_t m_RI; //!< input resistance - value_t m_RO; //!< output resistance - value_t m_UGF; //!< unity gain frequency (transition frequency) - value_t m_VLL; //!< low output swing minus low supply rail - value_t m_VLH; //!< high supply rail minus high output swing - value_t m_DAB; //!< Differential Amp Bias - total quiescent current + param_model_t::value_t m_TYPE; //!< Model Type, 1 and 3 are supported + param_model_t::value_t m_FPF; //!< frequency of first pole + param_model_t::value_t m_SLEW; //!< unity gain slew rate + param_model_t::value_t m_RI; //!< input resistance + param_model_t::value_t m_RO; //!< output resistance + param_model_t::value_t m_UGF; //!< unity gain frequency (transition frequency) + param_model_t::value_t m_VLL; //!< low output swing minus low supply rail + param_model_t::value_t m_VLH; //!< high supply rail minus high output swing + param_model_t::value_t m_DAB; //!< Differential Amp Bias - total quiescent current }; - NETLIB_OBJECT(opamp) + class nld_opamp : public base_device_t { - NETLIB_CONSTRUCTOR(opamp) + public: + nld_opamp(constructor_param_t data) + : base_device_t(data) , m_RP(*this, "RP1") , m_G1(*this, "G1") - , m_VCC(*this, "VCC") - , m_GND(*this, "GND") + , m_VCC(*this, "VCC", NETLIB_DELEGATE(supply)) + , m_GND(*this, "GND", NETLIB_DELEGATE(supply)) , m_model(*this, "MODEL", "LM324") + , m_modacc(m_model) , m_VH(*this, "VH") , m_VL(*this, "VL") , m_VREF(*this, "VREF") + , m_type(plib::narrow_cast<int>(m_modacc.m_TYPE)) { - m_type = static_cast<int>(m_model.m_TYPE); if (m_type < 1 || m_type > 3) + { log().fatal(MF_OPAMP_UNKNOWN_TYPE(m_type)); + throw nl_exception(MF_OPAMP_UNKNOWN_TYPE(m_type)); + } if (m_type == 1) { - register_subalias("PLUS", "G1.IP"); - register_subalias("MINUS", "G1.IN"); - register_subalias("OUT", "G1.OP"); + register_sub_alias("PLUS", "G1.IP"); + register_sub_alias("MINUS", "G1.IN"); + register_sub_alias("OUT", "G1.OP"); connect("G1.ON", "VREF"); connect("RP1.2", "VREF"); @@ -131,11 +136,13 @@ namespace netlist } if (m_type == 2 || m_type == 3) { - create_and_register_subdevice("CP1", m_CP); - create_and_register_subdevice("EBUF", m_EBUF); - - register_subalias("PLUS", "G1.IP"); - register_subalias("MINUS", "G1.IN"); + create_and_register_sub_device(*this, "CP1", m_CP); + create_and_register_sub_device(*this, "EBUF", m_EBUF); +#if TEST_ALT_OUTPUT + create_and_register_sub_device("RO", m_RO); +#endif + register_sub_alias("PLUS", "G1.IP"); + register_sub_alias("MINUS", "G1.IN"); connect("G1.ON", "VREF"); connect("RP1.2", "VREF"); @@ -150,97 +157,120 @@ namespace netlist } if (m_type == 2) { - register_subalias("OUT", "EBUF.OP"); +#if TEST_ALT_OUTPUT + connect("EBUF.OP", "RO.1"); + register_sub_alias("OUT", "RO.2"); +#else + register_sub_alias("OUT", "EBUF.OP"); +#endif } if (m_type == 3) { - create_and_register_subdevice("DN", m_DN, "D(IS=1e-15 N=1)"); - create_and_register_subdevice("DP", m_DP, "D(IS=1e-15 N=1)"); + create_and_register_sub_device(*this, "DN", m_DN, "D(IS=1e-15 N=1)"); + create_and_register_sub_device(*this, "DP", m_DP, "D(IS=1e-15 N=1)"); connect("DP.K", "VH"); connect("VL", "DN.A"); connect("DP.A", "DN.K"); connect("DN.K", "RP1.1"); - - register_subalias("OUT", "EBUF.OP"); +#if TEST_ALT_OUTPUT + connect("EBUF.OP", "RO.1"); + register_sub_alias("OUT", "RO.2"); +#else + register_sub_alias("OUT", "EBUF.OP"); +#endif } } - NETLIB_UPDATEI(); + NETLIB_HANDLERI(supply) + { + const nl_fptype cVt = nlconst::np_VT(nlconst::one()); // * m_n; + const nl_fptype cId = m_modacc.m_DAB; // 3 mA + const nl_fptype cVd = cVt * plib::log(cId / nlconst::np_Is() + nlconst::one()); + + m_VH.push(m_VCC() - m_modacc.m_VLH - cVd); + m_VL.push(m_GND() + m_modacc.m_VLL + cVd); + m_VREF.push((m_VCC() + m_GND()) / nlconst::two()); + } + NETLIB_RESETI() { } + NETLIB_UPDATE_PARAMI(); private: - analog::NETLIB_SUB(R_base) m_RP; - analog::NETLIB_SUB(VCCS) m_G1; - NETLIB_SUBXX(analog, C) m_CP; - NETLIB_SUBXX(analog, VCVS) m_EBUF; - NETLIB_SUBXX(analog, D) m_DP; - NETLIB_SUBXX(analog, D) m_DN; + NETLIB_SUB_NS(analog, R_base) m_RP; + NETLIB_SUB_NS(analog, VCCS) m_G1; + NETLIB_SUB_UPTR(analog, C) m_CP; +#if TEST_ALT_OUTPUT + NETLIB_SUB_UPTR(analog, R_base) m_RO; +#endif + NETLIB_SUB_UPTR(analog, VCVS) m_EBUF; + NETLIB_SUB_UPTR(analog, D) m_DP; + NETLIB_SUB_UPTR(analog, D) m_DN; analog_input_t m_VCC; analog_input_t m_GND; - opamp_model_t m_model; + param_model_t m_model; + opamp_model_t m_modacc; analog_output_t m_VH; analog_output_t m_VL; analog_output_t m_VREF; - /* state */ + // state int m_type; }; - NETLIB_UPDATE(opamp) - { - const double cVt = 0.0258 * 1.0; // * m_n; - const double cId = m_model.m_DAB; // 3 mA - const double cVd = cVt * std::log(cId / 1e-15 + 1.0); - - m_VH.push(m_VCC() - m_model.m_VLH - cVd); - m_VL.push(m_GND() + m_model.m_VLL + cVd); - m_VREF.push((m_VCC() + m_GND()) / 2.0); - } - NETLIB_UPDATE_PARAM(opamp) { - m_G1.m_RI.setTo(m_model.m_RI); + m_G1().m_RI.set(m_modacc.m_RI); if (m_type == 1) { - double RO = m_model.m_RO; - double G = m_model.m_UGF / m_model.m_FPF / RO; - m_RP.set_R(RO); - m_G1.m_G.setTo(G); + nl_fptype RO = m_modacc.m_RO; + nl_fptype G = m_modacc.m_UGF / m_modacc.m_FPF / RO; + m_RP().set_R(RO); + m_G1().m_G.set(G); } if (m_type == 3 || m_type == 2) { - double CP = m_model.m_DAB / m_model.m_SLEW; - double RP = 0.5 / constants::pi() / CP / m_model.m_FPF; - double G = m_model.m_UGF / m_model.m_FPF / RP; + nl_fptype CP = m_modacc.m_DAB / m_modacc.m_SLEW; + nl_fptype RP = nlconst::half() / nlconst::pi() / CP / m_modacc.m_FPF; + nl_fptype G = m_modacc.m_UGF / m_modacc.m_FPF / RP; //printf("OPAMP %s: %g %g %g\n", name().c_str(), CP, RP, G); - if (m_model.m_SLEW / (4.0 * constants::pi() * 0.0258) < m_model.m_UGF) + if (m_modacc.m_SLEW / (nlconst::four() * nlconst::pi() * nlconst::np_VT()) < m_modacc.m_UGF) log().warning(MW_OPAMP_FAIL_CONVERGENCE(this->name())); - m_CP->m_C.setTo(CP); - m_RP.set_R(RP); - m_G1.m_G.setTo(G); + m_CP->set_cap_embedded(CP); + m_RP().set_R(RP); + m_G1().m_G.set(G); } if (m_type == 2) { - m_EBUF->m_G.setTo(1.0); - m_EBUF->m_RO.setTo(m_model.m_RO); + m_EBUF->m_G.set(nlconst::one()); +#if TEST_ALT_OUTPUT + m_EBUF->m_RO.set(0.001); + m_RO->set_R(m_modacc.m_RO); +#else + m_EBUF->m_RO.set(m_modacc.m_RO); +#endif } if (m_type == 3) { - m_EBUF->m_G.setTo(1.0); - m_EBUF->m_RO.setTo(m_model.m_RO); + m_EBUF->m_G.set(nlconst::one()); +#if TEST_ALT_OUTPUT + m_EBUF->m_RO.set(0.001); + m_RO->set_R(m_modacc.m_RO); +#else + m_EBUF->m_RO.set(m_modacc.m_RO); +#endif } } diff --git a/src/lib/netlist/analog/nld_opamps.h b/src/lib/netlist/analog/nld_opamps.h deleted file mode 100644 index 4a07f646587..00000000000 --- a/src/lib/netlist/analog/nld_opamps.h +++ /dev/null @@ -1,24 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_opamps.h - * - */ - -//#pragma once - -#ifndef NLD_OPAMPS_H_ -#define NLD_OPAMPS_H_ - -#include "netlist/nl_setup.h" - -// ---------------------------------------------------------------------------------------- -// Macros -// ---------------------------------------------------------------------------------------- - -#define OPAMP(name, model) \ - NET_REGISTER_DEV(OPAMP, name) \ - NETDEV_PARAMI(name, MODEL, model) - - -#endif /* NLD_OPAMPS_H_ */ diff --git a/src/lib/netlist/analog/nld_switches.cpp b/src/lib/netlist/analog/nld_switches.cpp index 0e62fe13952..6b87279e398 100644 --- a/src/lib/netlist/analog/nld_switches.cpp +++ b/src/lib/netlist/analog/nld_switches.cpp @@ -1,19 +1,15 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_legacy.c - * - */ #include "nlid_twoterm.h" -#include "netlist/nl_base.h" -#include "netlist/nl_factory.h" -#include "netlist/solver/nld_solver.h" +#include "nl_base.h" +#include "nl_factory.h" +#include "solver/nld_solver.h" -/* FIXME : convert to parameters */ +// FIXME : convert to parameters -#define R_OFF (1.0 / exec().gmin()) -#define R_ON 0.01 +#define R_OFF (plib::reciprocal(exec().gmin())) +#define R_ON nlconst::magic(0.01) namespace netlist { @@ -23,83 +19,72 @@ namespace netlist // SWITCH // ---------------------------------------------------------------------------------------- - NETLIB_OBJECT(switch1) + class nld_switch1 : public base_device_t { - NETLIB_CONSTRUCTOR(switch1) + public: + nld_switch1(constructor_param_t data) + : base_device_t(data) , m_R(*this, "R") , m_POS(*this, "POS", false) { - register_subalias("1", m_R.m_P); - register_subalias("2", m_R.m_N); + register_sub_alias("1", m_R().P()); + register_sub_alias("2", m_R().N()); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_UPDATE_PARAMI(); - - analog::NETLIB_SUB(R_base) m_R; - param_logic_t m_POS; - }; - - - NETLIB_RESET(switch1) - { - m_R.set_R(R_OFF); - } - - NETLIB_UPDATE(switch1) - { - } - - NETLIB_UPDATE_PARAM(switch1) - { - m_R.solve_now(); - if (!m_POS()) + NETLIB_RESETI() { - m_R.set_R(R_OFF); + m_R().set_R(R_OFF); } - else + NETLIB_UPDATE_PARAMI() { - m_R.set_R(R_ON); + m_R().change_state([this]() + { + m_R().set_R(m_POS() ? R_ON : R_OFF); + }); } - m_R.solve_later(); - } + private: + NETLIB_SUB_NS(analog, R_base) m_R; + param_logic_t m_POS; + }; // ---------------------------------------------------------------------------------------- // SWITCH2 // ---------------------------------------------------------------------------------------- - NETLIB_OBJECT(switch2) + class nld_switch2 : public base_device_t { - NETLIB_CONSTRUCTOR(switch2) + public: + nld_switch2(constructor_param_t data) + : base_device_t(data) , m_R1(*this, "R1") , m_R2(*this, "R2") , m_POS(*this, "POS", false) { - connect(m_R1.m_N, m_R2.m_N); + connect(m_R1().N(), m_R2().N()); - register_subalias("1", m_R1.m_P); - register_subalias("2", m_R2.m_P); + register_sub_alias("1", m_R1().P()); + register_sub_alias("2", m_R2().P()); - register_subalias("Q", m_R1.m_N); + register_sub_alias("Q", m_R1().N()); } NETLIB_RESETI(); - NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI(); - analog::NETLIB_SUB(R_base) m_R1; - analog::NETLIB_SUB(R_base) m_R2; - param_logic_t m_POS; + private: + NETLIB_SUB_NS(analog, R_base) m_R1; + NETLIB_SUB_NS(analog, R_base) m_R2; + param_logic_t m_POS; }; NETLIB_RESET(switch2) { - m_R1.set_R(R_ON); - m_R2.set_R(R_OFF); + m_R1().set_R(R_ON); + m_R2().set_R(R_OFF); } +#ifdef FIXMELATER NETLIB_UPDATE(switch2) { if (!m_POS()) @@ -112,26 +97,23 @@ namespace netlist m_R1.set_R(R_OFF); m_R2.set_R(R_ON); } - - //m_R1.update_dev(time); - //m_R2.update_dev(time); } - +#endif NETLIB_UPDATE_PARAM(switch2) { - if (!m_POS()) - { - m_R1.set_R(R_ON); - m_R2.set_R(R_OFF); - } + // R1 and R2 are connected. However this net may be a rail net. + // The code here thus is a bit more complex. + + nl_fptype r1 = m_POS() ? R_OFF : R_ON; + nl_fptype r2 = m_POS() ? R_ON : R_OFF; + + if (m_R1().solver() == m_R2().solver()) + m_R1().change_state([this, &r1, &r2]() { m_R1().set_R(r1); m_R2().set_R(r2); }); else { - m_R1.set_R(R_OFF); - m_R2.set_R(R_ON); + m_R1().change_state([this, &r1]() { m_R1().set_R(r1); }); + m_R2().change_state([this, &r2]() { m_R2().set_R(r2); }); } - - m_R1.solve_now(); - m_R2.solve_now(); } } //namespace analog diff --git a/src/lib/netlist/analog/nld_switches.h b/src/lib/netlist/analog/nld_switches.h deleted file mode 100644 index 7aa31c925ae..00000000000 --- a/src/lib/netlist/analog/nld_switches.h +++ /dev/null @@ -1,25 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_switches.h - * - */ - -#pragma once - -#ifndef NLD_SWITCHES_H_ -#define NLD_SWITCHES_H_ - -#include "netlist/nl_setup.h" - -// ---------------------------------------------------------------------------------------- -// Macros -// ---------------------------------------------------------------------------------------- - -#define SWITCH(name) \ - NET_REGISTER_DEV(SWITCH, name) - -#define SWITCH2(name) \ - NET_REGISTER_DEV(SWITCH2, name) - -#endif /* NLD_SWITCHES_H_ */ diff --git a/src/lib/netlist/analog/nld_twoterm.h b/src/lib/netlist/analog/nld_twoterm.h deleted file mode 100644 index b175f40af97..00000000000 --- a/src/lib/netlist/analog/nld_twoterm.h +++ /dev/null @@ -1,67 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud - -#ifndef NLD_TWOTERM_H_ -#define NLD_TWOTERM_H_ - -#include "netlist/nl_setup.h" - -// ----------------------------------------------------------------------------- -// Macros -// ----------------------------------------------------------------------------- - -#define RES(name, p_R) \ - NET_REGISTER_DEV(RES, name) \ - NETDEV_PARAMI(name, R, p_R) - -#define POT(name, p_R) \ - NET_REGISTER_DEV(POT, name) \ - NETDEV_PARAMI(name, R, p_R) - -/* Does not have pin 3 connected */ -#define POT2(name, p_R) \ - NET_REGISTER_DEV(POT2, name) \ - NETDEV_PARAMI(name, R, p_R) - - -#define CAP(name, p_C) \ - NET_REGISTER_DEV(CAP, name) \ - NETDEV_PARAMI(name, C, p_C) - -#define IND(name, p_L) \ - NET_REGISTER_DEV(IND, name) \ - NETDEV_PARAMI(name, L, p_L) - -/* Generic Diode */ -#define DIODE(name, model) \ - NET_REGISTER_DEV(DIODE, name) \ - NETDEV_PARAMI(name, MODEL, model) - -#define VS(name, pV) \ - NET_REGISTER_DEV(VS, name) \ - NETDEV_PARAMI(name, V, pV) - -#define CS(name, pI) \ - NET_REGISTER_DEV(CS, name) \ - NETDEV_PARAMI(name, I, pI) - -// ----------------------------------------------------------------------------- -// Generic macros -// ----------------------------------------------------------------------------- - -#ifdef RES_R -#warning "Do not include rescap.h in a netlist environment" -#endif -#ifndef RES_R -#define RES_R(res) (static_cast<double>(res)) -#define RES_K(res) (static_cast<double>(res) * 1e3) -#define RES_M(res) (static_cast<double>(res) * 1e6) -#define CAP_U(cap) (static_cast<double>(cap) * 1e-6) -#define CAP_N(cap) (static_cast<double>(cap) * 1e-9) -#define CAP_P(cap) (static_cast<double>(cap) * 1e-12) -#define IND_U(ind) (static_cast<double>(ind) * 1e-6) -#define IND_N(ind) (static_cast<double>(ind) * 1e-9) -#define IND_P(ind) (static_cast<double>(ind) * 1e-12) -#endif - -#endif /* NLD_TWOTERM_H_ */ diff --git a/src/lib/netlist/analog/nlid_fourterm.cpp b/src/lib/netlist/analog/nlid_fourterm.cpp index 7fa6a2f3809..e12a931c142 100644 --- a/src/lib/netlist/analog/nlid_fourterm.cpp +++ b/src/lib/netlist/analog/nlid_fourterm.cpp @@ -1,124 +1,129 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_fourterm.c - * - */ -#include "netlist/solver/nld_solver.h" -#include "netlist/nl_factory.h" #include "nlid_fourterm.h" -#include <cmath> +#include "nl_factory.h" -namespace netlist +#include "solver/nld_solver.h" + +namespace netlist::analog { - namespace analog + + // ------------------------------------------------------------------------- + // nld_VCCS + // ------------------------------------------------------------------------- + + NETLIB_RESET(VCCS) { + const nl_fptype m_mult = m_G() * m_gfac; // 1.0 ==> 1V ==> 1A + const nl_fptype GI = plib::reciprocal(m_RI()); + m_IP.set_conductivity(GI); + m_IN.set_conductivity(GI); -// ---------------------------------------------------------------------------------------- -// nld_VCCS -// ---------------------------------------------------------------------------------------- + m_OP.set_go_gt(-m_mult, nlconst::zero()); + m_OP1.set_go_gt(m_mult, nlconst::zero()); -NETLIB_RESET(VCCS) -{ - const nl_double m_mult = m_G() * m_gfac; // 1.0 ==> 1V ==> 1A - const nl_double GI = plib::constants<nl_double>::one() / m_RI(); + m_ON.set_go_gt(m_mult, nlconst::zero()); + m_ON1.set_go_gt(-m_mult, nlconst::zero()); + } - m_IP.set_conductivity(GI); - m_IN.set_conductivity(GI); + NETLIB_HANDLER(VCCS, terminal_handler) + { + solver::matrix_solver_t *solv = nullptr; + // only called if connected to a rail net ==> notify the solver to + // recalculate + // NOLINTNEXTLINE(bugprone-branch-clone) + if ((solv = m_IP.solver()) != nullptr) + solv->solve_now(); + else if ((solv = m_IN.solver()) != nullptr) + solv->solve_now(); + else if ((solv = m_OP.solver()) != nullptr) + solv->solve_now(); + else if ((solv = m_ON.solver()) != nullptr) + solv->solve_now(); + } + + // ------------------------------------------------------------------------- + // nld_LVCCS + // ------------------------------------------------------------------------- + + NETLIB_RESET(LVCCS) { NETLIB_NAME(VCCS)::reset(); } + + NETLIB_UPDATE_PARAM(LVCCS) { NETLIB_NAME(VCCS)::update_param(); } + + NETLIB_UPDATE_TERMINALS(LVCCS) + { + const nl_fptype m_mult = m_G() * get_gfac(); // 1.0 ==> 1V ==> 1A + const nl_fptype vi = m_IP.net().Q_Analog() - m_IN.net().Q_Analog(); + const auto c1(nlconst::magic(0.2)); - m_OP.set_go_gt(-m_mult, plib::constants<nl_double>::zero()); - m_OP1.set_go_gt(m_mult, plib::constants<nl_double>::zero()); + if (plib::abs(m_mult / m_cur_limit() * vi) > nlconst::half()) + m_vi = m_vi + c1 * plib::tanh((vi - m_vi) / c1); + else + m_vi = vi; - m_ON.set_go_gt(m_mult, plib::constants<nl_double>::zero()); - m_ON1.set_go_gt(-m_mult, plib::constants<nl_double>::zero()); -} + const nl_fptype x = m_mult / m_cur_limit() * m_vi; + const nl_fptype tanhx = plib::tanh(x); -NETLIB_UPDATE(VCCS) -{ - /* only called if connected to a rail net ==> notify the solver to recalculate */ - if (!m_IP.net().isRailNet()) - m_IP.solve_now(); - else if (!m_IN.net().isRailNet()) - m_IN.solve_now(); - else if (!m_OP.net().isRailNet()) - m_OP.solve_now(); - else if (!m_ON.net().isRailNet()) - m_ON.solve_now(); -} - -// ---------------------------------------------------------------------------------------- -// nld_LVCCS -// ---------------------------------------------------------------------------------------- - -NETLIB_RESET(LVCCS) -{ - NETLIB_NAME(VCCS)::reset(); -} + const nl_fptype beta = m_mult * (nlconst::one() - tanhx * tanhx); + const nl_fptype I = m_cur_limit() * tanhx - beta * m_vi; -NETLIB_UPDATE_PARAM(LVCCS) -{ - NETLIB_NAME(VCCS)::update_param(); -} + m_OP.set_go_gt_I(-beta, nlconst::zero(), I); + m_OP1.set_go_gt(beta, nlconst::zero()); -NETLIB_UPDATE_TERMINALS(LVCCS) -{ - const nl_double m_mult = m_G() * m_gfac; // 1.0 ==> 1V ==> 1A - const nl_double vi = m_IP.net().Q_Analog() - m_IN.net().Q_Analog(); + m_ON.set_go_gt_I(beta, nlconst::zero(), -I); + m_ON1.set_go_gt(-beta, nlconst::zero()); + } - if (std::abs(m_mult / m_cur_limit() * vi) > 0.5) - m_vi = m_vi + 0.2*std::tanh((vi - m_vi)/0.2); - else - m_vi = vi; + // ------------------------------------------------------------------------- + // nld_CCCS + // ------------------------------------------------------------------------- - const nl_double x = m_mult / m_cur_limit() * m_vi; - const nl_double X = std::tanh(x); + NETLIB_RESET(CCCS) { NETLIB_NAME(VCCS)::reset(); } - const nl_double beta = m_mult * (1.0 - X*X); - const nl_double I = m_cur_limit() * X - beta * m_vi; + NETLIB_UPDATE_PARAM(CCCS) { NETLIB_NAME(VCCS)::update_param(); } - m_OP.set_go_gt_I(-beta, plib::constants<nl_double>::zero(), I); - m_OP1.set_go_gt(beta, plib::constants<nl_double>::zero()); + // ------------------------------------------------------------------------- + // nld_VCVS + // ------------------------------------------------------------------------- - m_ON.set_go_gt_I(beta, plib::constants<nl_double>::zero(), -I); - m_ON1.set_go_gt(-beta, plib::constants<nl_double>::zero()); -} + NETLIB_RESET(VCVS) + { + const auto gfac(plib::reciprocal(m_RO())); + set_gfac(gfac); -// ---------------------------------------------------------------------------------------- -// nld_CCCS -// ---------------------------------------------------------------------------------------- + NETLIB_NAME(VCCS)::reset(); -NETLIB_RESET(CCCS) -{ - NETLIB_NAME(VCCS)::reset(); -} + m_OP2.set_conductivity(gfac); + m_ON2.set_conductivity(gfac); + } -NETLIB_UPDATE_PARAM(CCCS) -{ - NETLIB_NAME(VCCS)::update_param(); -} + // ------------------------------------------------------------------------- + // nld_CCVS + // ------------------------------------------------------------------------- + + NETLIB_RESET(CCVS) + { + const auto gfac(plib::reciprocal(m_RO())); + set_gfac(gfac); + + NETLIB_NAME(VCCS)::reset(); + + m_OP2.set_conductivity(gfac); + m_ON2.set_conductivity(gfac); + } -// ---------------------------------------------------------------------------------------- -// nld_VCVS -// ---------------------------------------------------------------------------------------- +} // namespace netlist::analog -NETLIB_RESET(VCVS) +namespace netlist::devices { - m_gfac = plib::constants<nl_double>::one() / m_RO(); - NETLIB_NAME(VCCS)::reset(); - - m_OP2.set_conductivity(plib::constants<nl_double>::one() / m_RO()); - m_ON2.set_conductivity(plib::constants<nl_double>::one() / m_RO()); -} - - } //namespace analog - - namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, VCVS, "VCVS", "") - NETLIB_DEVICE_IMPL_NS(analog, VCCS, "VCCS", "") - NETLIB_DEVICE_IMPL_NS(analog, CCCS, "CCCS", "") - NETLIB_DEVICE_IMPL_NS(analog, LVCCS, "LVCCS", "") - } // namespace devices -} // namespace netlist + // clang-format off + NETLIB_DEVICE_IMPL_NS(analog, VCVS, "VCVS", "G") + NETLIB_DEVICE_IMPL_NS(analog, VCCS, "VCCS", "G") + NETLIB_DEVICE_IMPL_NS(analog, CCCS, "CCCS", "G") + NETLIB_DEVICE_IMPL_NS(analog, CCVS, "CCVS", "G") + NETLIB_DEVICE_IMPL_NS(analog, LVCCS, "LVCCS", "") + // clang-format on +} // namespace netlist::devices diff --git a/src/lib/netlist/analog/nlid_fourterm.h b/src/lib/netlist/analog/nlid_fourterm.h index 5ca6a747116..1320f97984b 100644 --- a/src/lib/netlist/analog/nlid_fourterm.h +++ b/src/lib/netlist/analog/nlid_fourterm.h @@ -1,71 +1,74 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nlid_fourterm.h - * - */ #ifndef NLID_FOURTERM_H_ #define NLID_FOURTERM_H_ -#include "netlist/nl_base.h" +/// +/// \file nlid_fourterm.h +/// + +#include "nl_base.h" + #include "plib/putil.h" -namespace netlist { - namespace analog { +namespace netlist::analog +{ // ---------------------------------------------------------------------------------------- // nld_VCCS // ---------------------------------------------------------------------------------------- - /* - * Voltage controlled current source - * - * IP ---+ +------> OP - * | | - * RI I - * RI => G => I IOut = (V(IP)-V(IN)) * G - * RI I - * | | - * IN ---+ +------< ON - * - * G=1 ==> 1V ==> 1A - * - * RI = 1 / NETLIST_GMIN - * - */ - - NETLIB_OBJECT(VCCS) + // + // Voltage controlled current source + // + // IP ---+ +------> OP + // | | + // RI I + // RI => G => I IOut = (V(IP)-V(IN)) * G + // RI I + // | | + // IN ---+ +------< ON + // + // G=1 ==> 1V ==> 1A + // + // RI = 1 / NETLIST_GMIN + // + class nld_VCCS : public base_device_t { public: - NETLIB_CONSTRUCTOR(VCCS) - , m_G(*this, "G", 1.0) - , m_RI(*this, "RI", 1e9) - , 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) + nld_VCCS(constructor_param_t data, nl_fptype ri = nlconst::magic(1e9)) + : base_device_t(data) + , m_G(*this, "G", nlconst::one()) + , m_RI(*this, "RI", ri) + , m_OP(*this, "OP", &m_IP, {&m_ON, &m_IN}, + NETLIB_DELEGATE(terminal_handler)) + , m_ON(*this, "ON", &m_IP, {&m_OP, &m_IN}, + NETLIB_DELEGATE(terminal_handler)) + , m_IP(*this, "IP", &m_IN, {&m_OP, &m_ON}, + NETLIB_DELEGATE(terminal_handler)) + , m_IN(*this, "IN", &m_IP, {&m_OP, &m_ON}, + NETLIB_DELEGATE(terminal_handler)) + , m_OP1(*this, "_OP1", &m_IN, NETLIB_DELEGATE(terminal_handler)) + , m_ON1(*this, "_ON1", &m_IN, NETLIB_DELEGATE(terminal_handler)) + , m_gfac(nlconst::one()) { connect(m_OP, m_OP1); connect(m_ON, m_ON1); - m_gfac = plib::constants<nl_double>::one(); } NETLIB_RESETI(); - param_double_t m_G; - param_double_t m_RI; + param_fp_t m_G; + param_fp_t m_RI; protected: - NETLIB_UPDATEI(); - NETLIB_UPDATE_PARAMI() - { - NETLIB_NAME(VCCS)::reset(); - } + NETLIB_HANDLERI(terminal_handler); + NETLIB_UPDATE_PARAMI() { NETLIB_NAME(VCCS)::reset(); } + void set_gfac(nl_fptype g) noexcept { m_gfac = g; } + + nl_fptype get_gfac() const noexcept { return m_gfac; } terminal_t m_OP; terminal_t m_ON; @@ -76,107 +79,107 @@ namespace netlist { terminal_t m_OP1; terminal_t m_ON1; - nl_double m_gfac; + private: + nl_fptype m_gfac; }; - /* Limited Current source*/ + // Limited Current source - NETLIB_OBJECT_DERIVED(LVCCS, VCCS) + class nld_LVCCS : public nld_VCCS { public: - NETLIB_CONSTRUCTOR_DERIVED(LVCCS, VCCS) - , m_cur_limit(*this, "CURLIM", 1000.0) - , m_vi(0.0) + nld_LVCCS(constructor_param_t data) + : nld_VCCS(data) + , m_cur_limit(*this, "CURLIM", nlconst::magic(1000.0)) + , m_vi(nlconst::zero()) { } NETLIB_IS_DYNAMIC(true) protected: - //NETLIB_UPDATEI(); NETLIB_RESETI(); NETLIB_UPDATE_PARAMI(); NETLIB_UPDATE_TERMINALSI(); private: - param_double_t m_cur_limit; /* current limit */ - nl_double m_vi; + param_fp_t m_cur_limit; // current limit + nl_fptype m_vi; }; // ---------------------------------------------------------------------------------------- // nld_CCCS // ---------------------------------------------------------------------------------------- - /* - * Current controlled current source - * - * IP ---+ +------> OP - * | | - * RI I - * RI => G => I IOut = (V(IP)-V(IN)) / RI * G - * RI I - * | | - * IN ---+ +------< ON - * - * G=1 ==> 1A ==> 1A - * - * RI = 1 - * - * This needs high levels of accuracy to work with 1 Ohm RI. - * - */ - - NETLIB_OBJECT_DERIVED(CCCS, VCCS) + // + // Current controlled current source + // + // IP ---+ +------> OP + // | | + // RI I + // RI => G => I IOut = -(V(IP)-V(IN)) / RI * G + // RI I + // | | + // IN ---+ +------< ON + // + // G=1 ==> 1A ==> 1A + // + // RI = 1 + // + // If current flows from IP to IN than output current flows from OP to ON + // + // This needs high levels of accuracy to work with 1 Ohm RI. + // + + class nld_CCCS : public nld_VCCS { public: - NETLIB_CONSTRUCTOR_DERIVED(CCCS, VCCS) + nld_CCCS(constructor_param_t data) + : nld_VCCS(data, nlconst::one()) { - m_gfac = plib::constants<nl_double>::one() / m_RI(); + set_gfac(-plib::reciprocal(m_RI())); } NETLIB_RESETI(); protected: - //NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI(); }; - // ---------------------------------------------------------------------------------------- // nld_VCVS // ---------------------------------------------------------------------------------------- - /* - * Voltage controlled voltage source - * - * Parameters: - * G Default: 1 - * RO Default: 1 (would be typically 50 for an op-amp - * - * IP ---+ +--+---- OP - * | | | - * RI I RO - * RI => G => I RO V(OP) - V(ON) = (V(IP)-V(IN)) * G - * RI I RO - * | | | - * IN ---+ +--+---- ON - * - * G=1 ==> 1V ==> 1V - * - * RI = 1 / NETLIST_GMIN - * - * Internal GI = G / RO - * - */ - - - NETLIB_OBJECT_DERIVED(VCVS, VCCS) + // + // Voltage controlled voltage source + // + // Parameters: + // G Default: 1 + // RO Default: 1 (would be typically 50 for an op-amp + // + // IP ---+ +--+---- OP + // | | | + // RI I RO + // RI => G => I RO V(OP) - V(ON) = (V(IP)-V(IN)) * G + // RI I RO + // | | | + // IN ---+ +--+---- ON + // + // G=1 ==> 1V ==> 1V + // + // RI = 1 / NETLIST_GMIN + // + // Internal GI = G / RO + // + + class nld_VCVS : public nld_VCCS { public: - NETLIB_CONSTRUCTOR_DERIVED(VCVS, VCCS) - , m_RO(*this, "RO", 1.0) - , m_OP2(*this, "_OP2", &m_ON2) - , m_ON2(*this, "_ON2", &m_OP2) + nld_VCVS(constructor_param_t data) + : nld_VCCS(data) + , m_RO(*this, "RO", nlconst::one()) + , m_OP2(*this, "_OP2", &m_ON2, NETLIB_DELEGATE(terminal_handler)) + , m_ON2(*this, "_ON2", &m_OP2, NETLIB_DELEGATE(terminal_handler)) { connect(m_OP2, m_OP1); connect(m_ON2, m_ON1); @@ -184,19 +187,74 @@ namespace netlist { NETLIB_RESETI(); - param_double_t m_RO; + param_fp_t m_RO; private: - //NETLIB_UPDATEI(); - //NETLIB_UPDATE_PARAMI(); + // NETLIB_UPDATE_PARAMI(); + NETLIB_HANDLERI(terminal_handler) + { + NETLIB_NAME(VCCS)::terminal_handler(); + } terminal_t m_OP2; terminal_t m_ON2; + }; + // ---------------------------------------------------------------------------------------- + // nld_CCVS + // ---------------------------------------------------------------------------------------- + // + // Voltage controlled voltage source + // + // Parameters: + // G Default: 1 + // RO Default: 1 (would be typically 50 for an op-amp + // + // IP ---+ +--+---- OP + // | | | + // RI I RO + // RI => G => I RO V(OP) - V(ON) = (V(IP)-V(IN)) / RI * G + // RI I RO + // | | | + // IN ---+ +--+---- ON + // + // G=1 ==> 1A ==> 1V + // + // RI = 1 + // + // Internal GI = G / RO + // + + class nld_CCVS : public nld_VCCS + { + public: + nld_CCVS(constructor_param_t data) + : nld_VCCS(data, nlconst::one()) + , m_RO(*this, "RO", nlconst::one()) + , m_OP2(*this, "_OP2", &m_ON2, NETLIB_DELEGATE(terminal_handler)) + , m_ON2(*this, "_ON2", &m_OP2, NETLIB_DELEGATE(terminal_handler)) + { + connect(m_OP2, m_OP1); + connect(m_ON2, m_ON1); + } + + NETLIB_RESETI(); + + param_fp_t m_RO; + + private: + // NETLIB_UPDATE_PARAMI(); + + NETLIB_HANDLERI(terminal_handler) + { + NETLIB_NAME(VCCS)::terminal_handler(); + } + + terminal_t m_OP2; + terminal_t m_ON2; }; - } // namespace analog -} // namespace netlist +} // namespace netlist::analog -#endif /* NLD_FOURTERM_H_ */ +#endif // NLD_FOURTERM_H_ diff --git a/src/lib/netlist/analog/nlid_twoterm.cpp b/src/lib/netlist/analog/nlid_twoterm.cpp index aaddb65387a..1a3c79e713f 100644 --- a/src/lib/netlist/analog/nlid_twoterm.cpp +++ b/src/lib/netlist/analog/nlid_twoterm.cpp @@ -1,190 +1,231 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_twoterm.c - * - */ -#include "netlist/solver/nld_solver.h" - -#include "netlist/nl_factory.h" #include "nlid_twoterm.h" -#include <cmath> +#include "nl_factory.h" -namespace netlist -{ - namespace analog - { +#include "solver/nld_solver.h" -// ---------------------------------------------------------------------------------------- -// nld_twoterm -// ---------------------------------------------------------------------------------------- - -void NETLIB_NAME(twoterm)::solve_now() -{ - /* we only need to call the non-rail terminal */ - if (m_P.has_net() && !m_P.net().isRailNet()) - m_P.solve_now(); - else if (m_N.has_net() && !m_N.net().isRailNet()) - m_N.solve_now(); -} - -void NETLIB_NAME(twoterm)::solve_later(netlist_time delay) +namespace netlist::analog { - /* we only need to call the non-rail terminal */ - if (m_P.has_net() && !m_P.net().isRailNet()) - m_P.schedule_solve_after(delay); - else if (m_N.has_net() && !m_N.net().isRailNet()) - m_N.schedule_solve_after(delay); -} + // ------------------------------------------------------------------------- + // nld_twoterm + // ------------------------------------------------------------------------- -NETLIB_UPDATE(twoterm) -{ - /* only called if connected to a rail net ==> notify the solver to recalculate */ - solve_now(); -} - -// ---------------------------------------------------------------------------------------- -// nld_R_base -// ---------------------------------------------------------------------------------------- - -NETLIB_RESET(R_base) -{ - NETLIB_NAME(twoterm)::reset(); - set_R(1.0 / exec().gmin()); -} + solver::matrix_solver_t *nld_two_terminal::solver() const noexcept + { + auto *solv(m_P.solver()); + if (solv != nullptr) + return solv; + return m_N.solver(); + } -// ---------------------------------------------------------------------------------------- -// nld_POT -// ---------------------------------------------------------------------------------------- + void nld_two_terminal::solve_now() const + { + auto *solv(solver()); + if (solv != nullptr) + solv->solve_now(); + } -NETLIB_RESET(POT) -{ - nl_double v = m_Dial(); - if (m_DialIsLog()) - v = (std::exp(v) - 1.0) / (std::exp(1.0) - 1.0); + NETLIB_HANDLER(two_terminal, terminal_handler) + { + // only called if connected to a rail net ==> notify the solver to + // recalculate + // printf("%s update\n", this->name().c_str()); + solve_now(); + } - m_R1.set_R(std::max(m_R() * v, exec().gmin())); - m_R2.set_R(std::max(m_R() * (plib::constants<nl_double>::one() - v), exec().gmin())); -} + // ------------------------------------------------------------------------- + // nld_POT + // ------------------------------------------------------------------------- -NETLIB_UPDATE_PARAM(POT) -{ - m_R1.solve_now(); - m_R2.solve_now(); + NETLIB_RESET(POT) + { + nl_fptype v = m_Dial(); + if (m_DialIsLog()) + v = (plib::exp(v) - nlconst::one()) + / (plib::exp(nlconst::one()) - nlconst::one()); - nl_double v = m_Dial(); - if (m_DialIsLog()) - v = (std::exp(v) - 1.0) / (std::exp(1.0) - 1.0); - if (m_Reverse()) - v = 1.0 - v; - m_R1.set_R(std::max(m_R() * v, exec().gmin())); - m_R2.set_R(std::max(m_R() * (plib::constants<nl_double>::one() - v), exec().gmin())); + m_R1().set_R(std::max(m_R() * v, exec().gmin())); + m_R2().set_R(std::max(m_R() * (nlconst::one() - v), exec().gmin())); + } -} + NETLIB_UPDATE_PARAM(POT) + { + nl_fptype v = m_Dial(); + if (m_DialIsLog()) + v = (plib::exp(v) - nlconst::one()) + / (plib::exp(nlconst::one()) - nlconst::one()); + if (m_Reverse()) + v = nlconst::one() - v; + + nl_fptype r1(std::max(m_R() * v, exec().gmin())); + nl_fptype r2(std::max(m_R() * (nlconst::one() - v), exec().gmin())); + + if (m_R1().solver() == m_R2().solver()) + m_R1().change_state( + [this, &r1, &r2]() + { + m_R1().set_R(r1); + m_R2().set_R(r2); + }); + else + { + m_R1().change_state([this, &r1]() { m_R1().set_R(r1); }); + m_R2().change_state([this, &r2]() { m_R2().set_R(r2); }); + } + } + + // ------------------------------------------------------------------------- + // nld_POT2 + // ------------------------------------------------------------------------- + + NETLIB_RESET(POT2) + { + nl_fptype v = m_Dial(); -// ---------------------------------------------------------------------------------------- -// nld_POT2 -// ---------------------------------------------------------------------------------------- + if (m_DialIsLog()) + v = (plib::exp(v) - nlconst::one()) + / (plib::exp(nlconst::one()) - nlconst::one()); + if (m_Reverse()) + v = nlconst::one() - v; + m_R1().set_R(std::max(m_R() * v, exec().gmin())); + } -NETLIB_RESET(POT2) -{ - nl_double v = m_Dial(); + NETLIB_UPDATE_PARAM(POT2) + { + nl_fptype v = m_Dial(); - if (m_DialIsLog()) - v = (std::exp(v) - 1.0) / (std::exp(1.0) - 1.0); - if (m_Reverse()) - v = 1.0 - v; - m_R1.set_R(std::max(m_R() * v, exec().gmin())); -} + if (m_DialIsLog()) + v = (plib::exp(v) - nlconst::one()) + / (plib::exp(nlconst::one()) - nlconst::one()); + if (m_Reverse()) + v = nlconst::one() - v; + m_R1().change_state( + [this, &v]() { m_R1().set_R(std::max(m_R() * v, exec().gmin())); }); + } -NETLIB_UPDATE_PARAM(POT2) -{ - m_R1.solve_now(); + // ------------------------------------------------------------------------- + // nld_L + // ------------------------------------------------------------------------- - nl_double v = m_Dial(); + NETLIB_RESET(L) + { + m_gmin = exec().gmin(); + m_I = nlconst::zero(); + m_G = m_gmin; + set_mat(m_G, -m_G, -m_I, // + -m_G, m_G, m_I); + } - if (m_DialIsLog()) - v = (std::exp(v) - 1.0) / (std::exp(1.0) - 1.0); - if (m_Reverse()) - v = 1.0 - v; - m_R1.set_R(std::max(m_R() * v, exec().gmin())); -} + NETLIB_UPDATE_PARAM(L) {} -// ---------------------------------------------------------------------------------------- -// nld_L -// ---------------------------------------------------------------------------------------- + NETLIB_TIMESTEP(L) + { + if (ts_type == detail::time_step_type::FORWARD) + { + m_last_I = m_I; + m_last_G = m_G; + // Gpar should support convergence + m_I += m_G * deltaV(); + m_G = step / m_L() + m_gmin; + set_mat(m_G, -m_G, -m_I, // + -m_G, m_G, m_I); + } + else + { + m_I = m_last_I; + m_G = m_last_G; + } + } + + // ------------------------------------------------------------------------- + // nld_D + // ------------------------------------------------------------------------- + + NETLIB_RESET(D) + { + nl_fptype Is = m_modacc.m_IS; + nl_fptype n = m_modacc.m_N; -NETLIB_RESET(L) -{ - m_gmin = exec().gmin(); - m_I = 0.0; - m_G = m_gmin; - set_mat( m_G, -m_G, -m_I, - -m_G, m_G, m_I); - //set(1.0/NETLIST_GMIN, 0.0, -5.0 * NETLIST_GMIN); -} - -NETLIB_UPDATE_PARAM(L) -{ -} + m_D.set_param(Is, n, exec().gmin(), nlconst::T0()); + set_G_V_I(m_D.G(), nlconst::zero(), m_D.Ieq()); + } -NETLIB_TIMESTEP(L) -{ - /* Gpar should support convergence */ - m_I += m_I + m_G * deltaV(); - m_G = step / m_L() + m_gmin; - set_mat( m_G, -m_G, -m_I, - -m_G, m_G, m_I); - //set(m_G, 0.0, m_I); -} - -// ---------------------------------------------------------------------------------------- -// nld_D -// ---------------------------------------------------------------------------------------- - -NETLIB_RESET(D) -{ - nl_double Is = m_model.m_IS; - nl_double n = m_model.m_N; + NETLIB_UPDATE_PARAM(D) + { + nl_fptype Is = m_modacc.m_IS; + nl_fptype n = m_modacc.m_N; - m_D.set_param(Is, n, exec().gmin(), constants::T0()); - set_G_V_I(m_D.G(), 0.0, m_D.Ieq()); -} + m_D.set_param(Is, n, exec().gmin(), nlconst::T0()); + } -NETLIB_UPDATE_PARAM(D) -{ - nl_double Is = m_model.m_IS; - nl_double n = m_model.m_N; + NETLIB_UPDATE_TERMINALS(D) + { + m_D.update_diode(deltaV()); + const nl_fptype G(m_D.G()); + const nl_fptype I(m_D.Ieq()); + set_mat(G, -G, -I, // + -G, G, I); + // set(m_D.G(), 0.0, m_D.Ieq()); + } + + // ------------------------------------------------------------------------- + // nld_Z + // ------------------------------------------------------------------------- + + NETLIB_RESET(Z) + { + nl_fptype IsBV = m_modacc.m_IBV + / (plib::exp(m_modacc.m_BV + / nlconst::np_VT(m_modacc.m_NBV)) + - nlconst::one()); + + m_D.set_param(m_modacc.m_IS, m_modacc.m_N, exec().gmin(), + nlconst::T0()); + m_R.set_param(IsBV, m_modacc.m_NBV, exec().gmin(), nlconst::T0()); + set_G_V_I(m_D.G(), nlconst::zero(), m_D.Ieq()); + } + + NETLIB_UPDATE_PARAM(Z) + { + nl_fptype IsBV = m_modacc.m_IBV + / (plib::exp(m_modacc.m_BV + / nlconst::np_VT(m_modacc.m_NBV)) + - nlconst::one()); + + m_D.set_param(m_modacc.m_IS, m_modacc.m_N, exec().gmin(), + nlconst::T0()); + m_R.set_param(IsBV, m_modacc.m_NBV, exec().gmin(), nlconst::T0()); + set_G_V_I(m_D.G(), nlconst::zero(), m_D.Ieq()); + } + + NETLIB_UPDATE_TERMINALS(Z) + { + m_D.update_diode(deltaV()); + m_R.update_diode(-deltaV()); + const nl_fptype G(m_D.G() + m_R.G()); + const nl_fptype I(m_D.Ieq() - m_R.Ieq()); + set_mat(G, -G, -I, // + -G, G, I); + } - m_D.set_param(Is, n, exec().gmin(), constants::T0()); -} +} // namespace netlist::analog -NETLIB_UPDATE_TERMINALS(D) +namespace netlist::devices { - m_D.update_diode(deltaV()); - const nl_double G = m_D.G(); - const nl_double I = m_D.Ieq(); - set_mat( G, -G, -I, - -G, G, I); - //set(m_D.G(), 0.0, m_D.Ieq()); -} - - - } //namespace analog - - namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, R, "RES", "R") - NETLIB_DEVICE_IMPL_NS(analog, POT, "POT", "R") - NETLIB_DEVICE_IMPL_NS(analog, POT2, "POT2", "R") - NETLIB_DEVICE_IMPL_NS(analog, C, "CAP", "C") - NETLIB_DEVICE_IMPL_NS(analog, L, "IND", "L") - NETLIB_DEVICE_IMPL_NS(analog, D, "DIODE", "MODEL") - NETLIB_DEVICE_IMPL_NS(analog, VS, "VS", "V") - NETLIB_DEVICE_IMPL_NS(analog, CS, "CS", "I") - } // namespace devices - -} // namespace netlist + // clang-format off + NETLIB_DEVICE_IMPL_NS(analog, R, "RES", "R") + NETLIB_DEVICE_IMPL_NS(analog, POT, "POT", "R") + NETLIB_DEVICE_IMPL_NS(analog, POT2, "POT2", "R") + NETLIB_DEVICE_IMPL_NS(analog, C, "CAP", "C") + NETLIB_DEVICE_IMPL_NS(analog, L, "IND", "L") + NETLIB_DEVICE_IMPL_NS(analog, D, "DIODE", "MODEL") + NETLIB_DEVICE_IMPL_NS(analog, Z, "ZDIODE", "MODEL") + NETLIB_DEVICE_IMPL_NS(analog, VS, "VS", "V") + NETLIB_DEVICE_IMPL_NS(analog, CS, "CS", "I") + // clang-format on +} // namespace netlist::devices diff --git a/src/lib/netlist/analog/nlid_twoterm.h b/src/lib/netlist/analog/nlid_twoterm.h index 1dc639008c4..d84356fe82d 100644 --- a/src/lib/netlist/analog/nlid_twoterm.h +++ b/src/lib/netlist/analog/nlid_twoterm.h @@ -1,245 +1,360 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_twoterm.h - * - * Devices with two terminals ... - * - * - * (k) - * +-----T-----+ - * | | | - * | +--+--+ | - * | | | | - * | R | | - * | R | | - * | R I | - * | | I | Device n - * | V+ I | - * | V | | - * | V- | | - * | | | | - * | +--+--+ | - * | | | - * +-----T-----+ - * (l) - * - * This is a resistance in series to a voltage source and paralleled by a - * current source. This is suitable to model voltage sources, current sources, - * resistors, capacitors, inductances and diodes. - * - */ #ifndef NLID_TWOTERM_H_ #define NLID_TWOTERM_H_ -#include "netlist/nl_base.h" -#include "netlist/nl_setup.h" -#include "netlist/solver/nld_solver.h" +/// +/// \file nlid_twoterm.h +/// +/// Devices with two terminals ... +/// +/// +/// (k) +/// +-----T-----+ +/// | | | +/// | +--+--+ | +/// | | | | +/// | R | | +/// | R | | +/// | R I | +/// | | I | Device n +/// | V+ I | +/// | V | | +/// | V- | | +/// | | | | +/// | +--+--+ | +/// | | | +/// +-----T-----+ +/// (l) +/// +/// This is a resistance in series to a voltage source and paralleled by a +/// current source. This is suitable to model voltage sources, current sources, +/// resistors, capacitors, inductances and diodes. +/// +// + +#include "../nl_setup.h" +#include "nl_base.h" #include "nld_generic_models.h" -#include "plib/pfunction.h" -#include <cmath> +#include "solver/nld_solver.h" + +#include "plib/pfunction.h" // ----------------------------------------------------------------------------- // Implementation // ----------------------------------------------------------------------------- -namespace netlist -{ -namespace analog +namespace netlist::analog { - // ----------------------------------------------------------------------------- - // nld_twoterm - // ----------------------------------------------------------------------------- - - template <class C> - inline core_device_t &bselect(bool b, C &d1, core_device_t &d2) - { - auto *h = dynamic_cast<core_device_t *>(&d1); - return b ? *h : d2; - } - template<> - inline core_device_t &bselect(bool b, netlist_state_t &d1, core_device_t &d2) - { - plib::unused_var(d1); - if (b) - throw nl_exception("bselect with netlist and b==true"); - return d2; - } + // ------------------------------------------------------------------------- + // nld_two_terminal + // ------------------------------------------------------------------------- - NETLIB_OBJECT(twoterm) + class nld_two_terminal : public base_device_t { - NETLIB_CONSTRUCTOR_EX(twoterm, bool terminals_owned = false) - , m_P(bselect(terminals_owned, owner, *this), (terminals_owned ? name + "." : "") + "1", &m_N) - , m_N(bselect(terminals_owned, owner, *this), (terminals_owned ? name + "." : "") + "2", &m_P) + public: + nld_two_terminal(constructor_param_t data) + : base_device_t(data) + , m_P(*this, "1", &m_N, NETLIB_DELEGATE(terminal_handler)) + , m_N(*this, "2", &m_P, NETLIB_DELEGATE(terminal_handler)) { } - terminal_t m_P; - terminal_t m_N; + // This constructor covers the case in which the terminals are "owned" + // by the device using a two_terminal. In this case it passes + // the terminal handler on to the terminals. + + nld_two_terminal(base_device_t &owner, const pstring &name, + nl_delegate owner_delegate) + : base_device_t( + constructor_data_t{owner.state(), owner.name() + "." + name}) + , m_P(owner, name + ".1", &m_N, owner_delegate) + , m_N(owner, name + ".2", &m_P, owner_delegate) + { + } - //NETLIB_UPDATE_TERMINALSI() { } - //NETLIB_RESETI() { } + // NETLIB_UPDATE_TERMINALSI() { } + // NETLIB_RESETI() {} public: + NETLIB_HANDLERI(terminal_handler); - NETLIB_UPDATEI(); + solver::matrix_solver_t *solver() const noexcept; - void solve_now(); + void solve_now() const; - void solve_later(netlist_time delay = netlist_time::quantum()); + template <typename F> + void change_state(F f) const + { + auto *solv(solver()); + if (solv) + solv->change_state(f); + } - void set_G_V_I(const nl_double G, const nl_double V, const nl_double I) + void set_G_V_I(nl_fptype G, nl_fptype V, nl_fptype I) const noexcept { - /* GO, GT, I */ + // GO, GT, I m_P.set_go_gt_I( -G, G, ( V) * G - I); m_N.set_go_gt_I( -G, G, ( -V) * G + I); } - nl_double deltaV() const + nl_fptype deltaV() const noexcept { return m_P.net().Q_Analog() - m_N.net().Q_Analog(); } - void set_mat(const nl_double a11, const nl_double a12, const nl_double rhs1, - const nl_double a21, const nl_double a22, const nl_double rhs2) + nl_fptype V1P() const noexcept { return m_P.net().Q_Analog(); } + + nl_fptype V2N() const noexcept { return m_N.net().Q_Analog(); } + + void set_mat(nl_fptype a11, nl_fptype a12, nl_fptype rhs1, // + nl_fptype a21, nl_fptype a22, nl_fptype rhs2 // + ) const noexcept { - /* GO, GT, I */ + // GO, GT, I m_P.set_go_gt_I(a12, a11, rhs1); m_N.set_go_gt_I(a21, a22, rhs2); } + void set_mat(const std::array<std::array<nl_fptype,3>,2> &a) const noexcept + { + // GO, GT, I + m_P.set_go_gt_I(a[0][1], a[0][0], a[0][2]); + m_N.set_go_gt_I(a[1][0], a[1][1], a[1][2]); + } + + void clear_mat() const noexcept + { + const auto z = nlconst::zero(); + // GO, GT, I + m_P.set_go_gt_I(z, z, z); + m_N.set_go_gt_I(z, z, z); + } + + /// \brief Get a const reference to the m_P terminal + /// + /// This is typically called during initialization to connect + /// terminals. + /// + /// \returns Reference to m_P terminal. + const terminal_t &P() const noexcept { return m_P; } + + /// \brief Get a const reference to the m_N terminal + /// + /// This is typically called during initialization to connect + /// terminals. + /// + /// \returns Reference to m_N terminal. + const terminal_t &N() const noexcept { return m_N; } + + /// \brief Get a reference to the m_P terminal + /// + /// This call is only allowed from the core. Device code should never + /// need to call this. + /// + /// \returns Reference to m_P terminal. + terminal_t &setup_P() noexcept { return m_P; } + + /// \brief Get a reference to the m_N terminal + /// + /// This call is only allowed from the core. Device code should never + /// need to call this. + /// + /// \returns Reference to m_P terminal. + terminal_t &setup_N() noexcept { return m_N; } + private: + terminal_t m_P; + terminal_t m_N; }; - - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // nld_R - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(R_base, twoterm) + class nld_R_base : public nld_two_terminal { - NETLIB_CONSTRUCTOR_DERIVED(R_base, twoterm) + public: + nld_R_base(constructor_param_t data) + : nld_two_terminal(data) { } - void set_R(const nl_double R) + void set_R(nl_fptype R) const noexcept { - const nl_double G = plib::constants<nl_double>::one() / R; - set_mat( G, -G, 0.0, - -G, G, 0.0); + const nl_fptype G = plib::reciprocal(R); + set_mat(G, -G, nlconst::zero(), // + -G, G, nlconst::zero()); } - NETLIB_RESETI(); + void set_G(nl_fptype G) const noexcept + { + set_mat(G, -G, nlconst::zero(), // + -G, G, nlconst::zero()); + } - protected: - //NETLIB_UPDATEI(); + // NETLIB_RESETI(); + protected: + // NETLIB_UPDATEI(); }; - NETLIB_OBJECT_DERIVED(R, R_base) + class nld_R : public nld_R_base { - NETLIB_CONSTRUCTOR_DERIVED(R, R_base) - , m_R(*this, "R", 1e9) + public: + nld_R(constructor_param_t data) + : nld_R_base(data) + , m_R(*this, "R", nlconst::magic(1e9)) { } - protected: - - //NETLIB_UPDATEI() { } - NETLIB_RESETI() - { - NETLIB_NAME(twoterm)::reset(); - set_R(std::max(m_R(), exec().gmin())); - } + NETLIB_RESETI() { set_R(std::max(m_R(), exec().gmin())); } NETLIB_UPDATE_PARAMI() { - solve_now(); - set_R(std::max(m_R(), exec().gmin())); + // FIXME: We only need to update the net first if this is a time + // stepping net + change_state([this]() { set_R(std::max(m_R(), exec().gmin())); }); } private: - param_double_t m_R; - /* protect set_R ... it's a recipe to desaster when used to bypass the parameter */ - using NETLIB_NAME(R_base)::set_R; + param_fp_t m_R; + // protect set_R ... it's a recipe to disaster when used to bypass the + // parameter + using nld_R_base::set_G; + using nld_R_base::set_R; }; - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // nld_POT - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - NETLIB_OBJECT(POT) + class nld_POT : public base_device_t { - NETLIB_CONSTRUCTOR(POT) + public: + nld_POT(constructor_param_t data) + : base_device_t(data) , m_R1(*this, "_R1") , m_R2(*this, "_R2") , m_R(*this, "R", 10000) - , m_Dial(*this, "DIAL", 0.5) + , m_Dial(*this, "DIAL", nlconst::half()) , m_DialIsLog(*this, "DIALLOG", false) , m_Reverse(*this, "REVERSE", false) { - register_subalias("1", m_R1.m_P); - register_subalias("2", m_R1.m_N); - register_subalias("3", m_R2.m_N); - - connect(m_R2.m_P, m_R1.m_N); + register_sub_alias("1", m_R1().P()); + register_sub_alias("2", m_R1().N()); + register_sub_alias("3", m_R2().N()); + connect(m_R2().P(), m_R1().N()); } - //NETLIB_UPDATEI(); + // NETLIB_UPDATEI(); NETLIB_RESETI(); NETLIB_UPDATE_PARAMI(); private: - NETLIB_SUB(R_base) m_R1; - NETLIB_SUB(R_base) m_R2; + NETLIB_SUB_NS(analog, R_base) m_R1; + NETLIB_SUB_NS(analog, R_base) m_R2; - param_double_t m_R; - param_double_t m_Dial; + param_fp_t m_R; + param_fp_t m_Dial; param_logic_t m_DialIsLog; param_logic_t m_Reverse; }; - NETLIB_OBJECT(POT2) + class nld_POT2 : public base_device_t { - NETLIB_CONSTRUCTOR(POT2) + public: + nld_POT2(constructor_param_t data) + : base_device_t(data) , m_R1(*this, "_R1") - , m_R(*this, "R", 10000) - , m_Dial(*this, "DIAL", 0.5) + , m_R(*this, "R", nlconst::magic(10000.0)) + , m_Dial(*this, "DIAL", nlconst::half()) , m_DialIsLog(*this, "DIALLOG", false) , m_Reverse(*this, "REVERSE", false) { - register_subalias("1", m_R1.m_P); - register_subalias("2", m_R1.m_N); - + register_sub_alias("1", m_R1().P()); + register_sub_alias("2", m_R1().N()); } - //NETLIB_UPDATEI(); + // NETLIB_UPDATEI(); NETLIB_RESETI(); NETLIB_UPDATE_PARAMI(); private: - NETLIB_SUB(R_base) m_R1; + NETLIB_SUB_NS(analog, R_base) m_R1; - param_double_t m_R; - param_double_t m_Dial; + param_fp_t m_R; + param_fp_t m_Dial; param_logic_t m_DialIsLog; param_logic_t m_Reverse; }; - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // nld_C - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + +#if 1 + class nld_C : public nld_two_terminal + { + public: + nld_C(constructor_param_t data) + : nld_two_terminal(data) + , m_C(*this, "C", nlconst::magic(1e-6)) + , m_cap(*this, "m_cap") + { + } + + NETLIB_IS_TIMESTEP(true) + NETLIB_TIMESTEPI() + { + if (ts_type == detail::time_step_type::FORWARD) + { + // G, Ieq + const auto res(m_cap.time_step(m_C(), deltaV(), step)); + const nl_fptype G = res.first; + const nl_fptype I = res.second; + set_mat(G, -G, -I, // + -G, G, I); + } + else + m_cap.restore_state(); + } + + NETLIB_RESETI() { m_cap.set_parameters(exec().gmin()); } + + /// \brief Set capacitance + /// + /// This call will set the capacitance. The typical use case are + /// are components like BJTs which use this component to model + /// internal capacitances. Typically called during initialization. + /// + /// \param val Capacitance value + /// + void set_cap_embedded(nl_fptype val) { m_C.set(val); } + + protected: + // NETLIB_UPDATEI(); + // FIXME: should be able to change + NETLIB_UPDATE_PARAMI() {} + + private: + param_fp_t m_C; + generic_capacitor_const m_cap; + }; - NETLIB_OBJECT_DERIVED(C, twoterm) +#else + // Code preserved as a basis for a current/voltage controlled capacitor + class nld_C : public nld_two_terminal) { public: - NETLIB_CONSTRUCTOR_DERIVED(C, twoterm) - , m_C(*this, "C", 1e-6) + nld_C(constructor_param_t data) + : nld_two_terminal(data) + , m_C(*this, "C", nlconst::magic(1e-6)) , m_cap(*this, "m_cap") { } @@ -247,55 +362,57 @@ namespace analog NETLIB_IS_TIMESTEP(true) NETLIB_TIMESTEPI() { - m_cap.timestep(m_C(), deltaV(), step); + m_cap.time_step(m_C(), deltaV(), step); if (m_cap.type() == capacitor_e::CONSTANT_CAPACITY) { - const nl_double I = m_cap.Ieq(m_C(), deltaV()); - const nl_double G = m_cap.G(m_C()); - set_mat( G, -G, -I, - -G, G, I); + const nl_fptype I = m_cap.Ieq(m_C(), deltaV()); + const nl_fptype G = m_cap.G(m_C()); + set_mat(G, -G, -I, // + -G, G, I); } } NETLIB_IS_DYNAMIC(m_cap.type() == capacitor_e::VARIABLE_CAPACITY) NETLIB_UPDATE_TERMINALSI() { - const nl_double I = m_cap.Ieq(m_C(), deltaV()); - const nl_double G = m_cap.G(m_C()); - set_mat( G, -G, -I, - -G, G, I); + const nl_fptype I = m_cap.Ieq(m_C(), deltaV()); + const nl_fptype G = m_cap.G(m_C()); + set_mat(G, -G, -I, // + -G, G, I); } - param_double_t m_C; - NETLIB_RESETI() - { - m_cap.setparams(exec().gmin()); - } + param_fp_t m_C; + NETLIB_RESETI() { m_cap.set_parameters(exec().gmin()); } protected: - //NETLIB_UPDATEI(); - NETLIB_UPDATE_PARAMI() { } + // NETLIB_UPDATEI(); + // FIXME: should be able to change + NETLIB_UPDATE_PARAMI() {} private: - //generic_capacitor<capacitor_e::VARIABLE_CAPACITY> m_cap; + // generic_capacitor<capacitor_e::VARIABLE_CAPACITY> m_cap; generic_capacitor<capacitor_e::CONSTANT_CAPACITY> m_cap; }; +#endif - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // nld_L - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(L, twoterm) + class nld_L : public nld_two_terminal { public: - NETLIB_CONSTRUCTOR_DERIVED(L, twoterm) - , m_L(*this, "L", 1e-6) - , m_gmin(0.0) - , m_G(0.0) - , m_I(0.0) + nld_L(constructor_param_t data) + : nld_two_terminal(data) + , m_L(*this, "L", nlconst::magic(1e-6)) + , m_gmin(nlconst::zero()) + , m_G(*this, "m_G", nlconst::zero()) + , m_I(*this, "m_I", nlconst::zero()) + , m_last_I(*this, "m_last_I", nlconst::zero()) + , m_last_G(*this, "m_last_G", nlconst::zero()) { - //register_term("1", m_P); - //register_term("2", m_N); + // register_term("1", m_P); + // register_term("2", m_N); } NETLIB_IS_TIMESTEP(true) @@ -303,69 +420,91 @@ namespace analog NETLIB_RESETI(); protected: - //NETLIB_UPDATEI(); + // NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI(); private: - param_double_t m_L; + param_fp_t m_L; - nl_double m_gmin; - nl_double m_G; - nl_double m_I; + nl_fptype m_gmin; + state_var<nl_fptype> m_G; + state_var<nl_fptype> m_I; + state_var<nl_fptype> m_last_I; + state_var<nl_fptype> m_last_G; }; - /*! Class representing the diode model paramers. - * This is the model representation of the diode model. Typically, SPICE uses - * the following parameters. A "Y" in the first column indicates that the - * parameter is actually used in netlist. - * - * |NL? |name |parameter |units|default| example|area | - * |:--:|:-----|:--------------------------------|:----|------:|-------:|:----:| - * | Y |IS |saturation current |A |1.0e-14| 1.0e-14| * | - * | |RS |ohmic resistance |Ohm | 0| 10| * | - * | Y |N |emission coefficient |- | 1| 1| | - * | |TT |transit-time |sec | 0| 0.1ns| | - * | |CJO |zero-bias junction capacitance |F | 0| 2pF| * | - * | |VJ |junction potential |V | 1| 0.6| | - * | |M |grading coefficient |- | 0.5| 0.5| | - * | |EG |band-gap energy |eV | 1.11| 1.11 Si| | - * | |XTI |saturation-current temp.exp |- | 3|3.0 pn. 2.0 Schottky| | - * | |KF |flicker noise coefficient |- | 0| | | - * | |AF |flicker noise exponent |- | 1| | | - * | |FC |coefficient for forward-bias depletion capacitance formula|-|0.5|| | - * | |BV |reverse breakdown voltage |V |infinite| 40| | - * | |IBV |current at breakdown voltage |V | 0.001| | | - * | |TNOM |parameter measurement temperature|deg C| 27| 50| | - * - */ - - class diode_model_t : public param_model_t + /// \brief Class representing the diode model parameters. + /// + /// This is the model representation of the diode model. Typically, SPICE + /// uses the following parameters. A "Y" in the first column indicates that + /// the parameter is actually used in netlist. + /// + /// NBV, BV and IBV are only used in the ZDIODE model. It is assumed + /// that DIODEs are not modeled up to their breakdown voltage. + /// + /// |NL? |name |parameter |units|default| example|area | + /// |:--:|:-----|:--------------------------------|:----|------:|-------:|:----:| + /// | Y |IS |saturation current |A |1.0e-14| 1.0e-14| * | + /// | |RS |ohmic resistance |Ohm | 0| 10| * | + /// | Y |N |emission coefficient |- | 1| 1| | + /// | |TT |transit-time |sec | 0| 0.1ns| | + /// | |CJO |zero-bias junction capacitance |F | 0| 2pF| * | + /// | |VJ |junction potential |V | 1| 0.6| | + /// | |M |grading coefficient |- | 0.5| 0.5| | + /// | |EG |band-gap energy |eV | 1.11| 1.11 Si| | + /// | |XTI |saturation-current temp.exp |- | 3|3.0 pn. 2.0 Schottky| | + /// | |KF |flicker noise coefficient |- | 0| | | + /// | |AF |flicker noise exponent |- | 1| | | + /// | |FC |coefficient for forward-bias depletion capacitance formula|-|0.5|| | + /// | Y |NBV |reverse emission coefficient |- | 3| 1| | + /// | Y |BV |reverse breakdown voltage |V |infinite| 40| | + /// | Y |IBV |current at breakdown voltage |A | 0.001| | | + /// | |TNOM |parameter measurement temperature|deg C| 27| 50| | + /// + class diode_model_t { public: - diode_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_IS(*this, "IS") - , m_N(*this, "N") - {} - - value_t m_IS; //!< saturation current. - value_t m_N; //!< emission coefficient. + diode_model_t(param_model_t &model) + : m_IS(model, "IS") + , m_N(model, "N") + { + } + + param_model_t::value_t m_IS; //!< saturation current. + param_model_t::value_t m_N; //!< emission coefficient. }; + class zdiode_model_t : public diode_model_t + { + public: + zdiode_model_t(param_model_t &model) + : diode_model_t(model) + , m_NBV(model, "NBV") + , m_BV(model, "BV") + , m_IBV(model, "IBV") + { + } - // ----------------------------------------------------------------------------- + param_model_t::value_t m_NBV; //!< reverse emission coefficient. + param_model_t::value_t m_BV; //!< reverse breakdown voltage. + param_model_t::value_t m_IBV; //!< current at breakdown voltage. + }; + + // ------------------------------------------------------------------------- // nld_D - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(D, twoterm) + class nld_D : public nld_two_terminal { public: - NETLIB_CONSTRUCTOR_DERIVED_EX(D, twoterm, pstring model = "D") + nld_D(constructor_param_t data, const pstring &model = "D") + : nld_two_terminal(data) , m_model(*this, "MODEL", model) + , m_modacc(m_model) , m_D(*this, "m_D") { - register_subalias("A", m_P); - register_subalias("K", m_N); + register_sub_alias("A", P()); + register_sub_alias("K", N()); } NETLIB_IS_DYNAMIC(true) @@ -373,125 +512,175 @@ namespace analog NETLIB_RESETI(); protected: - //NETLIB_UPDATEI(); + // NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI(); private: - diode_model_t m_model; + param_model_t m_model; + diode_model_t m_modacc; generic_diode<diode_e::BIPOLAR> m_D; }; + // ------------------------------------------------------------------------- + // nld_Z - Zener Diode + // ------------------------------------------------------------------------- - // ----------------------------------------------------------------------------- + class nld_Z : public nld_two_terminal + { + public: + nld_Z(constructor_param_t data, const pstring &model = "D") + : nld_two_terminal(data) + , m_model(*this, "MODEL", model) + , m_modacc(m_model) + , m_D(*this, "m_D") + , m_R(*this, "m_R") + { + register_sub_alias("A", P()); + register_sub_alias("K", N()); + } + + NETLIB_IS_DYNAMIC(true) + NETLIB_UPDATE_TERMINALSI(); + NETLIB_RESETI(); + + protected: + // NETLIB_UPDATEI(); + NETLIB_UPDATE_PARAMI(); + + private: + param_model_t m_model; + zdiode_model_t m_modacc; + generic_diode<diode_e::BIPOLAR> m_D; + // REVERSE diode + generic_diode<diode_e::BIPOLAR> m_R; + }; + + // ------------------------------------------------------------------------- // nld_VS - Voltage source // // netlist voltage source must have inner resistance - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(VS, twoterm) + class nld_VS : public nld_two_terminal { public: - NETLIB_CONSTRUCTOR_DERIVED(VS, twoterm) - , m_t(*this, "m_t", 0.0) - , m_R(*this, "R", 0.1) - , m_V(*this, "V", 0.0) - , m_func(*this,"FUNC", "") - , m_compiled(this->name() + ".FUNCC", this, this->state().run_state_manager()) - , m_funcparam({0.0}) + nld_VS(constructor_param_t data) + : nld_two_terminal(data) + , m_t(*this, "m_t", nlconst::zero()) + , m_R(*this, "RI", nlconst::magic(0.1)) + , m_V(*this, "V", nlconst::zero()) + , m_func(*this, "FUNC", "") + , m_compiled(*this, "m_compiled") + , m_funcparam({nlconst::zero()}) { - register_subalias("P", m_P); - register_subalias("N", m_N); - if (m_func() != "") - m_compiled.compile(std::vector<pstring>({{"T"}}), m_func()); + register_sub_alias("P", P()); + register_sub_alias("N", N()); + if (!m_func().empty()) + m_compiled->compile(m_func(), + std::vector<pstring>({{pstring("T")}})); } - NETLIB_IS_TIMESTEP(m_func() != "") + NETLIB_IS_TIMESTEP(!m_func().empty()) NETLIB_TIMESTEPI() { - m_t += step; - m_funcparam[0] = m_t; - this->set_G_V_I(1.0 / m_R(), - m_compiled.evaluate(m_funcparam), - 0.0); + if (ts_type == detail::time_step_type::FORWARD) + { + m_t += step; + m_funcparam[0] = m_t; + this->set_G_V_I(plib::reciprocal(m_R()), + m_compiled->evaluate(m_funcparam), + nlconst::zero()); + } + else + m_t -= step; // only need to restore state, will be called again } protected: - // NETLIB_UPDATEI() { NETLIB_NAME(twoterm)::update(time); } - NETLIB_RESETI() { - NETLIB_NAME(twoterm)::reset(); - this->set_G_V_I(1.0 / m_R(), m_V(), 0.0); + nld_two_terminal::reset(); + this->set_G_V_I(plib::reciprocal(m_R()), m_V(), nlconst::zero()); } private: - state_var<double> m_t; - param_double_t m_R; - param_double_t m_V; - param_str_t m_func; - plib::pfunction m_compiled; - std::vector<double> m_funcparam; + state_var<nl_fptype> m_t; + param_fp_t m_R; + param_fp_t m_V; + param_str_t m_func; + state_var<plib::pfunction<nl_fptype>> m_compiled; + std::vector<nl_fptype> m_funcparam; }; - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // nld_CS - Current source - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(CS, twoterm) + class nld_CS : public nld_two_terminal { public: - NETLIB_CONSTRUCTOR_DERIVED(CS, twoterm) - , m_t(*this, "m_t", 0.0) - , m_I(*this, "I", 1.0) - , m_func(*this,"FUNC", "") - , m_compiled(this->name() + ".FUNCC", this, this->state().run_state_manager()) - , m_funcparam({0.0}) + nld_CS(constructor_param_t data) + : nld_two_terminal(data) + , m_t(*this, "m_t", nlconst::zero()) + , m_I(*this, "I", nlconst::one()) + , m_func(*this, "FUNC", "") + , m_compiled(*this, "m_compiled") + , m_funcparam({nlconst::zero()}) { - register_subalias("P", m_P); - register_subalias("N", m_N); - if (m_func() != "") - m_compiled.compile(std::vector<pstring>({{"T"}}), m_func()); + register_sub_alias("P", "1"); + register_sub_alias("N", "2"); + if (!m_func().empty()) + m_compiled->compile(m_func(), + std::vector<pstring>({{pstring("T")}})); } - NETLIB_IS_TIMESTEP(m_func() != "") + NETLIB_IS_TIMESTEP(!m_func().empty()) NETLIB_TIMESTEPI() { - m_t += step; - m_funcparam[0] = m_t; - const double I = m_compiled.evaluate(m_funcparam); - set_mat(0.0, 0.0, -I, - 0.0, 0.0, I); + if (ts_type == detail::time_step_type::FORWARD) + { + m_t += step; + m_funcparam[0] = m_t; + const nl_fptype I = m_compiled->evaluate(m_funcparam); + const auto zero(nlconst::zero()); + set_mat(zero, zero, -I, // + zero, zero, I); + } + else + m_t -= step; } protected: - - //NETLIB_UPDATEI() { NETLIB_NAME(twoterm)::update(time); } NETLIB_RESETI() { - NETLIB_NAME(twoterm)::reset(); - set_mat(0.0, 0.0, -m_I(), - 0.0, 0.0, m_I()); + nld_two_terminal::reset(); + const auto zero(nlconst::zero()); + set_mat(zero, zero, -m_I(), // + zero, zero, m_I()); } NETLIB_UPDATE_PARAMI() { - solve_now(); - set_mat(0.0, 0.0, -m_I(), - 0.0, 0.0, m_I()); + // FIXME: We only need to update the net first if this is a time + // stepping net + // FIXME: works only for CS without function + change_state( + [this]() + { + const auto zero(nlconst::zero()); + set_mat(zero, zero, -m_I(), // + zero, zero, m_I()); + }); } - private: - state_var<double> m_t; - param_double_t m_I; - param_str_t m_func; - plib::pfunction m_compiled; - std::vector<double> m_funcparam; + state_var<nl_fptype> m_t; + param_fp_t m_I; + param_str_t m_func; + state_var<plib::pfunction<nl_fptype>> m_compiled; + std::vector<nl_fptype> m_funcparam; }; +} // namespace netlist::analog -} // namespace analog -} // namespace netlist - -#endif /* NLD_TWOTERM_H_ */ +#endif // NLD_TWOTERM_H_ diff --git a/src/lib/netlist/build/.clang-format b/src/lib/netlist/build/.clang-format new file mode 100644 index 00000000000..d312a0798cc --- /dev/null +++ b/src/lib/netlist/build/.clang-format @@ -0,0 +1,114 @@ +Language: Cpp +Standard: c++17 +UseTab: ForContinuationAndIndentation +TabWidth: 4 +IndentWidth: 4 +ColumnLimit: 80 +ContinuationIndentWidth: 4 +ConstructorInitializerIndentWidth: 0 +NamespaceIndentation: All +CompactNamespaces: true +FixNamespaceComments: true + +IndentAccessModifiers: false +AccessModifierOffset: -4 +IndentCaseLabels: true + +BreakBeforeBraces: Allman +BreakBeforeBinaryOperators: All +BreakConstructorInitializers: BeforeComma +# Currentline doesn't work +# PackConstructorInitializers: CurrentLine >= 14 +BreakStringLiterals: false +# Multiline does not work in clang-format 13 +# AlwaysBreakTemplateDeclarations: MultiLine +AlwaysBreakTemplateDeclarations: Yes +# AfterComma does not work <= 13 +#BreakInheritanceList: AfterComma +BreakInheritanceList: BeforeComma +#BreakInheritanceList: false +SpaceBeforeInheritanceColon: true + +#AlignAfterOpenBracket: DontAlign +AlignAfterOpenBracket: Align +PointerAlignment: Right +ReferenceAlignment: Right +SpacesInAngles: false +SpaceBeforeAssignmentOperators: true +AlignConsecutiveDeclarations: true + +#Clang>=14 +#AlignArrayOfStructures: Left + +AllowShortIfStatementsOnASingleLine: false +AllowShortCaseLabelsOnASingleLine: true +AllowAllArgumentsOnNextLine: false +AllowAllParametersOfDeclarationOnNextLine: false + +PenaltyBreakComment: 1 +PenaltyBreakAssignment: 1000 +AlwaysBreakBeforeMultilineStrings: true + +PenaltyReturnTypeOnItsOwnLine: 1 + +# SortIncludes: CaseSensitive # >= 13! +SortIncludes: true +IncludeBlocks: Regroup + +IncludeCategories: + - Regex: '^(("|"../)core)/' + Priority: 20 + - Regex: '^(("|"../)analog)/' + Priority: 21 + - Regex: '^(("|"../)devices)/' + Priority: 22 + - Regex: '^(("|"../)solver)/' + Priority: 23 + - Regex: '^(("|"../)plib)/' + Priority: 30 + - Regex: '<[([:alnum:]|_).]+>' + Priority: 40 + - Regex: '.*' + Priority: 10 + +StatementMacros: + - "DIPPINS" + - "TT_HEAD" + - "TT_LINE" + - "TT_FAMILY" +# - "TRUTH_TABLE" +# - "NETLIB_DEVICE_IMPL_NS" +# - "TTL_7400_NAND" +# - "TTL_7402_NOR" +# - "NET_C" +# - "TRUTHTABLE_ENTRY" + - "LOCAL_LIB_ENTRY" + +#StatementAttributeLikeMacros: +# - "NETLIST_NAME" +# - "NETLIB_NAME" + +TypenameMacros: + - "NETLIST_NAME" + - "NETLIB_NAME" + - "PENUM" + +WhitespaceSensitiveMacros: + - "ALIAS" + - "DIPPINS" + - "NET_C" + - "PENUM" + +IndentPPDirectives: BeforeHash +MacroBlockBegin: "^static NETLIST_START\\(.+\\)|static TRUTHTABLE_START\\(.*\\)$" +MacroBlockEnd: "^NETLIST_END\\(\\)|TRUTHTABLE_END\\(\\)$" + +# Avoid formatting +# -- clang-tidy +# - cspell +# - Doxygen tables +# - Doxygen commands +# - ignored comments +# - nltool parsed documentation +CommentPragmas: '^( NOLINT.+| spell-checker.+|/ \|.+|/ \\.+|#.+|-.+)' + diff --git a/src/lib/netlist/build/create_devinc.py b/src/lib/netlist/build/create_devinc.py new file mode 100644 index 00000000000..6888d71183f --- /dev/null +++ b/src/lib/netlist/build/create_devinc.py @@ -0,0 +1,119 @@ +#!/usr/bin/python +## +## license:BSD-3-Clause +## copyright-holders:Couriersud + +import os +import os.path +import re +import sys +import xml.sax +import xml.sax.saxutils +import zlib + + +# workaround for version incompatibility +if sys.version_info > (3, ): + long = int + +# globals + +last_src = "" + +def process_srcfile(srcfile): + global last_src + if (last_src != srcfile): + last_src = srcfile + print("// ---------------------------------------------------------------------") + print("// Source: {}".format(srcfile)) + print("// ---------------------------------------------------------------------") + print("") + +def process_entry_external(srcfile, name): + process_srcfile(srcfile) + print("NETLIST_EXTERNAL({})".format(name)) + +def process_entry(srcfile, name, params): + process_srcfile(srcfile) + p = re.sub("\+","",params) + ps = p.split(",") + pusage = "" + pauto = "" + for x in ps: + if x[0:1] == "@": + pauto = pauto + ", " + x[1:] + else: + pusage = pusage + ", " + x + print("// usage : {}(name{})".format(name, pusage)) + if len(pauto) > 0: + print("// auto connect: {}".format(pauto[2:])) + print("#define {}(...) \\".format(name)) + print("\tNET_REGISTER_DEVEXT({}, __VA_ARGS__)".format(name)) + print("") + + +def process_file(srcfile): + src = open(srcfile,'r') + lines = src.readlines() + for line in lines: + ls = re.sub("\s+","",line.strip()) + ls = re.sub("^\s*//.*","",ls) + ls = re.sub("\"","",ls) + m = re.match(r"NETLIB_DEVICE_IMPL\((\w+),(\w+),([a-zA-Z0-9_+@,]*)", ls) + #print("Line{}: {}".format(count, line.strip())) + if m is not None: + process_entry(srcfile, m.group(2), m.group(3)) + else: + m = re.match(r"NETLIB_DEVICE_IMPL_ALIAS\((\w+),(\w+),(\w+),([a-zA-Z0-9_+@,]*)", ls) + if m is not None: + process_entry(srcfile, m.group(3), m.group(4)) + else: + m = re.match(r"NETLIB_DEVICE_IMPL_NS\((\w+),(\w+),(\w+),([a-zA-Z0-9_+@,]*)", ls) + if m is not None: + process_entry(srcfile, m.group(3), m.group(4)) + else: + m = re.match(r"LOCAL_LIB_ENTRY\((\w+)\)", ls) + if m is not None: + process_entry(srcfile, m.group(1), "") + else: + m = re.match(r"(static)*TRUTH_TABLE\((\w+),(\w+),(\w+),([a-zA-Z0-9_+@,]*)", ls) + if m is not None: + process_entry(srcfile, m.group(2), m.group(5)) + else: + #m = re.match(r"EXTERNAL_SOURCE\((\w+)\)", ls) + m = re.match(r"NETLIST_START\((\w+)\)", ls) + if m is not None: + process_entry_external(srcfile, m.group(1)) + + src.close() + +def file_header(): + print("// license:BSD-3-Clause") + print("// copyright-holders:Couriersud") + print("") + print("#ifndef NLD_DEVINC_H") + print("#define NLD_DEVINC_H") + print("") + print("#ifndef __PLIB_PREPROCESSOR__\n") + print("") + print("#include \"../nl_setup.h\"") + print("") + +def file_footer(): + print("#endif // __PLIB_PREPROCESSOR__\n") + print("#endif // NLD_DEVINC_H\n") + +if __name__ == '__main__': + if (len(sys.argv) == 0): + print('Usage:') + print(' create_devinc files ...') + sys.exit(0) + files_sorted = [] + for argno in range(1, len(sys.argv)): + files_sorted.append(sys.argv[argno]) + files_sorted.sort() + file_header() + for entry in files_sorted: + process_file(entry) + file_footer() + diff --git a/src/lib/netlist/build/create_lib_entries.py b/src/lib/netlist/build/create_lib_entries.py new file mode 100644 index 00000000000..3d2d146fd98 --- /dev/null +++ b/src/lib/netlist/build/create_lib_entries.py @@ -0,0 +1,57 @@ +#!/usr/bin/python +## +## license:BSD-3-Clause +## copyright-holders:Couriersud + +import os +import os.path +import re +import sys +import xml.sax +import xml.sax.saxutils +import zlib + + +# workaround for version incompatibility +if sys.version_info > (3, ): + long = int + +# globals +devices = [] + +def process_file(srcfile): + src = open(srcfile,'r') + lines = src.readlines() + for line in lines: + ls = re.sub("\s+","",line.strip()) + ls = re.sub("^\s*//.*","",ls) + m = re.match(r"NETLIB_DEVICE_IMPL\((\w+),", ls) + #print("Line{}: {}".format(count, line.strip())) + if m != None: + n = m.group(1) + devices.append(n) + else: + m = re.match(r"NETLIB_DEVICE_IMPL_ALIAS\((\w+),", ls) + if m != None: + n = m.group(1) + devices.append(n) + else: + m = re.match(r"NETLIB_DEVICE_IMPL_NS\((\w+),(\w+),", ls) + if m != None: + n = m.group(2) + devices.append(n) + src.close() + +if __name__ == '__main__': + if (len(sys.argv) == 0): + print('Usage:') + print(' create_lib_entries.py files...') + sys.exit(0) + + for argno in range(1, len(sys.argv)): + process_file(sys.argv[argno]) + + devices.sort() + for d in devices: + print("LIB_ENTRY({})".format(d)) +
\ No newline at end of file diff --git a/src/lib/netlist/build/create_modules.py b/src/lib/netlist/build/create_modules.py new file mode 100644 index 00000000000..94cfe4a26ae --- /dev/null +++ b/src/lib/netlist/build/create_modules.py @@ -0,0 +1,84 @@ +#!/usr/bin/python +## +## license:BSD-3-Clause +## copyright-holders:Couriersud + +import os +import os.path +import re +import sys +import xml.sax +import xml.sax.saxutils +import zlib +import datetime + + +# workaround for version incompatibility +if sys.version_info > (3, ): + long = int + +# globals + +last_src = "" + +def process_entry(srcfile, name, params): + global last_src + if (last_src != srcfile): + last_src = srcfile + print("// ---------------------------------------------------------------------") + print("// Source: {}".format(srcfile)) + print("// ---------------------------------------------------------------------") + print("") + p = re.sub("\+","",params) + ps = p.split(",") + pusage = "" + pauto = "" + for x in ps: + if x[0:1] == "@": + pauto = pauto + ", " + x[1:] + else: + pusage = pusage + ", " + x + print("// usage : {}(name{})".format(name, pusage)) + if len(pauto) > 0: + print("// auto connect: {}".format(pauto[2:])) + print("#define {}(...) \\".format(name)) + print("\tNET_REGISTER_DEVEXT({}, __VA_ARGS__)".format(name)) + print("") + + +def process_file(srcfile): + src = open(srcfile,'r') + lines = src.readlines() + for line in lines: + ls = re.sub("\s+","",line.strip()) + ls = re.sub("^\s*//.*","",ls) + ls = re.sub("\"","",ls) + m = re.match(r"NETLIST_START\((\w+)\)", ls) + if m != None: + print("\tEXTERNAL_LIB_ENTRY("+ m.group(1) + ")") + src.close() + +if __name__ == '__main__': + if (len(sys.argv) == 0): + print('Usage:') + print(' create_devinc files ...') + sys.exit(0) + files_sorted = []; + for argno in range(1, len(sys.argv)): + files_sorted.append(sys.argv[argno]) + files_sorted.sort(); + print("// license:CC0-1.0") + print("// copyright-holders:Couriersud") + print("") + now = datetime.datetime.now() + print("// File programmatically created " + now.strftime("%c")) + print("") + print("#include \"devices/net_lib.h\"") + print("") + print("NETLIST_START(modules_lib)") + print("{") + print("") + for entry in files_sorted: + process_file(entry) + print("") + print("}") diff --git a/src/lib/netlist/build/cspell.json b/src/lib/netlist/build/cspell.json new file mode 100644 index 00000000000..bf46cc2e992 --- /dev/null +++ b/src/lib/netlist/build/cspell.json @@ -0,0 +1,166 @@ +{ +"words" : [ + "astable", + "behavioural", + "datasheet", + "datasheets", + "demultiplexer", + "demultiplexers", + "highpass", + "lowpass", + "misformatted", // not in leo + "monostable", + "presettable", // not in leo + "transconductance", + "retriggerable", // not in leo + // Names + "Chebyshev", + "Raphson", + "Schmitt", + "Schottky", + "Zener", + "Thevenin", + // Company names + "Fairchild", + "Signetics", + "Mostek", + // Technical terms + "cmos", + "kaby", // Kaby Lake + "mosfet", + "mosfets", + "nmos", + "opamp", + "opamps", + "picosecond", + "pmos", + // Physics + "atto", + "centi", + "deca", + "femto", + "giga", + "hecto", + "peta", + "tera", + "yocto", + "yotta", + "zepto", + "zetta", + // Software + "kicad", + // C library functions / definitions + "feenableexcept", + "fedisableexcept", + // asm + "rdtsc", + "rdtscp", + "cpuid", + // Specific project terms + "MAME", + "Couriersud", + "netlist", + "netlists", + "nltool", + "nlwav", + "nvcc", + "lfsr", + "gmres", + "nlmod_", + // FIXME: Remove everything below here again + // Excluded for now ... Still over 1000 in the log + "plib", // namespace + "isnull", + "pstring", + "passert", + "putf", + "tokstor", + "psplit", + "gmin", + "lastx", + "idrn", + "preprocessor", + "ppreprocessor", + "psource", + "psemaphore", + "modacc", + "Ainv", + "anetlist", + "netdev", + "solv", + "sexpr", + "pstonum", + "pmfp", + "pmatrix", + "pfmt", + "nlname", + "nlparse", + "nlstate", + "nlconst", + "nlsetup", + "pfmp", + "resched", + "tokenizer", + "ptokenizer", + "pexception", + "devs", + "gonn", + "nzbd", + "nthcode", + "Vcrit", + "perrmsg", + "pfunction", + "tname", + "stname", + "parray", + "nzrd" +], +"languageSettings": [ + // This one works with Python + { + "languageId": "python", + "includeRegExpList": [ + "/#.*/", + "/('''|\"\"\")[^\\1]+?\\1/g", + "strings" + ] + }, + // This one works with JavaScript, Typescript, etc + { + "languageId": "javascript,typescript", + "includeRegExpList": [ + "CStyleComment", + "strings" + ] + }, + // Use with cpp or c files + { + "languageId": "cpp,c,h", + // Turn off compound words, because it is only checking strings. + "allowCompoundWords": false, + // Only check comments and strings + //"includeRegExpList": [ + // "CStyleComment", + // "string" + //], + "ignoreRegExpList": [ + "/#include.*/", // Exclude includes, because they are also strings + "/#pragma.*/", // Exclude pragmas, they may include strings + "/\/\/ NOLINT\\(.*/", // Exclude clang-tidy instructions + "/\/\/\/ \\\\file.*/", // Doxygen + "/\/\/\/ \\\\addtogroup.*/", // Doxygen + "/`[^`]+`/", // Markup code formatt + "/} \/\/ namespace.*/", // Namespace comments + // Project specific exclusions start here + "/\/\/ copyright-holders.*/", + "/\/\/- Pinalias:/", + "/\/\/#.*/", // commented source code + "\/\/ Source:.*/", // generated code + "/\\$[A-z0-9][^\\s]*/", // everything starting with a $ + // The following should be removed again + "/[A-z][^\\s]+::[^\\s]+/", // any namespace qualifier + "/[A-Z][A-Z][A-Z][^\\s]*/" // Identifiers starting with at least 3 capital letters + ] + } +] +} diff --git a/src/lib/netlist/build/doxygen.conf b/src/lib/netlist/build/doxygen.conf index 6fb0b377e7b..dcafc37f852 100644 --- a/src/lib/netlist/build/doxygen.conf +++ b/src/lib/netlist/build/doxygen.conf @@ -32,7 +32,7 @@ DOXYFILE_ENCODING = UTF-8 # title of most generated pages and in a few other places. # The default value is: My Project. -PROJECT_NAME = Netlist documentation +PROJECT_NAME = "Netlist documentation" # The PROJECT_NUMBER tag can be used to enter a project or revision number. This # could be handy for archiving the generated documentation or if some version @@ -475,7 +475,7 @@ HIDE_UNDOC_MEMBERS = YES # has no effect if EXTRACT_ALL is enabled. # The default value is: NO. -HIDE_UNDOC_CLASSES = YES +HIDE_UNDOC_CLASSES = NO # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, doxygen will hide all friend # (class|struct|union) declarations. If set to NO, these declarations will be @@ -771,7 +771,7 @@ WARN_LOGFILE = # spaces. See also FILE_PATTERNS and EXTENSION_MAPPING # Note: If this tag is empty the current directory is searched. -INPUT = .. ../analog ../documentation ../devices +INPUT = .. ../analog ../documentation ../devices ../macro ../core # This tag can be used to specify the character encoding of the source files # that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses @@ -844,7 +844,7 @@ EXCLUDE_SYMBOLS = # that contain example code fragments that are included (see the \include # command). -EXAMPLE_PATH = ../../../../nl_examples ../documentation +EXAMPLE_PATH = ../documentation ../examples ./html # If the value of the EXAMPLE_PATH tag contains directories, you can use the # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp and @@ -2019,7 +2019,7 @@ SEARCH_INCLUDES = YES # preprocessor. # This tag requires that the tag SEARCH_INCLUDES is set to YES. -INCLUDE_PATH = +INCLUDE_PATH = .. ../.. # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard # patterns (like *.h and *.hpp) to filter out the header-files in the @@ -2145,6 +2145,7 @@ DIA_PATH = HIDE_UNDOC_RELATIONS = YES + # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is # available from the path. This tool is part of Graphviz (see: # http://www.graphviz.org/), a graph visualization toolkit from AT&T and Lucent diff --git a/src/lib/netlist/build/html/nltool.html b/src/lib/netlist/build/html/nltool.html new file mode 100644 index 00000000000..10cf6949e3f --- /dev/null +++ b/src/lib/netlist/build/html/nltool.html @@ -0,0 +1,366 @@ +<!-- Creator : groff version 1.22.3 --> +<!-- CreationDate: Sat May 14 18:10:42 2022 --> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" +"http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<meta name="generator" content="groff -Thtml, see www.gnu.org"> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<meta name="Content-Style" content="text/css"> +<style type="text/css"> + p { margin-top: 0; margin-bottom: 0; vertical-align: top } + pre { margin-top: 0; margin-bottom: 0; vertical-align: top } + table { margin-top: 0; margin-bottom: 0; vertical-align: top } + h1 { text-align: center } +</style> +<title>NLTOOL</title> + +</head> +<body> + +<h1 align="center">NLTOOL</h1> + +<a href="#NAME">NAME</a><br> +<a href="#SYNOPSIS">SYNOPSIS</a><br> +<a href="#DESCRIPTION">DESCRIPTION</a><br> +<a href="#OPTIONS">OPTIONS</a><br> +<a href="#EXAMPLES">EXAMPLES</a><br> +<a href="#AUTHOR">AUTHOR</a><br> +<a href="#COPYRIGHT">COPYRIGHT</a><br> +<a href="#SEE ALSO">SEE ALSO</a><br> + +<hr> + + +<h2>NAME +<a name="NAME"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">nltool − +manual page for nltool (netlist) 0.14</p> + +<h2>SYNOPSIS +<a name="SYNOPSIS"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em"><b>nltool</b> +[<i>option</i>]... [<i>files</i>]...</p> + +<h2>DESCRIPTION +<a name="DESCRIPTION"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">nltool serves +as the Swiss Army knife to run, test and convert +netlists.</p> + +<p style="margin-left:11%; margin-top: 1em">Commands may +accept one or more files depending on the functionality. If +no file is provided, standard input is used.</p> + +<h2>OPTIONS +<a name="OPTIONS"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em"><b>General +options:</b></p> + +<p style="margin-left:22%;">The following options apply to +all commands.</p> + +<table width="100%" border="0" rules="none" frame="void" + cellspacing="0" cellpadding="0"> +<tr valign="top" align="left"> +<td width="11%"></td> +<td width="89%"> + + +<p style="margin-top: 1em"><b>−c</b>, +<b>−−cmd</b>=<i>run</i>|validate|convert|listdevices|listmodels|static|header|docheader|tests</p> </td></tr> +</table> + + +<p style="margin-left:22%; margin-top: 1em">run|validate|convert|listdevices|listmodels|static|header|docheader|tests</p> + +<p><b>−I</b>, +<b>−−include</b>=<i>Value</i></p> </table> + +<p style="margin-left:22%;">Add the directory to the list +of directories to be searched for header files. This option +may be specified repeatedly.</p> + +<p style="margin-left:11%;"><b>−D</b>, +<b>−−define</b>=<i>Value</i></p> + +<p style="margin-left:22%;">predefine value as macro, e.g. +<b>−Dname</b>=<i>value</i>. If ’=value’ is +omitted predefine it as 1. This option may be specified +repeatedly.</p> + +<p style="margin-left:11%;"><b>−r</b>, +<b>−−rom</b>=<i>Value</i></p> + +<p style="margin-left:22%;">where to look for data +files</p> + +<p style="margin-left:11%;"><b>−v</b>, +<b>−−verbose</b></p> + +<p style="margin-left:22%;">be verbose − this +produces lots of output</p> + +<p style="margin-left:11%;"><b>−q</b>, +<b>−−quiet</b></p> + +<p style="margin-left:22%;">be quiet − no +warnings</p> + + +<p style="margin-left:11%;"><b>−−prepro</b></p> + +<p style="margin-left:22%;">output preprocessor output to +stderr</p> + + +<p style="margin-left:11%;"><b>−−progress</b></p> + +<p style="margin-left:22%;">show progress bar on longer +operations</p> + + +<p style="margin-left:11%;"><b>−−version</b></p> + +<p style="margin-left:22%;">display version and exit</p> + +<p style="margin-left:11%;"><b>−h</b>, +<b>−−help</b></p> + +<p style="margin-left:22%;">display help and exit</p> + +<p style="margin-left:11%; margin-top: 1em"><b>Options for +run and static commands:</b></p> + +<p style="margin-left:22%;">These options apply to run and +static commands.</p> + +<p style="margin-left:11%;"><b>−n</b>, +<b>−−name</b>=<i>Value</i></p> + +<p style="margin-left:22%;">the netlist in file specified +by <b>−f</b> option to run; default is first one</p> + +<p style="margin-left:11%; margin-top: 1em"><b>Options for +static command:</b></p> + +<p style="margin-left:22%;">These options apply to static +command.</p> + +<p style="margin-left:11%;"><b>−d</b>, +<b>−−dir</b>=<i>Value</i></p> + +<p style="margin-left:22%;">output directory for the +generated files.</p> + +<p style="margin-left:11%;"><b>−o</b>, +<b>−−output</b>=<i>Value</i></p> + +<p style="margin-left:22%;">single output file for the +generated code. Either <b>−−dir</b> or +<b>−−output</b> can be specificied</p> + + +<p style="margin-left:11%;"><b>−−static_include</b></p> + +<p style="margin-left:22%;">write static solvers to +individual files included by file specified with +<b>−−output</b>. <b>−−dir</b> must +be path to "generated/static" path in netlist +folder.</p> + +<p style="margin-left:11%; margin-top: 1em"><b>Options for +run command:</b></p> + +<p style="margin-left:22%;">These options are only used by +the run command.</p> + +<p style="margin-left:11%;"><b>−t</b>, +<b>−−time_to_run</b>=<i>Value</i></p> + +<p style="margin-left:22%;">time to run the emulation +(seconds)</p> + + +<p style="margin-left:11%;"><b>−−boost_lib</b>=<i>Value</i></p> + +<p style="margin-left:22%;">generic: will use generic +solvers. builtin: Use optimized solvers compiled in. +somelib.so: Use library with precompiled solvers.</p> + +<p style="margin-left:11%;"><b>−s</b>, +<b>−−statistics</b></p> + +<p style="margin-left:22%;">gather runtime statistics</p> + +<p style="margin-left:11%;"><b>−l</b>, +<b>−−log</b>=<i>Value</i></p> + +<p style="margin-left:22%;">define terminal to log. This +option may be specified repeatedly.</p> + +<p style="margin-left:11%;"><b>−i</b>, +<b>−−input</b>=<i>Value</i></p> + +<p style="margin-left:22%;">input file to process (default +is none)</p> + + +<p style="margin-left:11%;"><b>−−loadstate</b>=<i>Value</i></p> + +<p style="margin-left:22%;">load state from file and +continue from there</p> + + +<p style="margin-left:11%;"><b>−−savestate</b>=<i>Value</i></p> + +<p style="margin-left:22%;">save state to file at end of +run</p> + +<p style="margin-left:11%;"><b>−−fperr</b></p> + +<p style="margin-left:22%;">raise exception on floating +point errors. This is intended to be used during +debugging.</p> + +<p style="margin-left:11%; margin-top: 1em"><b>Options for +convert command:</b></p> + +<p style="margin-left:22%;">These options are only used by +the convert command.</p> + +<p style="margin-left:11%;"><b>−y</b>, +<b>−−type</b>=<i>spice</i>|eagle|rinf</p> + +<p style="margin-left:22%;">type of file to be converted: +spice,eagle,rinf</p> + +<p style="margin-left:11%; margin-top: 1em"><b>Options for +validate command:</b></p> + +<p style="margin-left:22%;">These options are only used by +the validate command.</p> + +<p style="margin-left:11%; margin-top: 1em"><b>Options for +header command:</b></p> + +<p style="margin-left:22%;">These options are only used by +the header command.</p> + + +<p style="margin-left:11%;"><b>−−tab−width</b>=<i>Value</i></p> + +<p style="margin-left:22%;">Tab width for output.</p> + + +<p style="margin-left:11%;"><b>−−line−width</b>=<i>Value</i></p> + +<p style="margin-left:22%;">Line width for output.</p> + + +<p style="margin-left:11%;"><b>−−pattern</b>=<i>Value</i></p> + +<p style="margin-left:22%;">Pattern to match against device +names. If the device name contains pattern, the device will +be included in the output. Multiple patterns can be +specified, if none is given, all devices will be output.</p> + +<h2>EXAMPLES +<a name="EXAMPLES"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">nltool −c +run −t 3.5 −n cap_delay nl_examples/cdelay.c</p> + +<p style="margin-left:22%; margin-top: 1em">Run netlist +"cap_delay" from file nl_examples/cdelay.c for 3.5 +seconds</p> + +<p style="margin-left:11%; margin-top: 1em">nltool +−−cmd=listdevices</p> + +<p style="margin-left:22%; margin-top: 1em">List all known +devices.</p> + +<p style="margin-left:11%; margin-top: 1em">nltool +−−cmd=header −−tab−width=8 +−−line−width=80</p> + +<p style="margin-left:22%; margin-top: 1em">Create the +header file needed for including netlists as code.</p> + +<p style="margin-left:11%; margin-top: 1em">nltool +−−cmd static −−output</p> + + +<p style="margin-left:22%; margin-top: 1em">src/lib/netlist/generated/static_solvers.cpp +src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp</p> + +<p style="margin-left:22%; margin-top: 1em">Create static +solvers for the MAME project using one single source +file.</p> + +<p style="margin-left:11%; margin-top: 1em">nltool +−−cmd static −−output</p> + + +<p style="margin-left:22%; margin-top: 1em">src/lib/netlist/generated/static_solvers.cpp +−−dir src/lib/netlist/generated/static +−−static_include src/mame/audio/nl_*.cpp +src/mame/machine/nl_*.cpp</p> + +<p style="margin-left:22%; margin-top: 1em">Create static +solvers for the MAME project using a single source file +which includes generated solvers written to +−−dir folder.</p> + +<p style="margin-left:11%; margin-top: 1em">nltool +−−cmd tests</p> + +<p style="margin-left:22%; margin-top: 1em">Run unit tests. +In case the unit tests are not linked in, this will do +nothing.</p> + +<h2>AUTHOR +<a name="AUTHOR"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">Written by +Couriersud.</p> + +<h2>COPYRIGHT +<a name="COPYRIGHT"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">Copyright +© 2021 Couriersud License BSD−3−Clause <br> +This is free software: you are free to change and +redistribute it. There is NO WARRANTY, to the extent +permitted by law.</p> + +<h2>SEE ALSO +<a name="SEE ALSO"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">More +documentation for the <b>nltool</b> program is available in +doxygen format.</p> +<hr> +</body> +</html> diff --git a/src/lib/netlist/build/html/nlwav.html b/src/lib/netlist/build/html/nlwav.html new file mode 100644 index 00000000000..d1e14b1528d --- /dev/null +++ b/src/lib/netlist/build/html/nlwav.html @@ -0,0 +1,285 @@ +<!-- Creator : groff version 1.22.3 --> +<!-- CreationDate: Sat May 14 18:10:42 2022 --> +<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" +"http://www.w3.org/TR/html4/loose.dtd"> +<html> +<head> +<meta name="generator" content="groff -Thtml, see www.gnu.org"> +<meta http-equiv="Content-Type" content="text/html; charset=US-ASCII"> +<meta name="Content-Style" content="text/css"> +<style type="text/css"> + p { margin-top: 0; margin-bottom: 0; vertical-align: top } + pre { margin-top: 0; margin-bottom: 0; vertical-align: top } + table { margin-top: 0; margin-bottom: 0; vertical-align: top } + h1 { text-align: center } +</style> +<title>NLWAV</title> + +</head> +<body> + +<h1 align="center">NLWAV</h1> + +<a href="#NAME">NAME</a><br> +<a href="#SYNOPSIS">SYNOPSIS</a><br> +<a href="#DESCRIPTION">DESCRIPTION</a><br> +<a href="#OPTIONS">OPTIONS</a><br> +<a href="#EXAMPLES">EXAMPLES</a><br> +<a href="#AUTHOR">AUTHOR</a><br> +<a href="#COPYRIGHT">COPYRIGHT</a><br> +<a href="#SEE ALSO">SEE ALSO</a><br> + +<hr> + + +<h2>NAME +<a name="NAME"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">nlwav − +manual page for nlwav (netlist) 0.1</p> + +<h2>SYNOPSIS +<a name="SYNOPSIS"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em"><b>nlwav</b> +[<i>OPTION</i>] ... [<i>FILE</i>] ...</p> + +<h2>DESCRIPTION +<a name="DESCRIPTION"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">Convert netlist +log files into wav files.</p> + +<h2>OPTIONS +<a name="OPTIONS"></a> +</h2> + + + +<p style="margin-left:11%; margin-top: 1em"><b>−f</b>, +<b>−−format</b>=<i>wav16s</i>|wav32s|wav32f|vcda|vcdd|tab</p> + +<p style="margin-left:22%;">output format. Available +options are wav16s|wav32s|wav32f|vcda|vcdd|tab.</p> + +<table width="100%" border="0" rules="none" frame="void" + cellspacing="0" cellpadding="0"> +<tr valign="top" align="left"> +<td width="11%"></td> +<td width="9%"> + + +<p>wav16s</p></td> +<td width="2%"></td> +<td width="60%"> + + +<p>: multichannel wav output 16 bit signed</p></td> +<td width="18%"> +</td></tr> +<tr valign="top" align="left"> +<td width="11%"></td> +<td width="9%"> + + +<p>wav32s</p></td> +<td width="2%"></td> +<td width="60%"> + + +<p>: multichannel wav output 32 bit signed</p></td> +<td width="18%"> +</td></tr> +<tr valign="top" align="left"> +<td width="11%"></td> +<td width="9%"> + + +<p>wav32f</p></td> +<td width="2%"></td> +<td width="60%"> + + +<p>: multichannel wav output 32 bit float</p></td> +<td width="18%"> +</td></tr> +</table> + +<p style="margin-left:11%;">vcda : analog VCD output</p> + +<p style="margin-left:22%;">vcdd : digital VCD output tab : +sampled output Digital signals are created using the +<b>−−high</b> and</p> + + +<p style="margin-left:22%; margin-top: 1em"><b>−−low</b> +options</p> + +<p style="margin-left:11%;"><b>−o</b>, +<b>−−output</b>=<i>Value</i></p> + +<p style="margin-left:22%;">output file</p> + +<p style="margin-left:11%; margin-top: 1em"><b>wav +options:</b></p> + +<p style="margin-left:22%;">These options apply to wav +output only</p> + +<p style="margin-left:11%;"><b>−r</b>, +<b>−−rate</b>=<i>Value</i></p> + +<p style="margin-left:22%;">sample rate of output file</p> + +<p style="margin-left:11%;"><b>−a</b>, +<b>−−amp</b>=<i>Value</i></p> + +<p style="margin-left:22%;">amplification after mean +correction</p> + + +<p style="margin-left:11%;"><b>−−lowpass</b>=<i>Value</i></p> + +<p style="margin-left:22%;">lowpass filter frequency. +Default 20000 Hz.</p> + + +<p style="margin-left:11%;"><b>−−highpass</b>=<i>Value</i></p> + +<p style="margin-left:22%;">highpass filter frequency. +Default is 20 Hz.</p> + + +<p style="margin-left:11%;"><b>−−hpboost</b></p> + +<p style="margin-left:22%;">enable highpass boost to filter +out initial click.</p> + +<p style="margin-left:11%; margin-top: 1em"><b>vcdd +options:</b></p> + +<p style="margin-left:22%;">These options apply to vcdd +output only</p> + +<p style="margin-left:11%;"><b>−u</b>, +<b>−−high</b>=<i>Value</i></p> + +<p style="margin-left:22%;">minimum input for high +level</p> + +<p style="margin-left:11%;"><b>−l</b>, +<b>−−low</b>=<i>Value</i></p> + +<p style="margin-left:22%;">maximum input for low level</p> + +<p style="margin-left:11%; margin-top: 1em"><b>tab +options:</b></p> + +<p style="margin-left:22%;">These options apply to sampled +output only</p> + +<p style="margin-left:11%;"><b>−s</b>, +<b>−−start</b>=<i>Value</i></p> + +<p style="margin-left:22%;">time when sampling starts</p> + +<p style="margin-left:11%;"><b>−i</b>, +<b>−−increment</b>=<i>Value</i></p> + +<p style="margin-left:22%;">time between samples</p> + +<p style="margin-left:11%;"><b>−n</b>, +<b>−−samples</b>=<i>Value</i></p> + +<p style="margin-left:22%;">number of samples</p> + +<p style="margin-left:11%; margin-top: 1em"><b>General +options:</b></p> + +<p style="margin-left:22%;">These options always apply</p> + +<p style="margin-left:11%;"><b>−v</b>, +<b>−−verbose</b></p> + +<p style="margin-left:22%;">be verbose − this +produces lots of output</p> + +<p style="margin-left:11%;"><b>−q</b>, +<b>−−quiet</b></p> + +<p style="margin-left:22%;">be quiet − no +warnings</p> + + +<p style="margin-left:11%;"><b>−−version</b></p> + +<p style="margin-left:22%;">display version and exit</p> + +<p style="margin-left:11%;"><b>−h</b>, +<b>−−help</b></p> + +<p style="margin-left:22%;">display help and exit</p> + +<h2>EXAMPLES +<a name="EXAMPLES"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">./nlwav +−f vcdd −o x.vcd log_V*</p> + +<p style="margin-left:22%; margin-top: 1em">convert all +files starting with "log_V" into a digital vcd +file</p> + +<p style="margin-left:11%; margin-top: 1em">./nlwav +−f wav16s −o x.wav log_V*</p> + +<p style="margin-left:22%; margin-top: 1em">convert all +files starting with "log_V" into a multichannel +wav file (16bit, signed)</p> + +<p style="margin-left:11%; margin-top: 1em">./nlwav +−f tab −o x.tab −s 0.0000005 −i +0.000001 −n 256 log_BLUE.log</p> + +<p style="margin-left:22%; margin-top: 1em">convert file +log_BLUE.log to sampled output. First sample at 500ns +followed by 255 samples every micro−second.</p> + +<h2>AUTHOR +<a name="AUTHOR"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">Written by +Couriersud.</p> + +<h2>COPYRIGHT +<a name="COPYRIGHT"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">Copyright +© 2021 Couriersud License BSD−3−Clause <br> +This is free software: you are free to change and +redistribute it. There is NO WARRANTY, to the extent +permitted by law.</p> + +<h2>SEE ALSO +<a name="SEE ALSO"></a> +</h2> + + +<p style="margin-left:11%; margin-top: 1em">More +documentation for the <b>nlwav</b> program is available in +doxygen format.</p> +<hr> +</body> +</html> diff --git a/src/lib/netlist/build/makefile b/src/lib/netlist/build/makefile index 4df755e5396..2a63e816c0a 100644 --- a/src/lib/netlist/build/makefile +++ b/src/lib/netlist/build/makefile @@ -2,171 +2,219 @@ # # makefile # -# Core makefile for building MAME and derivatives -# -# Copyright (c) Nicola Salmoria and the MAME Team. -# Visit http://mamedev.org for licensing and usage restrictions. +# Core makefile for building netlist # ########################################################################### +# +# Notes: +# These should go into some compile.md +# +# Mingw notes: +# +# graphviz is needed for documentation +# pacman -S mingw-w64-x86_64-graphviz +# +# Please build documentation using +# make mingw PARAMS=doc +# +# + +.DEFAULT_GOAL := all + SRC = .. +#SRC = $(abspath ..) + +PSRC = $(SRC)/plib VSBUILD = $(SRC)/buildVS DOC = $(SRC)/documentation -TIDY_DB = ../compile_commands.json -TIDY_FLAGSX = -checks=*,-google*,-hicpp*,-readability*,-fuchsia*,cert-*,-android-*, -TIDY_FLAGSX += -llvm-header-guard,-cppcoreguidelines-pro-type-reinterpret-cast, -TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-pointer-arithmetic,-cppcoreguidelines-owning-memory, +TIDY_FLAGSX = -checks=*,-google*,-hicpp*,readability*,-fuchsia*,cert-*,-android-*,-altera*, +TIDY_FLAGSX += -llvm-header-guard, +# TIDY_FLAGSX += -cppcoreguidelines-pro-type-reinterpret-cast, +TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-pointer-arithmetic, +#TIDY_FLAGSX += -cppcoreguidelines-owning-memory, TIDY_FLAGSX += -modernize-use-default-member-init,-cppcoreguidelines-pro-bounds-constant-array-index, -TIDY_FLAGSX += -modernize-pass-by-value,-cppcoreguidelines-pro-type-static-cast-downcast, +TIDY_FLAGSX += -modernize-pass-by-value, +#TIDY_FLAGSX += -cppcoreguidelines-pro-type-static-cast-downcast, TIDY_FLAGSX += -cppcoreguidelines-avoid-magic-numbers, TIDY_FLAGSX += -cppcoreguidelines-macro-usage, TIDY_FLAGSX += -cppcoreguidelines-non-private-member-variables-in-classes,-misc-non-private-member-variables-in-classes, -TIDY_FLAGSX += -bugprone-macro-parentheses,-misc-macro-parentheses, -TIDY_FLAGSX += -modernize-use-trailing-return-type - -space := -space += -TIDY_FLAGS = $(subst $(space),,$(TIDY_FLAGSX)) - -#TIDY_FLAGS = -checks=llvm-include-order,llvm-namespace-comment,modernize-use-override,modernize-use-using -fix +TIDY_FLAGSX += -bugprone-macro-parentheses, +#TIDY_FLAGSX += -misc-macro-parentheses, +TIDY_FLAGSX += -bugprone-too-small-loop-variable, +TIDY_FLAGSX += -modernize-use-trailing-return-type, +TIDY_FLAGSX += -readability-magic-numbers,-readability-braces-around-statements, +TIDY_FLAGSX += -readability-implicit-bool-conversion, +TIDY_FLAGSX += -readability-named-parameter,-readability-function-size, +TIDY_FLAGSX += -llvmlibc-restrict-system-libc-headers,-llvmlibc-implementation-in-namespace,-llvmlibc-callee-namespace, +TIDY_FLAGSX += -modernize-use-nodiscard, +TIDY_FLAGSX += -modernize-use-auto, +#TIDY_FLAGSX += -cppcoreguidelines-pro-bounds-array-to-pointer-decay, +#TIDY_FLAGSX += -cppcoreguidelines-prefer-member-initializer, +#TIDY_FLAGSX += -modernize-use-transparent-functors, +TIDY_FLAGSX += -readability-function-cognitive-complexity, +TIDY_FLAGSX += -readability-uppercase-literal-suffix +TIDY_FLAGSX += -cert-err58-cpp + + +#TIDY_FLAGSX += -cppcoreguidelines-avoid-non-const-global-variables + +space := +space += +TIDY_FLAGS = -p $(OBJ) $(subst $(space),,$(TIDY_FLAGSX)) +TIDY_SOURCES = $(ALLSOURCES) + +#TIDY_SOURCES = $(SRC)/devices/nld_7442.cpp $(SRC)/devices/nld_7492.cpp + +#TIDY_FLAGS = -p $(OBJ) -checks=llvm-include-order,llvm-namespace-comment,modernize-use-override,modernize-use-using -fix #TIDY_FLAGS = -checks=llvm-include-order -fix #TIDY_FLAGS = -checks=llvm-namespace-comment -fix #TIDY_FLAGS = -checks=modernize-use-override -fix #TIDY_FLAGS = -checks=modernize-use-using -fix -ifeq ($(subst Windows_NT,windows,$(OS)),windows) +ifeq ($(subst Windows_NT,Windows,$(OS)),Windows) + HOSTARCH := Windows +else + HOSTARCH := $(shell uname -s) +endif + +ifeq ($(HOSTARCH),Windows) OBJ = obj/mingw +EXESUFFIX = .exe +DOXYGEN = doxygen.exe +CEXTRAFLAGS = -DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN +LDEXTRAFLAGS = -Wl,--subsystem,console -municode +LIBS = $(EXTRALIBS) +MD = @mkdir.exe +RM = @rm.exe +SHELL = sh.exe +else ifeq ($(HOSTARCH),Darwin) +OBJ = obj/darwin +EXESUFFIX := +DOXYGEN = @doxygen +LIBS = -lpthread -ldl $(EXTRALIBS) +MD = @mkdir +RM = @rm else OBJ = obj/nix +EXESUFFIX := +DOXYGEN = @./doxygen +LIBS = -lpthread -ldl $(EXTRALIBS) +MD = @mkdir +RM = @rm endif -#-fuse-ld=gold -Wpedantic -march=native -march=native +CSPELL=cspell +PYTHON=@python -# LTO = -flto=4 -fuse-linker-plugin -flto-partition=balanced -Wodr +TIDY_DB = $(OBJ)/compile_commands.json -CFLAGS = $(LTO) -g -O3 -std=c++11 -I$(CURDIR)/.. -I$(CURDIR)/../.. $(CEXTRAFLAGS) -LDFLAGS = $(LTO) -g -O3 -std=c++11 $(LDEXTRAFLAGS) -LIBS = -lpthread -ldl + +#LTO decreases performance :-( +#LTO = -flto=4 -fuse-linker-plugin -Wodr + +CCOREFLAGS = -g -O3 -std=c++17 -I$(SRC) + +CFLAGS = $(LTO) $(CCOREFLAGS) $(CEXTRAFLAGS) +LDFLAGS = $(LTO) -g -O3 -std=c++17 $(LDEXTRAFLAGS) CC = g++ -LD = @g++ -MD = @mkdir -RM = @rm -DOXYGEN = @doxygen -CLANG_TIDY = clang-tidy-9 +LD = g++ +CLANG_TIDY = clang-tidy-13 +DEPENDCC=$(CC) + + +ifndef FAST +FAST=1 +endif + +ifeq ($(FAST),1) +CFLAGS += -DNL_USE_ACADEMIC_SOLVERS=0 +endif -TARGETS = nltool nlwav +TARGETS = nltool$(EXESUFFIX) nlwav$(EXESUFFIX) NLOBJ = $(OBJ) POBJ = $(OBJ)/plib +TESTOBJ = $(OBJ)/tests + +DEPEND := $(OBJ)/.depend OBJDIRS = $(OBJ) \ $(OBJ)/analog \ $(OBJ)/solver \ $(OBJ)/devices \ $(OBJ)/plib \ - $(OBJ)/devices \ $(OBJ)/macro \ + $(OBJ)/macro/modules \ + $(OBJ)/tests \ $(OBJ)/tools \ $(OBJ)/prg \ - - -OBJS = $(POBJS) $(NLOBJS) - -POBJS := \ - $(POBJ)/pstring.o \ - $(POBJ)/pchrono.o \ - $(POBJ)/pdynlib.o \ - $(POBJ)/pexception.o \ - $(POBJ)/pfunction.o \ - $(POBJ)/pfmtlog.o \ - $(POBJ)/poptions.o \ - $(POBJ)/pparser.o \ - $(POBJ)/pstate.o \ - $(POBJ)/pstream.o \ - $(POBJ)/putil.o \ - -PMAIN := $(POBJ)/pmain.o - -NLOBJS := \ - $(NLOBJ)/nl_base.o \ - $(NLOBJ)/nl_parser.o \ - $(NLOBJ)/nl_setup.o \ - $(NLOBJ)/nl_factory.o \ - $(NLOBJ)/analog/nld_bjt.o \ - $(NLOBJ)/analog/nld_mosfet.o \ - $(NLOBJ)/analog/nlid_fourterm.o \ - $(NLOBJ)/analog/nld_switches.o \ - $(NLOBJ)/analog/nlid_twoterm.o \ - $(NLOBJ)/analog/nld_opamps.o \ - $(NLOBJ)/devices/nld_2102A.o \ - $(NLOBJ)/devices/nld_2716.o \ - $(NLOBJ)/devices/nld_tms4800.o \ - $(NLOBJ)/devices/nld_4020.o \ - $(NLOBJ)/devices/nld_4066.o \ - $(NLOBJ)/devices/nld_4316.o \ - $(NLOBJ)/devices/nld_7448.o \ - $(NLOBJ)/devices/nld_7450.o \ - $(NLOBJ)/devices/nld_7473.o \ - $(NLOBJ)/devices/nld_7474.o \ - $(NLOBJ)/devices/nld_7475.o \ - $(NLOBJ)/devices/nld_7483.o \ - $(NLOBJ)/devices/nld_7485.o \ - $(NLOBJ)/devices/nld_7490.o \ - $(NLOBJ)/devices/nld_7493.o \ - $(NLOBJ)/devices/nld_7497.o \ - $(NLOBJ)/devices/nld_74107.o \ - $(NLOBJ)/devices/nld_74123.o \ - $(NLOBJ)/devices/nld_74153.o \ - $(NLOBJ)/devices/nld_74161.o \ - $(NLOBJ)/devices/nld_74164.o \ - $(NLOBJ)/devices/nld_74165.o \ - $(NLOBJ)/devices/nld_74166.o \ - $(NLOBJ)/devices/nld_74174.o \ - $(NLOBJ)/devices/nld_74175.o \ - $(NLOBJ)/devices/nld_74192.o \ - $(NLOBJ)/devices/nld_74193.o \ - $(NLOBJ)/devices/nld_74194.o \ - $(NLOBJ)/devices/nld_74365.o \ - $(NLOBJ)/devices/nld_74ls629.o \ - $(NLOBJ)/devices/nld_82S16.o \ - $(NLOBJ)/devices/nld_82S115.o \ - $(NLOBJ)/devices/nld_82S123.o \ - $(NLOBJ)/devices/nld_82S126.o \ - $(NLOBJ)/devices/nld_9310.o \ - $(NLOBJ)/devices/nld_9316.o \ - $(NLOBJ)/devices/nld_9322.o \ - $(NLOBJ)/devices/nld_am2847.o \ - $(NLOBJ)/devices/nld_dm9314.o \ - $(NLOBJ)/devices/nld_dm9334.o \ - $(NLOBJ)/devices/nld_mm5837.o \ - $(NLOBJ)/devices/nld_ne555.o \ - $(NLOBJ)/devices/nld_r2r_dac.o \ - $(NLOBJ)/devices/nld_tristate.o \ - $(NLOBJ)/devices/nld_schmitt.o \ - $(NLOBJ)/devices/nld_legacy.o \ - $(NLOBJ)/devices/net_lib.o \ - $(NLOBJ)/devices/nld_log.o \ - $(NLOBJ)/devices/nlid_proxy.o \ - $(NLOBJ)/devices/nld_system.o \ - $(NLOBJ)/devices/nlid_truthtable.o \ - $(NLOBJ)/macro/nlm_base.o \ - $(NLOBJ)/macro/nlm_cd4xxx.o \ - $(NLOBJ)/macro/nlm_opamp.o \ - $(NLOBJ)/macro/nlm_other.o \ - $(NLOBJ)/macro/nlm_ttl74xx.o \ - $(NLOBJ)/solver/nld_solver.o \ - $(NLOBJ)/solver/nld_matrix_solver.o \ - $(NLOBJ)/tools/nl_convert.o \ - -VSBUILDS = \ - $(VSBUILD/netlistlib.vcxproj) \ - $(VSBUILD/netlistlib.vcxproj.user \ - $(VSBUILD/nltool.vcxproj \ - $(VSBUILD/netlistlib.vcxproj.filters \ - $(VSBUILD/nltool.vcxproj.filters \ - $(VSBUILD/netlist.sln \ + $(OBJ)/generated + +MODULESOURCES += $(wildcard $(SRC)/macro/modules/*.cpp) +DEVSOURCES = $(SRC)/solver/nld_solver.cpp +DEVSOURCES += $(wildcard $(SRC)/devices/*.cpp) +DEVSOURCES += $(wildcard $(SRC)/analog/*.cpp) +DEVSOURCES += $(wildcard $(SRC)/macro/*.cpp) +DEVSOURCES += $(MODULESOURCES) +DEVSOURCES += $(SRC)/generated/nlm_modules_lib.cpp + +TESTSOURCES = $(wildcard $(SRC)/tests/*.cpp) + +CORESOURCES := \ + $(SRC)/solver/nld_matrix_solver.cpp \ + $(SRC)/nl_base.cpp \ + $(SRC)/nl_parser.cpp \ + $(SRC)/nl_setup.cpp \ + $(SRC)/nl_factory.cpp \ + $(SRC)/tools/nl_convert.cpp \ + $(SRC)/generated/static_solvers.cpp + +MAINSOURCES = $(SRC)/prg/nltool.cpp $(SRC)/prg/nlwav.cpp + +HEADERS = $(wildcard $(SRC)/analog/*.h) +HEADERS += $(wildcard $(SRC)/core/*.h) +HEADERS += $(wildcard $(SRC)/devices/*.h) +HEADERS += $(wildcard $(SRC)/solver/*.h) +HEADERS += $(wildcard $(SRC)/tools/*.h) +HEADERS += $(wildcard $(SRC)/*.h) +HEADERS += $(wildcard $(SRC)/generated/*.h) + +PHEADERS = $(wildcard $(SRC)/plib/*.h) + +PSOURCES := \ + $(PSRC)/pstring.cpp \ + $(PSRC)/pdynlib.cpp \ + $(PSRC)/pexception.cpp \ + $(PSRC)/pfunction.cpp \ + $(PSRC)/pfmtlog.cpp \ + $(PSRC)/pmain.cpp \ + $(PSRC)/poptions.cpp \ + $(PSRC)/ppmf.cpp \ + $(PSRC)/ppreprocessor.cpp \ + $(PSRC)/ptokenizer.cpp \ + $(PSRC)/putil.cpp + +NLOBJS = $(patsubst $(SRC)%, $(OBJ)%, $(CORESOURCES:.cpp=.o)) +NLDEVOBJS = $(patsubst $(SRC)%, $(OBJ)%, $(DEVSOURCES:.cpp=.o)) +TESTOBJS = $(patsubst $(SRC)%, $(OBJ)%, $(TESTSOURCES:.cpp=.o)) +MAINOBJS = $(patsubst $(SRC)%, $(OBJ)%, $(MAINSOURCES:.cpp=.o)) +POBJS = $(patsubst $(SRC)%, $(OBJ)%, $(PSOURCES:.cpp=.o)) + +OBJS = $(TESTOBJS) $(POBJS) $(NLOBJS) $(NLDEVOBJS) $(TESTOBJS) + +VSFILES = \ + $(VSBUILD)/netlistlib.vcxproj \ + $(VSBUILD)/netlistlib.vcxproj.filters \ + $(VSBUILD)/nltool.vcxproj \ + $(VSBUILD)/nltool.vcxproj.filters \ + $(VSBUILD)/nlwav.vcxproj \ + $(VSBUILD)/nlwav.vcxproj.filters \ + $(VSBUILD)/netlist.sln + +OTHERFILES = makefile DOCS = \ doxygen.conf \ @@ -174,134 +222,222 @@ DOCS = \ $(DOC)/mainpage.dox.h \ $(DOC)/primer_1.dox.h \ $(DOC)/structure.dox.h \ - $(DOC)/test1-50r.svg \ + $(DOC)/test1-50r.svg -ALL_OBJS = $(OBJS) $(PMAIN) $(NLOBJ)/prg/nltool.o $(NLOBJ)/prg/nlwav.o +ALL_OBJS = $(OBJS) $(MAINOBJS) ALL_TIDY_FILES = $(ALL_OBJS:.o=.json) -SOURCES = $(patsubst $(OBJ)%, $(SRC)%, $(ALL_OBJS:.o=.cpp)) -ALLFILES = $(SOURCES) $(VSBUILDS) $(DOCS) +ALLSOURCES = $(DEVSOURCES) $(CORESOURCES) $(TESTSOURCES) $(MAINSOURCES) $(PSOURCES) +ALLHEADERS = $(HEADERS) $(PHEADERS) +ALLFILES = $(ALLSOURCES) $(VSFILES) $(DOCS) $(OTHERFILES) -MAKEFILE_TARGETS_WITHOUT_INCLUDE := clean doc clang mingw nvcc +MAKEFILE_TARGETS_WITHOUT_INCLUDE := \ + clang clang-5 clang-libc gcc9 mingw native nvcc \ + clean depend doc generated manpages maketree \ + runtests tidy fix_permissions precommit srcclean +BUILD_DIRS = $(OBJDIRS) man html # git archive HEAD --prefix=project-name-version/ \ # --format=zip -o project-name-version.zip #------------------------------------------------- +# PHONY +#------------------------------------------------- + +.PHONY: $(MAKEFILE_TARGETS_WITHOUT_INCLUDE) + +#------------------------------------------------- # all #------------------------------------------------- -all: maketree depend $(TARGETS) +all: maketree $(DEPEND) $(TARGETS) #------------------------------------------------- # clean #------------------------------------------------- clean: - $(RM) -rf $(OBJS) $(TARGETS) $(OBJ)/prg/nltool.o $(OBJ)/prg/nlwav.o .depend doxy/* + $(RM) -rf $(OBJS) $(TARGETS) $(MAINOBJS) $(DEPEND) doxy/* #------------------------------------------------- # nltool #------------------------------------------------- -nltool: $(OBJ)/prg/nltool.o $(PMAIN) $(OBJS) +nltool$(EXESUFFIX): $(OBJ)/prg/nltool.o $(OBJS) @echo Linking $@... - $(LD) -o $@ $(LDFLAGS) $^ $(LIBS) + @$(LD) -o $@ $(LDFLAGS) $^ $(LIBS) -nlwav: $(OBJ)/prg/nlwav.o $(PMAIN) $(OBJS) +nlwav$(EXESUFFIX): $(OBJ)/prg/nlwav.o $(OBJS) @echo Linking $@... - $(LD) -o $@ $(LDFLAGS) $^ $(LIBS) + @$(LD) -o $@ $(LDFLAGS) $^ $(LIBS) #------------------------------------------------- # directories #------------------------------------------------- -$(sort $(OBJDIRS)): +$(sort $(BUILD_DIRS)): $(MD) -p $@ -maketree: $(sort $(OBJDIRS)) +maketree: $(sort $(BUILD_DIRS)) #------------------------------------------------- # Special targets #------------------------------------------------- -.PHONY: clang clang-5 mingw doc native - -native: - $(MAKE) CEXTRAFLAGS="-march=native -msse4.2 -Wall -Wpedantic -Wsign-compare -Wextra " +native: + $(MAKE) CEXTRAFLAGS="-march=native -msse4.2 -Wall -Wpedantic -Wsign-compare -Wextra" -gcc9: - $(MAKE) CC=g++-9 LD=g++-9 CEXTRAFLAGS="-march=native -msse4.2 -Wall -Wpedantic -Wsign-compare -Wextra " +gcc9: + $(MAKE) CC=g++-9 LD=g++-9 CEXTRAFLAGS="-march=native -Wall -Wextra -pedantic -Wpedantic -pedantic-errors -fext-numeric-literals -Wsign-compare" EXTRALIBS="-lquadmath" OBJ=obj/gcc9 clang: - $(MAKE) CC=clang++-10 LD=clang++-10 CEXTRAFLAGS="-march=native -Weverything -Werror -Wno-padded -Wno-weak-vtables -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors" - -clang-5: - $(MAKE) CC=clang++-5.0 LD=clang++-5.0 CEXTRAFLAGS="-march=native -Weverything -Werror -Wno-inconsistent-missing-destructor-override -Wno-unreachable-code -Wno-padded -Wno-weak-vtables -Wno-missing-variable-declarations -Wconversion -Wno-c++98-compat -Wno-float-equal -Wno-global-constructors -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-weak-template-vtables -Wno-exit-time-destructors" + #$(MAKE) CC=clang++-11 LD=clang++-11 OBJ=obj/clang CEXTRAFLAGS="-march=native -msse4.2 -Weverything -Wall -pedantic -Wpedantic -Wunused-private-field -Wno-padded -Wno-unused-template -Wno-missing-variable-declarations -Wno-float-equal -Wconversion -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wno-format-nonliteral -Wno-exit-time-destructors" + $(MAKE) CC=clang++-13 LD=clang++-13 OBJ=obj/clang CEXTRAFLAGS="-march=native \ + -mllvm -inline-threshold=2000 \ + -Wunknown-warning-option \ + -Weverything -Wall -pedantic -Wpedantic \ + -Werror -Wno-padded -Wno-weak-vtables -Wno-weak-template-vtables -Wunused-template \ + -Wno-float-equal \ + -Wno-c++98-compat -Wno-c++98-compat-pedantic \ + -Wno-exit-time-destructors \ + -Wno-undefined-reinterpret-cast -Wno-error=unused-macros \ + -Wno-error=deprecated" + +clang-libc: + #clang-11 currently broken + #$(MAKE) CC=clang++-11 LD=clang++-11 OBJ=obj/clang CEXTRAFLAGS="-march=native + $(MAKE) CC=clang++-13 LD=clang++-13 OBJ=obj/clang-libc CEXTRAFLAGS="-march=native \ + -stdlib=libc++ -mllvm -inline-threshold=2000 \ + -Wunknown-warning-option \ + -Weverything -Wall -pedantic -Wpedantic -Wunused-private-field \ + -Werror -Wno-padded -Wno-weak-vtables -Wno-weak-template-vtables -Wunused-template \ + -Wmissing-variable-declarations -Wno-float-equal -Wconversion \ + -Wno-c++98-compat -Wno-c++98-compat-pedantic -Wformat-nonliteral \ + -Wno-exit-time-destructors -Winconsistent-missing-destructor-override \ + -Wno-undefined-reinterpret-cast \ + -Wunreachable-code \ + -Wmissing-prototypes" \ + LDEXTRAFLAGS=-stdlib=libc++ nvcc: - $(MAKE) CC=/usr/local/cuda-9.0/bin/nvcc LD=/usr/local/cuda-9.2/bin/nvcc \ - CEXTRAFLAGS="-x cu -DNVCCBUILD=1 --expt-extended-lambda --expt-relaxed-constexpr --default-stream per-thread --restrict" + $(MAKE) CC=/usr/local/cuda-11.3/bin/nvcc LD=/usr/local/cuda-11.3/bin/nvcc \ + OBJ=obj/nvcc CEXTRAFLAGS="--std c++17 -x cu --expt-extended-lambda \ + --expt-relaxed-constexpr --default-stream per-thread --restrict \ + --ftemplate-depth 1024 \ + -Xcompiler -O6 -Xcompiler -march=native -ccbin g++-9 " \ + DEPENDCC=g++ -tidy_db: compile_commands_prefix $(ALL_TIDY_FILES) compile_commands_postfix +mingw: + $(MAKE) CEXTRAFLAGS="-DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 \ + -DWIN32_LEAN_AND_MEAN" LDEXTRAFLAGS="-Wl,--subsystem,console \ + -municode" LIBS= MD=@mkdir.exe SHELL=sh.exe DOXYGEN=doxygen.exe $(PARAMS) + +mingw-cross: + ${MAKE} CC="x86_64-w64-mingw32-g++-posix" LD="x86_64-w64-mingw32-g++-posix" \ + CEXTRAFLAGS="-DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN" \ + LDEXTRAFLAGS="-Wl,--subsystem,console -municode" OBJ=obj/mingw-cross \ + EXESUFFIX=.exe LIBS= # -# -Wno-c++11-narrowing : seems a bit broken -# Mostly done: -Wno-weak-vtables -Wno-cast-align -# FIXME: -Wno-weak-vtables -Wno-missing-variable-declarations -Wno-conversion -Wno-exit-time-destructors -# FIXME: -Winconsistent-missing-destructor-override : c++ community has diverging opinions on this https://github.com/isocpp/CppCoreGuidelines/issues/721 -# FIXME: -Wunreachable-code : False warnings, this a documented clang bug: https://llvm.org/bugs/show_bug.cgi?id=28994 -# -Wweak-template-vtables +# run with emrun --browser chrome nltool.html -c run -t 10 -n kidniki nl_kidniki.cpp # -# These have to be given: -# -Wno-missing-variable-declarations : Device factory code, on purpose +emsdk: + emmake $(MAKE) CC=emcc LD=emcc CEXTRAFLAGS="-fexceptions -msimd128" LDEXTRAFLAGS="-s ALLOW_MEMORY_GROWTH=0 -s TOTAL_MEMORY=268435456 -fexceptions -msimd128 --emrun --embed-file ../../../mame/machine/nl_pongf.cpp@nl_pongf.cpp --embed-file ../../../mame/audio/nl_kidniki.cpp@nl_kidniki.cpp" OBJ=obj/emsdk EXESUFFIX=.html + # LDFLAGS -s ASSERTIONS=1 -mingw: - $(MAKE) CEXTRAFLAGS="-DUNICODE -D_UNICODE -D_WIN32_WINNT=0x0501 -DWIN32_LEAN_AND_MEAN" \ - LDEXTRAFLAGS="-Wl,--subsystem,console -municode" LIBS= MD=@mkdir.exe SHELL=sh.exe -# -# FIXME: Unicode -# CEXTRAFLAGS = -DUNICODE -D_UNICODE -municode -# LDEXTRAFLAGS = -municode -# +#------------------------------------------------- +# regression tests +#------------------------------------------------- + +runtests: $(TARGETS) + ./nltool$(EXESUFFIX) -c tests +#------------------------------------------------- +# man pages +#------------------------------------------------- + +manpages: maketree $(TARGETS) man/nltool.1 man/nlwav.1 html/nltool.html html/nlwav.html + +#------------------------------------------------- +# documentation +#------------------------------------------------- -doc: nltool - ./nltool -c docheader > ../documentation/devsyn.dox.h +doc: + ./nltool$(EXESUFFIX) -c docheader > ../documentation/devsyn.dox.h $(DOXYGEN) doxygen.conf +cspell: + #cd .. && cspell -c build/cspell.json --no-color --locale en-GB --relative $(patsubst $(SRC)/%, %, $(ALLHEADERS) ) | sed -e "s/ - Unknown/: error: Unknown/g" + cd .. && $(CSPELL) -c build/cspell.json --no-color --locale en-GB --relative $(patsubst $(SRC)/%, %, $(ALLHEADERS) $(ALLSOURCES)) | sed -e "s/ - Unknown/: error: Unknown/g" + #------------------------------------------------- # depends #------------------------------------------------- -.depend: $(SOURCES) - @echo creating .depend - @rm -f ./.depend - @for i in $(SOURCES); do \ - $(CC) $(CFLAGS) -MM $$i -MT `echo $$i | sed -e 's+$(SRC)+$(OBJ)+' -e 's+.cpp+.o+' ` >> ./.depend; \ - done +.PHONY: depend +depend: $(DEPEND) -depend: .depend +$(DEPEND): $(ALLSOURCES) | $(OBJ) + @echo creating $(DEPEND) + @$(RM) -f $(DEPEND) + @for i in $(ALLSOURCES); do \ + $(DEPENDCC) $(CCOREFLAGS) -MM $$i -MT `echo $$i \ + | sed -e 's+$(SRC)+$(OBJ)+' -e 's+.cpp+.o+' ` \ + | sed -e 's_\.\./[a-z]*/\.\./_../_g' >> $(DEPEND); \ + done # Include only if the goal needs it ifeq ($(filter $(MAKECMDGOALS),$(MAKEFILE_TARGETS_WITHOUT_INCLUDE)),) --include .depend +-include $(DEPEND) endif #------------------------------------------------- +# generated +#------------------------------------------------- + +$(SRC)/generated/lib_entries.hxx: create_lib_entries.py $(DEVSOURCES) + @echo creating $@ + $(PYTHON) create_lib_entries.py $^ > $@ + +$(SRC)/generated/nld_devinc.h: create_devinc.py $(DEVSOURCES) + @echo creating $@ + $(PYTHON) create_devinc.py $^ > $@ + +$(SRC)/generated/nlm_modules_lib.cpp: create_modules.py $(MODULESOURCES) + @echo creating $@ + $(PYTHON) create_modules.py $^ > $@ + +.PHONY: generated +generated: $(SRC)/generated/lib_entries.hxx $(SRC)/generated/nld_devinc.h $(SRC)/generated/nlm_modules_lib.cpp + +#------------------------------------------------- +# fix permissions, source management +#------------------------------------------------- + +fix_permissions: + @find .. -executable -and -not -type d -print | grep -v /build | xargs -r chmod a-x + @chmod a-x $(ALLFILES) + @find .. -print | xargs setfacl -b + +srcclean: $(ALLSOURCES) $(ALLHEADERS) + @../../../../srcclean -u $(ALLSOURCES) $(ALLHEADERS) + +precommit: fix_permissions srcclean all runtests + +#------------------------------------------------- # clang tidy #------------------------------------------------- + +tidy_db: compile_commands_prefix $(ALL_TIDY_FILES) compile_commands_postfix + tidy: tidy_db @echo running tidy - @for i in $(SOURCES); do \ + @for i in $(TIDY_SOURCES); do \ $(CLANG_TIDY) $$i $(TIDY_FLAGS) -header-filter=.*; \ done -tidy_db: compile_commands_prefix $(ALL_TIDY_FILES) compile_commands_postfix - - #------------------------------------------------- # generic rules #------------------------------------------------- @@ -330,6 +466,14 @@ $(OBJ)/%.json: $(SRC)/%.cpp @echo \"file\": \"$(CURDIR)/$<\" } >> $(TIDY_DB) @echo "," >> $(TIDY_DB) +man/%.1: %$(EXESUFFIX) + @echo Building $@... + @help2man --include=$*.help2man --no-info ./$< > $@ + +html/%.html: man/%.1 + @echo Building $@... + @groff -mandoc -Thtml $< > $@ + compile_commands_prefix: @echo "[" > $(TIDY_DB) diff --git a/src/lib/netlist/build/man/nltool.1 b/src/lib/netlist/build/man/nltool.1 new file mode 100644 index 00000000000..ac1e7006794 --- /dev/null +++ b/src/lib/netlist/build/man/nltool.1 @@ -0,0 +1,176 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH NLTOOL "1" "May 2022" "nltool (netlist) 0.14" "User Commands" +.SH NAME +nltool \- manual page for nltool (netlist) 0.14 +.SH SYNOPSIS +.B nltool +[\fI\,option\/\fR]... [\fI\,files\/\fR]... +.SH DESCRIPTION +nltool serves as the Swiss Army knife to run, test and convert netlists. +.PP +Commands may accept one or more files depending on the functionality. +If no file is provided, standard input is used. +.SH OPTIONS +.SS "General options:" +.IP +The following options apply to all commands. +.HP +\fB\-c\fR, \fB\-\-cmd\fR=\fI\,run\/\fR|validate|convert|listdevices|listmodels|static|header|docheader|tests +.IP +run|validate|convert|listdevices|listmodels|static|header|docheader|tests +.TP +\fB\-I\fR, \fB\-\-include\fR=\fI\,Value\/\fR +Add the directory to the list of directories to be +searched for header files. This option may be +specified repeatedly. +.TP +\fB\-D\fR, \fB\-\-define\fR=\fI\,Value\/\fR +predefine value as macro, e.g. \fB\-Dname\fR=\fI\,value\/\fR. If +\&'=value' is omitted predefine it as 1. This option +may be specified repeatedly. +.TP +\fB\-r\fR, \fB\-\-rom\fR=\fI\,Value\/\fR +where to look for data files +.TP +\fB\-v\fR, \fB\-\-verbose\fR +be verbose \- this produces lots of output +.TP +\fB\-q\fR, \fB\-\-quiet\fR +be quiet \- no warnings +.TP +\fB\-\-prepro\fR +output preprocessor output to stderr +.TP +\fB\-\-progress\fR +show progress bar on longer operations +.TP +\fB\-\-version\fR +display version and exit +.TP +\fB\-h\fR, \fB\-\-help\fR +display help and exit +.SS "Options for run and static commands:" +.IP +These options apply to run and static commands. +.TP +\fB\-n\fR, \fB\-\-name\fR=\fI\,Value\/\fR +the netlist in file specified by \fB\-f\fR option to run; +default is first one +.SS "Options for static command:" +.IP +These options apply to static command. +.TP +\fB\-d\fR, \fB\-\-dir\fR=\fI\,Value\/\fR +output directory for the generated files. +.TP +\fB\-o\fR, \fB\-\-output\fR=\fI\,Value\/\fR +single output file for the generated code. +Either \fB\-\-dir\fR or \fB\-\-output\fR can be specificied +.TP +\fB\-\-static_include\fR +write static solvers to individual files included by +file specified with \fB\-\-output\fR. \fB\-\-dir\fR must be path to +"generated/static" path in netlist folder. +.SS "Options for run command:" +.IP +These options are only used by the run command. +.TP +\fB\-t\fR, \fB\-\-time_to_run\fR=\fI\,Value\/\fR +time to run the emulation (seconds) +.TP +\fB\-\-boost_lib\fR=\fI\,Value\/\fR +generic: will use generic solvers. +builtin: Use optimized solvers compiled in. +somelib.so: Use library with precompiled solvers. +.TP +\fB\-s\fR, \fB\-\-statistics\fR +gather runtime statistics +.TP +\fB\-l\fR, \fB\-\-log\fR=\fI\,Value\/\fR +define terminal to log. This option may be specified +repeatedly. +.TP +\fB\-i\fR, \fB\-\-input\fR=\fI\,Value\/\fR +input file to process (default is none) +.TP +\fB\-\-loadstate\fR=\fI\,Value\/\fR +load state from file and continue from there +.TP +\fB\-\-savestate\fR=\fI\,Value\/\fR +save state to file at end of run +.TP +\fB\-\-fperr\fR +raise exception on floating point errors. This is +intended to be used during debugging. +.SS "Options for convert command:" +.IP +These options are only used by the convert command. +.TP +\fB\-y\fR, \fB\-\-type\fR=\fI\,spice\/\fR|eagle|rinf +type of file to be converted: spice,eagle,rinf +.SS "Options for validate command:" +.IP +These options are only used by the validate command. +.SS "Options for header command:" +.IP +These options are only used by the header command. +.TP +\fB\-\-tab\-width\fR=\fI\,Value\/\fR +Tab width for output. +.TP +\fB\-\-line\-width\fR=\fI\,Value\/\fR +Line width for output. +.TP +\fB\-\-pattern\fR=\fI\,Value\/\fR +Pattern to match against device names. If the device +name contains pattern, the device will be included +in the output. Multiple patterns can be specified, +if none is given, all devices will be output. +.SH EXAMPLES +nltool \-c run \-t 3.5 \-n cap_delay nl_examples/cdelay.c +.IP +Run netlist "cap_delay" from file nl_examples/cdelay.c for 3.5 +seconds +.PP +nltool \-\-cmd=listdevices +.IP +List all known devices. +.PP +nltool \-\-cmd=header \-\-tab\-width=8 \-\-line\-width=80 +.IP +Create the header file needed for including netlists as code. +.PP +nltool \-\-cmd static \-\-output +.IP +src/lib/netlist/generated/static_solvers.cpp +src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp +.IP +Create static solvers for the MAME project using one single source +file. +.PP +nltool \-\-cmd static \-\-output +.IP +src/lib/netlist/generated/static_solvers.cpp \-\-dir +src/lib/netlist/generated/static \-\-static_include +src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp +.IP +Create static solvers for the MAME project using a single source +file which includes generated solvers written to \-\-dir folder. +.PP +nltool \-\-cmd tests +.IP +Run unit tests. In case the unit tests are not linked in, this will +do nothing. +.SH AUTHOR +Written by Couriersud. +.SH COPYRIGHT +Copyright \(co 2021 Couriersud +License BSD\-3\-Clause +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +More documentation for the +.B nltool +program is available in doxygen format. + diff --git a/src/lib/netlist/build/man/nlwav.1 b/src/lib/netlist/build/man/nlwav.1 new file mode 100644 index 00000000000..11c63423809 --- /dev/null +++ b/src/lib/netlist/build/man/nlwav.1 @@ -0,0 +1,116 @@ +.\" DO NOT MODIFY THIS FILE! It was generated by help2man 1.47.3. +.TH NLWAV "1" "May 2022" "nlwav (netlist) 0.1" "User Commands" +.SH NAME +nlwav \- manual page for nlwav (netlist) 0.1 +.SH SYNOPSIS +.B nlwav +[\fI\,OPTION\/\fR] ... [\fI\,FILE\/\fR] ... +.SH DESCRIPTION +Convert netlist log files into wav files. +.SH OPTIONS +.TP +\fB\-f\fR, \fB\-\-format\fR=\fI\,wav16s\/\fR|wav32s|wav32f|vcda|vcdd|tab +output format. Available options are +wav16s|wav32s|wav32f|vcda|vcdd|tab. +.TP +wav16s +: multichannel wav output 16 bit signed +.TP +wav32s +: multichannel wav output 32 bit signed +.TP +wav32f +: multichannel wav output 32 bit float +.TP +vcda : analog VCD output +vcdd : digital VCD output +tab : sampled output +Digital signals are created using the \fB\-\-high\fR and +.IP +\fB\-\-low\fR options +.TP +\fB\-o\fR, \fB\-\-output\fR=\fI\,Value\/\fR +output file +.SS "wav options:" +.IP +These options apply to wav output only +.TP +\fB\-r\fR, \fB\-\-rate\fR=\fI\,Value\/\fR +sample rate of output file +.TP +\fB\-a\fR, \fB\-\-amp\fR=\fI\,Value\/\fR +amplification after mean correction +.TP +\fB\-\-lowpass\fR=\fI\,Value\/\fR +lowpass filter frequency. +Default 20000 Hz. +.TP +\fB\-\-highpass\fR=\fI\,Value\/\fR +highpass filter frequency. +Default is 20 Hz. +.TP +\fB\-\-hpboost\fR +enable highpass boost to filter out initial click. +.SS "vcdd options:" +.IP +These options apply to vcdd output only +.TP +\fB\-u\fR, \fB\-\-high\fR=\fI\,Value\/\fR +minimum input for high level +.TP +\fB\-l\fR, \fB\-\-low\fR=\fI\,Value\/\fR +maximum input for low level +.SS "tab options:" +.IP +These options apply to sampled output only +.TP +\fB\-s\fR, \fB\-\-start\fR=\fI\,Value\/\fR +time when sampling starts +.TP +\fB\-i\fR, \fB\-\-increment\fR=\fI\,Value\/\fR +time between samples +.TP +\fB\-n\fR, \fB\-\-samples\fR=\fI\,Value\/\fR +number of samples +.SS "General options:" +.IP +These options always apply +.TP +\fB\-v\fR, \fB\-\-verbose\fR +be verbose \- this produces lots of output +.TP +\fB\-q\fR, \fB\-\-quiet\fR +be quiet \- no warnings +.TP +\fB\-\-version\fR +display version and exit +.TP +\fB\-h\fR, \fB\-\-help\fR +display help and exit +.SH EXAMPLES +\&./nlwav \-f vcdd \-o x.vcd log_V* +.IP +convert all files starting with "log_V" into a digital vcd file +.PP +\&./nlwav \-f wav16s \-o x.wav log_V* +.IP +convert all files starting with "log_V" into a multichannel wav file +(16bit, signed) +.PP +\&./nlwav \-f tab \-o x.tab \-s 0.0000005 \-i 0.000001 \-n 256 log_BLUE.log +.IP +convert file log_BLUE.log to sampled output. First sample at 500ns +followed by 255 samples every micro\-second. +.SH AUTHOR +Written by Couriersud. +.SH COPYRIGHT +Copyright \(co 2021 Couriersud +License BSD\-3\-Clause +.br +This is free software: you are free to change and redistribute it. +There is NO WARRANTY, to the extent permitted by law. +.SH "SEE ALSO" +More documentation for the +.B nlwav +program is available in doxygen format. + diff --git a/src/lib/netlist/build/nltool.help2man b/src/lib/netlist/build/nltool.help2man new file mode 100644 index 00000000000..76b0f15b8d0 --- /dev/null +++ b/src/lib/netlist/build/nltool.help2man @@ -0,0 +1,5 @@ +[see also] +More documentation for the +.B nltool +program is available in doxygen format. + diff --git a/src/lib/netlist/build/nlwav.help2man b/src/lib/netlist/build/nlwav.help2man new file mode 100644 index 00000000000..9d1c78b5139 --- /dev/null +++ b/src/lib/netlist/build/nlwav.help2man @@ -0,0 +1,5 @@ +[see also] +More documentation for the +.B nlwav +program is available in doxygen format. + diff --git a/src/lib/netlist/buildVS/netlist.sln b/src/lib/netlist/buildVS/netlist.sln index a06f407d3c2..ff0207d81a4 100755..100644 --- a/src/lib/netlist/buildVS/netlist.sln +++ b/src/lib/netlist/buildVS/netlist.sln @@ -1,20 +1,28 @@ Microsoft Visual Studio Solution File, Format Version 12.00 -# Visual Studio 14 -VisualStudioVersion = 14.0.25420.1 +# Visual Studio Version 16 +VisualStudioVersion = 16.0.30011.22 MinimumVisualStudioVersion = 10.0.40219.1 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "netlistlib", "netlistlib.vcxproj", "{A374399B-B87F-4E0F-9525-6C099600705F}" EndProject Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nltool", "nltool.vcxproj", "{9204EC28-A29B-4A36-9E47-2C46041D67D3}" EndProject +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "nlwav", "nlwav.vcxproj", "{48D0ADAF-62EC-472E-A51B-8D837280649D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution + CLRelease|x64 = CLRelease|x64 + CLRelease|x86 = CLRelease|x86 Debug|x64 = Debug|x64 Debug|x86 = Debug|x86 Release|x64 = Release|x64 Release|x86 = Release|x86 EndGlobalSection GlobalSection(ProjectConfigurationPlatforms) = postSolution + {A374399B-B87F-4E0F-9525-6C099600705F}.CLRelease|x64.ActiveCfg = CLRelease|x64 + {A374399B-B87F-4E0F-9525-6C099600705F}.CLRelease|x64.Build.0 = CLRelease|x64 + {A374399B-B87F-4E0F-9525-6C099600705F}.CLRelease|x86.ActiveCfg = CLRelease|Win32 + {A374399B-B87F-4E0F-9525-6C099600705F}.CLRelease|x86.Build.0 = CLRelease|Win32 {A374399B-B87F-4E0F-9525-6C099600705F}.Debug|x64.ActiveCfg = Debug|x64 {A374399B-B87F-4E0F-9525-6C099600705F}.Debug|x64.Build.0 = Debug|x64 {A374399B-B87F-4E0F-9525-6C099600705F}.Debug|x86.ActiveCfg = Debug|Win32 @@ -23,6 +31,10 @@ Global {A374399B-B87F-4E0F-9525-6C099600705F}.Release|x64.Build.0 = Release|x64 {A374399B-B87F-4E0F-9525-6C099600705F}.Release|x86.ActiveCfg = Release|Win32 {A374399B-B87F-4E0F-9525-6C099600705F}.Release|x86.Build.0 = Release|Win32 + {9204EC28-A29B-4A36-9E47-2C46041D67D3}.CLRelease|x64.ActiveCfg = CLRelease|x64 + {9204EC28-A29B-4A36-9E47-2C46041D67D3}.CLRelease|x64.Build.0 = CLRelease|x64 + {9204EC28-A29B-4A36-9E47-2C46041D67D3}.CLRelease|x86.ActiveCfg = CLRelease|Win32 + {9204EC28-A29B-4A36-9E47-2C46041D67D3}.CLRelease|x86.Build.0 = CLRelease|Win32 {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Debug|x64.ActiveCfg = Debug|x64 {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Debug|x64.Build.0 = Debug|x64 {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Debug|x86.ActiveCfg = Debug|Win32 @@ -31,8 +43,23 @@ Global {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Release|x64.Build.0 = Release|x64 {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Release|x86.ActiveCfg = Release|Win32 {9204EC28-A29B-4A36-9E47-2C46041D67D3}.Release|x86.Build.0 = Release|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.CLRelease|x64.ActiveCfg = CLRelease|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.CLRelease|x64.Build.0 = CLRelease|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.CLRelease|x86.ActiveCfg = CLRelease|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.CLRelease|x86.Build.0 = CLRelease|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x64.ActiveCfg = Debug|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x64.Build.0 = Debug|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x86.ActiveCfg = Debug|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Debug|x86.Build.0 = Debug|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x64.ActiveCfg = Release|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x64.Build.0 = Release|x64 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x86.ActiveCfg = Release|Win32 + {48D0ADAF-62EC-472E-A51B-8D837280649D}.Release|x86.Build.0 = Release|Win32 EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {992701A0-B9F5-4F7D-BF3F-5B0EBEA51F04} + EndGlobalSection EndGlobal diff --git a/src/lib/netlist/buildVS/netlistlib.vcxproj b/src/lib/netlist/buildVS/netlistlib.vcxproj index 4a36bdc3496..47338e4c6c6 100755..100644 --- a/src/lib/netlist/buildVS/netlistlib.vcxproj +++ b/src/lib/netlist/buildVS/netlistlib.vcxproj @@ -1,6 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="CLRelease|Win32"> + <Configuration>CLRelease</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="CLRelease|x64"> + <Configuration>CLRelease</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> @@ -21,28 +29,38 @@ <PropertyGroup Label="Globals"> <ProjectGuid>{A374399B-B87F-4E0F-9525-6C099600705F}</ProjectGuid> <Keyword>Win32Proj</Keyword> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>StaticLibrary</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'" Label="Configuration"> + <ConfigurationType>StaticLibrary</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>ClangCL</PlatformToolset> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <ImportGroup Label="ExtensionSettings"> @@ -55,12 +73,18 @@ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <LinkIncremental>true</LinkIncremental> @@ -68,6 +92,9 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>true</LinkIncremental> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> <PreprocessorDefinitions>WIN32;_DEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> @@ -98,27 +125,77 @@ <OptimizeReferences>true</OptimizeReferences> </Link> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'"> + <ClCompile> + <PreprocessorDefinitions>WIN32;NDEBUG;_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> + <WarningLevel>Level3</WarningLevel> + <DebugInformationFormat>ProgramDatabase</DebugInformationFormat> + <AdditionalIncludeDirectories>..\..\</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <TargetMachine>MachineX86</TargetMachine> + <GenerateDebugInformation>true</GenerateDebugInformation> + <SubSystem>Windows</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + </Link> + </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..;$(SolutionDir)..\..</AdditionalIncludeDirectories> <Optimization>Full</Optimization> <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <AdditionalOptions>/bigobj</AdditionalOptions> + <LanguageStandard>stdcpp17</LanguageStandard> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'"> + <ClCompile> + <AdditionalIncludeDirectories>$(SolutionDir)..;$(SolutionDir)..\..</AdditionalIncludeDirectories> + <Optimization>Full</Optimization> + <FavorSizeOrSpeed>Speed</FavorSizeOrSpeed> + <AdditionalOptions>/bigobj</AdditionalOptions> + <LanguageStandard>stdcpp17</LanguageStandard> + </ClCompile> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <LanguageStandard>stdcpp17</LanguageStandard> </ClCompile> </ItemDefinitionGroup> <ItemGroup> <ClCompile Include="..\analog\nld_bjt.cpp" /> + <ClCompile Include="..\analog\nld_mosfet.cpp" /> <ClCompile Include="..\analog\nld_opamps.cpp" /> <ClCompile Include="..\analog\nld_switches.cpp" /> <ClCompile Include="..\analog\nlid_fourterm.cpp" /> <ClCompile Include="..\analog\nlid_twoterm.cpp" /> <ClCompile Include="..\devices\net_lib.cpp" /> - <ClCompile Include="..\devices\nld_2102A.cpp" /> - <ClCompile Include="..\devices\nld_2716.cpp" /> + <ClCompile Include="..\devices\nld_2102a.cpp" /> + <ClCompile Include="..\devices\nld_4006.cpp" /> + <ClCompile Include="..\devices\nld_4017.cpp" /> + <ClCompile Include="..\devices\nld_4029.cpp" /> + <ClCompile Include="..\devices\nld_4042.cpp" /> + <ClCompile Include="..\devices\nld_4053.cpp" /> + <ClCompile Include="..\devices\nld_4076.cpp" /> + <ClCompile Include="..\devices\nld_74125.cpp" /> + <ClCompile Include="..\devices\nld_74163.cpp" /> + <ClCompile Include="..\devices\nld_74377.cpp" /> + <ClCompile Include="..\devices\nld_74393.cpp" /> + <ClCompile Include="..\devices\nld_7492.cpp" /> + <ClCompile Include="..\devices\nld_7497.cpp" /> + <ClCompile Include="..\devices\nld_8277.cpp" /> + <ClCompile Include="..\devices\nld_9321.cpp" /> + <ClCompile Include="..\devices\nld_roms.cpp" /> + <ClCompile Include="..\devices\nld_schmitt.cpp" /> <ClCompile Include="..\devices\nld_tms4800.cpp" /> + <ClCompile Include="..\devices\nld_4013.cpp" /> <ClCompile Include="..\devices\nld_4020.cpp" /> <ClCompile Include="..\devices\nld_4066.cpp" /> <ClCompile Include="..\devices\nld_4316.cpp" /> <ClCompile Include="..\devices\nld_74107.cpp" /> + <ClCompile Include="..\devices\nld_74113.cpp" /> <ClCompile Include="..\devices\nld_74123.cpp" /> <ClCompile Include="..\devices\nld_74153.cpp" /> <ClCompile Include="..\devices\nld_74161.cpp" /> @@ -141,10 +218,8 @@ <ClCompile Include="..\devices\nld_7490.cpp" /> <ClCompile Include="..\devices\nld_7493.cpp" /> <ClCompile Include="..\devices\nld_74ls629.cpp" /> - <ClCompile Include="..\devices\nld_82S115.cpp" /> - <ClCompile Include="..\devices\nld_82S123.cpp" /> - <ClCompile Include="..\devices\nld_82S126.cpp" /> - <ClCompile Include="..\devices\nld_82S16.cpp" /> + <ClCompile Include="..\devices\nld_82s115.cpp" /> + <ClCompile Include="..\devices\nld_82s16.cpp" /> <ClCompile Include="..\devices\nld_9310.cpp" /> <ClCompile Include="..\devices\nld_9316.cpp" /> <ClCompile Include="..\devices\nld_9322.cpp" /> @@ -160,27 +235,31 @@ <ClCompile Include="..\devices\nld_tristate.cpp" /> <ClCompile Include="..\devices\nlid_proxy.cpp" /> <ClCompile Include="..\devices\nlid_truthtable.cpp" /> - <ClCompile Include="..\macro\nlm_base.cpp" /> - <ClCompile Include="..\macro\nlm_cd4xxx.cpp" /> - <ClCompile Include="..\macro\nlm_opamp.cpp" /> - <ClCompile Include="..\macro\nlm_other.cpp" /> - <ClCompile Include="..\macro\nlm_ttl74xx.cpp" /> + <ClCompile Include="..\generated\nlm_modules_lib.cpp" /> + <ClCompile Include="..\generated\static_solvers.cpp" /> + <ClCompile Include="..\macro\modules\nlmod_icl8038_dip.cpp" /> + <ClCompile Include="..\macro\modules\nlmod_ne556_dip.cpp" /> + <ClCompile Include="..\macro\modules\nlmod_rtest.cpp" /> + <ClCompile Include="..\macro\nlm_base_lib.cpp" /> + <ClCompile Include="..\macro\nlm_cd4xxx_lib.cpp" /> + <ClCompile Include="..\macro\nlm_opamp_lib.cpp" /> + <ClCompile Include="..\macro\nlm_otheric_lib.cpp" /> + <ClCompile Include="..\macro\nlm_roms_lib.cpp" /> + <ClCompile Include="..\macro\nlm_ttl74xx_lib.cpp" /> <ClCompile Include="..\nl_base.cpp" /> <ClCompile Include="..\nl_factory.cpp" /> <ClCompile Include="..\nl_parser.cpp" /> <ClCompile Include="..\nl_setup.cpp" /> - <ClCompile Include="..\plib\palloc.cpp" /> - <ClCompile Include="..\plib\pchrono.cpp" /> <ClCompile Include="..\plib\pdynlib.cpp" /> <ClCompile Include="..\plib\pexception.cpp" /> <ClCompile Include="..\plib\pfmtlog.cpp" /> <ClCompile Include="..\plib\pfunction.cpp" /> <ClCompile Include="..\plib\pmain.cpp" /> <ClCompile Include="..\plib\poptions.cpp" /> - <ClCompile Include="..\plib\pparser.cpp" /> - <ClCompile Include="..\plib\pstate.cpp" /> - <ClCompile Include="..\plib\pstream.cpp" /> + <ClCompile Include="..\plib\ppmf.cpp" /> + <ClCompile Include="..\plib\ppreprocessor.cpp" /> <ClCompile Include="..\plib\pstring.cpp" /> + <ClCompile Include="..\plib\ptokenizer.cpp" /> <ClCompile Include="..\plib\putil.cpp" /> <ClCompile Include="..\solver\nld_matrix_solver.cpp" /> <ClCompile Include="..\solver\nld_solver.cpp" /> @@ -189,57 +268,16 @@ <ItemGroup> <ClInclude Include="..\analog\nld_bjt.h" /> <ClInclude Include="..\analog\nld_fourterm.h" /> + <ClInclude Include="..\analog\nld_generic_models.h" /> + <ClInclude Include="..\analog\nld_mosfet.h" /> <ClInclude Include="..\analog\nld_opamps.h" /> <ClInclude Include="..\analog\nld_switches.h" /> <ClInclude Include="..\analog\nld_twoterm.h" /> <ClInclude Include="..\analog\nlid_fourterm.h" /> <ClInclude Include="..\analog\nlid_twoterm.h" /> <ClInclude Include="..\devices\net_lib.h" /> - <ClInclude Include="..\devices\nld_2102A.h" /> - <ClInclude Include="..\devices\nld_2716.h" /> - <ClInclude Include="..\devices\nld_tms4800.h" /> - <ClInclude Include="..\devices\nld_4020.h" /> - <ClInclude Include="..\devices\nld_4066.h" /> - <ClInclude Include="..\devices\nld_4316.h" /> - <ClInclude Include="..\devices\nld_74107.h" /> - <ClInclude Include="..\devices\nld_74123.h" /> - <ClInclude Include="..\devices\nld_74153.h" /> - <ClInclude Include="..\devices\nld_74161.h" /> - <ClInclude Include="..\devices\nld_74164.h" /> - <ClInclude Include="..\devices\nld_74165.h" /> - <ClInclude Include="..\devices\nld_74166.h" /> - <ClInclude Include="..\devices\nld_74174.h" /> - <ClInclude Include="..\devices\nld_74175.h" /> - <ClInclude Include="..\devices\nld_74192.h" /> - <ClInclude Include="..\devices\nld_74193.h" /> - <ClInclude Include="..\devices\nld_74194.h" /> - <ClInclude Include="..\devices\nld_74365.h" /> - <ClInclude Include="..\devices\nld_7448.h" /> - <ClInclude Include="..\devices\nld_7450.h" /> - <ClInclude Include="..\devices\nld_7473.h" /> - <ClInclude Include="..\devices\nld_7474.h" /> - <ClInclude Include="..\devices\nld_7475.h" /> - <ClInclude Include="..\devices\nld_7483.h" /> - <ClInclude Include="..\devices\nld_7485.h" /> - <ClInclude Include="..\devices\nld_7490.h" /> - <ClInclude Include="..\devices\nld_7493.h" /> - <ClInclude Include="..\devices\nld_74ls629.h" /> - <ClInclude Include="..\devices\nld_82S115.h" /> - <ClInclude Include="..\devices\nld_82S123.h" /> - <ClInclude Include="..\devices\nld_82S126.h" /> - <ClInclude Include="..\devices\nld_82S16.h" /> - <ClInclude Include="..\devices\nld_9310.h" /> - <ClInclude Include="..\devices\nld_9316.h" /> - <ClInclude Include="..\devices\nld_9322.h" /> - <ClInclude Include="..\devices\nld_am2847.h" /> + <ClInclude Include="..\devices\nld_schmitt.h" /> <ClInclude Include="..\devices\nld_devinc.h" /> - <ClInclude Include="..\devices\nld_dm9314.h" /> - <ClInclude Include="..\devices\nld_dm9334.h" /> - <ClInclude Include="..\devices\nld_legacy.h" /> - <ClInclude Include="..\devices\nld_log.h" /> - <ClInclude Include="..\devices\nld_mm5837.h" /> - <ClInclude Include="..\devices\nld_ne555.h" /> - <ClInclude Include="..\devices\nld_r2r_dac.h" /> <ClInclude Include="..\devices\nld_system.h" /> <ClInclude Include="..\devices\nld_tristate.h" /> <ClInclude Include="..\devices\nlid_cmos.h" /> @@ -248,12 +286,6 @@ <ClInclude Include="..\devices\nlid_truthtable.h" /> <ClInclude Include="..\documentation\primer_1.dox.h" /> <ClInclude Include="..\documentation\structure.dox.h" /> - <ClInclude Include="..\macro\nlm_base.h" /> - <ClInclude Include="..\macro\nlm_cd4xxx.h" /> - <ClInclude Include="..\macro\nlm_opamp.h" /> - <ClInclude Include="..\macro\nlm_other.h" /> - <ClInclude Include="..\macro\nlm_ttl74xx.h" /> - <ClInclude Include="..\netlist_types.h" /> <ClInclude Include="..\nl_base.h" /> <ClInclude Include="..\nl_config.h" /> <ClInclude Include="..\nl_dice_compat.h" /> @@ -262,8 +294,10 @@ <ClInclude Include="..\nl_lists.h" /> <ClInclude Include="..\nl_parser.h" /> <ClInclude Include="..\nl_setup.h" /> - <ClInclude Include="..\nl_time.h" /> + <ClInclude Include="..\plib\gmres.h" /> + <ClInclude Include="..\plib\mat_cr.h" /> <ClInclude Include="..\plib\palloc.h" /> + <ClInclude Include="..\plib\parray.h" /> <ClInclude Include="..\plib\pchrono.h" /> <ClInclude Include="..\plib\pconfig.h" /> <ClInclude Include="..\plib\pdynlib.h" /> @@ -272,15 +306,24 @@ <ClInclude Include="..\plib\pfunction.h" /> <ClInclude Include="..\plib\plists.h" /> <ClInclude Include="..\plib\pmain.h" /> + <ClInclude Include="..\plib\pmath.h" /> + <ClInclude Include="..\plib\pmatrix2d.h" /> + <ClInclude Include="..\plib\pmempool.h" /> + <ClInclude Include="..\plib\pomp.h" /> <ClInclude Include="..\plib\poptions.h" /> <ClInclude Include="..\plib\pparser.h" /> <ClInclude Include="..\plib\ppmf.h" /> + <ClInclude Include="..\plib\ppreprocessor.h" /> <ClInclude Include="..\plib\pstate.h" /> + <ClInclude Include="..\plib\pstonum.h" /> <ClInclude Include="..\plib\pstream.h" /> <ClInclude Include="..\plib\pstring.h" /> + <ClInclude Include="..\plib\pstrutil.h" /> + <ClInclude Include="..\plib\ptime.h" /> + <ClInclude Include="..\plib\ptokenizer.h" /> <ClInclude Include="..\plib\ptypes.h" /> <ClInclude Include="..\plib\putil.h" /> - <ClInclude Include="..\solver\mat_cr.h" /> + <ClInclude Include="..\plib\vector_ops.h" /> <ClInclude Include="..\solver\nld_matrix_solver.h" /> <ClInclude Include="..\solver\nld_ms_direct.h" /> <ClInclude Include="..\solver\nld_ms_direct1.h" /> diff --git a/src/lib/netlist/buildVS/netlistlib.vcxproj.filters b/src/lib/netlist/buildVS/netlistlib.vcxproj.filters index 2b923f04bde..2b7549429b1 100755..100644 --- a/src/lib/netlist/buildVS/netlistlib.vcxproj.filters +++ b/src/lib/netlist/buildVS/netlistlib.vcxproj.filters @@ -30,9 +30,6 @@ <ClCompile Include="..\plib\pfunction.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\plib\pstream.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\plib\pmain.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -48,21 +45,9 @@ <ClCompile Include="..\plib\pexception.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\plib\pstate.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\plib\pparser.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\plib\putil.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\plib\palloc.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\plib\pchrono.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\plib\pdynlib.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -90,21 +75,6 @@ <ClCompile Include="..\tools\nl_convert.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\macro\nlm_cd4xxx.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\macro\nlm_ttl74xx.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\macro\nlm_other.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\macro\nlm_opamp.cpp"> - <Filter>Source Files</Filter> - </ClCompile> - <ClCompile Include="..\macro\nlm_base.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\devices\nld_74ls629.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -117,7 +87,7 @@ <ClCompile Include="..\devices\nld_7483.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\devices\nld_82S115.cpp"> + <ClCompile Include="..\devices\nld_4013.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\devices\nld_4020.cpp"> @@ -156,9 +126,6 @@ <ClCompile Include="..\devices\nld_74153.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\devices\nld_82S16.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\devices\nld_74123.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -174,9 +141,6 @@ <ClCompile Include="..\devices\nld_7485.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\devices\nld_2716.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\devices\nld_tms4800.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -189,6 +153,9 @@ <ClCompile Include="..\devices\nld_7473.cpp"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\devices\nld_74113.cpp"> + <Filter>Source Files</Filter> + </ClCompile> <ClCompile Include="..\devices\nld_4066.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -216,9 +183,6 @@ <ClCompile Include="..\devices\nld_74174.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\devices\nld_2102A.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\devices\nld_4316.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -231,18 +195,12 @@ <ClCompile Include="..\devices\nld_7474.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\devices\nld_82S126.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\devices\nlid_truthtable.cpp"> <Filter>Source Files</Filter> </ClCompile> <ClCompile Include="..\devices\nld_tristate.cpp"> <Filter>Source Files</Filter> </ClCompile> - <ClCompile Include="..\devices\nld_82S123.cpp"> - <Filter>Source Files</Filter> - </ClCompile> <ClCompile Include="..\devices\nld_legacy.cpp"> <Filter>Source Files</Filter> </ClCompile> @@ -252,6 +210,108 @@ <ClCompile Include="..\devices\nld_74164.cpp"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\plib\ppreprocessor.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\plib\ptokenizer.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_7497.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_schmitt.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\analog\nld_mosfet.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_7492.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_4006.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\generated\static_solvers.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_74393.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_74163.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_roms.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_74125.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_74377.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\nlm_base_lib.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\nlm_cd4xxx_lib.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\nlm_opamp_lib.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\nlm_otheric_lib.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\nlm_roms_lib.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\nlm_ttl74xx_lib.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_4017.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_4053.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_8277.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_9321.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\generated\nlm_modules_lib.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_4042.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_4076.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_4029.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_2102a.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_82s16.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\devices\nld_82s115.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\modules\nlmod_icl8038_dip.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\modules\nlmod_ne556_dip.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\macro\modules\nlmod_rtest.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\plib\ppmf.cpp"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> <ItemGroup> <ClInclude Include="..\nl_errstr.h"> @@ -260,18 +320,12 @@ <ClInclude Include="..\nl_dice_compat.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\nl_time.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\nl_base.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\nl_parser.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\netlist_types.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\nl_factory.h"> <Filter>Header Files</Filter> </ClInclude> @@ -389,9 +443,6 @@ <ClInclude Include="..\solver\nld_ms_direct.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\solver\mat_cr.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\solver\nld_ms_direct_lu.h"> <Filter>Header Files</Filter> </ClInclude> @@ -401,182 +452,83 @@ <ClInclude Include="..\tools\nl_convert.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\macro\nlm_ttl74xx.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\macro\nlm_opamp.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\macro\nlm_other.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\macro\nlm_base.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\macro\nlm_cd4xxx.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\documentation\structure.dox.h"> <Filter>Header Files</Filter> </ClInclude> <ClInclude Include="..\documentation\primer_1.dox.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_2102A.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\nlid_system.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_r2r_dac.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_74193.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\nlid_proxy.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_log.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_2716.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_tms4800.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_am2847.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_74174.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_7448.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_74192.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_9310.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_4066.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\nlid_cmos.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_4020.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_7474.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_74194.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_dm9314.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_dm9334.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\nld_tristate.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_7450.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\net_lib.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_7473.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_74161.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_82S115.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\nlid_truthtable.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_9316.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_7485.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_74166.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\nld_devinc.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_74165.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_82S126.h"> - <Filter>Header Files</Filter> - </ClInclude> <ClInclude Include="..\devices\nld_system.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_74ls629.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_74365.h"> + <ClInclude Include="..\plib\gmres.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_7475.h"> + <ClInclude Include="..\plib\mat_cr.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_7483.h"> + <ClInclude Include="..\plib\parray.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_74123.h"> + <ClInclude Include="..\plib\pmath.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_mm5837.h"> + <ClInclude Include="..\plib\pmatrix2d.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_4316.h"> + <ClInclude Include="..\plib\pmempool.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_82S123.h"> + <ClInclude Include="..\plib\pomp.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_74153.h"> + <ClInclude Include="..\plib\ppreprocessor.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_7493.h"> + <ClInclude Include="..\plib\pstonum.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_legacy.h"> + <ClInclude Include="..\plib\pstrutil.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_74107.h"> + <ClInclude Include="..\plib\ptime.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_ne555.h"> + <ClInclude Include="..\plib\ptokenizer.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_9322.h"> + <ClInclude Include="..\plib\vector_ops.h"> <Filter>Header Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_7490.h"> - <Filter>Header Files</Filter> - </ClInclude> - <ClInclude Include="..\devices\nld_82S16.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\devices\nld_schmitt.h"> + <Filter>Source Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_74175.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\analog\nld_generic_models.h"> + <Filter>Source Files</Filter> </ClInclude> - <ClInclude Include="..\devices\nld_74164.h"> - <Filter>Header Files</Filter> + <ClInclude Include="..\analog\nld_mosfet.h"> + <Filter>Source Files</Filter> </ClInclude> </ItemGroup> </Project>
\ No newline at end of file diff --git a/src/lib/netlist/buildVS/netlistlib.vcxproj.user b/src/lib/netlist/buildVS/netlistlib.vcxproj.user deleted file mode 100755 index abe8dd8961e..00000000000 --- a/src/lib/netlist/buildVS/netlistlib.vcxproj.user +++ /dev/null @@ -1,4 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<Project ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> - <PropertyGroup /> -</Project>
\ No newline at end of file diff --git a/src/lib/netlist/buildVS/nltool.vcxproj b/src/lib/netlist/buildVS/nltool.vcxproj index 200e701ea33..508833656e0 100755..100644 --- a/src/lib/netlist/buildVS/nltool.vcxproj +++ b/src/lib/netlist/buildVS/nltool.vcxproj @@ -1,6 +1,14 @@ <?xml version="1.0" encoding="utf-8"?> <Project DefaultTargets="Build" ToolsVersion="14.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="CLRelease|Win32"> + <Configuration>CLRelease</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="CLRelease|x64"> + <Configuration>CLRelease</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> <ProjectConfiguration Include="Debug|Win32"> <Configuration>Debug</Configuration> <Platform>Win32</Platform> @@ -22,32 +30,46 @@ <ProjectGuid>{9204EC28-A29B-4A36-9E47-2C46041D67D3}</ProjectGuid> <Keyword>Win32Proj</Keyword> <RootNamespace>nltool</RootNamespace> - <WindowsTargetPlatformVersion>8.1</WindowsTargetPlatformVersion> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> </PropertyGroup> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>true</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <ConfigurationType>Application</ConfigurationType> <UseDebugLibraries>false</UseDebugLibraries> - <PlatformToolset>v140</PlatformToolset> + <PlatformToolset>v142</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>ClangCL</PlatformToolset> <WholeProgramOptimization>true</WholeProgramOptimization> <CharacterSet>Unicode</CharacterSet> </PropertyGroup> @@ -62,12 +84,18 @@ <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> <PropertyGroup Label="UserMacros" /> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <LinkIncremental>true</LinkIncremental> @@ -78,8 +106,16 @@ <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> <LinkIncremental>false</LinkIncremental> </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <LinkIncremental>false</LinkIncremental> + <IncludePath>$(ProjectDir)\..\..;$(IncludePath)</IncludePath> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'"> + <LinkIncremental>false</LinkIncremental> + <IncludePath>$(ProjectDir)\..\..;$(IncludePath)</IncludePath> </PropertyGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> <ClCompile> @@ -101,6 +137,7 @@ <WarningLevel>Level3</WarningLevel> <Optimization>Disabled</Optimization> <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <LanguageStandard>stdcpp17</LanguageStandard> </ClCompile> <Link> <SubSystem>Console</SubSystem> @@ -125,6 +162,24 @@ <GenerateDebugInformation>true</GenerateDebugInformation> </Link> </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>..\..\</AdditionalIncludeDirectories> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ClCompile> <WarningLevel>Level3</WarningLevel> @@ -134,7 +189,27 @@ <FunctionLevelLinking>true</FunctionLevelLinking> <IntrinsicFunctions>true</IntrinsicFunctions> <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> - <AdditionalIncludeDirectories>$(SolutionDir)..\..\</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\;$(SolutionDir)..\</AdditionalIncludeDirectories> + <LanguageStandard>stdcpp17</LanguageStandard> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'"> + <ClCompile> + <WarningLevel>Level3</WarningLevel> + <PrecompiledHeader> + </PrecompiledHeader> + <Optimization>MaxSpeed</Optimization> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\;$(SolutionDir)..\</AdditionalIncludeDirectories> + <LanguageStandard>stdcpp17</LanguageStandard> </ClCompile> <Link> <SubSystem>Console</SubSystem> @@ -144,7 +219,16 @@ </Link> </ItemDefinitionGroup> <ItemGroup> - <ClCompile Include="..\prg\nltool.cpp" /> + <ClCompile Include="..\prg\nltool.cpp"> + <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(SolutionDir)..\;$(SolutionDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalIncludeDirectories Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'">$(SolutionDir)..\;$(SolutionDir)..\..\;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> + <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='Release|x64'">/bigobj</AdditionalOptions> + <AdditionalOptions Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'">/bigobj</AdditionalOptions> + </ClCompile> + <ClCompile Include="..\tests\test_pfunction.cpp" /> + <ClCompile Include="..\tests\test_pmfp.cpp" /> + <ClCompile Include="..\tests\test_pmfp_multibase.cpp" /> + <ClCompile Include="..\tests\test_pstring.cpp" /> </ItemGroup> <ItemGroup> <ProjectReference Include="netlistlib.vcxproj"> diff --git a/src/lib/netlist/buildVS/nltool.vcxproj.filters b/src/lib/netlist/buildVS/nltool.vcxproj.filters index 2a9c313c0d0..52f522f23e8 100755..100644 --- a/src/lib/netlist/buildVS/nltool.vcxproj.filters +++ b/src/lib/netlist/buildVS/nltool.vcxproj.filters @@ -18,5 +18,17 @@ <ClCompile Include="..\prg\nltool.cpp"> <Filter>Source Files</Filter> </ClCompile> + <ClCompile Include="..\tests\test_pfunction.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\tests\test_pmfp.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\tests\test_pstring.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + <ClCompile Include="..\tests\test_pmfp_multibase.cpp"> + <Filter>Source Files</Filter> + </ClCompile> </ItemGroup> </Project>
\ No newline at end of file diff --git a/src/lib/netlist/buildVS/nlwav.vcxproj b/src/lib/netlist/buildVS/nlwav.vcxproj new file mode 100644 index 00000000000..239fcf7ba5c --- /dev/null +++ b/src/lib/netlist/buildVS/nlwav.vcxproj @@ -0,0 +1,237 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup Label="ProjectConfigurations"> + <ProjectConfiguration Include="CLRelease|Win32"> + <Configuration>CLRelease</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="CLRelease|x64"> + <Configuration>CLRelease</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|Win32"> + <Configuration>Debug</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|Win32"> + <Configuration>Release</Configuration> + <Platform>Win32</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Debug|x64"> + <Configuration>Debug</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + <ProjectConfiguration Include="Release|x64"> + <Configuration>Release</Configuration> + <Platform>x64</Platform> + </ProjectConfiguration> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\prg\nlwav.cpp" /> + </ItemGroup> + <ItemGroup> + <ProjectReference Include="netlistlib.vcxproj"> + <Project>{a374399b-b87f-4e0f-9525-6c099600705f}</Project> + </ProjectReference> + </ItemGroup> + <PropertyGroup Label="Globals"> + <VCProjectVersion>16.0</VCProjectVersion> + <ProjectGuid>{48D0ADAF-62EC-472E-A51B-8D837280649D}</ProjectGuid> + <Keyword>Win32Proj</Keyword> + <RootNamespace>nlwav</RootNamespace> + <WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>true</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>v142</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'" Label="Configuration"> + <ConfigurationType>Application</ConfigurationType> + <UseDebugLibraries>false</UseDebugLibraries> + <PlatformToolset>ClangCL</PlatformToolset> + <WholeProgramOptimization>true</WholeProgramOptimization> + <CharacterSet>Unicode</CharacterSet> + </PropertyGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> + <ImportGroup Label="ExtensionSettings"> + </ImportGroup> + <ImportGroup Label="Shared"> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <ImportGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'" Label="PropertySheets"> + <Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" /> + </ImportGroup> + <PropertyGroup Label="UserMacros" /> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <LinkIncremental>true</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'"> + <LinkIncremental>false</LinkIncremental> + </PropertyGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck> + </SDLCheck> + <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\;$(SolutionDir)..\</AdditionalIncludeDirectories> + <LanguageStandard>stdcpp17</LanguageStandard> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck> + </SDLCheck> + <PreprocessorDefinitions>NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <AdditionalIncludeDirectories>$(SolutionDir)..\..\;$(SolutionDir)..\</AdditionalIncludeDirectories> + <LanguageStandard>stdcpp17</LanguageStandard> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>_DEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + <LanguageStandard>stdcpp17</LanguageStandard> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='CLRelease|Win32'"> + <ClCompile> + <PrecompiledHeader> + </PrecompiledHeader> + <WarningLevel>Level3</WarningLevel> + <FunctionLevelLinking>true</FunctionLevelLinking> + <IntrinsicFunctions>true</IntrinsicFunctions> + <SDLCheck>true</SDLCheck> + <PreprocessorDefinitions>WIN32;NDEBUG;_CONSOLE;%(PreprocessorDefinitions)</PreprocessorDefinitions> + <ConformanceMode>true</ConformanceMode> + </ClCompile> + <Link> + <SubSystem>Console</SubSystem> + <EnableCOMDATFolding>true</EnableCOMDATFolding> + <OptimizeReferences>true</OptimizeReferences> + <GenerateDebugInformation>true</GenerateDebugInformation> + </Link> + </ItemDefinitionGroup> + <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> + <ImportGroup Label="ExtensionTargets"> + </ImportGroup> +</Project>
\ No newline at end of file diff --git a/src/lib/netlist/buildVS/nlwav.vcxproj.filters b/src/lib/netlist/buildVS/nlwav.vcxproj.filters new file mode 100644 index 00000000000..7b114761bb4 --- /dev/null +++ b/src/lib/netlist/buildVS/nlwav.vcxproj.filters @@ -0,0 +1,22 @@ +<?xml version="1.0" encoding="utf-8"?> +<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> + <ItemGroup> + <Filter Include="Source Files"> + <UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier> + <Extensions>cpp;c;cc;cxx;c++;def;odl;idl;hpj;bat;asm;asmx</Extensions> + </Filter> + <Filter Include="Header Files"> + <UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier> + <Extensions>h;hh;hpp;hxx;h++;hm;inl;inc;ipp;xsd</Extensions> + </Filter> + <Filter Include="Resource Files"> + <UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier> + <Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions> + </Filter> + </ItemGroup> + <ItemGroup> + <ClCompile Include="..\prg\nlwav.cpp"> + <Filter>Source Files</Filter> + </ClCompile> + </ItemGroup> +</Project>
\ No newline at end of file diff --git a/src/lib/netlist/core/analog.h b/src/lib/netlist/core/analog.h new file mode 100644 index 00000000000..a6f15b76f58 --- /dev/null +++ b/src/lib/netlist/core/analog.h @@ -0,0 +1,173 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file param.h +/// + +#ifndef NL_CORE_ANALOG_H_ +#define NL_CORE_ANALOG_H_ + +#include "../nltypes.h" +#include "base_objects.h" +#include "nets.h" + +#include "../plib/plists.h" +#include "../plib/pstring.h" + +#include <array> +#include <utility> + +namespace netlist +{ + // ------------------------------------------------------------------------- + // analog_t + // ------------------------------------------------------------------------- + + class analog_t : public detail::core_terminal_t + { + public: + analog_t(core_device_t &dev, const pstring &aname, state_e state, + nl_delegate delegate); + + const analog_net_t &net() const noexcept + { + return plib::downcast<const analog_net_t &>(core_terminal_t::net()); + } + + analog_net_t &net() noexcept + { + return plib::downcast<analog_net_t &>(core_terminal_t::net()); + } + + solver::matrix_solver_t *solver() const noexcept; + }; + + /// \brief Base class for terminals. + /// + /// Each \ref nld_two_terminal object consists of two terminals. Terminals + /// are at the core of analog netlists and are connected to \ref net_t + /// objects. + /// + class terminal_t : public analog_t + { + public: + /// \brief constructor + /// + /// \param dev object owning the terminal + /// \param aname name of this terminal + /// \param other_terminal pointer to the sibling terminal + terminal_t(core_device_t &dev, const pstring &aname, + terminal_t *other_terminal, nl_delegate delegate); + + terminal_t(core_device_t &dev, const pstring &aname, + terminal_t * other_terminal, + const std::array<terminal_t *, 2> &splitter_terms, + nl_delegate delegate); + + /// \brief Returns voltage of connected net + /// + /// \return voltage of net this terminal is connected to + nl_fptype operator()() const noexcept { return net().Q_Analog(); } + + /// \brief sets conductivity value of this terminal + /// + /// \param G Conductivity + void set_conductivity(nl_fptype G) const noexcept + { + set_go_gt_I(-G, G, nlconst::zero()); + } + + void set_go_gt(nl_fptype GO, nl_fptype GT) const noexcept + { + set_go_gt_I(GO, GT, nlconst::zero()); + } + + void set_go_gt_I(nl_fptype GO, nl_fptype GT, + nl_fptype I) const noexcept; + + void set_ptrs(nl_fptype *gt, nl_fptype *go, nl_fptype *Idr) noexcept( + false); + + private: + nl_fptype *m_Idr; //!< drive current + nl_fptype *m_go; //!< conductance for Voltage from other term + nl_fptype *m_gt; //!< conductance for total conductance + }; + + // ------------------------------------------------------------------------- + // analog_input_t + // ------------------------------------------------------------------------- + + /// \brief terminal providing analog input voltage. + /// + /// This terminal class provides a voltage measurement. The conductance + /// against ground is infinite. + class analog_input_t : public analog_t + { + public: + /// \brief Constructor + analog_input_t(core_device_t &dev, //!< owning device + const pstring & aname, //!< name of terminal + nl_delegate delegate //!< delegate + ); + + /// \brief returns voltage at terminal. + /// \returns voltage at terminal. + nl_fptype operator()() const noexcept { return Q_Analog(); } + + /// \brief returns voltage at terminal. + /// \returns voltage at terminal. + nl_fptype Q_Analog() const noexcept { return net().Q_Analog(); } + }; + + // ------------------------------------------------------------------------- + // analog_output_t + // ------------------------------------------------------------------------- + + class analog_output_t : public analog_t + { + public: + analog_output_t(core_device_t &dev, const pstring &aname); + + void push(nl_fptype val) noexcept; + + void initial(nl_fptype val) noexcept; + + private: + analog_net_t m_my_net; + }; + + // ------------------------------------------------------------------------- + // out of class + // ------------------------------------------------------------------------- + + inline solver::matrix_solver_t *analog_t::solver() const noexcept + { + return (this->has_net() ? net().solver() : nullptr); + } + + inline void terminal_t::set_go_gt_I(nl_fptype GO, nl_fptype GT, + nl_fptype I) const noexcept + { + // Check for rail nets ... + if (m_go != nullptr) + { + *m_Idr = I; + *m_go = GO; + *m_gt = GT; + } + } + + inline void analog_output_t::push(nl_fptype val) noexcept + { + if (val != m_my_net.Q_Analog()) + { + m_my_net.set_Q_Analog(val); + m_my_net.toggle_and_push_to_queue(netlist_time::quantum()); + } + } + +} // namespace netlist + +#endif // NL_CORE_ANALOG_H_ diff --git a/src/lib/netlist/core/base_objects.h b/src/lib/netlist/core/base_objects.h new file mode 100644 index 00000000000..b62c82e160c --- /dev/null +++ b/src/lib/netlist/core/base_objects.h @@ -0,0 +1,317 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file param.h +/// + +#ifndef NL_CORE_BASE_OBJECTS_H_ +#define NL_CORE_BASE_OBJECTS_H_ + +#include "../nltypes.h" +#include "netlist_state.h" +#include "state_var.h" + +#include "../plib/palloc.h" +#include "../plib/pchrono.h" +#include "../plib/pexception.h" +#include "../plib/plists.h" +#include "../plib/pmempool.h" +#include "../plib/ppmf.h" + +#include <unordered_map> + +namespace netlist +{ + /// \brief Delegate type for device notification. + /// + using nl_delegate = plib::pmfp<void()>; + using nl_delegate_ts = plib::pmfp<void(detail::time_step_type, nl_fptype)>; + using nl_delegate_dyn = plib::pmfp<void()>; +} // namespace netlist + +namespace netlist::detail +{ + + template <typename C, typename T> + struct property_store_t + { + using value_type = T; + using key_type = const C *; + using store_type = std::unordered_map<key_type, value_type>; + + static void add(key_type obj, const value_type &value) noexcept + { + try + { + store().insert({obj, value}); + } + catch (...) + { + plib::terminate("exception in property_store_t.add()"); + } + } + + static const value_type &get(key_type obj) noexcept + { + try + { + typename store_type::iterator ret(store().find(obj)); + if (ret == store().end()) + plib::terminate( + "object not found in property_store_t.get()"); + return ret->second; + } + catch (...) + { + plib::terminate("exception in property_store_t.get()"); + } + } + + static void remove(key_type obj) noexcept + { + try + { + store().erase(store().find(obj)); + } + catch (...) + { + plib::terminate("exception in property_store_t.remove()"); + } + } + + static store_type &store() noexcept + { + static store_type static_store; + return static_store; + } + }; + + // ------------------------------------------------------------------------- + // object_t + // ------------------------------------------------------------------------- + + /// \brief The base class for netlist devices, terminals and parameters. + /// + /// This class serves as the base class for all device, terminal and + /// objects. + + class object_t + { + public: + /// \brief Constructor. + /// Every class derived from the object_t class must have a name. + /// + /// \param aname string containing name of the object + + explicit object_t(const pstring &aname) { props::add(this, aname); } + + PCOPYASSIGNMOVE(object_t, delete) + /// \brief return name of the object + /// + /// \returns name of the object. + + const pstring &name() const noexcept { return props::get(this); } + + protected: + using props = property_store_t<object_t, pstring>; + + // only childs should be destructible + ~object_t() noexcept { props::remove(this); } + + private: + }; + + /// \brief Base class for all objects being owned by a netlist + /// + /// The object provides adds \ref netlist_state_t and \ref netlist_t + /// accessors. + /// + + class netlist_object_t : public object_t + { + public: + explicit netlist_object_t(netlist_t &nl, const pstring &name) + : object_t(name) + , m_netlist(nl) + { + } + + ~netlist_object_t() = default; + + PCOPYASSIGNMOVE(netlist_object_t, delete) + + netlist_state_t &state() noexcept; + const netlist_state_t &state() const noexcept; + + constexpr netlist_t &exec() noexcept { return m_netlist; } + constexpr const netlist_t &exec() const noexcept { return m_netlist; } + + // to ease template design + template <typename T, typename... Args> + device_arena::unique_ptr<T> + make_pool_object(Args &&...args) noexcept(false) + { + return state().make_pool_object<T>(std::forward<Args>(args)...); + } + + private: + netlist_t &m_netlist; + }; + + // ------------------------------------------------------------------------- + // device_object_t + // ------------------------------------------------------------------------- + + /// \brief Base class for all objects being owned by a device. + /// + /// Serves as the base class of all objects being owned by a device. + /// + /// The class also supports device-less objects. In this case, + /// nullptr is passed in as the device object. + /// + + class device_object_t : public object_t + { + public: + /// \brief Constructor. + /// + /// \param dev pointer to device owning the object. + /// \param name string holding the name of the device + + device_object_t(core_device_t *dev, const pstring &name); + + /// \brief returns reference to owning device. + /// \returns reference to owning device. + + core_device_t &device() noexcept { return *m_device; } + const core_device_t &device() const noexcept { return *m_device; } + + /// \brief The netlist owning the owner of this object. + /// \returns reference to netlist object. + + netlist_state_t &state() noexcept; + const netlist_state_t &state() const noexcept; + + private: + core_device_t *m_device; + }; + + // ------------------------------------------------------------------------- + // core_terminal_t + // ------------------------------------------------------------------------- + + /// \brief Base class for all terminals. + /// + /// All terminals are derived from this class. + /// + class core_terminal_t + : public device_object_t + , public plib::linked_list_t<core_terminal_t, 0>::element_t +#if NL_USE_INPLACE_CORE_TERMS + , public plib::linked_list_t<core_terminal_t, 1>::element_t +#endif + { + public: + /// \brief Number of signal bits + /// + /// Going forward setting this to 8 will allow 8-bit signal + /// buses to be used in netlist, e.g. for more complex memory + /// arrangements. + /// Minimum value is 2 here to support tristate output on proxies. + static constexpr const unsigned int INP_BITS = 2; + + static constexpr const unsigned int INP_MASK = (1 << INP_BITS) - 1; + static constexpr const unsigned int INP_HL_SHIFT = 0; + static constexpr const unsigned int INP_LH_SHIFT = INP_BITS; + + static constexpr netlist_sig_t OUT_TRISTATE() { return INP_MASK; } + + static_assert(INP_BITS * 2 <= sizeof(netlist_sig_t) * 8, + "netlist_sig_t size not sufficient"); + + enum state_e + { + STATE_INP_PASSIVE = 0, + STATE_INP_HL = (INP_MASK << INP_HL_SHIFT), + STATE_INP_LH = (INP_MASK << INP_LH_SHIFT), + STATE_INP_ACTIVE = STATE_INP_HL | STATE_INP_LH, + STATE_OUT = (1 << (2 * INP_BITS)), + STATE_BIDIR = (1 << (2 * INP_BITS + 1)) + }; + + core_terminal_t(core_device_t &dev, const pstring &aname, state_e state, + nl_delegate delegate); + virtual ~core_terminal_t() noexcept = default; + + PCOPYASSIGNMOVE(core_terminal_t, delete) + + /// \brief The object type. + /// \returns type of the object + terminal_type type() const noexcept(false); + + /// \brief Checks if object is of specified type. + /// \param atype type to check object against. + /// \returns true if object is of specified type else false. + bool is_type(const terminal_type atype) const noexcept(false) + { + return (type() == atype); + } + + void set_net(net_t *anet) noexcept { m_net = anet; } + void clear_net() noexcept { m_net = nullptr; } + constexpr bool has_net() const noexcept { return (m_net != nullptr); } + + constexpr net_t &net() const noexcept { return *m_net; } + + bool is_logic() const noexcept; + bool is_logic_input() const noexcept; + bool is_logic_output() const noexcept; + bool is_tristate_output() const noexcept; + bool is_analog() const noexcept; + bool is_analog_input() const noexcept; + bool is_analog_output() const noexcept; + + constexpr bool is_state(state_e state) const noexcept + { + return (m_state == state); + } + constexpr state_e terminal_state() const noexcept { return m_state; } + constexpr void set_state(state_e state) noexcept { m_state = state; } + + void reset() noexcept + { + set_state(is_type(terminal_type::OUTPUT) ? STATE_OUT + : STATE_INP_ACTIVE); + } + + constexpr void + set_copied_input([[maybe_unused]] netlist_sig_t val) noexcept + { + if constexpr (config::use_copy_instead_of_reference::value) + { + m_Q_CIR = val; + } + } + + void set_delegate(const nl_delegate &delegate) noexcept + { + m_delegate = delegate; + } + const nl_delegate &delegate() const noexcept { return m_delegate; } + void run_delegate() const noexcept { return m_delegate(); } + + protected: + // std::conditional_t<config::use_copy_instead_of_reference::value, + // state_var_sig, void *> m_Q; + state_var_sig m_Q_CIR; + + private: + nl_delegate m_delegate; + net_t *m_net; + state_var<state_e> m_state; + }; + +} // namespace netlist::detail + +#endif // NL_CORE_BASE_OBJECTS_H_ diff --git a/src/lib/netlist/core/core_device.h b/src/lib/netlist/core/core_device.h new file mode 100644 index 00000000000..305a5aed14e --- /dev/null +++ b/src/lib/netlist/core/core_device.h @@ -0,0 +1,203 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file device.h +/// + +#ifndef NL_CORE_DEVICE_H_ +#define NL_CORE_DEVICE_H_ + +#include "../nltypes.h" +#include "base_objects.h" + +#include "../plib/pstring.h" + +namespace netlist +{ + // ------------------------------------------------------------------------- + // core_device_t construction parameters + // ------------------------------------------------------------------------- + + struct core_device_data_t + { + friend class core_device_t; + friend class base_device_t; + friend class analog::NETLIB_NAME(two_terminal); + friend class logic_family_std_proxy_t; + + template <unsigned m_NI, unsigned m_NO> + friend class devices::factory_truth_table_t; + + template <class C, typename... Args> + friend class factory::device_element_t; + friend class factory::library_element_t; + + template <typename DEVICE> + friend struct sub_device_wrapper; + + friend class solver::matrix_solver_t; + + private: + core_device_data_t(netlist_state_t &o, const pstring &n) + : owner(o) + , name(n) + { + } + netlist_state_t &owner; + const pstring & name; + }; + + // The type use to pass data on + using core_device_param_t = const core_device_data_t &; + + // ------------------------------------------------------------------------- + // core_device_t + // ------------------------------------------------------------------------- + // FIXME: belongs into detail namespace + + class core_device_t : public detail::netlist_object_t + { + public: + using constructor_data_t = core_device_data_t; + using constructor_param_t = core_device_param_t; + + core_device_t(core_device_param_t data); + + core_device_t(const core_device_t &) = delete; + core_device_t &operator=(const core_device_t &) = delete; + core_device_t(core_device_t &&) noexcept = delete; + core_device_t &operator=(core_device_t &&) noexcept = delete; + + virtual ~core_device_t() noexcept = default; + + void do_inc_active() noexcept; + + void do_dec_active() noexcept; + + void set_hint_deactivate(bool v) noexcept { m_hint_deactivate = v; } + bool get_hint_deactivate() const noexcept { return m_hint_deactivate; } + // Has to be set in device reset + void set_active_outputs(int n) noexcept { m_active_outputs = n; } + + // stats + struct stats_t + { + // NL_KEEP_STATISTICS + plib::pperftime_t<true> m_stat_total_time; + plib::pperfcount_t<true> m_stat_call_count; + plib::pperfcount_t<true> m_stat_inc_active; + }; + + stats_t *stats() const noexcept { return m_stats.get(); } + + virtual void reset() {} + + void handler_noop() {} + + protected: + using activate_delegate = plib::pmfp<void(bool)>; + + activate_delegate m_activate; + + log_type &log(); + + public: + virtual void time_step([[maybe_unused]] detail::time_step_type ts_type, + [[maybe_unused]] nl_fptype st) noexcept + { + } + virtual void update_terminals() noexcept {} + + virtual void update_param() noexcept {} + virtual bool is_dynamic() const noexcept { return false; } + virtual bool is_time_step() const noexcept { return false; } + + private: + // FIXME: should this be a state_var? + bool m_hint_deactivate; + state_var_s32 m_active_outputs; + device_arena::unique_ptr<stats_t> m_stats; + }; + + inline void core_device_t::do_inc_active() noexcept + { + gsl_Expects(m_active_outputs >= 0); + + if (!m_activate.isnull() && m_hint_deactivate) + { + if (++m_active_outputs == 1) + { + if (m_stats) + m_stats->m_stat_inc_active.inc(); + m_activate(true); // inc_active(); + } + } + } + + inline void core_device_t::do_dec_active() noexcept + { + gsl_Expects(m_active_outputs >= 1); + + if (!m_activate.isnull() && m_hint_deactivate) + if (--m_active_outputs == 0) + { + m_activate(false); // dec_active(); + } + } + + // ------------------------------------------------------------------------- + // core_device_t construction parameters + // ------------------------------------------------------------------------- + + using base_device_data_t = core_device_data_t; + // The type use to pass data on + using base_device_param_t = const base_device_data_t &; + + // ------------------------------------------------------------------------- + // base_device_t + // ------------------------------------------------------------------------- + + class base_device_t : public core_device_t + { + public: + using constructor_data_t = base_device_data_t; + using constructor_param_t = base_device_param_t; + + base_device_t(base_device_param_t data); + + PCOPYASSIGNMOVE(base_device_t, delete) + + ~base_device_t() noexcept override = default; + + template <class O, class C, typename... Args> + void create_and_register_sub_device(O &owner, const pstring &name, + device_arena::unique_ptr<C> &dev, Args &&...args) + { + // dev = state().make_pool_object<C>(owner, name, + // std::forward<Args>(args)...); + using dev_constructor_data_t = typename C::constructor_data_t; + dev = state().make_pool_object<C>( + dev_constructor_data_t{state(), owner.name() + "." + name}, + std::forward<Args>(args)...); + state().register_device(dev->name(), + device_arena::owned_ptr<core_device_t>(dev.get(), false)); + } + + void register_sub_alias(const pstring &name, + const detail::core_terminal_t & term); + void register_sub_alias(const pstring &name, const pstring &aliased); + + void connect(const pstring &t1, const pstring &t2); + void connect(const detail::core_terminal_t &t1, + const detail::core_terminal_t & t2); + + protected: + // NETLIB_UPDATE_TERMINALSI() { } + + private: + }; + +} // namespace netlist + +#endif // NL_CORE_DEVICE_H_ diff --git a/src/lib/netlist/core/device.h b/src/lib/netlist/core/device.h new file mode 100644 index 00000000000..12f3f7d174e --- /dev/null +++ b/src/lib/netlist/core/device.h @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file device.h +/// + +#ifndef NL_DEVICE_H_ +#define NL_DEVICE_H_ + +#include "core_device.h" +#include "logic_family.h" +#include "param.h" + +namespace netlist +{ + + // ------------------------------------------------------------------------- + // device_t construction parameters + // ------------------------------------------------------------------------- + + using device_data_t = base_device_data_t; + // The type use to pass data on + using device_param_t = const device_data_t &; + + // ------------------------------------------------------------------------- + // device_t + // ------------------------------------------------------------------------- + + class device_t : public base_device_t, public logic_family_t + { + public: + using constructor_data_t = device_data_t; + using constructor_param_t = device_param_t; + + device_t(device_param_t data); + + device_t(device_param_t data, const pstring &model); + // only needed by proxies + device_t(device_param_t data, const logic_family_desc_t *desc); + + device_t(const device_t &) = delete; + device_t &operator=(const device_t &) = delete; + device_t(device_t &&) noexcept = delete; + device_t &operator=(device_t &&) noexcept = delete; + + ~device_t() noexcept override = default; + + protected: + template <typename T1, typename T2> + void push_two(T1 &term1, netlist_sig_t newQ1, + const netlist_time &delay1, T2 &term2, netlist_sig_t newQ2, + const netlist_time &delay2) noexcept + { + if (delay2 < delay1) + { + term1.push(newQ1, delay1); + term2.push(newQ2, delay2); + } + else + { + term2.push(newQ2, delay2); + term1.push(newQ1, delay1); + } + } + + // NETLIB_UPDATE_TERMINALSI() { } + private: + param_model_t m_model; + }; + + // ------------------------------------------------------------------------- + // FIXME: Rename + // ------------------------------------------------------------------------- + + template <typename DEVICE> + struct sub_device_wrapper + { + using constructor_data_t = typename DEVICE::constructor_data_t; + using constructor_param_t = typename DEVICE::constructor_param_t; + + template <typename... Args> + sub_device_wrapper(base_device_t &owner, const pstring &name, + Args &&...args) + { + // m_dev = owner.state().make_pool_object<DEVICE>(owner, name, + // std::forward<Args>(args)...); + m_dev = owner.state().make_pool_object<DEVICE>( + constructor_data_t{owner.state(), owner.name() + "." + name}, + std::forward<Args>(args)...); + owner.state().register_device( + m_dev->name(), + device_arena::owned_ptr<core_device_t>(m_dev.get(), false)); + } + template <typename... Args> + sub_device_wrapper(device_t &owner, const pstring &name, Args &&...args) + { + // m_dev = owner.state().make_pool_object<DEVICE>(owner, name, + // std::forward<Args>(args)...); + m_dev = owner.state().make_pool_object<DEVICE>( + constructor_data_t{owner.state(), owner.name() + "." + name}, + std::forward<Args>(args)...); + owner.state().register_device( + m_dev->name(), + device_arena::owned_ptr<core_device_t>(m_dev.get(), false)); + } + DEVICE & operator()() { return *m_dev; } + const DEVICE &operator()() const { return *m_dev; } + + private: + device_arena::unique_ptr<DEVICE> m_dev; + }; + +} // namespace netlist + +#endif // NL_DEVICE_H_ diff --git a/src/lib/netlist/core/device_macros.h b/src/lib/netlist/core/device_macros.h new file mode 100644 index 00000000000..8f46f036412 --- /dev/null +++ b/src/lib/netlist/core/device_macros.h @@ -0,0 +1,154 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef NL_CORE_DEVICE_MACROS_H_ +#define NL_CORE_DEVICE_MACROS_H_ + +/// +/// \file device_macros.h +/// + +// ----------------------------------------------------------------------------- +// MACROS / New Syntax +// ----------------------------------------------------------------------------- + +/// \brief Start a netlist device class. +/// +/// Used to start defining a netlist device class. +/// The simplest device without inputs or outputs would look like this: +/// +/// NETLIB_OBJECT(some_object) +/// { +/// public: +/// NETLIB_CONSTRUCTOR(some_object) { } +/// }; +/// +/// Also refer to #NETLIB_CONSTRUCTOR. +#define NETLIB_OBJECT(name) \ + class NETLIB_NAME(name) \ + : public device_t + +/// \brief Used to define the constructor of a netlist device. +/// +/// Use this to define the constructor of a netlist device. Please refer to +/// #NETLIB_OBJECT for an example. +#define NETLIB_CONSTRUCTOR(cname) \ +public: \ + NETLIB_NAME(cname)(constructor_param_t data) \ + : device_t(data) + +/// \brief Used to define the constructor of a netlist device and define a +/// default model. +/// +/// +/// NETLIB_CONSTRUCTOR_MODEL(some_object, "TTL") +/// { +/// public: +/// NETLIB_CONSTRUCTOR(some_object) { } +/// }; +/// +#define NETLIB_CONSTRUCTOR_MODEL(cname, cmodel) \ +public: \ + NETLIB_NAME(cname)(constructor_param_t data) \ + : device_t(data, cmodel) + +/// \brief Used to define the destructor of a netlist device. +/// The use of a destructor for netlist device should normally not be necessary. +#define NETLIB_DESTRUCTOR(name) \ +public: \ + virtual ~NETLIB_NAME(name)() noexcept override + +/// \brief Add this to a device definition to mark the device as dynamic. +/// +/// If NETLIB_IS_DYNAMIC(true) is added to the device definition the device +/// is treated as an analog dynamic device, i.e. \ref NETLIB_UPDATE_TERMINALSI +/// is called on a each step of the Newton-Raphson step +/// of solving the linear equations. +/// +/// You may also use e.g. NETLIB_IS_DYNAMIC(m_func() != "") to only make the +/// device a dynamic device if parameter m_func is set. +/// +/// \param expr boolean expression +/// +#define NETLIB_IS_DYNAMIC(expr) \ +public: \ + virtual bool is_dynamic() const noexcept override { return expr; } + +/// \brief Add this to a device definition to mark the device as a time-stepping +/// device. +/// +/// You have to implement NETLIB_TIMESTEP in this case as well. Currently, only +/// the capacitor and inductor devices uses this. +/// +/// You may also use e.g. NETLIB_IS_TIMESTEP(m_func() != "") to only make the +/// device a dynamic device if parameter m_func is set. This is used by the +/// Voltage Source element. +/// +/// Example: +/// +/// \code +/// NETLIB_TIMESTEP_IS_TIMESTEP() +/// NETLIB_TIMESTEPI() +/// { +/// // Gpar should support convergence +/// const nl_fptype G = m_C.Value() / step + m_GParallel; +/// const nl_fptype I = -G/// deltaV(); +/// set(G, 0.0, I); +/// } +/// \endcode + +#define NETLIB_IS_TIMESTEP(expr) \ +public: \ + virtual bool is_time_step() const noexcept override { return expr; } + +/// \brief Used to implement the time stepping code. +/// +/// Please see \ref NETLIB_IS_TIMESTEP for an example. + +#define NETLIB_TIMESTEPI() \ +public: \ + virtual void time_step(detail::time_step_type ts_type, \ + nl_fptype step) noexcept override + +/// \brief Used to implement the body of the time stepping code. +/// +/// Used when the implementation is outside the class definition +/// +/// Please see \ref NETLIB_IS_TIMESTEP for an example. +/// +/// \param cname Name of object as given to \ref NETLIB_OBJECT +/// +#define NETLIB_TIMESTEP(cname) \ + void NETLIB_NAME(cname)::time_step(detail::time_step_type ts_type, \ + nl_fptype step) noexcept + +//#define NETLIB_DELEGATE(name) nl_delegate(&this_type :: name, this) +#define NETLIB_DELEGATE(name) \ + nl_delegate(&std::remove_pointer_t<decltype(this)>::name, this) + +#define NETLIB_DELEGATE_NOOP() \ + nl_delegate(&core_device_t::handler_noop, \ + static_cast<core_device_t *>(this)) + +#define NETLIB_UPDATE_TERMINALSI() \ + virtual void update_terminals() noexcept override +#define NETLIB_HANDLERI(name) void name() noexcept +#define NETLIB_UPDATE_PARAMI() virtual void update_param() noexcept override +#define NETLIB_RESETI() virtual void reset() override + +#define NETLIB_SUB(chip) sub_device_wrapper<nld_##chip> +#define NETLIB_SUB_NS(ns, chip) sub_device_wrapper<ns ::nld_##chip> + +#define NETLIB_SUB_UPTR(ns, chip) device_arena::unique_ptr<ns ::nld_##chip> + +#define NETLIB_HANDLER(chip, name) void NETLIB_NAME(chip)::name() noexcept + +#define NETLIB_RESET(chip) void NETLIB_NAME(chip)::reset(void) + +#define NETLIB_UPDATE_PARAM(chip) \ + void NETLIB_NAME(chip)::update_param() noexcept + +#define NETLIB_UPDATE_TERMINALS(chip) \ + void NETLIB_NAME(chip)::update_terminals() noexcept + +#endif // NL_CORE_DEVICE_MACROS_H_ diff --git a/src/lib/netlist/core/devices.h b/src/lib/netlist/core/devices.h new file mode 100644 index 00000000000..29667723bf5 --- /dev/null +++ b/src/lib/netlist/core/devices.h @@ -0,0 +1,166 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef NL_CORE_DEVICES_H_ +#define NL_CORE_DEVICES_H_ + +/// +/// \file devices.h +/// +/// The core is accessing members or type definitions of devices defined +/// here directly (e.g. nld_nc_pin). +/// + +#include "analog.h" +#include "device.h" +#include "device_macros.h" +#include "logic.h" +#include "param.h" + +//============================================================ +// Namespace starts +//============================================================ + +namespace netlist::devices +{ + // ----------------------------------------------------------------------------- + // main clock + // ----------------------------------------------------------------------------- + + NETLIB_OBJECT(mainclock) + { + NETLIB_CONSTRUCTOR(mainclock) + , m_Q(*this, "Q"), m_freq(*this, "FREQ", nlconst::magic(7159000.0 * 5)) + { + m_inc = netlist_time::from_fp( + plib::reciprocal(m_freq() * nlconst::two())); + } + + NETLIB_RESETI() { m_Q.net().set_next_scheduled_time(exec().time()); } + + NETLIB_UPDATE_PARAMI() + { + m_inc = netlist_time::from_fp( + plib::reciprocal(m_freq() * nlconst::two())); + } + + public: + logic_output_t m_Q; // NOLINT: needed in core + netlist_time m_inc; // NOLINT: needed in core + private: + param_fp_t m_freq; + }; + + // ----------------------------------------------------------------------------- + // power pins - not a device, but a helper + // ----------------------------------------------------------------------------- + + /// \brief Power pins class. + /// + /// Power Pins are passive inputs. Delegate noop will silently ignore any + /// updates. + + class nld_power_pins + { + public: + using constructor_type = nld_power_pins; + + explicit nld_power_pins(device_t &owner) + : m_VCC(owner, owner.logic_family()->vcc_pin(), NETLIB_DELEGATE(noop)) + , m_GND(owner, owner.logic_family()->gnd_pin(), NETLIB_DELEGATE(noop)) + { + } + + explicit nld_power_pins(device_t &owner, nl_delegate delegate) + : m_VCC(owner, owner.logic_family()->vcc_pin(), delegate) + , m_GND(owner, owner.logic_family()->gnd_pin(), delegate) + { + } + + // Some devices like the 74LS629 have two pairs of supply pins. + explicit nld_power_pins(device_t &owner, const pstring &vcc, + const pstring &gnd) + : m_VCC(owner, vcc, NETLIB_DELEGATE(noop)) + , m_GND(owner, gnd, NETLIB_DELEGATE(noop)) + { + } + + // Some devices like the 74LS629 have two pairs of supply pins. + explicit nld_power_pins(device_t &owner, const pstring &vcc, + const pstring &gnd, nl_delegate delegate) + : m_VCC(owner, vcc, delegate) + , m_GND(owner, gnd, delegate) + { + } + + const analog_input_t &VCC() const noexcept { return m_VCC; } + const analog_input_t &GND() const noexcept { return m_GND; } + + private: + void noop() {} + analog_input_t m_VCC; + analog_input_t m_GND; + }; + + // ----------------------------------------------------------------------------- + // netlist parameters + // ----------------------------------------------------------------------------- + + NETLIB_OBJECT(netlistparams) + { + NETLIB_CONSTRUCTOR(netlistparams) + , m_use_deactivate(*this, "USE_DEACTIVATE", false) + , m_startup_strategy(*this, "STARTUP_STRATEGY", 0) + , m_mos_cap_model(*this, "DEFAULT_MOS_CAPMODEL", 2) + , m_max_link_loops(*this, "MAX_LINK_RESOLVE_LOOPS", 100) + { + } + // NETLIB_RESETI() {} + // NETLIB_UPDATE_PARAMI() { } + public: + param_logic_t m_use_deactivate; + param_num_t<unsigned> m_startup_strategy; + param_num_t<unsigned> m_mos_cap_model; + //! How many times do we try to resolve links (connections) + param_num_t<unsigned> m_max_link_loops; + }; + + // ----------------------------------------------------------------------------- + // nld_nc_pin + // + // FIXME: This needs to optimized + // The input can be in de-activated state. + // ----------------------------------------------------------------------------- + + NETLIB_OBJECT(nc_pin) + { + public: + NETLIB_CONSTRUCTOR(nc_pin) + , m_I(*this, "I", NETLIB_DELEGATE_NOOP()) {} + + protected: + // NETLIB_RESETI() {} + + private: + analog_input_t m_I; + }; + + // ----------------------------------------------------------------------------- + // nld_gnd + // ----------------------------------------------------------------------------- + + NETLIB_OBJECT(gnd) + { + NETLIB_CONSTRUCTOR(gnd) + , m_Q(*this, "Q") {} + + NETLIB_UPDATE_PARAMI() { m_Q.push(nlconst::zero()); } + + // NETLIB_RESETI() {} + protected: + analog_output_t m_Q; + }; + +} // namespace netlist::devices + +#endif // NL_CORE_DEVICES_H_ diff --git a/src/lib/netlist/core/exec.h b/src/lib/netlist/core/exec.h new file mode 100644 index 00000000000..091d7181e7d --- /dev/null +++ b/src/lib/netlist/core/exec.h @@ -0,0 +1,124 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file exec.h +/// + +#ifndef NL_CORE_EXEC_H_ +#define NL_CORE_EXEC_H_ + +#include "../nltypes.h" +#include "base_objects.h" +#include "state_var.h" + +#include "../plib/plists.h" +#include "../plib/pstring.h" + +namespace netlist +{ + // ------------------------------------------------------------------------- + // netlist_t + // ------------------------------------------------------------------------- + + class netlist_t // NOLINT(clang-analyzer-optin.performance.Padding) + { + public: + explicit netlist_t(netlist_state_t &state, const pstring &aname); + + netlist_t(const netlist_t &) = delete; + netlist_t &operator=(const netlist_t &) = delete; + netlist_t(netlist_t &&) noexcept = delete; + netlist_t &operator=(netlist_t &&) noexcept = delete; + + virtual ~netlist_t() noexcept = default; + + // run functions + + constexpr const netlist_time_ext &time() const noexcept + { + return m_time; + } + + void process_queue(netlist_time_ext delta) noexcept; + void abort_current_queue_slice() noexcept + { + queue_remove(nullptr); + queue_push(m_time, nullptr); + } + + constexpr const detail::queue_t &queue() const noexcept + { + return m_queue; + } + + template <typename... Args> + void queue_push(Args &&...args) noexcept + { + if (config::use_queue_stats::value && m_use_stats) + m_queue.emplace<true>(std::forward<Args>( + args)...); // NOLINT(performance-move-const-arg) + else + m_queue.emplace<false>(std::forward<Args>( + args)...); // NOLINT(performance-move-const-arg) + } + + template <class R> + void queue_remove(R &&elem) noexcept + { + if (config::use_queue_stats::value && m_use_stats) + m_queue.remove<true>(std::forward<R>(elem)); + else + m_queue.remove<false>(std::forward<R>(elem)); + } + + // Control functions + + void stop(); + void reset(); + + // only used by nltool to create static c-code + devices::nld_solver *solver() const noexcept { return m_solver; } + + // FIXME: force late type resolution + template <typename X = devices::nld_solver> + nl_fptype gmin([[maybe_unused]] X *solver = nullptr) const noexcept + { + return static_cast<X *>(m_solver)->gmin(); + } + + netlist_state_t & nl_state() noexcept { return m_state; } + const netlist_state_t &nl_state() const noexcept { return m_state; } + + log_type & log() noexcept { return m_state.log(); } + const log_type &log() const noexcept { return m_state.log(); } + + void print_stats() const; + + constexpr bool stats_enabled() const noexcept { return m_use_stats; } + void enable_stats(bool val) noexcept { m_use_stats = val; } + + private: + template <bool KEEP_STATS> + void process_queue_stats(netlist_time_ext delta) noexcept; + + netlist_state_t & m_state; + devices::nld_solver *m_solver; + + // mostly rw + // PALIGNAS(16) + netlist_time_ext m_time; + devices::nld_mainclock *m_main_clock; + + // PALIGNAS_CACHELINE() + // PALIGNAS(16) + bool m_use_stats; + detail::queue_t m_queue; + // performance + plib::pperftime_t<true> m_stat_mainloop; + plib::pperfcount_t<true> m_perf_out_processed; + }; + +} // namespace netlist + +#endif // NL_CORE_EXEC_H_ diff --git a/src/lib/netlist/core/logic.h b/src/lib/netlist/core/logic.h new file mode 100644 index 00000000000..ef567398c84 --- /dev/null +++ b/src/lib/netlist/core/logic.h @@ -0,0 +1,212 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file logic.h +/// + +#ifndef NL_CORE_LOGIC_H_ +#define NL_CORE_LOGIC_H_ + +#include "../nltypes.h" +#include "base_objects.h" +#include "logic_family.h" +#include "nets.h" +#include "state_var.h" + +#include "../plib/plists.h" +#include "../plib/pstring.h" + +#include <array> +#include <utility> + +namespace netlist +{ + // ------------------------------------------------------------------------- + // logic_t + // ------------------------------------------------------------------------- + + class logic_t + : public detail::core_terminal_t + , public logic_family_t + { + public: + logic_t(device_t &dev, const pstring &aname, state_e terminal_state, + nl_delegate delegate); + + logic_net_t &net() noexcept + { + return plib::downcast<logic_net_t &>(core_terminal_t::net()); + } + constexpr const logic_net_t &net() const noexcept + { + return plib::downcast<const logic_net_t &>(core_terminal_t::net()); + } + }; + + // ------------------------------------------------------------------------- + // logic_input_t + // ------------------------------------------------------------------------- + + class logic_input_t : public logic_t + { + public: + logic_input_t(device_t &dev, const pstring &aname, + nl_delegate delegate); + + // const netlist_sig_t &operator()() const noexcept + constexpr netlist_sig_t operator()() const noexcept + { + gsl_Expects(terminal_state() != STATE_INP_PASSIVE); + if constexpr (config::use_copy_instead_of_reference::value) + return m_Q_CIR; + else + return net().Q(); + } + + void inactivate() noexcept + { + if (!is_state(STATE_INP_PASSIVE)) + { + set_state(STATE_INP_PASSIVE); + net().remove_from_active_list(*this); + } + } + + void activate() noexcept + { + if (is_state(STATE_INP_PASSIVE)) + { + net().add_to_active_list(*this); + set_state(STATE_INP_ACTIVE); + } + } + + void activate_hl() noexcept + { + if (is_state(STATE_INP_PASSIVE)) + { + net().add_to_active_list(*this); + set_state(STATE_INP_HL); + } + } + + void activate_lh() noexcept + { + if (is_state(STATE_INP_PASSIVE)) + { + net().add_to_active_list(*this); + set_state(STATE_INP_LH); + } + } + }; + + // ------------------------------------------------------------------------- + // logic_output_t + // ------------------------------------------------------------------------- + + class logic_output_t : public logic_t + { + public: + /// \brief logic output constructor + /// + /// The third parameter does nothing. It is provided only for + /// compatibility with tristate_output_t in templatized device models + /// + /// \param dev Device owning this output + /// \param aname The name of this output + /// \param dummy Dummy parameter to allow construction like tristate + /// output + /// + logic_output_t(device_t &dev, const pstring &aname, bool dummy = false); + + void initial(netlist_sig_t val) noexcept; + + void push(netlist_sig_t newQ, const netlist_time &delay) noexcept + { + gsl_Expects(delay >= netlist_time::zero()); + + m_my_net.set_Q_and_push(newQ, delay); // take the shortcut + } + + void set_Q_time(netlist_sig_t newQ, const netlist_time_ext &at) noexcept + { + m_my_net.set_Q_time(newQ, at); // take the shortcut + } + + /// \brief Dummy implementation for templatized generic devices + /// + /// This function shall never be called. It is defined here so that + /// templatized generic device models do not have to do tons of + /// template magic. + /// + /// This function terminates if actually called. + /// + [[noreturn]] static void set_tristate([[maybe_unused]] netlist_sig_t v, + [[maybe_unused]] netlist_time ts_off_on, + [[maybe_unused]] netlist_time ts_on_off) + { + plib::terminate( + "set_tristate on logic_output should never be called!"); + } + + private: + logic_net_t m_my_net; + }; + + // ------------------------------------------------------------------------- + // tristate_output_t + // ------------------------------------------------------------------------- + + /// \brief Tristate output + /// + /// In a lot of applications tristate enable inputs are just connected to + /// VCC/GND to permanently enable the outputs. In this case a pure + /// implementation using analog outputs would not perform well. + /// + /// For this object during creation it can be decided if a logic output or + /// a tristate output is used. Generally the owning device uses parameter + /// FORCE_TRISTATE_LOGIC to determine this. + /// + /// This is the preferred way to implement tristate outputs. + /// + + class tristate_output_t : public logic_output_t + { + public: + tristate_output_t(device_t &dev, const pstring &aname, + bool force_logic); + + void push(netlist_sig_t newQ, netlist_time delay) noexcept + { + if (!m_tristate) + logic_output_t::push(newQ, delay); + m_last_logic = newQ; + } + + void set_tristate(netlist_sig_t v, netlist_time ts_off_on, + netlist_time ts_on_off) noexcept + { + if (!m_force_logic) + if (v != m_tristate) + { + logic_output_t::push((v != 0) ? OUT_TRISTATE() + : m_last_logic, + v ? ts_off_on : ts_on_off); + m_tristate = v; + } + } + + bool is_force_logic() const noexcept { return m_force_logic; } + + private: + using logic_output_t::initial; + using logic_output_t::set_Q_time; + state_var<netlist_sig_t> m_last_logic; + state_var<netlist_sig_t> m_tristate; + bool m_force_logic; + }; + +} // namespace netlist + +#endif // NL_CORE_LOGIC_H_ diff --git a/src/lib/netlist/core/logic_family.h b/src/lib/netlist/core/logic_family.h new file mode 100644 index 00000000000..216e74ead2a --- /dev/null +++ b/src/lib/netlist/core/logic_family.h @@ -0,0 +1,145 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file logic_family.h +/// + +#ifndef NL_CORE_LOGIC_FAMILY_H_ +#define NL_CORE_LOGIC_FAMILY_H_ + +#include "../nltypes.h" + +#include "../plib/palloc.h" +#include "../plib/pmempool.h" +#include "../plib/pstring.h" + +namespace netlist +{ + /// \brief Logic families descriptors are used to create proxy devices. + /// The logic family describes the analog capabilities of logic devices, + /// inputs and outputs. + + class logic_family_desc_t + { + public: + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, + // modernize-use-equals-default) + logic_family_desc_t() = default; + + logic_family_desc_t(const logic_family_desc_t &) = delete; + logic_family_desc_t &operator=(const logic_family_desc_t &) = delete; + + // FOXME: Should be move constructible + logic_family_desc_t(logic_family_desc_t &&) noexcept = delete; + logic_family_desc_t &operator=( + logic_family_desc_t &&) noexcept = delete; + + virtual ~logic_family_desc_t() noexcept = default; + + virtual device_arena::unique_ptr<devices::nld_base_d_to_a_proxy> + create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, + const logic_output_t *proxied) const = 0; + virtual device_arena::unique_ptr<devices::nld_base_a_to_d_proxy> + create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, + const logic_input_t *proxied) const = 0; + + nl_fptype low_threshold_V(nl_fptype VN, nl_fptype VP) const noexcept + { + return VN + (VP - VN) * m_low_threshold_PCNT; + } + nl_fptype high_threshold_V(nl_fptype VN, nl_fptype VP) const noexcept + { + return VN + (VP - VN) * m_high_threshold_PCNT; + } + nl_fptype low_offset_V() const noexcept { return m_low_VO; } + nl_fptype high_offset_V() const noexcept { return m_high_VO; } + nl_fptype R_low() const noexcept { return m_R_low; } + nl_fptype R_high() const noexcept { return m_R_high; } + + bool is_above_high_threshold_V(nl_fptype V, nl_fptype VN, + nl_fptype VP) const noexcept + { + return V > high_threshold_V(VN, VP); + } + + bool is_below_low_threshold_V(nl_fptype V, nl_fptype VN, + nl_fptype VP) const noexcept + { + return V < low_threshold_V(VN, VP); + } + + pstring vcc_pin() const { return pstring(m_vcc); } + pstring gnd_pin() const { return pstring(m_gnd); } + + nl_fptype m_low_threshold_PCNT; //!< low input threshold offset. If the + //!< input voltage is below this value + //!< times supply voltage, a "0" input + //!< is signalled + nl_fptype m_high_threshold_PCNT; //!< high input threshold offset. If + //!< the input voltage is above the + //!< value times supply voltage, a "0" + //!< input is signalled + nl_fptype m_low_VO; //!< low output voltage offset. This voltage is + //!< output if the ouput is "0" + nl_fptype m_high_VO; //!< high output voltage offset. The supply voltage + //!< minus this offset is output if the ouput is + //!< "1" + nl_fptype m_R_low; //!< low output resistance. Value of series resistor + //!< used for low output + nl_fptype m_R_high; //!< high output resistance. Value of series + //!< resistor used for high output + const char *m_vcc; //!< default power pin name for positive supply + const char *m_gnd; //!< default power pin name for negative supply + }; + + /// \brief Base class for devices, terminals, outputs and inputs which + /// support + /// logic families. + /// This class is a storage container to store the logic family for a + /// netlist object. You will not directly use it. Please refer to + /// \ref NETLIB_FAMILY to learn how to define a logic family for a device. + /// + /// All terminals inherit the family description from the device + /// The default is the ttl family, but any device can override the family. + /// For individual terminals, the family can be overwritten as well. + /// + + class logic_family_t + { + public: + logic_family_t() + : m_logic_family(nullptr) + { + } + logic_family_t(const logic_family_desc_t *d) + : m_logic_family(d) + { + } + + logic_family_t(const logic_family_t &) = delete; + logic_family_t &operator=(const logic_family_t &) = delete; + + // FIXME: logic family can be move constructible. + logic_family_t(logic_family_t &&) noexcept = delete; + logic_family_t &operator=(logic_family_t &&) noexcept = delete; + + const logic_family_desc_t *logic_family() const noexcept + { + return m_logic_family; + } + void set_logic_family(const logic_family_desc_t *fam) noexcept + { + m_logic_family = fam; + } + + protected: + ~logic_family_t() noexcept = default; // prohibit polymorphic + // destruction + private: + const logic_family_desc_t *m_logic_family; + }; + +} // namespace netlist + +#endif // NL_CORE_LOGIC_FAMILY_H_ diff --git a/src/lib/netlist/core/netlist_state.h b/src/lib/netlist/core/netlist_state.h new file mode 100644 index 00000000000..505665d9acf --- /dev/null +++ b/src/lib/netlist/core/netlist_state.h @@ -0,0 +1,295 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file netlist_state.h +/// + +#ifndef NL_CORE_NETLIST_STATE_H_ +#define NL_CORE_NETLIST_STATE_H_ + +#include "../nltypes.h" +#include "queue.h" + +#include "../plib/plists.h" +#include "../plib/pmempool.h" +#include "../plib/pstate.h" +#include "../plib/pstring.h" + +#include <array> +#include <unordered_map> +#include <utility> +#include <vector> + +namespace netlist +{ + // ----------------------------------------------------------------------------- + // netlist_state__t + // ----------------------------------------------------------------------------- + + class netlist_state_t + { + public: + using nets_collection_type = std::vector< + device_arena::owned_ptr<detail::net_t>>; + using family_collection_type = std::unordered_map< + pstring, host_arena::unique_ptr<logic_family_desc_t>>; + + // need to preserve order of device creation ... + using devices_collection_type = std::vector< + std::pair<pstring, device_arena::owned_ptr<core_device_t>>>; + + netlist_state_t(const pstring &name, plib::plog_delegate logger); + + PCOPYASSIGNMOVE(netlist_state_t, delete) + + /// \brief Destructor + /// + /// The destructor is virtual to allow implementation specific devices + /// to connect to the outside world. For examples see MAME netlist.cpp. + /// + virtual ~netlist_state_t() noexcept = default; + + template <class C> + static bool check_class(core_device_t *p) noexcept + { + return bool(plib::dynamic_downcast<C *>(p)); + } + + core_device_t * + get_single_device(const pstring &classname, + bool (*cc)(core_device_t *)) const noexcept(false); + + /// \brief Get single device filtered by class and name + /// + /// \tparam C Device class for which devices will be returned + /// \param name Name of the device + /// + /// \return pointers to device + + template <class C> + C *get_single_device(const pstring &name) const + { + return dynamic_cast<C *>(get_single_device(name, check_class<C>)); + } + + /// \brief Get vector of devices + /// + /// \tparam C Device class for which devices will be returned + /// + /// \return vector with pointers to devices + + template <class C> + std::vector<C *> get_device_list() const + { + std::vector<C *> tmp; + for (const auto &d : m_devices) + { + if (auto dev = plib::dynamic_downcast<C *>(d.second.get())) + tmp.push_back(*dev); + } + return tmp; + } + + // logging + + log_type &log() noexcept { return m_log; } + const log_type &log() const noexcept { return m_log; } + + plib::dynamic_library_base &static_solver_lib() const noexcept + { + return *m_lib; + } + + /// \brief provide library with static solver implementations. + /// + /// By default no static solvers are provided since these are + /// determined by the specific use case. You can pass such a collection + /// of symbols with this method. + /// + void set_static_solver_lib( + std::unique_ptr<plib::dynamic_library_base> &&lib); + + netlist_t &exec() noexcept { return *m_netlist; } + const netlist_t &exec() const noexcept { return *m_netlist; } + + // state handling + plib::state_manager_t &run_state_manager() noexcept { return m_state; } + + template <typename O, typename C> + void + save(O &owner, C &state, const pstring &module, const pstring &stname) + { + this->run_state_manager().save_item(plib::void_ptr_cast(&owner), + state, module + "." + stname); + } + + template <typename O, typename C> + void save(O &owner, C *state, const pstring &module, + const pstring &stname, const std::size_t count) + { + this->run_state_manager().save_state_ptr( + plib::void_ptr_cast(&owner), module + "." + stname, + plib::state_manager_t::dtype<C>(), count, state); + } + + // FIXME: only used by queue_t save state + std::size_t find_net_id(const detail::net_t *net) const; + detail::net_t *net_by_id(std::size_t id) const; + + template <typename T> + void register_net(device_arena::owned_ptr<T> &&net) + { + m_nets.push_back(std::move(net)); + } + + /// \brief Get device pointer by name + /// + /// + /// \param name Name of the device + /// + /// \return core_device_t pointer if device exists, else nullptr + + core_device_t *find_device(const pstring &name) const + { + for (const auto &d : m_devices) + if (d.first == name) + return d.second.get(); + return nullptr; + } + + /// \brief Register device using owned_ptr + /// + /// Used to register owned devices. These are devices declared as + /// objects in another devices. + /// + /// \param name Name of the device + /// \param dev Device to be registered + + template <typename T> + void register_device(const pstring &name, + device_arena::owned_ptr<T> &&dev) noexcept(false) + { + for (auto &d : m_devices) + if (d.first == name) + { + dev.release(); + log().fatal(MF_DUPLICATE_NAME_DEVICE_LIST(name)); + throw nl_exception(MF_DUPLICATE_NAME_DEVICE_LIST(name)); + } + // m_devices.push_back(std::move(dev)); + m_devices.insert(m_devices.end(), {name, std::move(dev)}); + } + + /// \brief Register device using unique_ptr + /// + /// Used to register devices. + /// + /// \param name Name of the device + /// \param dev Device to be registered + + template <typename T> + void + register_device(const pstring &name, device_arena::unique_ptr<T> &&dev) + { + register_device(name, device_arena::owned_ptr<T>( + dev.release(), true, dev.get_deleter())); + } + + /// \brief Remove device + /// + /// Care needs to be applied if this is called to remove devices with + /// sub-devices which may have registered state. + /// + /// \param dev Device to be removed + + void remove_device(core_device_t *dev); + + setup_t &setup() noexcept { return *m_setup; } + const setup_t &setup() const noexcept { return *m_setup; } + + nlparse_t &parser() noexcept; + const nlparse_t &parser() const noexcept; + + // FIXME: make a post load member and include code there + void rebuild_lists(); // must be called after post_load ! + + static void + compile_defines(std::vector<std::pair<pstring, pstring>> &defs); + static pstring version(); + static pstring version_patchlevel(); + + nets_collection_type &nets() noexcept { return m_nets; } + const nets_collection_type &nets() const noexcept { return m_nets; } + + devices_collection_type &devices() noexcept { return m_devices; } + const devices_collection_type &devices() const noexcept + { + return m_devices; + } + + family_collection_type &family_cache() { return m_family_cache; } + + template <typename T, typename... Args> + device_arena::unique_ptr<T> make_pool_object(Args &&...args) + { + return plib::make_unique<T>(m_pool, std::forward<Args>(args)...); + } + // memory pool - still needed in some places + device_arena &pool() noexcept { return m_pool; } + const device_arena &pool() const noexcept { return m_pool; } + + struct stats_info + { + const detail::queue_t &m_queue; // performance + const plib::pperftime_t<true> &m_stat_mainloop; + const plib::pperfcount_t<true> &m_perf_out_processed; + }; + + /// \brief print statistics gathered during run + /// + void print_stats(stats_info &si) const; + + /// \brief call reset on all netlist components + /// + void reset(); + + /// \brief prior to running free no longer needed resources + /// + void free_setup_resources(); +#if !(NL_USE_INPLACE_CORE_TERMS) + std::vector<detail::core_terminal_t *> & + core_terms(const detail::net_t &net) + { + return m_core_terms[&net]; + } +#endif + private: + device_arena m_pool; // must be deleted last! + + device_arena::unique_ptr<netlist_t> m_netlist; + std::unique_ptr<plib::dynamic_library_base> m_lib; + plib::state_manager_t m_state; + log_type m_log; + + // FIXME: should only be available during device construction + host_arena::unique_ptr<setup_t> m_setup; + + nets_collection_type m_nets; + // sole use is to manage lifetime of net objects + devices_collection_type m_devices; + // sole use is to manage lifetime of family objects + family_collection_type m_family_cache; +#if !(NL_USE_INPLACE_CORE_TERMS) + // all terms for a net + std::unordered_map<const detail::net_t *, + std::vector<detail::core_terminal_t *>> + m_core_terms; +#endif + // dummy version + int m_dummy_version; + }; + +} // namespace netlist + +#endif // NL_CORE_NETLIST_STATE_H_ diff --git a/src/lib/netlist/core/nets.h b/src/lib/netlist/core/nets.h new file mode 100644 index 00000000000..1a81c7ecd1c --- /dev/null +++ b/src/lib/netlist/core/nets.h @@ -0,0 +1,401 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file nets.h +/// + +#ifndef NL_CORE_NETS_H_ +#define NL_CORE_NETS_H_ + +#include "../nltypes.h" +#include "base_objects.h" +#include "core_device.h" +#include "exec.h" +#include "state_var.h" + +#include "../plib/plists.h" +#include "../plib/pstring.h" + +#include <algorithm> + +namespace netlist +{ + namespace detail + { + + // --------------------------------------------------------------------- + // net_t + // --------------------------------------------------------------------- + + class net_t : public netlist_object_t + { + public: + enum class queue_status + { + DELAYED_DUE_TO_INACTIVE = 0, + QUEUED, + DELIVERED + }; + + net_t(netlist_state_t &nl, const pstring &aname, + core_terminal_t *rail_terminal = nullptr); + + net_t(const net_t &) = delete; + net_t &operator=(const net_t &) = delete; + net_t(net_t &&) noexcept = delete; + net_t &operator=(net_t &&) noexcept = delete; + + virtual ~net_t() noexcept = default; + + virtual void reset() noexcept; + + // ----------------------------------------------------------------- + // Hot section + // + // Any changes below will impact performance. + // ----------------------------------------------------------------- + + constexpr void toggle_new_Q() noexcept { m_new_Q = (m_cur_Q ^ 1); } + + void toggle_and_push_to_queue(const netlist_time &delay) noexcept + { + toggle_new_Q(); + push_to_queue(delay); + } + + void push_to_queue(const netlist_time &delay) noexcept; + + constexpr bool is_queued() const noexcept + { + return m_in_queue == queue_status::QUEUED; + } + + // ----------------------------------------------------------------- + // Very hot + // ----------------------------------------------------------------- + + template <bool KEEP_STATS> + void update_devs() noexcept; + + constexpr const netlist_time_ext & + next_scheduled_time() const noexcept + { + return m_next_scheduled_time; + } + void set_next_scheduled_time( + const netlist_time_ext &next_time) noexcept + { + m_next_scheduled_time = next_time; + } + + bool is_rail_net() const noexcept + { + return !(m_rail_terminal == nullptr); + } + core_terminal_t &rail_terminal() const noexcept + { + return *m_rail_terminal; + } + + void add_to_active_list(core_terminal_t &term) noexcept; + void remove_from_active_list(core_terminal_t &term) noexcept; + + // ----------------------------------------------------------------- + // setup stuff - cold + // ----------------------------------------------------------------- + + bool is_logic() const noexcept; + bool is_analog() const noexcept; + + void rebuild_list() noexcept(false); // rebuild m_list after a load + + void update_inputs() noexcept + { + if constexpr (config::use_copy_instead_of_reference::value) + { + for (auto *term : core_terms_ref()) + term->set_copied_input(m_cur_Q); + } + } + + // ----------------------------------------------------------------- + // net management + // ----------------------------------------------------------------- + + std::vector<detail::core_terminal_t *> + core_terms_copy() noexcept(false) + { + std::vector<detail::core_terminal_t *> ret( + core_terms_ref().size()); + std::copy(core_terms_ref().begin(), core_terms_ref().end(), + ret.begin()); + return ret; + } + + void remove_terminal(detail::core_terminal_t &term) noexcept(false); + void remove_all_terminals() noexcept(false); + void add_terminal(detail::core_terminal_t &terminal) noexcept( + false); + + bool core_terms_empty() noexcept(false) + { + return core_terms_ref().empty(); + } + + protected: + // only used for logic nets + constexpr const netlist_sig_t &Q() const noexcept + { + return m_cur_Q; + } + + // only used for logic nets + void initial(netlist_sig_t val) noexcept + { + m_cur_Q = m_new_Q = val; + update_inputs(); + } + + // only used for logic nets + void set_Q_and_push(netlist_sig_t newQ, + const netlist_time & delay) noexcept; + + // only used for logic nets + void set_Q_time(netlist_sig_t newQ, + const netlist_time_ext & at) noexcept; + + private: +#if NL_USE_INPLACE_CORE_TERMS + const plib::linked_list_t<core_terminal_t, 1> & + core_terms_ref() const noexcept + { + return m_core_terms; + } +#else + std::vector<detail::core_terminal_t *> &core_terms_ref() + { + return state().core_terms(*this); + } +#endif + state_var<netlist_sig_t> m_new_Q; + state_var<netlist_sig_t> m_cur_Q; + state_var<queue_status> m_in_queue; + // FIXME: this needs to be saved as well + plib::linked_list_t<core_terminal_t, 0> m_list_active; + state_var<netlist_time_ext> m_next_scheduled_time; + + core_terminal_t *m_rail_terminal; +#if NL_USE_INPLACE_CORE_TERMS + plib::linked_list_t<core_terminal_t, 1> m_core_terms; +#endif + }; + + inline void net_t::push_to_queue(const netlist_time &delay) noexcept + { + if (is_queued()) + exec().queue_remove(this); + + m_next_scheduled_time = exec().time() + delay; + if constexpr (config::avoid_noop_queue_pushes::value) + m_in_queue = (m_list_active.empty() + ? queue_status::DELAYED_DUE_TO_INACTIVE + : (m_new_Q != m_cur_Q + ? queue_status::QUEUED + : queue_status::DELIVERED)); + else + m_in_queue = m_list_active.empty() + ? queue_status::DELAYED_DUE_TO_INACTIVE + : queue_status::QUEUED; + + if (m_in_queue == queue_status::QUEUED) + exec().queue_push(m_next_scheduled_time, this); + else + update_inputs(); + } + + template <bool KEEP_STATS> + void net_t::update_devs() noexcept + { + gsl_Expects(this->is_rail_net()); + + m_in_queue = queue_status::DELIVERED; // mark as taken ... + + const netlist_sig_t new_Q(m_new_Q); + const netlist_sig_t cur_Q(m_cur_Q); + if (config::avoid_noop_queue_pushes::value + || ((new_Q ^ cur_Q) != 0)) + { + m_cur_Q = new_Q; + const auto mask = (new_Q << core_terminal_t::INP_LH_SHIFT) + | (cur_Q << core_terminal_t::INP_HL_SHIFT); + + if (!KEEP_STATS) + { + for (core_terminal_t *p : m_list_active) + { + p->set_copied_input(new_Q); + if ((p->terminal_state() & mask) != 0) + p->run_delegate(); + } + } + else + { + for (core_terminal_t *p : m_list_active) + { + p->set_copied_input(new_Q); + auto *stats(p->device().stats()); + stats->m_stat_call_count.inc(); + if ((p->terminal_state() & mask)) + { + auto g(stats->m_stat_total_time.guard()); + p->run_delegate(); + } + } + } + } + } + + inline void net_t::add_to_active_list(core_terminal_t &term) noexcept + { + if (!m_list_active.empty()) + { + term.set_copied_input(m_cur_Q); + m_list_active.push_front(&term); + } + else + { + m_list_active.push_front(&term); + rail_terminal().device().do_inc_active(); + if (m_in_queue == queue_status::DELAYED_DUE_TO_INACTIVE) + { + // if we avoid queue pushes we must test if m_cur_Q and + // m_new_Q are equal + if ((!config::avoid_noop_queue_pushes::value + || (m_cur_Q != m_new_Q)) + && (m_next_scheduled_time > exec().time())) + { + m_in_queue = queue_status::QUEUED; // pending + exec().queue_push(m_next_scheduled_time, this); + } + else + { + m_in_queue = queue_status::DELIVERED; + m_cur_Q = m_new_Q; + } + update_inputs(); + } + else + term.set_copied_input(m_cur_Q); + } + } + + inline void net_t::remove_from_active_list( + core_terminal_t &term) noexcept + { + gsl_Expects(!m_list_active.empty()); + m_list_active.remove(&term); + if (m_list_active.empty()) + { + if constexpr (true || config::avoid_noop_queue_pushes::value) + { + // All our connected outputs have signalled they no longer + // will act on input. We thus remove any potentially queued + // events and mark them. + // FIXME: May cause regression test to fail - revisit in + // this case + // + // This code is definitively needed for the + // AVOID_NOOP_QUEUE_PUSHES code path - therefore I left + // the if statement in and enabled it for all code paths + if (is_queued()) + { + exec().queue_remove(this); + m_in_queue = queue_status::DELAYED_DUE_TO_INACTIVE; + } + } + rail_terminal().device().do_dec_active(); + } + } + + // only used for logic nets + inline void net_t::set_Q_and_push(netlist_sig_t newQ, + const netlist_time & delay) noexcept + { + gsl_Expects(delay >= netlist_time::zero()); + + if (newQ != m_new_Q) + { + m_new_Q = newQ; + push_to_queue(delay); + } + } + + // only used for logic nets + inline void net_t::set_Q_time(netlist_sig_t newQ, + const netlist_time_ext & at) noexcept + { + gsl_Expects(at >= netlist_time_ext::zero()); + + if (newQ != m_new_Q) + { + m_in_queue = queue_status::DELAYED_DUE_TO_INACTIVE; + m_next_scheduled_time = at; + m_cur_Q = m_new_Q = newQ; + update_inputs(); + } + else + { + m_cur_Q = newQ; + update_inputs(); + } + } + + } // namespace detail + + class analog_net_t : public detail::net_t + { + public: + analog_net_t(netlist_state_t &nl, const pstring &aname, + detail::core_terminal_t *rail_terminal = nullptr); + + void reset() noexcept override; + + const nl_fptype &Q_Analog() const noexcept { return m_cur_Analog; } + void set_Q_Analog(nl_fptype v) noexcept { m_cur_Analog = v; } + // used by solver code ... + nl_fptype *Q_Analog_state_ptr() noexcept { return *m_cur_Analog; } + + // FIXME: needed by current solver code + solver::matrix_solver_t *solver() const noexcept { return m_solver; } + void set_solver(solver::matrix_solver_t *solver) noexcept + { + m_solver = solver; + } + + friend constexpr bool operator==(const analog_net_t &lhs, + const analog_net_t & rhs) noexcept + { + return &lhs == &rhs; + } + + private: + state_var<nl_fptype> m_cur_Analog; + solver::matrix_solver_t *m_solver; + }; + + class logic_net_t : public detail::net_t + { + public: + logic_net_t(netlist_state_t &nl, const pstring &aname, + detail::core_terminal_t *rail_terminal = nullptr); + + using detail::net_t::initial; + using detail::net_t::Q; + using detail::net_t::set_Q_and_push; + using detail::net_t::set_Q_time; + }; + +} // namespace netlist + +#endif // NL_CORE_NETS_H_ diff --git a/src/lib/netlist/core/object_array.h b/src/lib/netlist/core/object_array.h new file mode 100644 index 00000000000..cf1bc5ea4af --- /dev/null +++ b/src/lib/netlist/core/object_array.h @@ -0,0 +1,251 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file param.h +/// + +#ifndef NL_CORE_OBJECT_ARRAY_H_ +#define NL_CORE_OBJECT_ARRAY_H_ + +#include "base_objects.h" +#include "logic.h" + +#include "../nltypes.h" + +#include "../plib/pfmtlog.h" +#include "../plib/plists.h" +#include "../plib/pstring.h" + +#include <array> +#include <utility> + +namespace netlist +{ + template<class C, std::size_t N> + class object_array_base_t : public plib::static_vector<C, N> + { + public: + template<class D, typename... Args> + //object_array_base_t(D &dev, const std::initializer_list<const char *> &names, Args&&... args) + object_array_base_t(D &dev, std::array<const char *, N> &&names, Args&&... args) + { + for (std::size_t i = 0; i<N; i++) + this->emplace_back(dev, pstring(names[i]), std::forward<Args>(args)...); + } + + template<class D> + object_array_base_t(D &dev, const pstring &fmt) + { + for (std::size_t i = 0; i<N; i++) + this->emplace_back(dev, formatted(fmt, i)); + } + + template<class D, typename... Args> + object_array_base_t(D &dev, std::size_t offset, const pstring &fmt, Args&&... args) + { + for (std::size_t i = 0; i<N; i++) + this->emplace_back(dev, formatted(fmt, i+offset), std::forward<Args>(args)...); + } + + template<class D> + object_array_base_t(D &dev, std::size_t offset, const pstring &fmt, nl_delegate delegate) + { + for (std::size_t i = 0; i<N; i++) + this->emplace_back(dev, formatted(fmt, i+offset), delegate); + } + + template<class D> + object_array_base_t(D &dev, std::size_t offset, std::size_t output_mask, const pstring &fmt) + { + for (std::size_t i = 0; i<N; i++) + { + pstring name(formatted(fmt, i+offset)); + if ((output_mask >> i) & 1) + name += "Q"; + this->emplace(i, dev, name); + } + } + protected: + object_array_base_t() = default; + + static pstring formatted(const pstring &fmt, std::size_t n) + { + if (N != 1) + return plib::pfmt(fmt)(n); + return plib::pfmt(fmt)(""); + } + }; + + + template<class C, std::size_t N> + class object_array_t : public object_array_base_t<C, N> + { + public: + using base_type = object_array_base_t<C, N>; + using base_type::base_type; + }; + + template<std::size_t N> + class object_array_t<logic_input_t,N> : public object_array_base_t<logic_input_t, N> + { + public: + using base_type = object_array_base_t<logic_input_t, N>; + using base_type::base_type; + + template<class D, std::size_t ND> + object_array_t(D &dev, std::size_t offset, std::size_t output_mask, + const pstring &fmt, std::array<nl_delegate, ND> &&delegates) + { + static_assert(N <= ND, "initializer_list size mismatch"); + std::size_t i = 0; + for (auto &e : delegates) + { + if (i < N) + { + pstring name(this->formatted(fmt, i+offset)); + if ((output_mask >> i) & 1) + name += "Q"; + this->emplace_back(dev, name, e); + } + i++; + } + } + + //using value_type = typename plib::fast_type_for_bits<N>::type; + using value_type = std::uint32_t; + value_type operator ()() + { + if (N == 1) return e<0>() ; + if (N == 2) return e<0>() | (e<1>() << 1); + if (N == 3) return e<0>() | (e<1>() << 1) | (e<2>() << 2); + if (N == 4) return e<0>() | (e<1>() << 1) | (e<2>() << 2) | (e<3>() << 3); + if (N == 5) return e<0>() | (e<1>() << 1) | (e<2>() << 2) | (e<3>() << 3) + | (e<4>() << 4); + if (N == 6) return e<0>() | (e<1>() << 1) | (e<2>() << 2) | (e<3>() << 3) + | (e<4>() << 4) | (e<5>() << 5); + if (N == 7) return e<0>() | (e<1>() << 1) | (e<2>() << 2) | (e<3>() << 3) + | (e<4>() << 4) | (e<5>() << 5) | (e<6>() << 6); + if (N == 8) return e<0>() | (e<1>() << 1) | (e<2>() << 2) | (e<3>() << 3) + | (e<4>() << 4) | (e<5>() << 5) | (e<6>() << 6) | (e<7>() << 7); + + value_type r(0); + for (std::size_t i = 0; i < N; i++) + r = static_cast<value_type>((*this)[i]() << (N-1)) | (r >> 1); + return r; + } + + private: + template <std::size_t P> + constexpr value_type e() const { return (*this)[P](); } + }; + + template<std::size_t N> + class object_array_t<logic_output_t,N> : public object_array_base_t<logic_output_t, N> + { + public: + using base_type = object_array_base_t<logic_output_t, N>; + using base_type::base_type; + + template <typename T> + void push(const T &v, const netlist_time &t) + { + if (N >= 1) (*this)[0].push((v >> 0) & 1, t); + if (N >= 2) (*this)[1].push((v >> 1) & 1, t); + if (N >= 3) (*this)[2].push((v >> 2) & 1, t); + if (N >= 4) (*this)[3].push((v >> 3) & 1, t); + if (N >= 5) (*this)[4].push((v >> 4) & 1, t); + if (N >= 6) (*this)[5].push((v >> 5) & 1, t); + if (N >= 7) (*this)[6].push((v >> 6) & 1, t); + if (N >= 8) (*this)[7].push((v >> 7) & 1, t); + for (std::size_t i = 8; i < N; i++) + (*this)[i].push((v >> i) & 1, t); + } + + template<typename T> + void push(const T &v, const netlist_time * t) + { + if (N >= 1) (*this)[0].push((v >> 0) & 1, t[0]); + if (N >= 2) (*this)[1].push((v >> 1) & 1, t[1]); + if (N >= 3) (*this)[2].push((v >> 2) & 1, t[2]); + if (N >= 4) (*this)[3].push((v >> 3) & 1, t[3]); + if (N >= 5) (*this)[4].push((v >> 4) & 1, t[4]); + if (N >= 6) (*this)[5].push((v >> 5) & 1, t[5]); + if (N >= 7) (*this)[6].push((v >> 6) & 1, t[6]); + if (N >= 8) (*this)[7].push((v >> 7) & 1, t[7]); + for (std::size_t i = 8; i < N; i++) + (*this)[i].push((v >> i) & 1, t[i]); + } + + template<typename T, std::size_t NT> + void push(const T &v, const std::array<const netlist_time, NT> &t) + { + static_assert(NT >= N, "Not enough timing entries provided"); + + push(v, t.data()); + } + + void set_tristate(netlist_sig_t v, + netlist_time ts_off_on, netlist_time ts_on_off) noexcept + { + for (std::size_t i = 0; i < N; i++) + (*this)[i].set_tristate(v, ts_off_on, ts_on_off); + } + }; + + template<std::size_t N> + class object_array_t<tristate_output_t, N> : public object_array_base_t<tristate_output_t, N> + { + public: + using base_type = object_array_base_t<tristate_output_t, N>; + using base_type::base_type; + + template <typename T> + void push(const T &v, const netlist_time &t) + { + if (N >= 1) (*this)[0].push((v >> 0) & 1, t); + if (N >= 2) (*this)[1].push((v >> 1) & 1, t); + if (N >= 3) (*this)[2].push((v >> 2) & 1, t); + if (N >= 4) (*this)[3].push((v >> 3) & 1, t); + if (N >= 5) (*this)[4].push((v >> 4) & 1, t); + if (N >= 6) (*this)[5].push((v >> 5) & 1, t); + if (N >= 7) (*this)[6].push((v >> 6) & 1, t); + if (N >= 8) (*this)[7].push((v >> 7) & 1, t); + for (std::size_t i = 8; i < N; i++) + (*this)[i].push((v >> i) & 1, t); + } + + void set_tristate(netlist_sig_t v, + netlist_time ts_off_on, netlist_time ts_on_off) noexcept + { + for (std::size_t i = 0; i < N; i++) + (*this)[i].set_tristate(v, ts_off_on, ts_on_off); + } + }; + + // ----------------------------------------------------------------------------- + // Externals + // ----------------------------------------------------------------------------- + + extern template class object_array_t<logic_input_t, 1>; + extern template class object_array_t<logic_input_t, 2>; + extern template class object_array_t<logic_input_t, 3>; + extern template class object_array_t<logic_input_t, 4>; + extern template class object_array_t<logic_input_t, 5>; + extern template class object_array_t<logic_input_t, 6>; + extern template class object_array_t<logic_input_t, 7>; + extern template class object_array_t<logic_input_t, 8>; + + extern template class object_array_t<logic_output_t, 1>; + extern template class object_array_t<logic_output_t, 2>; + extern template class object_array_t<logic_output_t, 3>; + extern template class object_array_t<logic_output_t, 4>; + extern template class object_array_t<logic_output_t, 5>; + extern template class object_array_t<logic_output_t, 6>; + extern template class object_array_t<logic_output_t, 7>; + extern template class object_array_t<logic_output_t, 8>; + +} // namespace netlist + + +#endif // NL_CORE_OBJECT_ARRAY_H_ diff --git a/src/lib/netlist/core/param.h b/src/lib/netlist/core/param.h new file mode 100644 index 00000000000..34e6c3b1b1e --- /dev/null +++ b/src/lib/netlist/core/param.h @@ -0,0 +1,367 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file param.h +/// + +#ifndef NL_CORE_PARAM_H_ +#define NL_CORE_PARAM_H_ + +#include "../nltypes.h" +#include "base_objects.h" +#include "core_device.h" +#include "setup.h" + +#include "../plib/palloc.h" +#include "../plib/pfunction.h" +#include "../plib/pstream.h" +#include "../plib/pstring.h" +#include "../plib/putil.h" // psource_t + +#include <memory> + +namespace netlist +{ + /// @brief Base class for all device parameters + /// + /// All device parameters classes derive from this object. + class param_t : public detail::device_object_t + { + public: + enum param_type_t + { + STRING, + DOUBLE, + INTEGER, + LOGIC, + POINTER // Special-case which is always initialized at MAME startup + // time + }; + + // device-less, it's the responsibility of the owner to register! + param_t(const pstring &name); + + param_t(core_device_t &device, const pstring &name); + + PCOPYASSIGNMOVE(param_t, delete) + virtual ~param_t() noexcept; + + param_type_t param_type() const noexcept(false); + + virtual pstring value_string() const = 0; + + protected: + pstring get_initial(const core_device_t *dev, bool *found) const; + + template <typename C> + void set_and_update_param(C &p, const C v) noexcept + { + if (p != v) + { + p = v; + device().update_param(); + } + } + }; + + // ----------------------------------------------------------------------------- + // numeric parameter template + // ----------------------------------------------------------------------------- + + template <typename T> + class param_num_t final : public param_t + { + public: + using value_type = T; + + param_num_t(core_device_t &device, const pstring &name, T val) noexcept( + false); + + constexpr const T &operator()() const noexcept { return m_param; } + constexpr operator const T &() const noexcept { return m_param; } + + void set(const T ¶m) noexcept + { + set_and_update_param(m_param, param); + } + + pstring value_string() const override + { + return plib::pfmt("{}").e(gsl::narrow<nl_fptype>(m_param)); + } + + private: + T m_param; + }; + + template <typename T> + class param_enum_t final : public param_t + { + public: + using value_type = T; + + param_enum_t(core_device_t &device, const pstring &name, + T val) noexcept(false); + + constexpr T operator()() const noexcept { return m_param; } + constexpr operator T() const noexcept { return m_param; } + void set(const T ¶m) noexcept + { + set_and_update_param(m_param, param); + } + + pstring value_string() const override + { + // returns the numerical value + return plib::pfmt("{}")(static_cast<int>(m_param)); + } + + private: + T m_param; + }; + + // ----------------------------------------------------------------------------- + // pointer parameter + // ----------------------------------------------------------------------------- + + // FIXME: not a core component -> legacy + class param_ptr_t final : public param_t + { + public: + param_ptr_t(core_device_t &device, const pstring &name, + std::uint8_t *val); + std::uint8_t *operator()() const noexcept { return m_param; } + void set(std::uint8_t *param) noexcept + { + set_and_update_param(m_param, param); + } + + pstring value_string() const override + { + // returns something which errors + return {"PTRERROR"}; + } + + private: + std::uint8_t *m_param; + }; + + // ----------------------------------------------------------------------------- + // string parameter + // ----------------------------------------------------------------------------- + + class param_str_t : public param_t + { + public: + param_str_t(core_device_t &device, const pstring &name, + const pstring &val); + // FIXME: The device less constructor is only used by macro parameters + // Every macro device gets a nld_wrapper object as the owner. + // Use this as the owner and get rid of this constructor. + param_str_t(netlist_state_t &state, const pstring &name, + const pstring &val); + + pstring operator()() const noexcept { return str(); } + void set(const pstring ¶m) + { + if (*m_param != param) + { + *m_param = param; + changed(); + device().update_param(); + } + } + pstring value_string() const override { return *m_param; } + + protected: + virtual void changed() noexcept; + pstring str() const noexcept { return *m_param; } + + private: + host_arena::unique_ptr<pstring> m_param; + }; + + // ----------------------------------------------------------------------------- + // model parameter + // ----------------------------------------------------------------------------- + + class param_model_t : public param_str_t + { + public: + template <typename T> + class value_base_t + { + public: + template <typename P, typename Y = T, + typename DUMMY = std::enable_if_t< + plib::is_arithmetic<Y>::value>> + value_base_t(P ¶m, const pstring &name) + : m_value(gsl::narrow<T>(param.value(name))) + { + } + template <typename P, typename Y = T, + std::enable_if_t<!plib::is_arithmetic<Y>::value, int> = 0> + value_base_t(P ¶m, const pstring &name) + : m_value(static_cast<T>(param.value_str(name))) + { + } + T operator()() const noexcept { return m_value; } + operator T() const noexcept { return m_value; } + + private: + const T m_value; + }; + + using value_t = value_base_t<nl_fptype>; + using value_str_t = value_base_t<pstring>; + + param_model_t(core_device_t &device, const pstring &name, + const pstring &val) + : param_str_t(device, name, val) + { + } + + pstring value_str(const pstring &entity); + nl_fptype value(const pstring &entity); + pstring type(); + // hide this + void set(const pstring ¶m) = delete; + + protected: + void changed() noexcept override; + + private: + }; + + // ----------------------------------------------------------------------------- + // data parameter + // ----------------------------------------------------------------------------- + + class param_data_t : public param_str_t + { + public: + param_data_t(core_device_t &device, const pstring &name) + : param_str_t(device, name, "") + { + } + + plib::istream_uptr stream(); + + protected: + void changed() noexcept override {} + }; + + // ----------------------------------------------------------------------------- + // rom parameter + // ----------------------------------------------------------------------------- + + template <typename ST, std::size_t AW, std::size_t DW> + class param_rom_t final : public param_data_t + { + public: + param_rom_t(core_device_t &device, const pstring &name); + + const ST &operator[](std::size_t n) const noexcept { return m_data[n]; } + + protected: + void changed() noexcept override + { + plib::istream_read(*stream(), m_data.data(), 1 << AW); + } + + private: + std::array<ST, 1 << AW> m_data; + }; + + template <typename T> + param_num_t<T>::param_num_t(core_device_t &device, const pstring &name, + const T val) + : param_t(device, name) + , m_param(val) + { + bool found = false; + pstring p = this->get_initial(&device, &found); + if (found) + { + plib::pfunction<nl_fptype> func; + func.compile_infix(p, {}); + auto valx = func.evaluate(); + if (plib::is_integral<T>::value) + if (plib::abs(valx - plib::trunc(valx)) > nlconst::magic(1e-6)) + throw nl_exception(MF_INVALID_NUMBER_CONVERSION_1_2( + device.name() + "." + name, p)); + m_param = plib::narrow_cast<T>(valx); + } + + device.state().save(*this, m_param, this->name(), "m_param"); + } + + template <typename T> + param_enum_t<T>::param_enum_t(core_device_t &device, const pstring &name, + const T val) + : param_t(device, name) + , m_param(val) + { + bool found = false; + pstring p = this->get_initial(&device, &found); + if (found) + { + T temp(val); + bool ok = temp.set_from_string(p); + if (!ok) + { + device.state().log().fatal( + MF_INVALID_ENUM_CONVERSION_1_2(name, p)); + throw nl_exception(MF_INVALID_ENUM_CONVERSION_1_2(name, p)); + } + m_param = temp; + } + + device.state().save(*this, m_param, this->name(), "m_param"); + } + + template <typename ST, std::size_t AW, std::size_t DW> + param_rom_t<ST, AW, DW>::param_rom_t(core_device_t &device, + const pstring & name) + : param_data_t(device, name) + { + auto f = this->stream(); + if (!f.empty()) + { + plib::istream_read(*f, m_data.data(), 1 << AW); + // FIXME: check for failbit if not in validation. + } + else + device.state().log().warning(MW_ROM_NOT_FOUND(str())); + } + + // ----------------------------------------------------------------------------- + // Externals + // ----------------------------------------------------------------------------- + + extern template class param_num_t<std::uint8_t>; + extern template class param_num_t<std::uint16_t>; + extern template class param_num_t<std::uint32_t>; + extern template class param_num_t<std::uint64_t>; + extern template class param_num_t<std::int8_t>; + extern template class param_num_t<std::int16_t>; + extern template class param_num_t<std::int32_t>; + extern template class param_num_t<std::int64_t>; + extern template class param_num_t<float>; + extern template class param_num_t<double>; + extern template class param_num_t<long double>; + extern template class param_num_t<bool>; + + // FIXME: Should not be used as parameters. Fix later. + using param_logic_t = param_num_t<bool>; + using param_int_t = param_num_t<int>; + using param_fp_t = param_num_t<nl_fptype>; + + extern template class param_model_t::value_base_t<float>; + extern template class param_model_t::value_base_t<double>; + extern template class param_model_t::value_base_t<long double>; + +} // namespace netlist + +#endif // NL_CORE_PARAM_H_ diff --git a/src/lib/netlist/core/queue.h b/src/lib/netlist/core/queue.h new file mode 100644 index 00000000000..9fdd6ac1c64 --- /dev/null +++ b/src/lib/netlist/core/queue.h @@ -0,0 +1,107 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file queue.h +/// + +#ifndef NL_CORE_QUEUE_H_ +#define NL_CORE_QUEUE_H_ + +#include "../nl_errstr.h" +#include "../nltypes.h" +#include "queue.h" + +#include "../plib/pstate.h" +#include "../plib/pstring.h" +#include "../plib/ptimed_queue.h" + +#include <array> +#include <queue> +#include <unordered_map> +#include <utility> +#include <vector> + +namespace netlist::detail +{ + // ----------------------------------------------------------------------------- + // queue_t + // ----------------------------------------------------------------------------- + + // We don't need a thread-safe queue currently. Parallel processing of + // solvers will update inputs after parallel processing. + + template <typename A, typename O> + class queue_base + : public config::timed_queue<A, plib::queue_entry_t<netlist_time_ext, O *>> + , public plib::state_manager_t::callback_t + { + public: + using entry_t = plib::queue_entry_t<netlist_time_ext, O *>; + using base_queue = config::timed_queue<A, entry_t>; + using id_delegate = plib::pmfp<std::size_t(const O *)>; + using obj_delegate = plib::pmfp<O *(std::size_t)>; + + explicit queue_base(A &arena, std::size_t size, id_delegate get_id, + obj_delegate get_obj) + : base_queue(arena, size) + , m_size(0) + , m_times(size) + , m_net_ids(size) + , m_get_id(get_id) + , m_obj_by_id(get_obj) + { + } + + ~queue_base() noexcept override = default; + + queue_base(const queue_base &) = delete; + queue_base(queue_base &&) = delete; + queue_base &operator=(const queue_base &) = delete; + queue_base &operator=(queue_base &&) = delete; + + protected: + void register_state(plib::state_manager_t &manager, + const pstring & module) override + { + manager.save_item(this, m_size, module + "." + "size"); + manager.save_item(this, &m_times[0], module + "." + "times", + m_times.size()); + manager.save_item(this, &m_net_ids[0], module + "." + "names", + m_net_ids.size()); + } + void on_pre_save( + [[maybe_unused]] plib::state_manager_t &manager) override + { + m_size = this->size(); + for (std::size_t i = 0; i < m_size; i++) + { + m_times[i] = this->list_pointer()[i].exec_time().as_raw(); + m_net_ids[i] = m_get_id(this->list_pointer()[i].object()); + } + } + void on_post_load( + [[maybe_unused]] plib::state_manager_t &manager) override + { + this->clear(); + for (std::size_t i = 0; i < m_size; i++) + { + O *n = m_obj_by_id(m_net_ids[i]); + this->template push<false>( + entry_t(netlist_time_ext::from_raw(m_times[i]), n)); + } + } + + private: + std::size_t m_size; + std::vector<netlist_time_ext::internal_type> m_times; + std::vector<std::size_t> m_net_ids; + id_delegate m_get_id; + obj_delegate m_obj_by_id; + }; + + using queue_t = queue_base<device_arena, net_t>; + +} // namespace netlist::detail + +#endif // NL_CORE_QUEUE_H_ diff --git a/src/lib/netlist/core/setup.h b/src/lib/netlist/core/setup.h new file mode 100644 index 00000000000..0168417c35c --- /dev/null +++ b/src/lib/netlist/core/setup.h @@ -0,0 +1,377 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file setup.h +/// + +#ifndef NL_CORE_SETUP_H_ +#define NL_CORE_SETUP_H_ + +#include "../nl_config.h" +#include "../nl_factory.h" +#include "../nl_setup.h" +#include "../nltypes.h" + +#include "../plib/pstream.h" +#include "../plib/pstring.h" + +#include <initializer_list> +#include <memory> +#include <stack> +#include <unordered_map> +#include <vector> + + +namespace netlist +{ + + // ---------------------------------------------------------------------------------------- + // Collection of models + // ---------------------------------------------------------------------------------------- + + class models_t + { + public: + using raw_map_t = std::unordered_map<pstring, pstring>; + using map_t = std::unordered_map<pstring, pstring>; + class model_t + { + public: + model_t(const pstring &model, const map_t &map) + : m_model(model), m_map(map) { } + + pstring value_str(const pstring &entity) const; + + nl_fptype value(const pstring &entity) const; + + pstring type() const { return value_str("COREMODEL"); } + + private: + static pstring model_string(const map_t &map); + + const pstring m_model; // only for error messages + const map_t &m_map; + }; + + models_t(const raw_map_t &models) + : m_models(models) + {} + + model_t get_model(const pstring &model); + + std::vector<pstring> known_models() const + { + std::vector<pstring> ret; + for (const auto &e : m_models) + ret.push_back(e.first); + return ret; + } + + private: + + void model_parse(const pstring &model, map_t &map); + + const raw_map_t &m_models; + std::unordered_map<pstring, map_t> m_cache; + }; + + namespace detail + { + struct alias_t + { + alias_t(alias_type type, pstring alias, pstring references) + : m_type(type) + , m_alias(alias) + , m_references(references) + {} + + alias_t(const alias_t &) = default; + alias_t &operator=(const alias_t &) = default; + alias_t(alias_t &&) noexcept = default; + alias_t &operator=(alias_t &&) noexcept = default; + + pstring name() const { return m_alias; } + pstring references() const { return m_references; } + alias_type type() const { return m_type; } + private: + alias_type m_type; + pstring m_alias; + pstring m_references; + }; + + /// + /// \brief class containing the abstract net list + /// + /// After parsing a net list this class contains all raw + /// connections, parameter values and devices. + struct abstract_t + { + using connection_t = std::pair<pstring, pstring>; + + abstract_t(log_type &log) : m_factory(log) { } + std::unordered_map<pstring, alias_t> m_aliases; + std::vector<connection_t> m_connections; + std::unordered_map<pstring, pstring> m_param_values; + models_t::raw_map_t m_models; + + // need to preserve order of device creation ... + std::vector<std::pair<pstring, factory::element_t *>> m_device_factory; + // lifetime control only - can be cleared before run + std::vector<std::pair<pstring, pstring>> m_default_params; + std::unordered_map<pstring, bool> m_hints; + factory::list_t m_factory; + }; + } // namespace detail + + // ----------------------------------------------------------------------------- + // param_ref_t + // ----------------------------------------------------------------------------- + + struct param_ref_t + { + param_ref_t() noexcept : m_device(nullptr), m_param(nullptr) {} + param_ref_t(core_device_t &device, param_t ¶m) noexcept + : m_device(&device) + , m_param(¶m) + { } + + ~param_ref_t() = default; + PCOPYASSIGNMOVE(param_ref_t, default) + + const core_device_t &device() const noexcept { return *m_device; } + param_t ¶m() const noexcept { return *m_param; } + + bool is_valid() const noexcept { return (m_device != nullptr) && (m_param != nullptr); } + private: + core_device_t *m_device; + param_t *m_param; + }; + + // ---------------------------------------------------------------------------------------- + // setup_t + // ---------------------------------------------------------------------------------------- + + class setup_t + { + public: + + explicit setup_t(netlist_state_t &nlstate); + ~setup_t() noexcept = default; + + PCOPYASSIGNMOVE(setup_t, delete) + + // called from param_t creation + void register_param_t(param_t ¶m); + pstring get_initial_param_val(const pstring &name, const pstring &def) const; + + void register_term(detail::core_terminal_t &term); + void register_term(terminal_t &term, terminal_t *other_term, const std::array<terminal_t *, 2> &splitter_terms); + + // called from matrix_solver_t::get_connected_net + // returns the terminal being part of a two terminal device. + terminal_t *get_connected_terminal(const terminal_t &term) const noexcept + { + auto ret(m_connected_terminals.find(&term)); + return (ret != m_connected_terminals.end()) ? ret->second[0] : nullptr; + } + + // called from net_splitter + const std::array<terminal_t *, 4> *get_connected_terminals(const terminal_t &term) const noexcept + { + auto ret(m_connected_terminals.find(&term)); + return (ret != m_connected_terminals.end()) ? &ret->second : nullptr; + } + + // get family -> truth table + const logic_family_desc_t *family_from_model(const pstring &model); + + param_ref_t find_param(const pstring ¶m_in) const; + // needed by nltool + std::vector<pstring> get_terminals_for_device_name(const pstring &devname) const; + + // needed by proxy device to check power terminals + detail::core_terminal_t *find_terminal(const pstring &terminal_in, detail::terminal_type atype, bool required = true) const; + detail::core_terminal_t *find_terminal(const pstring &terminal_in, bool required = true) const; + pstring de_alias(const pstring &alias) const; + + // run preparation + + void prepare_to_run(); + + models_t &models() noexcept { return m_models; } + const models_t &models() const noexcept { return m_models; } + + netlist_state_t &nlstate() noexcept { return m_nlstate; } + const netlist_state_t &nlstate() const noexcept { return m_nlstate; } + + nlparse_t &parser() noexcept { return m_parser; } + const nlparse_t &parser() const noexcept { return m_parser; } + + log_type &log() noexcept; + const log_type &log() const noexcept; + + private: + + void resolve_inputs(); + pstring resolve_alias(const pstring &name) const; + + void merge_nets(detail::net_t &this_net, detail::net_t &other_net); + + void connect_terminals(detail::core_terminal_t &t1, detail::core_terminal_t &t2); + void connect_input_output(detail::core_terminal_t &input, detail::core_terminal_t &output); + void connect_terminal_output(detail::core_terminal_t &terminal, detail::core_terminal_t &output); + void connect_terminal_input(detail::core_terminal_t &terminal, detail::core_terminal_t &input); + bool connect_input_input(detail::core_terminal_t &input1, detail::core_terminal_t &input2); + + bool connect(detail::core_terminal_t &t1, detail::core_terminal_t &t2); + + // helpers + static pstring termtype_as_str(detail::core_terminal_t &in); + + devices::nld_base_proxy *get_d_a_proxy(const detail::core_terminal_t &out); + devices::nld_base_proxy *get_a_d_proxy(detail::core_terminal_t &inp); + detail::core_terminal_t &resolve_proxy(detail::core_terminal_t &term); + + // net manipulations + + //void remove_terminal(detail::net_t &net, detail::core_terminal_t &terminal) noexcept(false); + void move_connections(detail::net_t &net, detail::net_t &dest_net); + void delete_empty_nets(); + + detail::abstract_t m_abstract; + nlparse_t m_parser; + netlist_state_t &m_nlstate; + + models_t m_models; + + // FIXME: currently only used during setup + devices::nld_netlistparams * m_netlist_params; + + // FIXME: can be cleared before run + std::unordered_map<pstring, detail::core_terminal_t *> m_terminals; + // FIXME: Limited to 3 additional terminals + std::unordered_map<const terminal_t *, + std::array<terminal_t *, 4>> m_connected_terminals; + std::unordered_map<pstring, param_ref_t> m_params; + std::unordered_map<const detail::core_terminal_t *, + devices::nld_base_proxy *> m_proxies; + std::vector<host_arena::unique_ptr<param_t>> m_defparam_lifetime; + + unsigned m_proxy_cnt; + }; + + // ---------------------------------------------------------------------------------------- + // Specific netlist `psource_t` implementations + // ---------------------------------------------------------------------------------------- + + class source_netlist_t : public plib::psource_t + { + public: + + source_netlist_t() = default; + + PCOPYASSIGNMOVE(source_netlist_t, delete) + ~source_netlist_t() noexcept override = default; + + virtual bool parse(nlparse_t &setup, const pstring &name); + }; + + class source_data_t : public plib::psource_t + { + public: + + source_data_t() = default; + + PCOPYASSIGNMOVE(source_data_t, delete) + ~source_data_t() noexcept override = default; + }; + + class source_string_t : public source_netlist_t + { + public: + + explicit source_string_t(const pstring &source) + : m_str(source) + { + } + + protected: + plib::istream_uptr stream(const pstring &name) override; + + private: + pstring m_str; + }; + + class source_file_t : public source_netlist_t + { + public: + + explicit source_file_t(const pstring &filename) + : m_filename(filename) + { + } + + protected: + plib::istream_uptr stream(const pstring &name) override; + + private: + pstring m_filename; + }; + + class source_pattern_t : public source_netlist_t + { + public: + + explicit source_pattern_t(const pstring &pat, bool force_lowercase) + : m_pattern(pat) + , m_force_lowercase(force_lowercase) + { + } + + protected: + plib::istream_uptr stream(const pstring &name) override; + + private: + pstring m_pattern; + bool m_force_lowercase; + }; + + class source_mem_t : public source_netlist_t + { + public: + explicit source_mem_t(const char *mem) + : m_str(mem) + { + } + + protected: + plib::istream_uptr stream(const pstring &name) override; + + private: + std::string m_str; + }; + + class source_proc_t : public source_netlist_t + { + public: + source_proc_t(const pstring &name, nlsetup_func setup_func) + : m_setup_func(setup_func) + , m_setup_func_name(name) + { + } + + bool parse(nlparse_t &setup, const pstring &name) override; + + protected: + plib::istream_uptr stream(const pstring &name) override; + + private: + nlsetup_func m_setup_func; + pstring m_setup_func_name; + }; + +} // namespace netlist + + +#endif // NL_CORE_SETUP_H_ diff --git a/src/lib/netlist/core/state_var.h b/src/lib/netlist/core/state_var.h new file mode 100644 index 00000000000..a2b0ae5f477 --- /dev/null +++ b/src/lib/netlist/core/state_var.h @@ -0,0 +1,214 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file state_var.h +/// + +#ifndef NL_CORE_STATE_VAR_H_ +#define NL_CORE_STATE_VAR_H_ + +#include "../nltypes.h" + +#include "../plib/pfmtlog.h" +#include "../plib/pstring.h" + +namespace netlist +{ + /// \brief A persistent variable template. + /// Use the state_var template to define a variable whose value is saved. + /// Within a device definition use + /// + /// ``` + /// NETLIB_OBJECT(abc) + /// { + /// NETLIB_CONSTRUCTOR(abc) + /// , m_var(*this, "myvar", 0) + /// ... + /// state_var<unsigned> m_var; + /// } + /// ``` + /// + template <typename T> + struct state_var + { + public: + using value_type = T; + + template <typename O> + //! Constructor. + state_var(O & owner, //!< owner must have a netlist() method. + const pstring &name, //!< identifier/name for this state variable + const T & value //!< Initial value after construction + ); + + template <typename O> + //! Constructor. + state_var(O & owner, //!< owner must have a netlist() method. + const pstring &name //!< identifier/name for this state variable + ); + + state_var(state_var &&) noexcept = delete; + state_var &operator=(state_var &&) noexcept = delete; + + //! Destructor. + ~state_var() noexcept = default; + + //! Copy Constructor removed. + constexpr state_var(const state_var &rhs) = delete; + //! Assignment operator to assign value of a state var. + constexpr state_var &operator=(const state_var &rhs) noexcept + { + if (this != &rhs) + m_value = rhs.m_value; + return *this; + } // OSX doesn't like noexcept + //! Assignment operator to assign value of type T. + constexpr state_var &operator=(const T &rhs) noexcept + { + m_value = rhs; + return *this; + } + //! Assignment move operator to assign value of type T. + // constexpr state_var &operator=(T &&rhs) noexcept { std::swap(m_value, + // rhs); return *this; } + constexpr state_var &operator=(T &&rhs) noexcept + { + m_value = std::move(rhs); + return *this; + } + //! Return non-const value of state variable. + constexpr operator T &() noexcept { return m_value; } + //! Return const value of state variable. + constexpr operator const T &() const noexcept { return m_value; } + //! Return non-const value of state variable. + constexpr T &var() noexcept { return m_value; } + //! Return const value of state variable. + constexpr const T &var() const noexcept { return m_value; } + //! Return non-const value of state variable. + constexpr T &operator()() noexcept { return m_value; } + //! Return const value of state variable. + constexpr const T &operator()() const noexcept { return m_value; } + //! Access state variable by ->. + constexpr T *operator->() noexcept { return &m_value; } + //! Access state variable by const ->. + constexpr const T *operator->() const noexcept { return &m_value; } + //! Access state variable by *. + constexpr T *operator*() noexcept { return &m_value; } + //! Access state variable by const *. + constexpr const T *operator*() const noexcept { return &m_value; } + + private: + T m_value; + }; + + /// \brief A persistent array template. + /// Use this state_var template to define an array whose contents are + /// saved. Please refer to \ref state_var. + /// + /// \tparam C container class to use. + + template <typename C> + struct state_container : public C + { + public: + using value_type = typename C::value_type; + //! Constructor. + template <typename O> + state_container(O & owner, //!< owner must have a netlist() method. + const pstring & name, //!< identifier/name for this state variable + const value_type &value //!< Initial value after construction + ); + //! Constructor. + template <typename O> + state_container(O & owner, //!< owner must have a netlist() method. + const pstring & name, //!< identifier/name for this state variable + std::size_t n, //!< number of elements to allocate + const value_type &value //!< Initial value after construction + ); + //! Copy Constructor. + state_container(const state_container &rhs) noexcept = default; + //! Destructor. + ~state_container() noexcept = default; + //! Move Constructor. + state_container(state_container &&rhs) noexcept = default; + state_container &operator=( + const state_container &rhs) noexcept = default; + state_container &operator=(state_container &&rhs) noexcept = default; + }; + + // ----------------------------------------------------------------------------- + // State variables - predefined and c++11 non-optional + // ----------------------------------------------------------------------------- + + /// \brief predefined state variable type for uint8_t + using state_var_u8 = state_var<std::uint8_t>; + /// \brief predefined state variable type for int8_t + using state_var_s8 = state_var<std::int8_t>; + + /// \brief predefined state variable type for uint32_t + using state_var_u32 = state_var<std::uint32_t>; + /// \brief predefined state variable type for int32_t + using state_var_s32 = state_var<std::int32_t>; + /// \brief predefined state variable type for sig_t + using state_var_sig = state_var<netlist_sig_t>; + + template <typename T> + template <typename O> + state_var<T>::state_var(O &owner, const pstring &name, const T &value) + : m_value(value) + { + owner.state().save(owner, m_value, owner.name(), name); + } + + template <typename T> + template <typename O> + state_var<T>::state_var(O &owner, const pstring &name) + { + owner.state().save(owner, m_value, owner.name(), name); + } + + template <typename C> + template <typename O> + state_container<C>::state_container(O &owner, const pstring &name, + const state_container<C>::value_type &value) + { + owner.state().save(owner, static_cast<C &>(*this), owner.name(), name); + for (std::size_t i = 0; i < this->size(); i++) + (*this)[i] = value; + } + + template <typename C> + template <typename O> + state_container<C>::state_container(O &owner, const pstring &name, + std::size_t n, const state_container<C>::value_type &value) + : C(n, value) + { + owner.state().save(owner, static_cast<C &>(*this), owner.name(), name); + } + + // ----------------------------------------------------------------------------- + // Externals + // ----------------------------------------------------------------------------- + + extern template struct state_var<std::uint8_t>; + extern template struct state_var<std::uint16_t>; + extern template struct state_var<std::uint32_t>; + extern template struct state_var<std::uint64_t>; + extern template struct state_var<std::int8_t>; + extern template struct state_var<std::int16_t>; + extern template struct state_var<std::int32_t>; + extern template struct state_var<std::int64_t>; + extern template struct state_var<bool>; + +} // namespace netlist + +namespace plib +{ + template <typename X> + struct format_traits<netlist::state_var<X>> : format_traits<X> + { + }; +} // namespace plib + +#endif // NL_CORE_STATE_VAR_H_ diff --git a/src/lib/netlist/devices/net_lib.cpp b/src/lib/netlist/devices/net_lib.cpp index 4fe03f81534..e2f437aabca 100644 --- a/src/lib/netlist/devices/net_lib.cpp +++ b/src/lib/netlist/devices/net_lib.cpp @@ -1,172 +1,33 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*************************************************************************** - netlib.c - - Discrete netlist implementation. - -****************************************************************************/ +// *************************************************************************** +// +// net_lib.cpp +// +// *************************************************************************** #include "net_lib.h" -#include "netlist/nl_factory.h" -#include "netlist/solver/nld_solver.h" - +#include "nl_factory.h" +#include "solver/nld_solver.h" -#define xstr(s) # s #define NETLIB_DEVICE_DECL(chip) extern factory::constructor_ptr_t decl_ ## chip +#define LIB_DECL(decl) factory.add( decl () ); +#define LIB_ENTRY(nic) { NETLIB_DEVICE_DECL(nic); LIB_DECL(decl_ ## nic) } -#define LIB_DECL(nic, decl) factory.register_device( decl ( pstring(xstr(nic))) ); -#define LIB_ENTRY(nic) { NETLIB_DEVICE_DECL(nic); LIB_DECL(NETLIB_NAME(nic), decl_ ## nic) } - -namespace netlist -{ -namespace devices -{ +namespace netlist::devices { void initialize_factory(factory::list_t &factory) { - LIB_ENTRY(R) - LIB_ENTRY(POT) - LIB_ENTRY(POT2) - LIB_ENTRY(C) - LIB_ENTRY(L) - LIB_ENTRY(D) - LIB_ENTRY(VS) - LIB_ENTRY(CS) - LIB_ENTRY(VCVS) - LIB_ENTRY(VCCS) - LIB_ENTRY(CCCS) - LIB_ENTRY(LVCCS) - LIB_ENTRY(opamp) - LIB_ENTRY(dummy_input) - LIB_ENTRY(frontier) // not intended to be used directly - LIB_ENTRY(function) // only for macro devices - NO FEEDBACK loops - LIB_ENTRY(QBJT_EB) - LIB_ENTRY(QBJT_switch) - LIB_ENTRY(MOSFET) - LIB_ENTRY(logic_input_ttl) - LIB_ENTRY(logic_input) - LIB_ENTRY(analog_input) - LIB_ENTRY(log) - LIB_ENTRY(logD) - LIB_ENTRY(clock) - LIB_ENTRY(varclock) - LIB_ENTRY(extclock) - LIB_ENTRY(mainclock) - LIB_ENTRY(gnd) - LIB_ENTRY(netlistparams) - LIB_ENTRY(solver) - LIB_ENTRY(res_sw) - LIB_ENTRY(switch1) - LIB_ENTRY(switch2) - LIB_ENTRY(nicRSFF) - LIB_ENTRY(nicDelay) - LIB_ENTRY(2102A) - LIB_ENTRY(2102A_dip) - LIB_ENTRY(2716) - LIB_ENTRY(2716_dip) -#if !(USE_TRUTHTABLE_7448) - LIB_ENTRY(7448) - LIB_ENTRY(7448_dip) -#endif - LIB_ENTRY(7450) - LIB_ENTRY(7450_dip) - LIB_ENTRY(7473) - LIB_ENTRY(7473_dip) - LIB_ENTRY(7473A) - LIB_ENTRY(7473A_dip) - LIB_ENTRY(7474) - LIB_ENTRY(7474_dip) - LIB_ENTRY(7475) - LIB_ENTRY(7475_dip) - LIB_ENTRY(7477) - LIB_ENTRY(7477_dip) - LIB_ENTRY(7483) - LIB_ENTRY(7483_dip) - LIB_ENTRY(7485) - LIB_ENTRY(7485_dip) - LIB_ENTRY(7490) - LIB_ENTRY(7490_dip) - LIB_ENTRY(7493) - LIB_ENTRY(7493_dip) - LIB_ENTRY(7497) - LIB_ENTRY(7497_dip) -#if (!USE_TRUTHTABLE_74107) - LIB_ENTRY(74107) - LIB_ENTRY(74107_dip) -#endif - LIB_ENTRY(74107A) // FIXME: implement missing DIP - LIB_ENTRY(74123) - LIB_ENTRY(74123_dip) - LIB_ENTRY(74153) - LIB_ENTRY(74153_dip) - LIB_ENTRY(74161) - LIB_ENTRY(74161_dip) - LIB_ENTRY(74164) - LIB_ENTRY(74164_dip) - LIB_ENTRY(74165) - LIB_ENTRY(74165_dip) - LIB_ENTRY(74166) - LIB_ENTRY(74166_dip) - LIB_ENTRY(74174) - LIB_ENTRY(74175) - LIB_ENTRY(74192) - LIB_ENTRY(74193) - LIB_ENTRY(74194) - LIB_ENTRY(74365) - //ENTRY(74279, TTL_74279, "") // only dip available - LIB_ENTRY(SN74LS629) - LIB_ENTRY(82S16) - LIB_ENTRY(82S115) - LIB_ENTRY(82S123) - LIB_ENTRY(82S126) - LIB_ENTRY(9310) - LIB_ENTRY(9314) - LIB_ENTRY(9316) - LIB_ENTRY(9322) - LIB_ENTRY(9334) - LIB_ENTRY(AM2847) - // FIXME: duplicate? - LIB_ENTRY(CD4020_WI) - LIB_ENTRY(CD4020) - LIB_ENTRY(CD4066_GATE) - LIB_ENTRY(CD4316_GATE) - LIB_ENTRY(4538_dip) - LIB_ENTRY(schmitt_trigger) - /* entries with suffix WI are legacy only */ - //ENTRY(4066, CD_4066, "+A,B") - LIB_ENTRY(NE555) - LIB_ENTRY(NE555_dip) - LIB_ENTRY(MC1455P) - LIB_ENTRY(MC1455P_dip) - LIB_ENTRY(TMS4800) - LIB_ENTRY(TMS4800_dip) - LIB_ENTRY(r2r_dac) - LIB_ENTRY(tristate) - LIB_ENTRY(tristate3) - LIB_ENTRY(74174_dip) - LIB_ENTRY(74175_dip) - LIB_ENTRY(74192_dip) - LIB_ENTRY(74193_dip) - LIB_ENTRY(74194_dip) - LIB_ENTRY(74365_dip) - LIB_ENTRY(82S16_dip) - LIB_ENTRY(82S115_dip) - LIB_ENTRY(82S123_dip) - LIB_ENTRY(82S126_dip) - LIB_ENTRY(9602_dip) - LIB_ENTRY(9310_dip) - LIB_ENTRY(9314_dip) - LIB_ENTRY(9316_dip) - LIB_ENTRY(9322_dip) - LIB_ENTRY(9334_dip) - LIB_ENTRY(AM2847_dip) - LIB_ENTRY(SN74LS629_dip) - LIB_ENTRY(MM5837_dip) + // The following is from a script which automatically creates + // the entries. + // FIXME: the list should be either included or the whole + // initialize factory code should be created programmatically. + + #include "../generated/lib_entries.hxx" + } -} //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/net_lib.h b/src/lib/netlist/devices/net_lib.h index abf58ccee16..f3487fc2740 100644 --- a/src/lib/netlist/devices/net_lib.h +++ b/src/lib/netlist/devices/net_lib.h @@ -1,103 +1,35 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*************************************************************************** - - net_lib.h - - Discrete netlist implementation. - -****************************************************************************/ #ifndef NET_LIB_H #define NET_LIB_H -#include "netlist/nl_setup.h" - -//#define NL_AUTO_DEVICES 1 - -#define SOLVER(name, freq) \ - NET_REGISTER_DEV(SOLVER, name) \ - PARAM(name.FREQ, freq) - -#ifdef NL_AUTO_DEVICES -#include "nld_devinc.h" - -#include "macro/nlm_cd4xxx.h" -#include "macro/nlm_ttl74xx.h" -#include "macro/nlm_opamp.h" -#include "macro/nlm_other.h" - -#include "nld_7448.h" - -#else - -#include "nld_system.h" +/// +/// \file net_lib.h +/// +/// This file is included by all netlist implementations. +/// -#include "nld_2102A.h" -#include "nld_2716.h" -#include "nld_4020.h" -#include "nld_4066.h" -#include "nld_74107.h" -#include "nld_74123.h" -#include "nld_74153.h" -#include "nld_74161.h" -#include "nld_74164.h" -#include "nld_74165.h" -#include "nld_74166.h" -#include "nld_74174.h" -#include "nld_74175.h" -#include "nld_74192.h" -#include "nld_74193.h" -#include "nld_74194.h" -#include "nld_74365.h" -#include "nld_7448.h" -#include "nld_7450.h" -#include "nld_7473.h" -#include "nld_7474.h" -#include "nld_7475.h" -#include "nld_7483.h" -#include "nld_7485.h" -#include "nld_7490.h" -#include "nld_7493.h" -#include "nld_7497.h" -#include "nld_74ls629.h" -#include "nld_82S115.h" -#include "nld_82S123.h" -#include "nld_82S126.h" -#include "nld_82S16.h" -#include "nld_9310.h" -#include "nld_9316.h" -#include "nld_9322.h" -#include "nld_tms4800.h" +#include "../nl_setup.h" -#include "nld_am2847.h" -#include "nld_dm9314.h" -#include "nld_dm9334.h" - -#include "nld_mm5837.h" -#include "nld_ne555.h" - -#include "nld_r2r_dac.h" - -#include "nld_schmitt.h" - -#include "nld_tristate.h" - -#include "nld_log.h" +#ifdef RES_R +#warning "Do not include `rescap.h` in a netlist environment" +#endif +#ifndef RES_R +#define RES_R(res) (res) +#define RES_K(res) ((res) * 1e3) +#define RES_M(res) ((res) * 1e6) +#define CAP_U(cap) ((cap) * 1e-6) +//#define CAP_U(cap) ((cap) * 1μ) +#define CAP_N(cap) ((cap) * 1e-9) +#define CAP_P(cap) ((cap) * 1e-12) +#define IND_U(ind) ((ind) * 1e-6) +#define IND_N(ind) ((ind) * 1e-9) +#define IND_P(ind) ((ind) * 1e-12) +#endif -#include "netlist/macro/nlm_cd4xxx.h" -#include "netlist/macro/nlm_opamp.h" -#include "netlist/macro/nlm_other.h" -#include "netlist/macro/nlm_ttl74xx.h" +#include "../generated/nld_devinc.h" -#include "netlist/analog/nld_bjt.h" -#include "netlist/analog/nld_fourterm.h" -#include "netlist/analog/nld_mosfet.h" -#include "netlist/analog/nld_opamps.h" -#include "netlist/analog/nld_switches.h" -#include "netlist/analog/nld_twoterm.h" +NETLIST_EXTERNAL(base_lib) -#include "nld_legacy.h" -#endif - -#endif +#endif // NET_LIB_H diff --git a/src/lib/netlist/devices/nld_2102A.cpp b/src/lib/netlist/devices/nld_2102A.cpp deleted file mode 100644 index 54922ad71cf..00000000000 --- a/src/lib/netlist/devices/nld_2102A.cpp +++ /dev/null @@ -1,111 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_2102A.cpp - * - */ - -#include "nld_2102A.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -#define ADDR2BYTE(a) ((a) >> 3) -#define ADDR2BIT(a) ((a) & 0x7) - -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(2102A) - { - NETLIB_CONSTRUCTOR(2102A) - , m_A(*this, {{"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9" }}) - , m_CEQ(*this, "CEQ") - , m_RWQ(*this, "RWQ") - , m_DI(*this, "DI") - , m_DO(*this, "DO") - , m_ram(*this, "m_ram", 0) - , m_RAM(*this, "m_RAM", &m_ram[0]) - , m_power_pins(*this) - { - } - - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - protected: - object_array_t<logic_input_t, 10> m_A; - logic_input_t m_CEQ; - logic_input_t m_RWQ; - logic_input_t m_DI; - - logic_output_t m_DO; - - state_array<uint8_t, 128> m_ram; // 1024x1 bits - param_ptr_t m_RAM; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(2102A_dip, 2102A) - { - NETLIB_CONSTRUCTOR_DERIVED(2102A_dip, 2102A) - { - register_subalias("8", m_A[0]); - register_subalias("4", m_A[1]); - register_subalias("5", m_A[2]); - register_subalias("6", m_A[3]); - register_subalias("7", m_A[4]); - register_subalias("2", m_A[5]); - register_subalias("1", m_A[6]); - register_subalias("16", m_A[7]); - register_subalias("15", m_A[8]); - register_subalias("14", m_A[9]); - - register_subalias("13", m_CEQ); - register_subalias("3", m_RWQ); - - register_subalias("11", m_DI); - register_subalias("12", m_DO); - - register_subalias("10", "VCC"); - register_subalias("9", "GND"); - - } - }; - - NETLIB_UPDATE(2102A) - { - netlist_time max_delay = NLTIME_FROM_NS(350); - - if (!m_CEQ()) - { - unsigned a = 0; - for (std::size_t i=0; i<10; i++) - { - a |= (m_A[i]() << i); - } - const unsigned byte = ADDR2BYTE(a); - const unsigned bit = ADDR2BIT(a); - - if (!m_RWQ()) - { - m_ram[byte] &= ~(static_cast<uint8_t>(1) << bit); - m_ram[byte] |= (static_cast<uint8_t>(m_DI()) << bit); - } - - m_DO.push((m_ram[byte] >> bit) & 1, max_delay); - } - } - - NETLIB_RESET(2102A) - { - m_RAM.setTo(&m_ram[0]); - for (std::size_t i=0; i<128; i++) - m_ram[i] = 0; - } - - NETLIB_DEVICE_IMPL(2102A, "RAM_2102A", "+CEQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+RWQ,+DI,@VCC,@GND") - NETLIB_DEVICE_IMPL(2102A_dip,"RAM_2102A_DIP","") - - } //namespace devices -} // namespace netlist diff --git a/src/lib/netlist/devices/nld_2102A.h b/src/lib/netlist/devices/nld_2102A.h deleted file mode 100644 index 9d2279445f1..00000000000 --- a/src/lib/netlist/devices/nld_2102A.h +++ /dev/null @@ -1,50 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_2102A.h - * - * 2102: 1024 x 1-bit Static RAM - * - * +--------------+ - * A6 |1 ++ 16| A7 - * A5 |2 15| A8 - * RWQ |3 14| A9 - * A1 |4 82S16 13| CEQ - * A2 |5 12| DO - * A3 |6 11| DI - * A4 |7 10| VCC - * A0 |8 9| GND - * +--------------+ - * - * - * Naming conventions follow Intel datasheet - * - */ - -#ifndef NLD_2102A_H_ -#define NLD_2102A_H_ - -#include "netlist/nl_setup.h" - -#define RAM_2102A(name, cCEQ, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cA9, cRWQ, cDI) \ - NET_REGISTER_DEV(RAM_2102A, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CEQ, cCEQ) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, A5, cA5) \ - NET_CONNECT(name, A6, cA6) \ - NET_CONNECT(name, A7, cA7) \ - NET_CONNECT(name, A8, cA8) \ - NET_CONNECT(name, A9, cA9) \ - NET_CONNECT(name, RWQ, cRWQ) \ - NET_CONNECT(name, DI, cDI) - -#define RAM_2102A_DIP(name) \ - NET_REGISTER_DEV(RAM_2102A_DIP, name) - -#endif /* NLD_2102A_H_ */ diff --git a/src/lib/netlist/devices/nld_2102a.cpp b/src/lib/netlist/devices/nld_2102a.cpp new file mode 100644 index 00000000000..dd03560a32d --- /dev/null +++ b/src/lib/netlist/devices/nld_2102a.cpp @@ -0,0 +1,91 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/* + * nld_2102A.cpp + * + * 2102: 1024 x 1-bit Static RAM + * + * +--------------+ + * A6 |1 ++ 16| A7 + * A5 |2 15| A8 + * RWQ |3 14| A9 + * A1 |4 82S16 13| CEQ + * A2 |5 12| DO + * A3 |6 11| DI + * A4 |7 10| VCC + * A0 |8 9| GND + * +--------------+ + * + * + * Naming conventions follow Intel datasheet + * + */ + +#include "nl_base.h" + +#define ADDR2BYTE(a) ((a) >> 3) +#define ADDR2BIT(a) ((a) & 0x7) + +namespace netlist::devices { + + NETLIB_OBJECT(2102A) + { + NETLIB_CONSTRUCTOR(2102A) + , m_A(*this, {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9" }, NETLIB_DELEGATE(inputs)) + , m_CEQ(*this, "CEQ", NETLIB_DELEGATE(inputs)) + , m_RWQ(*this, "RWQ", NETLIB_DELEGATE(inputs)) + , m_DI(*this, "DI", NETLIB_DELEGATE(inputs)) + , m_DO(*this, "DO") + , m_ram(*this, "m_ram", 0) + , m_RAM(*this, "m_RAM", &m_ram[0]) + , m_power_pins(*this) + { + } + + NETLIB_RESETI() + { + m_RAM.set(&m_ram[0]); + for (std::size_t i=0; i<128; i++) + m_ram[i] = 0; + } + + NETLIB_HANDLERI(inputs) + { + netlist_time max_delay = NLTIME_FROM_NS(350); + + if (!m_CEQ()) + { + unsigned a = 0; + for (std::size_t i=0; i<10; i++) + { + a |= (m_A[i]() << i); + } + const unsigned byte = ADDR2BYTE(a); + const unsigned bit = ADDR2BIT(a); + + if (!m_RWQ()) + { + m_ram[byte] &= ~(static_cast<uint8_t>(1) << bit); + m_ram[byte] |= (static_cast<uint8_t>(m_DI()) << bit); + } + + m_DO.push((m_ram[byte] >> bit) & 1, max_delay); + } + } + + private: + object_array_t<logic_input_t, 10> m_A; + logic_input_t m_CEQ; + logic_input_t m_RWQ; + logic_input_t m_DI; + + logic_output_t m_DO; + + state_container<std::array<uint8_t, 128>> m_ram; // 1024x1 bits + param_ptr_t m_RAM; + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(2102A, "RAM_2102A", "+CEQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+RWQ,+DI,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_2716.cpp b/src/lib/netlist/devices/nld_2716.cpp deleted file mode 100644 index 02fbec5b4d0..00000000000 --- a/src/lib/netlist/devices/nld_2716.cpp +++ /dev/null @@ -1,105 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_2716.cpp - * - */ - -#include "nld_2716.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(2716) - { - NETLIB_CONSTRUCTOR(2716) - , m_A(*this, {{ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10" }}) - , m_GQ(*this, "GQ") - , m_EPQ(*this, "EPQ") - , m_D(*this, {{ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7" }}) - , m_last_EPQ(*this, "m_last_EPQ", 1) - , m_ROM(*this, "ROM") - , m_power_pins(*this) - { - } - - NETLIB_UPDATEI(); - - protected: - object_array_t<logic_input_t, 11> m_A; - logic_input_t m_GQ; - logic_input_t m_EPQ; - object_array_t<logic_output_t, 8> m_D; - - state_var<unsigned> m_last_EPQ; - - param_rom_t<uint8_t, 11, 8> m_ROM; // 16 Kbits, used as 2 Kbit x 8 - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(2716_dip, 2716) - { - NETLIB_CONSTRUCTOR_DERIVED(2716_dip, 2716) - { - register_subalias("8", m_A[0]); - register_subalias("7", m_A[1]); - register_subalias("6", m_A[2]); - register_subalias("5", m_A[3]); - register_subalias("4", m_A[4]); - register_subalias("3", m_A[5]); - register_subalias("2", m_A[6]); - register_subalias("1", m_A[7]); - register_subalias("23", m_A[8]); - register_subalias("22", m_A[9]); - register_subalias("19", m_A[10]); - - register_subalias("20", m_GQ); - register_subalias("18", m_EPQ); - - register_subalias("9", m_D[0]); - register_subalias("10", m_D[1]); - register_subalias("11", m_D[2]); - register_subalias("13", m_D[3]); - register_subalias("14", m_D[4]); - register_subalias("15", m_D[5]); - register_subalias("16", m_D[6]); - register_subalias("17", m_D[7]); - - register_subalias("12", "GND"); - register_subalias("24", "VCC"); - } - }; - - // FIXME: timing! - NETLIB_UPDATE(2716) - { - unsigned d = 0xff; - - netlist_time delay = NLTIME_FROM_NS(450); - if (!m_GQ() && !m_EPQ()) - { - unsigned a = 0; - for (std::size_t i=0; i<11; i++) - a |= (m_A[i]() << i); - - d = m_ROM[a]; - - if (m_last_EPQ) - delay = NLTIME_FROM_NS(120); - } - - m_last_EPQ = m_EPQ(); - - // FIXME: Outputs are tristate. This needs to be properly implemented - for (std::size_t i=0; i<8; i++) - m_D[i].push((d >> i) & 1, delay); - } - - NETLIB_DEVICE_IMPL(2716, "EPROM_2716", "+GQ,+EPQ,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10,@VCC,@GND") - NETLIB_DEVICE_IMPL(2716_dip, "EPROM_2716_DIP", "") - - } //namespace devices -} // namespace netlist diff --git a/src/lib/netlist/devices/nld_2716.h b/src/lib/netlist/devices/nld_2716.h deleted file mode 100644 index c5e039e1421..00000000000 --- a/src/lib/netlist/devices/nld_2716.h +++ /dev/null @@ -1,54 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_82S126.h - * - * 2716: 16 Kbit (2Kb x 8) UV EPROM - * - * +----------------+ - * A7 |1 ++ 24| VCC - * A6 |2 23| A8 - * A5 |3 22| A9 - * A4 |4 2716 21| VPP - * A3 |5 20| GQ - * A2 |6 19| A10 - * A1 |7 18| EPQ - * A0 |8 17| D7 - * D0 |9 16| D6 - * D1 |10 15| D5 - * D2 |11 14| D4 - * VSS |12 13| D3 - * +----------------+ - * - * - * Naming conventions follow STMicro datasheet - * - */ - -#ifndef NLD_2716_H_ -#define NLD_2716_H_ - -#include "netlist/nl_setup.h" - -#define EPROM_2716(name, cGQ, cEPQ, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cA9, cA10) \ - NET_REGISTER_DEV(EPROM_2716, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GQ, cGQ) \ - NET_CONNECT(name, EPQ, cEPQ) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, A5, cA5) \ - NET_CONNECT(name, A6, cA6) \ - NET_CONNECT(name, A7, cA7) \ - NET_CONNECT(name, A8, cA8) \ - NET_CONNECT(name, A9, cA9) \ - NET_CONNECT(name, A10, cA10) - -#define EPROM_2716_DIP(name) \ - NET_REGISTER_DEV(EPROM_2716_DIP, name) - -#endif /* NLD_2716_H_ */ diff --git a/src/lib/netlist/devices/nld_4006.cpp b/src/lib/netlist/devices/nld_4006.cpp new file mode 100644 index 00000000000..94a3685032c --- /dev/null +++ b/src/lib/netlist/devices/nld_4006.cpp @@ -0,0 +1,114 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_4006.cpp + * + * CD4006: CMOS 18-Stage Static Register + * + * Description + * + * CD4006BMS types are composed of 4 separate shift register sections: two + * sections of four stages and two sections of five stages with an output tap + * at the fourth stage. Each section has an independent single-rail data path. + * + * A common clock signal is used for all stages. Data are shifted to the next + * stages on negative-going transitions of the clock. Through appropriate + * connections of inputs and outputs, multiple register sections of 4, 5, 8, + * and 9 stages or single register sections of 10, 12, 13, 14, 16, 17 and 18 + * stages can be implemented using one CD4006BMS package. Longer shift register + * sections can be assembled by using more than one CD4006BMS. + * + * To facilitate cascading stages when clock rise and fall times are slow, + * an optional output (D1 + 4’) that is delayed one-half clockcycle, is + * provided. + * + * +--------------+ + * D1 |1 ++ 14| VDD + * D1+4' |2 13| D1+4 + * CLOCK |3 12| D2+5 + * D2 |4 4006 11| D2+4 + * D3 |5 10| D3+4 + * D4 |6 9| D4+5 + * VSS |7 8| D4+4 + * +--------------+ + * + * + * Naming conventions follow SYC datasheet + * + * FIXME: Timing depends on VDD-VSS - partially done + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + // FIXME: optimize clock input + + NETLIB_OBJECT(CD4006) + { + NETLIB_CONSTRUCTOR_MODEL(CD4006, "CD4XXX") + , m_CLOCK(*this, "CLOCK", NETLIB_DELEGATE(inputs)) + , m_I(*this, {"D1", "D2", "D3", "D4"}, NETLIB_DELEGATE(inputs)) + , m_Q(*this, {"D1P4", "D1P4S", "D2P4", "D2P5", "D3P4", "D4P4", "D4P5"}) + , m_d(*this, "m_d", 0) + , m_last_clock(*this, "m_last_clock", 0) + , m_tp(*this, "m_tp", netlist_time::from_nsec(200)) + , m_supply(*this, NETLIB_DELEGATE(vdd_vss)) + { + } + + private: + NETLIB_HANDLERI(inputs) + { + if (m_last_clock && !m_CLOCK()) + { + m_d[0] >>= 1; + m_d[1] >>= 1; + m_d[2] >>= 1; + m_d[3] >>= 1; + // falling, output all but D1P4S + m_Q[0].push(m_d[0] & 1, m_tp); + m_Q[2].push((m_d[1] >> 1) & 1, m_tp); // D2 + 4 + m_Q[3].push( m_d[1] & 1, m_tp); // D2 + 5 + m_Q[4].push( m_d[2] & 1, m_tp); // D3 + 4 + m_Q[5].push((m_d[3] >> 1) & 1, m_tp); // D4 + 4 + m_Q[6].push( m_d[3] & 1, m_tp); // D5 + 5 + m_last_clock = m_CLOCK(); + } + else if (!m_last_clock && m_CLOCK()) + { + // rising, output D1P4S + m_Q[1].push(m_d[0] & 1, m_tp); + m_last_clock = m_CLOCK(); + } + else + { + m_d[0] = static_cast<uint8_t>((m_d[0] & 0x0f) | (m_I[0]() << 4)); + m_d[1] = static_cast<uint8_t>((m_d[1] & 0x1f) | (m_I[1]() << 5)); + m_d[2] = static_cast<uint8_t>((m_d[2] & 0x0f) | (m_I[2]() << 4)); + m_d[3] = static_cast<uint8_t>((m_d[3] & 0x1f) | (m_I[3]() << 5)); + } + } + + NETLIB_HANDLERI(vdd_vss) + { + auto d = m_supply.VCC()() - m_supply.GND()(); + if (d > 0.1) // avoid unrealistic values + { + m_tp = netlist_time::from_nsec(gsl::narrow_cast<unsigned>(923.0 / d + 13.0)); // calculated from datasheet + } + } + + logic_input_t m_CLOCK; + object_array_t<logic_input_t, 4> m_I; + object_array_t<logic_output_t, 7> m_Q; + state_container<std::array<uint8_t, 4>> m_d; + state_var<netlist_sig_t> m_last_clock; + state_var<netlist_time> m_tp; // propagation time + nld_power_pins m_supply; + }; + + NETLIB_DEVICE_IMPL(CD4006, "CD4006", "+CLOCK,+D1,+D2,+D3,+D4,+D1P4,+D1P4S,+D2P4,+D2P5,+D3P4,+D4P4,+D4P5,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4013.cpp b/src/lib/netlist/devices/nld_4013.cpp new file mode 100644 index 00000000000..5fa3aa25586 --- /dev/null +++ b/src/lib/netlist/devices/nld_4013.cpp @@ -0,0 +1,122 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_4013.cpp + * + * CD4013: Dual Positive-Edge-Triggered D Flip-Flops + * with Set, Reset and Complementary Outputs + * + * +--------------+ + * Q1 |1 ++ 14| VDD + * Q1Q |2 13| Q2 + * CLOCK1 |3 12| Q2Q + * RESET1 |4 4013 11| CLOCK2 + * DATA1 |5 10| RESET2 + * SET1 |6 9| DATA2 + * VSS |7 8| SET2 + * +--------------+ + * + * +-----+-----+-----+---++---+-----+ + * | SET | RES | CLK | D || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 1 | 0 | X | X || 1 | 0 | + * | 0 | 1 | X | X || 0 | 1 | + * | 1 | 1 | X | X || 1 | 1 | (*) + * | 0 | 0 | R | 1 || 1 | 0 | + * | 0 | 0 | R | 0 || 0 | 1 | + * | 0 | 0 | 0 | X || Q0| Q0Q | + * +-----+-----+-----+---++---+-----+ + * + * (*) This configuration is not stable, i.e. it will not persist + * when either the preset and or clear inputs return to their inactive (high) level + * + * Q0 The output logic level of Q before the indicated input conditions were established + * + * R: 0 -. 1 + * + * Naming conventions follow National Semiconductor datasheet + * + * FIXME: Check that (*) is emulated properly + */ + +#include "nl_base.h" +#include "nl_factory.h" + +namespace netlist::devices { + + NETLIB_OBJECT(CD4013) + { + NETLIB_CONSTRUCTOR_MODEL(CD4013, "CD4XXX") + , m_D(*this, "DATA", NETLIB_DELEGATE(inputs)) + , m_RESET(*this, "RESET", NETLIB_DELEGATE(inputs)) + , m_SET(*this, "SET", NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLOCK", NETLIB_DELEGATE(clk)) + , m_Q(*this, "Q") + , m_QQ(*this, "QQ") + , m_nextD(*this, "m_nextD", 0) + , m_power_pins(*this) + { + } + + private: + NETLIB_RESETI() + { + m_CLK.set_state(logic_t::STATE_INP_LH); + m_D.set_state(logic_t::STATE_INP_ACTIVE); + m_nextD = 0; + } + + NETLIB_HANDLERI(inputs) + { + const auto set(m_SET()); + const auto reset(m_RESET()); + if ((set ^ 1) & (reset ^ 1)) + { + m_D.activate(); + m_nextD = m_D(); + m_CLK.activate_lh(); + } + else + { + set_reset(set, reset); + m_CLK.inactivate(); + m_D.inactivate(); + } + } + + NETLIB_HANDLERI(clk) + { + set_output(m_nextD); + m_CLK.inactivate(); + } + + logic_input_t m_D; + logic_input_t m_RESET; + logic_input_t m_SET; + logic_input_t m_CLK; + logic_output_t m_Q; + logic_output_t m_QQ; + + state_var<netlist_sig_t> m_nextD; + + nld_power_pins m_power_pins; + + void set_output(const netlist_sig_t stateQ) + { + static constexpr const auto delay = NLTIME_FROM_NS(150); + m_Q.push(stateQ, delay); + m_QQ.push(!stateQ, delay); + } + + void set_reset(const netlist_sig_t stateQ, const netlist_sig_t stateQQ) + { + // Q: 150 ns, QQ: 200 ns + static constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(150), NLTIME_FROM_NS(200) }; + m_Q.push(stateQ, delay[0]); + m_QQ.push(stateQQ, delay[1]); + } + }; + + NETLIB_DEVICE_IMPL(CD4013, "CD4013", "+CLOCK,+DATA,+RESET,+SET,@VDD,@VSS") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4017.cpp b/src/lib/netlist/devices/nld_4017.cpp new file mode 100644 index 00000000000..36162e764b5 --- /dev/null +++ b/src/lib/netlist/devices/nld_4017.cpp @@ -0,0 +1,113 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_4017.cpp + * + * CD4017: Decade Counter/Divider with 10 Decoded Outputs + * + * +--------------+ + * Q5 |1 ++ 16| VDD + * Q1 |2 15| RESET + * Q0 |3 14| CLOCK + * Q2 |4 4017 13| CLOCK ENABLE + * Q6 |5 12| CARRY OUT + * Q7 |6 11| Q9 + * Q3 |7 10| Q4 + * VSS |8 9| Q8 + * +--------------+ + * + * + * CD4022: Divide-by-8 Counter/Divider with 8 Decoded Outputs + * + * +--------------+ + * Q1 |1 ++ 16| VDD + * Q0 |2 15| RESET + * Q2 |3 14| CLOCK + * Q5 |4 4022 13| CLOCK ENABLE + * Q6 |5 12| CARRY OUT + * NC |6 11| Q4 + * Q3 |7 10| Q7 + * VSS |8 9| NC + * +--------------+ + * + * Naming conventions follow Fairchild datasheet + * + * FIXME: Timing depends on VDD-VSS + * This needs a cmos d-a/a-d proxy implementation. + * + */ + +#include "nl_base.h" +#include "nl_factory.h" + +namespace netlist::devices { + + template <std::size_t MaxCount> + NETLIB_OBJECT(CD4017_base) + { + NETLIB_CONSTRUCTOR_MODEL(CD4017_base, "CD4XXX") + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_CLKEN(*this, "CLKEN", NETLIB_DELEGATE(inputs)) + , m_RESET(*this, "RESET", NETLIB_DELEGATE(inputs)) + , m_CO(*this, "CO") + , m_Q(*this, 0, "Q{}") + , m_cnt(*this, "m_cnt", 0) + , m_supply(*this) + { + } + + private: + NETLIB_RESETI() + { + m_CLK.set_state(logic_t::STATE_INP_LH); + m_cnt = 0; + } + + NETLIB_HANDLERI(clk) + { + ++m_cnt; + update_outputs(m_cnt); + } + + NETLIB_HANDLERI(inputs) + { + if (m_RESET()) + { + m_CLK.inactivate(); + m_cnt = 0; + update_outputs(m_cnt); + } + else if (m_CLKEN()) + { + m_CLK.inactivate(); + } + else + { + m_CLK.activate_lh(); + } + } + + void update_outputs(const unsigned cnt) noexcept + { + for (std::size_t i = 0; i < MaxCount; i++) + m_Q[i].push(i == cnt, NLTIME_FROM_NS(200)); + m_CO.push(cnt < MaxCount / 2, NLTIME_FROM_NS(160)); + } + logic_input_t m_CLK; + logic_input_t m_CLKEN; + logic_input_t m_RESET; + logic_output_t m_CO; + object_array_t<logic_output_t, MaxCount> m_Q; + + state_var<unsigned> m_cnt; + nld_power_pins m_supply; + }; + + using NETLIB_NAME(CD4017) = NETLIB_NAME(CD4017_base)<10>; + using NETLIB_NAME(CD4022) = NETLIB_NAME(CD4017_base)<8>; + + + NETLIB_DEVICE_IMPL(CD4017, "CD4017", "") + NETLIB_DEVICE_IMPL(CD4022, "CD4022", "") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4020.cpp b/src/lib/netlist/devices/nld_4020.cpp index d0e35f502b7..626a22f7d05 100644 --- a/src/lib/netlist/devices/nld_4020.cpp +++ b/src/lib/netlist/devices/nld_4020.cpp @@ -1,27 +1,58 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_4020.c + * nld_4020.cpp + * + * CD4020: 14-Stage Ripple Carry Binary Counters + * + * +--------------+ + * Q12 |1 ++ 16| VDD + * Q13 |2 15| Q11 + * Q14 |3 14| Q10 + * Q6 |4 4020 13| Q8 + * Q5 |5 12| Q9 + * Q7 |6 11| RESET + * Q4 |7 10| IP (Input pulses) + * VSS |8 9| Q1 + * +--------------+ + * + * + * CD4024: 7-Stage Ripple Carry Binary Counters + * + * +--------------+ + * IP |1 ++ 14| VDD + * RESET |2 13| NC + * Q7 |3 12| Q1 + * Q6 |4 4024 11| Q2 + * Q5 |5 10| NC + * Q4 |6 9| Q3 + * VSS |7 8| NC + * +--------------+ + * + * + * Naming conventions follow Texas Instruments datasheet + * + * FIXME: Timing depends on VDD-VSS + * This needs a cmos d-a/a-d proxy implementation. * */ -//#include "nlid_cmos.h" -#include "nld_4020.h" -#include "nlid_system.h" +#include "nl_base.h" +#include "nl_factory.h" -namespace netlist -{ - namespace devices - { +namespace netlist::devices { + + template <unsigned TotalBits, unsigned LiveBitmask> NETLIB_OBJECT(CD4020_sub) { - NETLIB_CONSTRUCTOR(CD4020_sub) - NETLIB_FAMILY("CD4XXX") - , m_IP(*this, "IP") - , m_Q(*this, {{"Q1", "_Q2", "_Q3", "Q4", "Q5", "Q6", "Q7", "Q8", "Q9", - "Q10", "Q11", "Q12", "Q13", "Q14"}}) + static_assert((LiveBitmask >> TotalBits) == 0, "Live bitmask too large"); + + NETLIB_CONSTRUCTOR_MODEL(CD4020_sub, "CD4XXX") + , m_IP(*this, "IP", NETLIB_DELEGATE(ip)) + , m_RESET(*this, "RESET", NETLIB_DELEGATE(reseti)) + , m_Q(*this, 1, "Q{}") , m_cnt(*this, "m_cnt", 0) - , m_supply(*this, "VDD", "VSS") + , m_supply(*this) { } @@ -31,91 +62,57 @@ namespace netlist m_cnt = 0; } - NETLIB_UPDATEI(); - - public: - void update_outputs(const unsigned cnt); - - logic_input_t m_IP; - object_array_t<logic_output_t, 14> m_Q; - - state_var<unsigned> m_cnt; - nld_power_pins m_supply; - }; - - NETLIB_OBJECT(CD4020) - { - NETLIB_CONSTRUCTOR(CD4020) - NETLIB_FAMILY("CD4XXX") - , m_sub(*this, "sub") - , m_RESET(*this, "RESET") + NETLIB_HANDLERI(ip) { - register_subalias("IP", m_sub.m_IP); - register_subalias("Q1", m_sub.m_Q[0]); - register_subalias("Q4", m_sub.m_Q[3]); - register_subalias("Q5", m_sub.m_Q[4]); - register_subalias("Q6", m_sub.m_Q[5]); - register_subalias("Q7", m_sub.m_Q[6]); - register_subalias("Q8", m_sub.m_Q[7]); - register_subalias("Q9", m_sub.m_Q[8]); - register_subalias("Q10", m_sub.m_Q[9]); - register_subalias("Q11", m_sub.m_Q[10]); - register_subalias("Q12", m_sub.m_Q[11]); - register_subalias("Q13", m_sub.m_Q[12]); - register_subalias("Q14", m_sub.m_Q[13]); - register_subalias("VDD", "sub.VDD"); - register_subalias("VSS", "sub.VSS"); + ++m_cnt; + update_outputs(m_cnt); } - NETLIB_RESETI() { } - NETLIB_UPDATEI(); - private: - NETLIB_SUB(CD4020_sub) m_sub; - logic_input_t m_RESET; - }; - - - NETLIB_UPDATE(CD4020_sub) - { - ++m_cnt; - m_cnt &= 0x3fff; - update_outputs(m_cnt); - } + NETLIB_HANDLERI(reseti) + { + if (m_RESET()) + { + m_cnt = 0; + m_IP.inactivate(); + /* static */ const netlist_time reset_time = netlist_time::from_nsec(140); + for (unsigned i = 0; i < TotalBits; i++) + if (((LiveBitmask >> i) & 1) != 0) + m_Q[i].push(0, reset_time); + } + else + m_IP.activate_hl(); + } - NETLIB_UPDATE(CD4020) - { - if (m_RESET()) + public: + void update_outputs(const unsigned cnt) noexcept { - m_sub.m_cnt = 0; - m_sub.m_IP.inactivate(); - /* static */ const netlist_time reset_time = netlist_time::from_nsec(140); - m_sub.m_Q[0].push(0, reset_time); - for (std::size_t i=3; i<14; i++) - m_sub.m_Q[i].push(0, reset_time); + static constexpr const std::array<netlist_time, 14> out_delayQn = { + NLTIME_FROM_NS(180), NLTIME_FROM_NS(280), + NLTIME_FROM_NS(380), NLTIME_FROM_NS(480), + NLTIME_FROM_NS(580), NLTIME_FROM_NS(680), + NLTIME_FROM_NS(780), NLTIME_FROM_NS(880), + NLTIME_FROM_NS(980), NLTIME_FROM_NS(1080), + NLTIME_FROM_NS(1180), NLTIME_FROM_NS(1280), + NLTIME_FROM_NS(1380), NLTIME_FROM_NS(1480), + }; + + for (unsigned i = 0; i < TotalBits; i++) + if (((LiveBitmask >> i) & 1) != 0) + m_Q[i].push((cnt >> i) & 1, out_delayQn[i]); } - else - m_sub.m_IP.activate_hl(); - } + logic_input_t m_IP; + logic_input_t m_RESET; + object_array_t<logic_output_t, TotalBits> m_Q; - NETLIB_FUNC_VOID(CD4020_sub, update_outputs, (const unsigned cnt)) - { - static constexpr const std::array<netlist_time, 14> out_delayQn = { - NLTIME_FROM_NS(180), NLTIME_FROM_NS(280), - NLTIME_FROM_NS(380), NLTIME_FROM_NS(480), - NLTIME_FROM_NS(580), NLTIME_FROM_NS(680), - NLTIME_FROM_NS(780), NLTIME_FROM_NS(880), - NLTIME_FROM_NS(980), NLTIME_FROM_NS(1080), - NLTIME_FROM_NS(1180), NLTIME_FROM_NS(1280), - NLTIME_FROM_NS(1380), NLTIME_FROM_NS(1480), - }; + state_var<unsigned> m_cnt; + nld_power_pins m_supply; + }; - m_Q[0].push(cnt & 1, out_delayQn[0]); - for (std::size_t i=3; i<14; i++) - m_Q[i].push((cnt >> i) & 1, out_delayQn[i]); - } + // FIXME: Exposes Q2 and Q3 as well + using NETLIB_NAME(CD4020_impl) = nld_CD4020_sub<14, 0x3ff9>; + NETLIB_DEVICE_IMPL_ALIAS(CD4020, CD4020_impl,"CD4020", "+IP,+RESET,+VDD,+VSS") - NETLIB_DEVICE_IMPL(CD4020, "CD4020", "") - NETLIB_DEVICE_IMPL_ALIAS(CD4020_WI, CD4020, "CD4020_WI", "+IP,+RESET,+VDD,+VSS") + using NETLIB_NAME(CD4024_impl) = nld_CD4020_sub<7, 0x7f>; + NETLIB_DEVICE_IMPL_ALIAS(CD4024, CD4024_impl, "CD4024", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4020.h b/src/lib/netlist/devices/nld_4020.h deleted file mode 100644 index f24251fb1dc..00000000000 --- a/src/lib/netlist/devices/nld_4020.h +++ /dev/null @@ -1,43 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_4020.h - * - * CD4020: 14-Stage Ripple Carry Binary Counters - * - * +--------------+ - * Q12 |1 ++ 16| VDD - * Q13 |2 15| Q11 - * Q14 |3 14| Q10 - * Q6 |4 4020 13| Q8 - * Q5 |5 12| Q9 - * Q7 |6 11| RESET - * Q4 |7 10| IP (Input pulses) - * VSS |8 9| Q1 - * +--------------+ - * - * - * Naming conventions follow Texas Instruments datasheet - * - * FIXME: Timing depends on VDD-VSS - * This needs a cmos d-a/a-d proxy implementation. - * - */ - -#ifndef NLD_4020_H_ -#define NLD_4020_H_ - -#include "netlist/nl_setup.h" - -/* FIXME: only used in mario.c */ -#define CD4020_WI(name, cIP, cRESET, cVDD, cVSS) \ - NET_REGISTER_DEV(CD4020_WI, name) \ - NET_CONNECT(name, IP, cIP) \ - NET_CONNECT(name, RESET, cRESET) \ - NET_CONNECT(name, VDD, cVDD) \ - NET_CONNECT(name, VSS, cVSS) - -#define CD4020(name) \ - NET_REGISTER_DEV(CD4020, name) - -#endif /* NLD_4020_H_ */ diff --git a/src/lib/netlist/devices/nld_4029.cpp b/src/lib/netlist/devices/nld_4029.cpp new file mode 100644 index 00000000000..e6f1b6856a3 --- /dev/null +++ b/src/lib/netlist/devices/nld_4029.cpp @@ -0,0 +1,268 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud, Jonathan Gevaryahu +/* + * nld_4029.cpp + * + * CD4029BM/CD4029BC Presettable Binary/Decade Up/Down Counter + * + * +--------------+ + * PE |1 ++ 16| VDD + * Q4 |2 15| CLK + * J4 |3 14| Q3 + * J1 |4 4029 13| J3 + * CI |5 12| J2 + * Q1 |6 11| Q2 + * CO |7 10| U/D + * VSS |8 9| B/D + * +--------------+ + * + * Counter Sequences: + * + * B/D high (Binary), U/D high (Up) + * +-------++----+----+----+----+----++-------+ + * | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | + * +=======++====+====+====+====+====++=======+ + * | 0 || 0 | 0 | 0 | 0 | 1 || 1 | + * | 1 || 0 | 0 | 0 | 1 | 1 || 2 | + * | 2 || 0 | 0 | 1 | 0 | 1 || 3 | + * | 3 || 0 | 0 | 1 | 1 | 1 || 4 | + * | 4 || 0 | 1 | 0 | 0 | 1 || 5 | + * | 5 || 0 | 1 | 0 | 1 | 1 || 6 | + * | 6 || 0 | 1 | 1 | 0 | 1 || 7 | + * | 7 || 0 | 1 | 1 | 1 | 1 || 8 | + * | 8 || 1 | 0 | 0 | 0 | 1 || 9 | + * | 9 || 1 | 0 | 0 | 1 | 1 || A | + * | A || 1 | 0 | 1 | 0 | 1 || B | + * | B || 1 | 0 | 1 | 1 | 1 || C | + * | C || 1 | 1 | 0 | 0 | 1 || D | + * | D || 1 | 1 | 0 | 1 | 1 || E | + * | E || 1 | 1 | 1 | 0 | 1 || F | + * | F || 1 | 1 | 1 | 1 |0|CI|| 0 | + * | 0 || 0 | 0 | 0 | 0 | 1 || 1 | + * +-------++----+----+----+----+----++-------+ + * + * B/D high (Binary), U/D low (Down) + * +-------++----+----+----+----+----++-------+ + * | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | + * +=======++====+====+====+====+====++=======+ + * | F || 1 | 1 | 1 | 1 | 1 || E | + * | E || 1 | 1 | 1 | 0 | 1 || D | + * | D || 1 | 1 | 0 | 1 | 1 || C | + * | C || 1 | 1 | 0 | 0 | 1 || B | + * | B || 1 | 0 | 1 | 1 | 1 || A | + * | A || 1 | 0 | 1 | 0 | 1 || 9 | + * | 9 || 1 | 0 | 0 | 1 | 1 || 8 | + * | 8 || 1 | 0 | 0 | 0 | 1 || 7 | + * | 7 || 0 | 1 | 1 | 1 | 1 || 6 | + * | 6 || 0 | 1 | 1 | 0 | 1 || 5 | + * | 5 || 0 | 1 | 0 | 1 | 1 || 4 | + * | 4 || 0 | 1 | 0 | 0 | 1 || 3 | + * | 3 || 0 | 0 | 1 | 1 | 1 || 2 | + * | 2 || 0 | 0 | 1 | 0 | 1 || 1 | + * | 1 || 0 | 0 | 0 | 1 | 1 || 0 | + * | 0 || 0 | 0 | 0 | 0 |0|CI|| F | + * | F || 1 | 1 | 1 | 1 | 1 || E | + * +-------++----+----+----+----+----++-------+ + * + * B/D low (Decimal), U/D high (Up) + * +-------++----+----+----+----+----++-------+ + * | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | + * +=======++====+====+====+====+====++=======+ + * | 0 || 0 | 0 | 0 | 0 | 1 || 1 | + * | 1 || 0 | 0 | 0 | 1 | 1 || 2 | + * | 2 || 0 | 0 | 1 | 0 | 1 || 3 | + * | 3 || 0 | 0 | 1 | 1 | 1 || 4 | + * | 4 || 0 | 1 | 0 | 0 | 1 || 5 | + * | 5 || 0 | 1 | 0 | 1 | 1 || 6 | + * | 6 || 0 | 1 | 1 | 0 | 1 || 7 | + * | 7 || 0 | 1 | 1 | 1 | 1 || 8 | + * | 8 || 1 | 0 | 0 | 0 | 1 || 9 | + * | 9 || 1 | 0 | 0 | 1 |0|CI|| 0 | + * | A || 1 | 0 | 1 | 0 | 1 || B | + * | B || 1 | 0 | 1 | 1 |0|CI|| 6 | + * | C || 1 | 1 | 0 | 0 | 1 || D | + * | D || 1 | 1 | 0 | 1 |0|CI|| 4 | + * | E || 1 | 1 | 1 | 0 | 1 || F | + * | F || 1 | 1 | 1 | 1 |0|CI|| 2 | + * | 0 || 0 | 0 | 0 | 0 | 1 || 1 | + * +-------++----+----+----+----+----++-------+ + * + * B/D low (Decimal), U/D low (Down) + * +-------++----+----+----+----+----++-------+ + * | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | + * +=======++====+====+====+====+====++=======+ + * | F || 1 | 1 | 1 | 1 | 1 || E | + * | E || 1 | 1 | 1 | 0 | 1 || D | + * | D || 1 | 1 | 0 | 1 | 1 || C | + * | C || 1 | 1 | 0 | 0 | 1 || B | + * | B || 1 | 0 | 1 | 1 | 1 || A | + * | A || 1 | 0 | 1 | 0 | 1 || 9 | + * | 9 || 1 | 0 | 0 | 1 | 1 || 8 | + * | 8 || 1 | 0 | 0 | 0 | 1 || 7 | + * | 7 || 0 | 1 | 1 | 1 | 1 || 6 | + * | 6 || 0 | 1 | 1 | 0 | 1 || 5 | + * | 5 || 0 | 1 | 0 | 1 | 1 || 4 | + * | 4 || 0 | 1 | 0 | 0 | 1 || 3 | + * | 3 || 0 | 0 | 1 | 1 | 1 || 2 | + * | 2 || 0 | 0 | 1 | 0 | 1 || 1 | + * | 1 || 0 | 0 | 0 | 1 | 1 || 0 | + * | 0 || 0 | 0 | 0 | 0 |0|CI|| 9 | + * | 9 || 1 | 0 | 0 | 1 | 1 || 8 | + * +-------++----+----+----+----+----++-------+ + * + * Note that in all cases where Carry-out is generating a non-1 signal (0 | Carry-in), + * this signal is asynchronous, so if carry-in changes the carry-out value will + * change immediately. + * + * + * Preset/Carry in function table + * +-----+-----+-----++----+----+----+----+ + * | PE | CLK | CI || Q1 | Q2 | Q3 | Q4 | + * +=====+=====+=====++====+====+====+====+ + * | 1 | X | X || J1 | J2 | J3 | J4 | + * | 0 | X | 1 || Q1 | Q2 | Q3 | Q4 | + * | 0 | ./` | 0 || COUNT | + * +-----+-----+-----++----+----+----+----+ + * + * Naming conventions follow National Semiconductor datasheet + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + NETLIB_OBJECT(CD4029) + { + NETLIB_CONSTRUCTOR_MODEL(CD4029, "CD4XXX") + , m_PE(*this, "PE", NETLIB_DELEGATE(inputs)) + , m_J(*this, {"J1", "J2", "J3", "J4"}, NETLIB_DELEGATE(inputs)) + , m_CI(*this, "CI", NETLIB_DELEGATE(inputs)) + , m_UD(*this, "UD", NETLIB_DELEGATE(inputs)) + , m_BD(*this, "BD", NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_clk_old(*this, "m_clk_old", false) + , m_Q(*this, {"Q1", "Q2", "Q3", "Q4"}) + , m_CO(*this, "CO", false) + , m_cnt(*this, "m_cnt", 0) + , m_power_pins(*this) + { + } + + private: + NETLIB_HANDLERI(inputs) // pe causes an asynchronous counter load on level so has to be handled separately; if pe is high, then J changing will asynchronously change the Q state. changing J in this state does affect CO as well; CI will affect CO asynchronously if there is currently a carry + { + if (m_PE()) + { + m_cnt = m_J()&0xf; + } + m_Q.push(m_cnt, NLTIME_FROM_NS(200)); + // figure out CO + if (!m_UD()) // downward is the same for binary and decimal + { + m_CO.push(m_cnt||m_CI(),NLTIME_FROM_NS(320)); + } + else // upward mode differs + { + if (!m_BD()) // decimal mode + { + m_CO.push((m_cnt<8)||(~m_cnt&1)||m_CI(),NLTIME_FROM_NS(320)); + } + else // binary mode + { + m_CO.push((m_cnt!=0xf)||m_CI(),NLTIME_FROM_NS(320)); + } + } + } + + NETLIB_HANDLERI(clk) + { + // clocking only happens if m_clk_old was low, m_CLK is high, m_PE is NOT high, and m_CI is NOT high. + if (!m_PE() && !m_CI() && !m_clk_old && m_CLK()) + { + if (m_BD()) // binary + { + m_cnt += (m_UD() ? 1 : -1); + m_cnt &= 0xf; + } + else // decimal + { + if (m_UD()) // upward + { + switch(m_cnt) + { + case 0: case 1: case 2: case 3: + case 4: case 5: case 6: case 7: + case 8: case 0xa: case 0xc: case 0xe: + m_cnt++; + break; + case 9: + m_cnt = 0; + break; + case 0xb: + m_cnt = 6; + break; + case 0xd: + m_cnt = 4; + break; + case 0xf: + m_cnt = 2; + break; + } + } + else // downward + { + if (m_cnt>0) + { + m_cnt--; + } + else // m_cnt == 0 + { + m_cnt = 9; + } + } + } + } + m_clk_old = m_CLK(); + m_Q.push(m_cnt, NLTIME_FROM_NS(200)); + // figure out CO + if (!m_UD()) // downward is the same for binary and decimal + { + m_CO.push(m_cnt||m_CI(),NLTIME_FROM_NS(320)); + } + else // upward mode differs + { + if (!m_BD()) // decimal mode + { + m_CO.push((m_cnt<8)||(~m_cnt&1)||m_CI(),NLTIME_FROM_NS(320)); + } + else // binary mode + { + m_CO.push((m_cnt!=0xf)||m_CI(),NLTIME_FROM_NS(320)); + } + } + } + + NETLIB_RESETI() + { + m_cnt = 0; + m_clk_old = false; + } + + logic_input_t m_PE; + object_array_t<logic_input_t, 4> m_J; + logic_input_t m_CI; + logic_input_t m_UD; + logic_input_t m_BD; + logic_input_t m_CLK; + + state_var<netlist_sig_t> m_clk_old; + object_array_t<logic_output_t, 4> m_Q; + logic_output_t m_CO; + state_var_u8 m_cnt; + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(CD4029, "CD4029", "+PE,+J1,+J2,+J3,+J4,+CI,+UD,+BD,+CLK,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4042.cpp b/src/lib/netlist/devices/nld_4042.cpp new file mode 100644 index 00000000000..14b80b5b53a --- /dev/null +++ b/src/lib/netlist/devices/nld_4042.cpp @@ -0,0 +1,116 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud, Jonathan Gevaryahu +/* + * nld_4042.cpp + * + * CD4042BM/CD4042BC Quad Clocked D Latch + * + * +--------------+ + * Q4 |1 ++ 16| VDD + * Q1 |2 15| Q4Q + * Q1Q |3 14| D4 + * D1 |4 4042 13| D3 + * CLK |5 12| Q3Q + * POL |6 11| Q3 + * D2 |7 10| Q2 + * VSS |8 9| Q2Q + * +--------------+ + * + * + * Function table + * +-----+-----+----++----+-----+ + * | POL | CLK | Dx || Qx | QQx | + * +=====+=====+====++====+=====+ + * | 0 | 0 | X || Qx | /Qx | + * | 0 | 1 | D || D | /D | + * | 1 | 1 | X || Qx | /Qx | + * | 1 | 0 | D || D | /D | + * +-----+-----+----++----+-----+ + * Note that since this is a level triggered transparent latch, + * as long as POL ^ CLK == true, the latch is transparent, and + * if D changes Q and QQ(/Q) will instantly change. + * + * Naming conventions follow National Semiconductor datasheet + * + * National Semiconductor Datasheet: http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS005966.PDF + * TI Datasheet: https://www.ti.com/lit/ds/symlink/cd4042b.pdf + */ + +#include "nl_base.h" + +namespace netlist::devices { + + + NETLIB_OBJECT(CD4042) + { + NETLIB_CONSTRUCTOR_MODEL(CD4042, "CD4XXX") + , m_D(*this, {"D1", "D2", "D3", "D4"}, NETLIB_DELEGATE(inputs)) + , m_POL(*this, "POL", NETLIB_DELEGATE(clk)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_Q(*this, {"Q1", "Q2", "Q3", "Q4"}) + , m_QQ(*this, {"Q1Q", "Q2Q", "Q3Q", "Q4Q"}) + , m_latch(*this, "m_latch", 0) + , m_tpdq(*this, "m_tpd", netlist_time::from_nsec(175)) + , m_tpdqq(*this, "m_tpd", netlist_time::from_nsec(150)) + , m_tpcq(*this, "m_tpc", netlist_time::from_nsec(250)) + , m_tpcqq(*this, "m_tpc", netlist_time::from_nsec(250)) + , m_power_pins(*this, NETLIB_DELEGATE(vdd_vss)) + { + } + + private: + NETLIB_HANDLERI(clk) + { + if (m_POL() ^ m_CLK()) // are we in transparent mode? if so latch the data and push it. + { + m_latch = m_D()&0xf; + m_Q.push(m_latch&0xf, m_tpcq); + m_QQ.push((~m_latch)&0xf, m_tpcqq); + } + // if not, the data inputs are ignored and just do nothing + } + + NETLIB_HANDLERI(inputs) + { + if ((m_POL() ^ m_CLK())&&(m_latch != (m_D()&0xf))) // are we in transparent mode? if so latch the data and push it. only do this if the data actually changed + { + m_latch = m_D()&0xf; + m_Q.push(m_latch&0xf, m_tpdq); + m_QQ.push((~m_latch)&0xf, m_tpdqq); + } + } + + NETLIB_HANDLERI(vdd_vss) + { + auto d = m_power_pins.VCC()() - m_power_pins.GND()(); + if (d > 0.1) // avoid unrealistic values + { + m_tpdq = netlist_time::from_nsec(gsl::narrow_cast<unsigned>(894.0 / d - 6.0)); + m_tpdqq = netlist_time::from_nsec(gsl::narrow_cast<unsigned>(750.0 / d + 0.0)); + m_tpcq = netlist_time::from_nsec(gsl::narrow_cast<unsigned>(1327.0 / d - 18.8)); + m_tpcqq = netlist_time::from_nsec(gsl::narrow_cast<unsigned>(1234.5 / d + 0.8)); + } + } + + NETLIB_RESETI() + { + m_latch = 0; + } + + object_array_t<logic_input_t, 4> m_D; + logic_input_t m_POL; + logic_input_t m_CLK; + + object_array_t<logic_output_t, 4> m_Q; + object_array_t<logic_output_t, 4> m_QQ; + state_var_u8 m_latch; + state_var<netlist_time> m_tpdq; // propagation time for data alone when in transparent mode, Q + state_var<netlist_time> m_tpdqq; // propagation time for data alone when in transparent mode, /Q + state_var<netlist_time> m_tpcq; // propagation time for data vs CLK, Q + state_var<netlist_time> m_tpcqq; // propagation time for data vs CLK, /Q + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(CD4042, "CD4042", "+D1,+D2,+D3,+D4,+POL,+CLK,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4053.cpp b/src/lib/netlist/devices/nld_4053.cpp new file mode 100644 index 00000000000..a199fedf7fc --- /dev/null +++ b/src/lib/netlist/devices/nld_4053.cpp @@ -0,0 +1,142 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_4053.cpp + * + * CD4053: Triple 2-Channel Analog Multiplexer/Demultiplexer + * + * +--------------+ + * INOUTBY |1 ++ 16| VDD + * INOUTBX |2 15| OUTINB + * INOUTCY |3 14| OUTINA + * OUTINC |4 4053 13| INOUTAY + * INOUTCX |5 12| INOUTAX + * INH |6 11| A + * VEE |7 10| B + * VSS |8 9| C + * +--------------+ + * + * FIXME: These devices are slow (~125 ns). This is currently not reflected + * + * Naming conventions follow National semiconductor datasheet + * + */ + + +#include "analog/nlid_twoterm.h" +#include "solver/nld_solver.h" + +namespace netlist::devices { + + NETLIB_OBJECT(CD4053_GATE) + { + NETLIB_CONSTRUCTOR_MODEL(CD4053_GATE, "CD4XXX") + , m_RX(*this, "RX") + , m_RY(*this, "RY") + , m_select(*this, "S", NETLIB_DELEGATE(controls)) + , m_inhibit(*this, "INH", NETLIB_DELEGATE(controls)) + , m_VEE(*this, "VEE", NETLIB_DELEGATE(controls)) + , m_base_r(*this, "BASER", nlconst::magic(270.0)) + , m_last_x(*this, "m_lastx", false) + , m_last_y(*this, "m_lasty", false) + , m_select_state(*this, "m_select_state", false) + , m_inhibit_state(*this, "m_inhibit_state", false) + , m_supply(*this) + { + connect("RX.2", "RY.2"); + register_sub_alias("X", "RX.1"); + register_sub_alias("Y", "RY.1"); + register_sub_alias("XY", "RX.2"); + } + + NETLIB_RESETI() + { + update_state(true, false); + } + + private: + NETLIB_HANDLERI(controls) + { + bool new_x = false; + bool new_y = false; + if (!on(m_inhibit, m_inhibit_state)) + { + if (!on(m_select, m_select_state)) + { + new_x = true; + } + else + { + new_y = true; + } + } + + if (new_x != m_last_x || new_y != m_last_y) + update_state(new_x, new_y); + } + + bool on(analog_input_t &input, bool &state) + { + // digital inputs are based on VDD + nl_fptype sup = (m_supply.VCC().Q_Analog() - m_supply.GND().Q_Analog()); + nl_fptype in = input() - m_supply.GND().Q_Analog(); + nl_fptype low = nlconst::magic(0.3) * sup; + nl_fptype high = nlconst::magic(0.7) * sup; + if (in < low) + { + state = false; + } + else if (in > high) + { + state = true; + } + return state; + } + + void update_state(bool newx, bool newy) + { + // analog output is based on VEE + const nl_fptype sup = (m_VEE() - m_supply.GND().Q_Analog()); + const nl_fptype Ron = m_base_r() * nlconst::magic(5.0) / sup; + const nl_fptype Roff = plib::reciprocal(exec().gmin()); + const nl_fptype RX = newx ? Ron : Roff; + const nl_fptype RY = newy ? Ron : Roff; + if (m_RX().solver() == m_RY().solver()) + { + m_RX().change_state([this, &RX, &RY]() + { + m_RX().set_R(RX); + m_RY().set_R(RY); + }); + } + else + { + m_RX().change_state([this, &RX]() + { + m_RX().set_R(RX); + }); + m_RY().change_state([this, &RY]() + { + m_RY().set_R(RY); + }); + } + m_last_x = newx; + m_last_y = newy; + } + + NETLIB_SUB_NS(analog, R_base) m_RX; + NETLIB_SUB_NS(analog, R_base) m_RY; + analog_input_t m_select; + analog_input_t m_inhibit; + analog_input_t m_VEE; + param_fp_t m_base_r; + state_var<bool> m_last_x; + state_var<bool> m_last_y; + state_var<bool> m_select_state; + state_var<bool> m_inhibit_state; + nld_power_pins m_supply; + }; + + NETLIB_DEVICE_IMPL(CD4053_GATE, "CD4053_GATE", "") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4066.cpp b/src/lib/netlist/devices/nld_4066.cpp index 96200688400..bd2a0a13196 100644 --- a/src/lib/netlist/devices/nld_4066.cpp +++ b/src/lib/netlist/devices/nld_4066.cpp @@ -1,76 +1,83 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_4066.c + * nld_4066.cpp + * + * CD4066: Quad Bilateral Switch + * + * +--------------+ + * INOUTA |1 ++ 14| VDD + * OUTINA |2 13| CONTROLA + * OUTINB |3 12| CONTROLD + * INOUTB |4 4066 11| INOUTD + * CONTROLB |5 10| OUTIND + * CONTROLC |6 9| OUTINC + * VSS |7 8| INOUTC + * +--------------+ + * + * FIXME: These devices are slow (~125 ns). This is currently not reflected + * + * Naming conventions follow National semiconductor datasheet * */ -#include "nld_4066.h" +#include "analog/nlid_twoterm.h" +#include "solver/nld_solver.h" -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/solver/nld_solver.h" -#include "nlid_system.h" -namespace netlist -{ - namespace devices - { +namespace netlist::devices { + NETLIB_OBJECT(CD4066_GATE) { - NETLIB_CONSTRUCTOR(CD4066_GATE) - NETLIB_FAMILY("CD4XXX") - , m_supply(*this, "VDD", "VSS", true) + NETLIB_CONSTRUCTOR_MODEL(CD4066_GATE, "CD4XXX") , m_R(*this, "R") - , m_control(*this, "CTL") - , m_base_r(*this, "BASER", 270.0) + , m_control(*this, "CTL", NETLIB_DELEGATE(control)) + , m_base_r(*this, "BASER", nlconst::magic(270.0)) + , m_last(*this, "m_last", false) + , m_supply(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + // Start in off condition + // FIXME: is ROFF correct? + m_R().set_R(plib::reciprocal(exec().gmin())); + } private: - nld_power_pins m_supply; - analog::NETLIB_SUB(R_base) m_R; + NETLIB_HANDLERI(control) + { + nl_fptype sup = (m_supply.VCC().Q_Analog() - m_supply.GND().Q_Analog()); + nl_fptype in = m_control() - m_supply.GND().Q_Analog(); + nl_fptype rON = m_base_r() * nlconst::magic(5.0) / sup; + nl_fptype R = -nlconst::one(); + nl_fptype low = nlconst::magic(0.45) * sup; + nl_fptype high = nlconst::magic(0.55) * sup; + bool new_state(false); + if (in < low) + { + R = plib::reciprocal(exec().gmin()); + } + else if (in > high) + { + R = rON; + new_state = true; + } + if (R > nlconst::zero() && (m_last != new_state)) + { + m_last = new_state; + m_R().change_state([this, &R]() -> void { this->m_R().set_R(R);}); + } + } + NETLIB_SUB_NS(analog, R_base) m_R; analog_input_t m_control; - param_double_t m_base_r; + param_fp_t m_base_r; + state_var<bool> m_last; + nld_power_pins m_supply; }; - NETLIB_RESET(CD4066_GATE) - { - // Start in off condition - // FIXME: is ROFF correct? - m_R.set_R(plib::constants<nl_double>::one() / exec().gmin()); - - } - - NETLIB_UPDATE(CD4066_GATE) - { - nl_double sup = (m_supply.VCC() - m_supply.GND()); - nl_double low = plib::constants<nl_double>::cast(0.45) * sup; - nl_double high = plib::constants<nl_double>::cast(0.55) * sup; - nl_double in = m_control() - m_supply.GND(); - nl_double rON = m_base_r() * plib::constants<nl_double>::cast(5.0) / sup; - nl_double R = -1.0; - - if (in < low) - { - R = plib::constants<nl_double>::one() / exec().gmin(); - } - else if (in > high) - { - R = rON; - } - if (R > plib::constants<nl_double>::zero()) - { - m_R.update(); - m_R.set_R(R); - m_R.solve_later(); - } - } - NETLIB_DEVICE_IMPL(CD4066_GATE, "CD4066_GATE", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4066.h b/src/lib/netlist/devices/nld_4066.h deleted file mode 100644 index 0a43911d3ce..00000000000 --- a/src/lib/netlist/devices/nld_4066.h +++ /dev/null @@ -1,34 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_4066.h - * - * CD4066: Quad Bilateral Switch - * - * +--------------+ - * INOUTA |1 ++ 14| VDD - * OUTINA |2 13| CONTROLA - * OUTINB |3 12| CONTROLD - * INOUTB |4 4066 11| INOUTD - * CONTROLB |5 10| OUTIND - * CONTROLC |6 9| OUTINC - * VSS |7 8| INOUTC - * +--------------+ - * - * FIXME: These devices are slow (~125 ns). This is currently not reflected - * - * Naming conventions follow National semiconductor datasheet - * - */ - -#ifndef NLD_4066_H_ -#define NLD_4066_H_ - -#include "netlist/nl_setup.h" - -// FIXME: Implement pure CMOS version - -#define CD4066_GATE(name) \ - NET_REGISTER_DEV(CD4066_GATE, name) - -#endif /* NLD_4066_H_ */ diff --git a/src/lib/netlist/devices/nld_4076.cpp b/src/lib/netlist/devices/nld_4076.cpp new file mode 100644 index 00000000000..41abfbc7711 --- /dev/null +++ b/src/lib/netlist/devices/nld_4076.cpp @@ -0,0 +1,127 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud, Jonathan Gevaryahu +/* + * nld_4076.cpp + * + * CD4076BM/CD4076BC TRI-STATE(R) Quad D Flip-Flop + * + * +--------------+ + * OD1 |1 ++ 16| VDD + * OD2 |2 15| CLR + * OA |3 14| IA + * OB |4 4076 13| IB + * OC |5 12| IC + * OD |6 11| ID + * CLK |7 10| ID2 + * VSS |8 9| ID1 + * +--------------+ + * + * + * Function table for ID1/2 pins + * +-----+-----+-----+----+-----++-----+ + * | ID1 | ID2 | CLR | Ix | CLK || iOx | + * +=====+=====+=====+====+=====++=====+ + * | X | X | 0 | X | 0 || iOx | + * | X | X | 0 | X | 1 || iOx | + * | 1 | X | 0 | X | 0>1 || iOx | + * | X | 1 | 0 | X | 0>1 || iOx | + * | 0 | 0 | 0 | 0 | 0>1 || 0 | + * | 0 | 0 | 0 | 1 | 0>1 || 1 | + * | X | X | 1 | X | X || 0 | + * +-----+-----+-----+----+-----++-----+ + * Note: iOX is an internal signal, the output of each D-latch + * + * Function table for OD1/2 pins vs output of the internal D-latches + * +-----+-----+-----++-----+ + * | OD1 | OD2 | iOx || Ox | + * +=====+=====+=====++=====+ + * | 1 | X | X || Z | + * | X | 1 | X || Z | + * | 0 | 0 | 0 || 0 | + * | 0 | 0 | 1 || 1 | + * +-----+-----+-----++-----+ + * + * Naming conventions follow National Semiconductor datasheet + * http://www.bitsavers.org/components/national/_dataBooks/1981_Natonal_CMOS_Databook.pdf 5-186 (pdf page 567) + * + * TODO: the 74C173 is 100% identical to this CMOS part. + */ + +#include "nl_base.h" + +namespace netlist::devices { + + NETLIB_OBJECT(CD4076) + { + NETLIB_CONSTRUCTOR_MODEL(CD4076, "CD4XXX") + , m_I(*this, {"IA", "IB", "IC", "ID"}, NETLIB_DELEGATE(id)) // if the d-pins change absolutely nothing happens, as they are clock-latched. + , m_ID1(*this, "ID1", NETLIB_DELEGATE(id)) + , m_ID2(*this, "ID2", NETLIB_DELEGATE(id)) + , m_enable_in(*this, "m_enable_in", true) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_clk_old(*this, "m_clk_old", 0) + , m_OD1(*this, "OD1", NETLIB_DELEGATE(od)) // if the OD pins change nothing about the internal state changes directly, but the outputs can change from driven to tri-state or vice-versa + , m_OD2(*this, "OD2", NETLIB_DELEGATE(od)) // "" + , m_enable_out(*this, "m_enable_out", true) + , m_O(*this, {"OA", "OB", "OC", "OD"}) + , m_latch(*this, "m_latch", 0) + , m_power_pins(*this) + { + } + + private: + NETLIB_HANDLERI(id) + { + m_enable_in = (!(m_ID1() || m_ID2())); + } + + NETLIB_HANDLERI(clk) + { + if ((!m_clk_old) && m_CLK() && m_enable_in) // clock rising edge and input is enabled; otherwise the latch just re-latches its own value + { + m_latch = m_I()&0xf; + } + m_clk_old = m_CLK(); + // update the pin output state + for (std::size_t i=0; i<4; i++) + { + m_O.set_tristate(m_enable_out, NLTIME_FROM_NS(170), NLTIME_FROM_NS(170)); + m_O[i].push((m_latch >> i) & 1, NLTIME_FROM_NS(220)); + } + } + + NETLIB_HANDLERI(od) + { + m_enable_out = (!(m_OD1() || m_OD2())); + // update the pin output state + for (std::size_t i=0; i<4; i++) + { + m_O.set_tristate(m_enable_out, NLTIME_FROM_NS(170), NLTIME_FROM_NS(170)); + m_O[i].push((m_latch >> i) & 1, NLTIME_FROM_NS(220)); + } + } + + NETLIB_RESETI() + { + m_latch = 0; + m_enable_in = true; + m_enable_out = true; + } + + object_array_t<logic_input_t, 4> m_I; + logic_input_t m_ID1; + logic_input_t m_ID2; + state_var<bool> m_enable_in; + logic_input_t m_CLK; + state_var<netlist_sig_t> m_clk_old; + logic_input_t m_OD1; + logic_input_t m_OD2; + state_var<bool> m_enable_out; + object_array_t<logic_output_t, 4> m_O; + state_var_u8 m_latch; + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(CD4076, "CD4076", "+I1,+I2,+I3,+I4,+ID1,+ID2,+OD1,+OD2,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4316.cpp b/src/lib/netlist/devices/nld_4316.cpp index bf04882fa27..c875a4e5840 100644 --- a/src/lib/netlist/devices/nld_4316.cpp +++ b/src/lib/netlist/devices/nld_4316.cpp @@ -1,57 +1,70 @@ // license:BSD-3-Clause // copyright-holders:Vas Crabb /* - * nld_4316.c + * nld_4316.cpp + * + * CD74HC4316: Quad Analog Switch with Level Translation + * + * +--------------+ + * 1Z |1 ++ 16| VCC + * 1Y |2 15| 1S + * 2Y |3 14| 4S + * 2Z |4 4316 13| 4Z + * 2S |5 12| 4Y + * 3S |6 11| 3Y + * /E |7 10| 3Z + * GND |8 9| VEE + * +--------------+ + * + * FIXME: These devices are slow (can be over 200 ns in HC types). This is currently not reflected + * + * Naming conventions follow Texas Instruments datasheet * */ -#include "nld_4316.h" -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/solver/nld_solver.h" -#include "nlid_system.h" +#include "analog/nlid_twoterm.h" +#include "solver/nld_solver.h" -namespace netlist { namespace devices { +namespace netlist::devices { + + // FIXME: tristate outputs? NETLIB_OBJECT(CD4316_GATE) { - NETLIB_CONSTRUCTOR(CD4316_GATE) - NETLIB_FAMILY("CD4XXX") - , m_supply(*this, "VDD", "VSS") + NETLIB_CONSTRUCTOR_MODEL(CD4316_GATE, "CD4XXX") , m_R(*this, "_R") - , m_S(*this, "S") - , m_E(*this, "E") - , m_base_r(*this, "BASER", 45.0) + , m_S(*this, "S", NETLIB_DELEGATE(inputs)) + , m_E(*this, "E", NETLIB_DELEGATE(inputs)) + , m_base_r(*this, "BASER", nlconst::magic(45.0)) + , m_supply(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - public: - nld_power_pins m_supply; - analog::NETLIB_SUB(R_base) m_R; + NETLIB_RESETI() + { + m_R().set_R(plib::reciprocal(exec().gmin())); + } - logic_input_t m_S; - logic_input_t m_E; - param_double_t m_base_r; - }; + NETLIB_HANDLERI(inputs) + { + m_R().change_state([this]() + { + if (m_S() && !m_E()) + m_R().set_R(m_base_r()); + else + m_R().set_R(plib::reciprocal(exec().gmin())); + }); + } - NETLIB_RESET(CD4316_GATE) - { - m_R.set_R(plib::constants<nl_double>::one() / exec().gmin()); - } + private: + NETLIB_SUB_NS(analog, R_base) m_R; - NETLIB_UPDATE(CD4316_GATE) - { - m_R.update(); - if (m_S() && !m_E()) - m_R.set_R(m_base_r()); - else - m_R.set_R(plib::constants<nl_double>::one() / exec().gmin()); - m_R.solve_later(NLTIME_FROM_NS(1)); - } + logic_input_t m_S; + logic_input_t m_E; + param_fp_t m_base_r; + nld_power_pins m_supply; + }; NETLIB_DEVICE_IMPL(CD4316_GATE, "CD4316_GATE", "") -} // namespace devices - } // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_4316.h b/src/lib/netlist/devices/nld_4316.h deleted file mode 100644 index 3cf05aeb9cf..00000000000 --- a/src/lib/netlist/devices/nld_4316.h +++ /dev/null @@ -1,33 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Vas Crabb -/* - * nld_4316.h - * - * CD4066: Quad Analog Switch with Level Translation - * - * +--------------+ - * 1Z |1 ++ 16| VCC - * 1Y |2 15| 1S - * 2Y |3 14| 4S - * 2Z |4 4066 13| 4Z - * 2S |5 12| 4Y - * 3S |6 11| 3Y - * /E |7 10| 3Z - * GND |8 9| VEE - * +--------------+ - * - * FIXME: These devices are slow (can be over 200 ns in HC types). This is currently not reflected - * - * Naming conventions follow Texas Instruments datasheet - * - */ - -#ifndef NLD_4316_H_ -#define NLD_4316_H_ - -#include "netlist/nl_setup.h" - -#define CD4316_GATE(name) \ - NET_REGISTER_DEV(CD4316_GATE, name) - -#endif /* NLD_4316_H_ */ diff --git a/src/lib/netlist/devices/nld_74107.cpp b/src/lib/netlist/devices/nld_74107.cpp index 8bc6ca4bc7a..1501be4763e 100644 --- a/src/lib/netlist/devices/nld_74107.cpp +++ b/src/lib/netlist/devices/nld_74107.cpp @@ -1,155 +1,155 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_74107.c + * nld_74107.cpp + * + * DM74107: DUAL J-K FLIP-FLOPS WITH CLEAR + * + * +--------------+ + * 1J |1 ++ 14| VCC + * 1QQ |2 13| 1CLRQ + * 1Q |3 12| 1CLK + * 1K |4 74107 11| 2K + * 2Q |5 10| 2CLRQ + * 2QQ |6 9| 2CLK + * GND |7 8| 2J + * +--------------+ + * + * + * Function table 107 + * + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | * | 0 | 0 || Q0| Q0Q | + * | 1 | * | 1 | 0 || 1 | 0 | + * | 1 | * | 0 | 1 || 0 | 1 | + * | 1 | * | 1 | 1 || TOGGLE | + * +-----+-----+-----+---++---+-----+ + * _ + * * = _| |_ + * + * This is positive triggered, J and K + * are latched during clock high and + * transferred when CLK falls. The + * datasheet requires J and K to be + * stable during clock high. + * + * Function table 107A + * + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | F | 0 | 0 || Q0| Q0Q | + * | 1 | F | 1 | 0 || 1 | 0 | + * | 1 | F | 0 | 1 || 0 | 1 | + * | 1 | F | 1 | 1 || TOGGLE | + * | 1 | 1 | X | X || Q0| Q0Q | + * +-----+-----+-----+---++---+-----+ + * + * THe 107A is negative triggered. + * + * Naming conventions follow Texas instruments datasheet + * + * TODO: Currently, only the 107A is implemented. + * The 107 uses the same model, but different timings. + * The requirement that J and K must be stable during + * clock high indicates that the chip may exhibit undefined + * behaviour. * */ -#include "nld_74107.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { +#include "nl_base.h" - static constexpr const netlist_time delay_107[2] = { NLTIME_FROM_NS(16), NLTIME_FROM_NS(25) }; - static constexpr const netlist_time delay_107A[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(15) }; +namespace netlist::devices { - NETLIB_OBJECT(74107A) + template <typename D> + NETLIB_OBJECT(74107_base) { - NETLIB_CONSTRUCTOR(74107A) - , m_clk(*this, "CLK", NETLIB_DELEGATE(74107A, clk)) + NETLIB_CONSTRUCTOR(74107_base) + , m_clk(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_J(*this, "J", NETLIB_DELEGATE(other)) + , m_K(*this, "K", NETLIB_DELEGATE(other)) + , m_clrQ(*this, "CLRQ", NETLIB_DELEGATE(other)) , m_Q(*this, "Q") , m_QQ(*this, "QQ") - , m_J(*this, "J") - , m_K(*this, "K") - , m_clrQ(*this, "CLRQ") , m_power_pins(*this) { - m_delay[0] = delay_107A[0]; - m_delay[1] = delay_107A[1]; } - friend class NETLIB_NAME(74107_dip); - friend class NETLIB_NAME(74107); - //friend class NETLIB_NAME(74107A_dip); - - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_HANDLERI(clk); - private: - logic_input_t m_clk; - - logic_output_t m_Q; - logic_output_t m_QQ; - - netlist_time m_delay[2]; - - logic_input_t m_J; - logic_input_t m_K; - logic_input_t m_clrQ; - - nld_power_pins m_power_pins; - void newstate(const netlist_sig_t state) + NETLIB_RESETI() { - m_Q.push(state, m_delay[state]); - m_QQ.push(state ^ 1, m_delay[state ^ 1]); + m_clk.set_state(logic_t::STATE_INP_HL); + //m_Q.initial(0); + //m_QQ.initial(1); } - }; - NETLIB_OBJECT_DERIVED(74107, 74107A) - { - public: - NETLIB_CONSTRUCTOR_DERIVED(74107, 74107A) + NETLIB_HANDLERI(other) { - m_delay[0] = delay_107[0]; - m_delay[1] = delay_107[1]; + if (!m_clrQ()) + { + m_clk.inactivate(); + newstate(0); + } + else if (m_J() | m_K()) + m_clk.activate_hl(); } - }; - NETLIB_OBJECT(74107_dip) - { - NETLIB_CONSTRUCTOR(74107_dip) - , m_A(*this, "A") - , m_B(*this, "B") + NETLIB_HANDLERI(clk) { - register_subalias("1", m_A.m_J); - register_subalias("2", m_A.m_QQ); - register_subalias("3", m_A.m_Q); - - register_subalias("4", m_A.m_K); - register_subalias("5", m_B.m_Q); - register_subalias("6", m_B.m_QQ); - - register_subalias("7", "A.GND"); - - register_subalias("8", m_B.m_J); - register_subalias("9", m_B.m_clk); - register_subalias("10", m_B.m_clrQ); + const netlist_sig_t J(m_J()); + const netlist_sig_t K(m_K()); + const netlist_sig_t t(m_Q.net().Q()); + /* + * J K Q1 Q2 F t Q + * 0 0 0 1 0 0 0 + * 0 1 0 0 0 0 0 + * 1 0 0 0 1 0 1 + * 1 1 1 0 0 0 1 + * 0 0 0 1 0 1 1 + * 0 1 0 0 0 1 0 + * 1 0 0 0 1 1 1 + * 1 1 1 0 0 1 0 + */ + if ((J & K) ^ 1) + m_clk.inactivate(); + newstate(((t ^ 1) & J) | (t & (K ^ 1))); + } - register_subalias("11", m_B.m_K); - register_subalias("12", m_A.m_clk); - register_subalias("13", m_A.m_clrQ); + void newstate(const netlist_sig_t state) noexcept + { + m_Q.push(state, D::delay::value(state)); + m_QQ.push(state ^ 1, D::delay::value(state ^ 1)); + } - register_subalias("14", "A.VCC" ); + logic_input_t m_clk; - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); + logic_input_t m_J; + logic_input_t m_K; + logic_input_t m_clrQ; - } - //NETLIB_RESETI(); - //NETLIB_UPDATEI(); + logic_output_t m_Q; + logic_output_t m_QQ; - private: - NETLIB_SUB(74107) m_A; - NETLIB_SUB(74107) m_B; + nld_power_pins m_power_pins; }; - NETLIB_RESET(74107A) + struct desc_74107 : public desc_base { - m_clk.set_state(logic_t::STATE_INP_HL); - //m_Q.initial(0); - //m_QQ.initial(1); - } - - NETLIB_HANDLER(74107A, clk) + using delay = times_ns2<16, 25>; + }; + struct desc_74107A : public desc_base { - const netlist_sig_t t(m_Q.net().Q()); - /* - * J K Q1 Q2 F t Q - * 0 0 0 1 0 0 0 - * 0 1 0 0 0 0 0 - * 1 0 0 0 1 0 1 - * 1 1 1 0 0 0 1 - * 0 0 0 1 0 1 1 - * 0 1 0 0 0 1 0 - * 1 0 0 0 1 1 1 - * 1 1 1 0 0 1 0 - */ - if ((m_J() & m_K()) ^ 1) - m_clk.inactivate(); - newstate(((t ^ 1) & m_J()) | (t & (m_K() ^ 1))); - } + using delay = times_ns2<15, 15>; + }; - NETLIB_UPDATE(74107A) - { - if (!m_clrQ()) - { - m_clk.inactivate(); - newstate(0); - } - else if (m_J() | m_K()) - m_clk.activate_hl(); - } + using NETLIB_NAME(74107) = NETLIB_NAME(74107_base)<desc_74107>; + using NETLIB_NAME(74107A) = NETLIB_NAME(74107_base)<desc_74107A>; -#if (!USE_TRUTHTABLE_74107) NETLIB_DEVICE_IMPL(74107, "TTL_74107", "+CLK,+J,+K,+CLRQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(74107_dip, "TTL_74107_DIP", "") -#endif NETLIB_DEVICE_IMPL(74107A, "TTL_74107A", "+CLK,+J,+K,+CLRQ,@VCC,@GND") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74107.h b/src/lib/netlist/devices/nld_74107.h deleted file mode 100644 index ae1adf33546..00000000000 --- a/src/lib/netlist/devices/nld_74107.h +++ /dev/null @@ -1,87 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74107.h - * - * DM74107: DUAL J-K FLIP-FLOPS WITH CLEAR - * - * +--------------+ - * 1J |1 ++ 14| VCC - * 1QQ |2 13| 1CLRQ - * 1Q |3 12| 1CLK - * 1K |4 74107 11| 2K - * 2Q |5 10| 2CLRQ - * 2QQ |6 9| 2CLK - * GND |7 8| 2J - * +--------------+ - * - * - * Function table 107 - * - * +-----+-----+-----+---++---+-----+ - * | CLRQ| CLK | J | K || Q | QQ | - * +=====+=====+=====+===++===+=====+ - * | 0 | X | X | X || 0 | 1 | - * | 1 | * | 0 | 0 || Q0| Q0Q | - * | 1 | * | 1 | 0 || 1 | 0 | - * | 1 | * | 0 | 1 || 0 | 1 | - * | 1 | * | 1 | 1 || TOGGLE | - * +-----+-----+-----+---++---+-----+ - * _ - * * = _| |_ - * - * This is positive triggered, J and K - * are latched during clock high and - * transferred when CLK falls. The - * datasheet requires J and K to be - * stable during clock high. - * - * Function table 107A - * - * +-----+-----+-----+---++---+-----+ - * | CLRQ| CLK | J | K || Q | QQ | - * +=====+=====+=====+===++===+=====+ - * | 0 | X | X | X || 0 | 1 | - * | 1 | F | 0 | 0 || Q0| Q0Q | - * | 1 | F | 1 | 0 || 1 | 0 | - * | 1 | F | 0 | 1 || 0 | 1 | - * | 1 | F | 1 | 1 || TOGGLE | - * | 1 | 1 | X | X || Q0| Q0Q | - * +-----+-----+-----+---++---+-----+ - * - * THe 107A is negative triggered. - * - * Naming conventions follow Texas instruments datasheet - * - * TODO: Currently, only the 107A is implemented. - * The 107 uses the same model, but different timings. - * The requirement that J and K must be stable during - * clock high indicates that the chip may exhibit undefined - * behaviour. - * - */ - -#ifndef NLD_74107_H_ -#define NLD_74107_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74107A(name, cCLK, cJ, cK, cCLRQ) \ - NET_REGISTER_DEV(TTL_74107A, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, J, cJ) \ - NET_CONNECT(name, K, cK) \ - NET_CONNECT(name, CLRQ, cCLRQ) - -#if (!USE_TRUTHTABLE_74107) -#define TTL_74107(name, cCLK, cJ, cK, cCLRQ) \ - TTL_74107A(name, cCLK, cJ, cK, cCLRQ) - -#define TTL_74107_DIP(name) \ - NET_REGISTER_DEV(TTL_74107_DIP, name) - -#endif - -#endif /* NLD_74107_H_ */ diff --git a/src/lib/netlist/devices/nld_74113.cpp b/src/lib/netlist/devices/nld_74113.cpp new file mode 100644 index 00000000000..32f96d87c12 --- /dev/null +++ b/src/lib/netlist/devices/nld_74113.cpp @@ -0,0 +1,142 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_74113.cpp + * + * 74113: Dual Master-Slave J-K Flip-Flops with Set and Complementary Outputs + * 74113A: Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flops with Set and Complementary Outputs + * + * +----------+ + * 1CLK |1 ++ 14| VCC + * 1K |2 13| 2CLK + * 1J |3 12| 2K + * 1SETQ |4 74113 11| 2J + * 1Q |5 10| 2SETQ + * 1QQ |6 9| 2Q + * GND |7 8| 2QQ + * +----------+ + * + * + * Function table 113 + * + * +-----+-----+-----+---++---+-----+ + * | SETQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 1 | 0 | + * | 1 | * | 0 | 0 || Q0| Q0Q | + * | 1 | * | 1 | 0 || 1 | 0 | + * | 1 | * | 0 | 1 || 0 | 1 | + * | 1 | * | 1 | 1 || TOGGLE | + * +-----+-----+-----+---++---+-----+ + * _ + * * = _| |_ + * + * This is positive triggered, J and K + * are latched during clock high and + * transferred when CLK falls. + * + * Function table 113A + * + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | F | 0 | 0 || Q0| Q0Q | + * | 1 | F | 1 | 0 || 1 | 0 | + * | 1 | F | 0 | 1 || 0 | 1 | + * | 1 | F | 1 | 1 || TOGGLE | + * | 1 | 1 | X | X || Q0| Q0Q | + * +-----+-----+-----+---++---+-----+ + * + * THe 113A is negative triggered. + * + * Naming conventions follow Texas instruments datasheet + * + * FIXME: Currently, only the 113 is implemented. + * The 113A uses the same model. + * + */ + +#include "nl_base.h" + +// FIXME: this can probably be merged with nld_7473.cpp +// FIXME: timing, see 74107 for example, use template + +namespace netlist::devices { + + NETLIB_OBJECT(74113) + { + NETLIB_CONSTRUCTOR(74113) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(inputs)) + , m_J(*this, "J", NETLIB_DELEGATE(inputs)) + , m_K(*this, "K", NETLIB_DELEGATE(inputs)) + , m_SETQ(*this, "SETQ", NETLIB_DELEGATE(inputs)) + , m_last_CLK(*this, "m_last_CLK", 0) + , m_q(*this, "m_q", 0) + , m_Q(*this, "Q") + , m_QQ(*this, "QQ") + , m_power_pins(*this) + { + } + + private: + NETLIB_RESETI() + { + m_last_CLK = 0; + } + + NETLIB_HANDLERI(inputs) + { + const auto JK = (m_J() << 1) | m_K(); + + if (m_SETQ()) + { + if (!m_CLK() && m_last_CLK) + { + switch (JK) + { + case 1: // (!m_J) & m_K)) + m_q = 0; + break; + case 2: // (m_J) & !m_K)) + m_q = 1; + break; + case 3: // (m_J) & m_K)) + m_q ^= 1; + break; + default: + case 0: + break; + } + } + } + else + { + m_q = 1; + } + + m_last_CLK = m_CLK(); + + m_Q.push(m_q, NLTIME_FROM_NS(20)); // FIXME: timing + m_QQ.push(m_q ^ 1, NLTIME_FROM_NS(20)); // FIXME: timing + } + + logic_input_t m_CLK; + logic_input_t m_J; + logic_input_t m_K; + logic_input_t m_SETQ; + + state_var<unsigned> m_last_CLK; + state_var<unsigned> m_q; + + logic_output_t m_Q; + logic_output_t m_QQ; + nld_power_pins m_power_pins; + }; + + using NETLIB_NAME(74113A) = NETLIB_NAME(74113); + + NETLIB_DEVICE_IMPL(74113, "TTL_74113", "+CLK,+J,+K,+CLRQ,@VCC,@GND") + NETLIB_DEVICE_IMPL(74113A, "TTL_74113A", "+CLK,+J,+K,+CLRQ,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74123.cpp b/src/lib/netlist/devices/nld_74123.cpp index 889ba019f78..fc0beef9972 100644 --- a/src/lib/netlist/devices/nld_74123.cpp +++ b/src/lib/netlist/devices/nld_74123.cpp @@ -1,72 +1,215 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_74123.c + * nld_74123.cpp + * + * 74123: Dual Retriggerable One-Shot with Clear and Complementary Outputs + * + * +--------------+ + * A1 |1 ++ 16| VCC + * B1 |2 15| RC1 + * CLR1 |3 14| C1 + * Q1Q |4 74123 13| Q1 + * Q2 |5 12| Q2Q + * C2 |6 11| CLR2 + * RC2 |7 10| B2 + * GND |8 9| A2 + * +--------------+ + * + * Naming conventions follow Fairchild Semiconductor datasheet + * + * DM9602: Dual Retriggerable, Resettable One Shots + * + * +--------------+ + * C1 |1 ++ 16| VCC + * RC1 |2 15| C2 + * CLR1 |3 14| RC2 + * B1 |4 9602 13| CLR2 + * A1 |5 12| B2 + * Q1 |6 11| A2 + * Q1Q |7 10| Q2 + * GND |8 9| Q2Q + * +--------------+ + * + * CD4538: Dual Retriggerable, Resettable One Shots + * + * +--------------+ + * C1 |1 ++ 16| VCC + * RC1 |2 15| C2 + * CLR1 |3 14| RC2 + * A1 |4 4538 13| CLR2 + * B1 |5 12| A2 + * Q1 |6 11| B2 + * Q1Q |7 10| Q2 + * GND |8 9| Q2Q + * +--------------+ * */ +#include "analog/nlid_twoterm.h" #include "nlid_system.h" -#include "netlist/analog/nlid_twoterm.h" - -#include <cmath> -namespace netlist -{ - namespace devices +namespace netlist::devices { + + /// \brief Base monostable device + /// + /// The basic operation is the following: + /// + /// After a trigger signal has been detected, the output changes to high. + /// The capacitor is quickly discharged until it reaches Vlow. + /// The device toggles into charging mode until Vhigh is reached. At this + /// point, the output is set to low. Charging continues until VCC - or + /// more specific VRC is reached. + /// + /// Using + /// + /// - Vlow = alpha * VCC + /// - Vhigh = (1-alpha) * VCC + /// - Ignoring Rext during discharge + /// + /// we have calculate the following time constants: + /// + /// - tD = - X*C * ln(alpha) + /// - tC = - R*C * ln(alhpa) + /// - tL = - R*C * ln(1.0 - alpha) + /// + /// where tD denotes the time to discharge from VCC to Vlow, tC denotes + /// the time to charge from 0.0 to Vhigh and tL denotes the time to charge + /// from 0 to Vlow. X denotes the internal resistance used to discharge the + /// capacitor. The total impulse duration is thus + /// + /// tP = tD + tC - tL + /// + /// Using K = ln(1 - alpha) - ln (alpha) = ln(1/alpha - 1) + /// + /// we get + /// + /// tP = R*C*K * (1 + X/R * ln(alpha) / K) + /// + /// and alpha = 1 / (1 + exp(K)) + /// + /// Datasheets express the right term usually as + /// + /// (1 + f * 1000 / R) = (1 + X/R * ln(alpha) / K) + /// + /// and thus + /// + /// X = f * 1000 * K / ln(alpha) + /// + /// FIXME: Currently X is given directly (as RI). It would be better to use + /// f (usually 0.7) and K to calculate X. + /// + template <typename D> + NETLIB_OBJECT(74123_base) { - NETLIB_OBJECT(74123) - { - NETLIB_CONSTRUCTOR_EX(74123, int dev_type = 74123) - , m_dev_type(dev_type) + NETLIB_CONSTRUCTOR(74123_base) , m_RP(*this, "RP") , m_RN(*this, "RN") , m_RP_Q(*this, "_RP_Q") , m_RN_Q(*this, "_RN_Q") - , m_A(*this, "A") - , m_B(*this, "B") - , m_CLRQ(*this, "CLRQ") + , m_I(*this, D::names(), NETLIB_DELEGATE(ab_clear)) , m_Q(*this, "Q") , m_QQ(*this, "QQ") - , m_CV(*this, "_CV") // internal + , m_CV(*this, "_CV", NETLIB_DELEGATE(cv)) // internal , m_last_trig(*this, "m_last_trig", 0) , m_state(*this, "m_state", 0) - , m_KP(*this, "m_KP", 0) - , m_K(*this, "K", (m_dev_type == 4538) ? 1.0 : 0.4) // CD4538 datasheet states PW=RC - , m_RI(*this, "RI", 400.0) // around 250 for HC series, 400 on LS/TTL, estimated from datasheets + , m_KP(plib::reciprocal(nlconst::one() + plib::exp(D::K()))) + //, m_power_pins(*this) { - if ((m_dev_type != 9602) && (m_dev_type != 4538) ) - m_dev_type = 74123; - register_subalias("GND", m_RN.m_R.m_N); - register_subalias("VCC", m_RP.m_R.m_P); - register_subalias("C", m_RN.m_R.m_N); - register_subalias("RC", m_RN.m_R.m_P); + register_sub_alias(pstring(D::gnd()), "RN.2"); + register_sub_alias(pstring(D::vcc()), "RP.1"); + register_sub_alias("C", "RN.2"); + register_sub_alias("RC", "RN.1"); - connect(m_RP_Q, m_RP.m_I); - connect(m_RN_Q, m_RN.m_I); + connect("_RP_Q", "RP.I"); + connect("_RN_Q", "RN.I"); - connect(m_RN.m_R.m_P, m_RP.m_R.m_N); - connect(m_CV, m_RN.m_R.m_P); + connect("RN.1", "RP.2"); + connect("_CV", "RN.1"); - m_RP.m_RON.setTo(m_RI()); - m_RN.m_RON.setTo(m_RI()); + m_RP().m_RON.set(D::RI()); + m_RN().m_RON.set(D::RI()); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_HANDLERI(ab_clear) + { + netlist_sig_t m_trig(0); + + m_trig = D::trigfunc(m_I); + + if (!D::clear(m_I)) + { + m_Q.push(0, D::t_C_to_Q::value()); + m_QQ.push(1, D::t_C_to_Q::value()); + /* quick charge until trigger */ + /* FIXME: SGS datasheet shows quick charge to 5V, + * though schematics indicate quick charge to Vhigh only. + */ + m_RP_Q.push(1, D::t_C_to_Q::value()); // R_ON + m_RN_Q.push(0, D::t_C_to_Q::value()); // R_OFF + m_state = 2; //charging (quick) + } + else if (!m_last_trig && m_trig) + { + // FIXME: Timing! + m_Q.push(1, D::t_AB_to_Q::value()); + m_QQ.push(0, D::t_AB_to_Q::value()); + + m_RN_Q.push(1, D::t_AB_to_Q::value()); // R_ON + m_RP_Q.push(0, D::t_AB_to_Q::value()); // R_OFF + + m_state = 1; // discharging + } + + m_last_trig = m_trig; + } + + NETLIB_HANDLERI(cv) + { + if (m_state == 1) + { + const nl_fptype vLow = m_KP * m_RP().P()(); + if (m_CV() < vLow) + { + m_RN_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF + m_state = 2; // charging + } + } + if (m_state == 2) + { + const nl_fptype vHigh = (nlconst::one() - m_KP) * m_RP().P()(); + if (m_CV() > vHigh) + { + m_RP_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF + + m_Q.push(0, NLTIME_FROM_NS(10)); + m_QQ.push(1, NLTIME_FROM_NS(10)); + m_state = 0; // waiting + } + } + } + + NETLIB_RESETI() + { + m_RP().reset(); + m_RN().reset(); + + //m_RP.set_R(R_OFF); + //m_RN.set_R(R_OFF); + + m_last_trig = 0; + m_state = 0; + } private: - int m_dev_type; - public: - NETLIB_SUB(res_sw) m_RP; - NETLIB_SUB(res_sw) m_RN; + NETLIB_SUB(sys_dsw1) m_RP; + NETLIB_SUB(sys_dsw1) m_RN; logic_output_t m_RP_Q; logic_output_t m_RN_Q; - logic_input_t m_A; - logic_input_t m_B; - logic_input_t m_CLRQ; + object_array_t<logic_input_t, 3> m_I; logic_output_t m_Q; logic_output_t m_QQ; @@ -74,242 +217,74 @@ namespace netlist state_var<netlist_sig_t> m_last_trig; state_var<unsigned> m_state; - state_var<double> m_KP; - - param_double_t m_K; - param_double_t m_RI; + nl_fptype m_KP; + //nld_power_pins m_power_pins; // not needed, device exposes VCC and GND }; - NETLIB_OBJECT(74123_dip) + struct desc_74123 : public desc_base { - NETLIB_CONSTRUCTOR(74123_dip) - , m_A(*this, "A", 74123) - , m_B(*this, "B", 74123) + using t_AB_to_Q = time_ns<10>; + using t_C_to_Q = time_ns<10>; + static constexpr nl_fptype K() { return nlconst::magic(0.4); } + static constexpr nl_fptype RI() { return nlconst::magic(400.0); } + + static constexpr std::array<const char *, 3> names() { return {"CLRQ", "A", "B"};} + template<typename T> + static netlist_sig_t trigfunc(const T &in) { - register_subalias("1", m_A.m_A); - register_subalias("2", m_A.m_B); - register_subalias("3", m_A.m_CLRQ); - register_subalias("4", m_A.m_QQ); - register_subalias("5", m_B.m_Q); - register_subalias("6", m_B.m_RN.m_R.m_N); - register_subalias("7", m_B.m_RN.m_R.m_P); - register_subalias("8", m_A.m_RN.m_R.m_N); - connect(m_A.m_RN.m_R.m_N, m_B.m_RN.m_R.m_N); - - register_subalias("9", m_B.m_A); - register_subalias("10", m_B.m_B); - register_subalias("11", m_B.m_CLRQ); - register_subalias("12", m_B.m_QQ); - register_subalias("13", m_A.m_Q); - register_subalias("14", m_A.m_RN.m_R.m_N); - register_subalias("15", m_A.m_RN.m_R.m_P); - register_subalias("16", m_A.m_RP.m_R.m_P); - connect(m_A.m_RP.m_R.m_P, m_B.m_RP.m_R.m_P); + return ((in[1]() | (in[2]() ^ 1)) ^ 1) & in[0](); // ((m_A() | (m_B() ^ 1)) ^ 1) & m_CLRQ() } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - private: - NETLIB_SUB(74123) m_A; - NETLIB_SUB(74123) m_B; + template<typename T> static constexpr netlist_sig_t clear(const T &in) { return in[0]();} + + static constexpr const char *vcc() { return "VCC"; } + static constexpr const char *gnd() { return "GND"; } }; - NETLIB_OBJECT(9602_dip) + struct desc_74121 : public desc_74123 { - NETLIB_CONSTRUCTOR(9602_dip) - , m_A(*this, "A", 9602) - , m_B(*this, "B", 9602) + static constexpr nl_fptype K() { return nlconst::magic(0.7); } + + static constexpr std::array<const char *, 3> names() { return {"A1", "A2", "B"};} + template<typename T> + static netlist_sig_t trigfunc(const T &in) { - register_subalias("1", m_A.m_RN.m_R.m_N); // C1 - register_subalias("2", m_A.m_RN.m_R.m_P); // RC1 - register_subalias("3", m_A.m_CLRQ); - register_subalias("4", m_A.m_B); - register_subalias("5", m_A.m_A); - register_subalias("6", m_A.m_Q); - register_subalias("7", m_A.m_QQ); - register_subalias("8", m_A.m_RN.m_R.m_N); - connect(m_A.m_RN.m_R.m_N, m_B.m_RN.m_R.m_N); - - register_subalias("9", m_B.m_QQ); - register_subalias("10", m_B.m_Q); - register_subalias("11", m_B.m_A); - register_subalias("12", m_B.m_B); - register_subalias("13", m_B.m_CLRQ); - register_subalias("14", m_B.m_RN.m_R.m_P); // RC2 - register_subalias("15", m_B.m_RN.m_R.m_N); // C2 - register_subalias("16", m_A.m_RP.m_R.m_P); - connect(m_A.m_RP.m_R.m_P, m_B.m_RP.m_R.m_P); + return ((in[0]() ^ 1) | (in[1]() ^ 1)) & in[2](); // (~A1 | ~A2) & B } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - private: - NETLIB_SUB(74123) m_A; - NETLIB_SUB(74123) m_B; + template<typename T> static constexpr netlist_sig_t clear([[maybe_unused]] const T &in) { return 1; } }; - NETLIB_OBJECT(4538_dip) + struct desc_9602 : public desc_74123 { - NETLIB_CONSTRUCTOR(4538_dip) - NETLIB_FAMILY("CD4XXX") - , m_A(*this, "A", 4538) - , m_B(*this, "B", 4538) + template<typename T> + static netlist_sig_t trigfunc(const T &in) { - register_subalias("1", m_A.m_RN.m_R.m_N); // C1 - register_subalias("2", m_A.m_RN.m_R.m_P); // RC1 - register_subalias("3", m_A.m_CLRQ); - register_subalias("4", m_A.m_A); - register_subalias("5", m_A.m_B); - register_subalias("6", m_A.m_Q); - register_subalias("7", m_A.m_QQ); - register_subalias("8", m_A.m_RN.m_R.m_N); - connect(m_A.m_RN.m_R.m_N, m_B.m_RN.m_R.m_N); - - register_subalias("9", m_B.m_QQ); - register_subalias("10", m_B.m_Q); - register_subalias("11", m_B.m_B); - register_subalias("12", m_B.m_A); - register_subalias("13", m_B.m_CLRQ); - register_subalias("14", m_B.m_RN.m_R.m_P); // RC2 - register_subalias("15", m_B.m_RN.m_R.m_N); // C2 - register_subalias("16", m_A.m_RP.m_R.m_P); - connect(m_A.m_RP.m_R.m_P, m_B.m_RP.m_R.m_P); + return ((in[1]() ^ 1) | in[2]()); // (m_A() ^ 1) | m_B() } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - private: - NETLIB_SUB(74123) m_A; - NETLIB_SUB(74123) m_B; }; - NETLIB_UPDATE(74123) + struct desc_4538 : public desc_74123 { - netlist_sig_t m_trig; - netlist_sig_t res = !m_CLRQ(); - netlist_time t_AB_to_Q = NLTIME_FROM_NS(10); - netlist_time t_C_to_Q = NLTIME_FROM_NS(10); + using t_AB_to_Q = time_ns<300>; + using t_C_to_Q = time_ns<250>; + static constexpr nl_fptype K() { return nlconst::one(); } // CD4538 datasheet states PW=RC - if (m_dev_type == 74123) + template<typename T> + static netlist_sig_t trigfunc(const T &in) { - m_trig = (m_A() ^ 1) & m_B() & m_CLRQ(); + return (in[1]() | (in[2]() ^ 1)); // m_A() | (m_B() ^ 1) } - else if (m_dev_type == 9602) - { - m_trig = (m_A() ^ 1) | m_B(); - } - else // 4538 - { - m_trig = (m_B() ^ 1) | m_A(); - // The line below is from the datasheet truthtable ... doesn't make sense at all - //res = res | m_A) | (m_B) ^ 1); - t_AB_to_Q = NLTIME_FROM_NS(300); - t_C_to_Q = NLTIME_FROM_NS(250); - } - - if (res) - { - m_Q.push(0, t_C_to_Q); - m_QQ.push(1, t_C_to_Q); - /* quick charge until trigger */ - /* FIXME: SGS datasheet shows quick charge to 5V, - * though schematics indicate quick charge to Vhigh only. - */ - m_RP_Q.push(1, t_C_to_Q); // R_ON - m_RN_Q.push(0, t_C_to_Q); // R_OFF - m_state = 2; //charging (quick) - } - else if (!m_last_trig && m_trig) - { - // FIXME: Timing! - m_Q.push(1, t_AB_to_Q); - m_QQ.push(0,t_AB_to_Q); - - m_RN_Q.push(1, t_AB_to_Q); // R_ON - m_RP_Q.push(0, t_AB_to_Q); // R_OFF - - m_state = 1; // discharging - } - - m_last_trig = m_trig; - - if (m_state == 1) - { - const nl_double vLow = m_KP * m_RP.m_R.m_P(); - if (m_CV() < vLow) - { - m_RN_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF - m_state = 2; // charging - } - } - if (m_state == 2) - { - const nl_double vHigh = m_RP.m_R.m_P() * (1.0 - m_KP); - if (m_CV() > vHigh) - { - m_RP_Q.push(0, NLTIME_FROM_NS(10)); // R_OFF - - m_Q.push(0, NLTIME_FROM_NS(10)); - m_QQ.push(1, NLTIME_FROM_NS(10)); - m_state = 0; // waiting - } - } - } - - NETLIB_RESET(74123) - { - m_KP = 1.0 / (1.0 + exp(m_K())); - - m_RP.reset(); - m_RN.reset(); - - //m_RP.set_R(R_OFF); - //m_RN.set_R(R_OFF); - - m_last_trig = 0; - m_state = 0; - } - - NETLIB_UPDATE(74123_dip) - { - /* only called during startup */ - //_1.update_dev(); - //m_2.update_dev(); - } - - NETLIB_RESET(74123_dip) - { - //m_1.reset(); - //m_2.reset(); - } - - NETLIB_UPDATE(9602_dip) - { - /* only called during startup */ - //m_1.update_dev(); - //m_2.update_dev(); - } - - NETLIB_RESET(9602_dip) - { - //m_1.reset(); - //m_2.reset(); - } - - NETLIB_UPDATE(4538_dip) - { - /* only called during startup */ - //m_1.update_dev(); - //m_2.update_dev(); - } + static constexpr const char *vcc() { return "VDD"; } + static constexpr const char *gnd() { return "VSS"; } + }; - NETLIB_RESET(4538_dip) - { - m_A.reset(); - m_B.reset(); - } + using NETLIB_NAME(74123) = NETLIB_NAME(74123_base)<desc_74123>; + using NETLIB_NAME(74121) = NETLIB_NAME(74123_base)<desc_74121>; + using NETLIB_NAME(4538) = NETLIB_NAME(74123_base)<desc_4538>; + using NETLIB_NAME(9602) = NETLIB_NAME(74123_base)<desc_9602>; NETLIB_DEVICE_IMPL(74123, "TTL_74123", "") - NETLIB_DEVICE_IMPL(74123_dip, "TTL_74123_DIP", "") - NETLIB_DEVICE_IMPL(4538_dip, "CD4538_DIP", "") - NETLIB_DEVICE_IMPL(9602_dip, "TTL_9602_DIP", "") + NETLIB_DEVICE_IMPL(74121, "TTL_74121", "") + NETLIB_DEVICE_IMPL(4538, "CD4538", "") + NETLIB_DEVICE_IMPL(9602, "TTL_9602", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74123.h b/src/lib/netlist/devices/nld_74123.h deleted file mode 100644 index 3eca141b613..00000000000 --- a/src/lib/netlist/devices/nld_74123.h +++ /dev/null @@ -1,74 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74123.h - * - * 74123: Dual Retriggerable One-Shot with Clear and Complementary Outputs - * - * +--------------+ - * A1 |1 ++ 16| VCC - * B1 |2 15| RC1 - * CLR1 |3 14| C1 - * Q1Q |4 74123 13| Q1 - * Q2 |5 12| Q2Q - * C2 |6 11| CLR2 - * RC2 |7 10| B2 - * GND |8 9| A2 - * +--------------+ - * - * Naming conventions follow Fairchild Semiconductor datasheet - * - * DM9602: Dual Retriggerable, Resettable One Shots - * - * +--------------+ - * C1 |1 ++ 16| VCC - * RC1 |2 15| C2 - * CLR1 |3 14| RC2 - * B1 |4 9602 13| CLR2 - * A1 |5 12| B2 - * Q1 |6 11| A2 - * Q1Q |7 10| Q2 - * GND |8 9| Q2Q - * +--------------+ - * - * CD4538: Dual Retriggerable, Resettable One Shots - * - * +--------------+ - * C1 |1 ++ 16| VCC - * RC1 |2 15| C2 - * CLR1 |3 14| RC2 - * A1 |4 4538 13| CLR2 - * B1 |5 12| A2 - * Q1 |6 11| B2 - * Q1Q |7 10| Q2 - * GND |8 9| Q2Q - * +--------------+ - * - */ - -#ifndef NLD_74123_H_ -#define NLD_74123_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74123(name) \ - NET_REGISTER_DEV(TTL_74123, name) - -#define TTL_74123_DIP(name) \ - NET_REGISTER_DEV(TTL_74123_DIP, name) - -/* The 9602 is very similar to the 123. Input triggering is slightly different - * The 9602 uses an OR gate instead of an AND gate. - */ - -#define TTL_9602_DIP(name) \ - NET_REGISTER_DEV(TTL_9602_DIP, name) - -/* - * The CD4538 is pretty similar to the 9602 - */ - -#define CD4538_DIP(name) \ - NET_REGISTER_DEV(CD4538_DIP, name) - -#endif /* NLD_74123_H_ */ diff --git a/src/lib/netlist/devices/nld_74125.cpp b/src/lib/netlist/devices/nld_74125.cpp new file mode 100644 index 00000000000..aca9f4175e2 --- /dev/null +++ b/src/lib/netlist/devices/nld_74125.cpp @@ -0,0 +1,77 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_74125.cpp + * + */ + +#include "nl_base.h" + +#include <type_traits> + +namespace netlist::devices { + + template <typename D> + NETLIB_OBJECT(74125_base) + { + NETLIB_CONSTRUCTOR(74125_base) + , m_TE(*this, "FORCE_TRISTATE_LOGIC", 0) + , m_A(*this, "A", NETLIB_DELEGATE(A)) + , m_G(*this, pstring(D::invert_g::value ? "G" : "GQ"), NETLIB_DELEGATE(G)) + , m_Y(*this, "Y", m_TE()) + //, m_Y(*this, "Y") + , m_power_pins(*this) + { + } + + private: + //NETLIB_RESETI() {} + + NETLIB_UPDATE_PARAMI() + { + // this one is only called during startup. Ensure all outputs + // are in a consistent state. + m_Y.set_tristate(m_G() ^ D::invert_g::value, + D::ts_off_on::value(), D::ts_on_off::value()); + m_Y.push(m_A(), m_A() ? D::sig_off_on::value() : D::sig_on_off::value()); + } + + NETLIB_HANDLERI(A) + { + m_Y.push(m_A(), m_A() ? D::sig_off_on::value() : D::sig_on_off::value()); + } + + NETLIB_HANDLERI(G) + { + m_Y.set_tristate(m_G() ^ D::invert_g::value, + D::ts_off_on::value(), D::ts_on_off::value()); + } + + param_logic_t m_TE; + logic_input_t m_A; + logic_input_t m_G; + tristate_output_t m_Y; + nld_power_pins m_power_pins; + }; + + struct desc_74125 : public desc_base + { + using invert_g = desc_const<0>; + using ts_off_on = time_ns<11>; + using ts_on_off = time_ns<13>; + using sig_off_on = time_ns<8>; + using sig_on_off = time_ns<12>; + }; + + struct desc_74126 : public desc_74125 + { + using invert_g = desc_const<1>; + }; + + using NETLIB_NAME(74125) = NETLIB_NAME(74125_base)<desc_74125>; + using NETLIB_NAME(74126) = NETLIB_NAME(74125_base)<desc_74126>; + + NETLIB_DEVICE_IMPL(74125, "TTL_74125_GATE", "") + NETLIB_DEVICE_IMPL(74126, "TTL_74126_GATE", "") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74153.cpp b/src/lib/netlist/devices/nld_74153.cpp index ce2e25cb3f3..c68a8537811 100644 --- a/src/lib/netlist/devices/nld_74153.cpp +++ b/src/lib/netlist/devices/nld_74153.cpp @@ -1,43 +1,75 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_74153.c + * nld_74153.cpp + * + * DM74153: Dual 4-Line to 1-Line Data Selectors Multiplexers + * + * +--------------+ + * G1 |1 ++ 16| VCC + * B |2 15| G2 + * 1C3 |3 14| A + * 1C2 |4 74153 13| 2C3 + * 1C1 |5 12| 2C2 + * 1C0 |6 11| 2C1 + * Y1 |7 10| 2C0 + * GND |8 9| Y2 + * +--------------+ + * + * + * Function table + * + * +-----+-----++----+----+----+----++----+----+ + * | B | A || C0 | C1 | C2 | C3 || G | Y | + * +=====+=====++====+====+====+====++====+====+ + * | X | X || X | X | X | X || H | L | + * | L | L || L | X | X | X || L | L | + * | L | L || H | X | X | X || L | H | + * | L | H || X | L | X | X || L | L | + * | L | H || X | H | X | X || L | H | + * | H | L || X | X | L | X || L | L | + * | H | L || X | X | H | X || L | H | + * | H | H || X | X | X | L || L | L | + * | H | H || X | X | X | H || L | H | + * +-----+-----++----+----+----+----++----+----+ + * + * A, B : Select Inputs + * C* : Data inputs + * G : Strobe + * Y : Output + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_74153.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" -namespace netlist -{ -namespace devices -{ +namespace netlist::devices { - /* FIXME: timing is not 100% accurate, Strobe and Select inputs have a - * slightly longer timing. - * Convert this to sub-devices at some time. - */ + // FIXME: timing is not 100% accurate, Strobe and Select inputs have a + // slightly longer timing . + // FIXME: Truth table candidate NETLIB_OBJECT(74153) { NETLIB_CONSTRUCTOR(74153) - , m_C(*this, {{"C0", "C1", "C2", "C3"}}, NETLIB_DELEGATE(74153, sub)) - , m_G(*this, "G", NETLIB_DELEGATE(74153, sub)) + , m_C(*this, {"C0", "C1", "C2", "C3"}, NETLIB_DELEGATE(sub)) + , m_G(*this, "G", NETLIB_DELEGATE(sub)) , m_Y(*this, "AY") //FIXME: Change netlists , m_chan(*this, "m_chan", 0) - , m_A(*this, "A") - , m_B(*this, "B") + , m_A(*this, "A", NETLIB_DELEGATE(other)) + , m_B(*this, "B", NETLIB_DELEGATE(other)) , m_power_pins(*this) { } + private: NETLIB_RESETI() { m_chan = 0; } - NETLIB_UPDATEI() + NETLIB_HANDLERI(other) { m_chan = (m_A() | (m_B()<<1)); sub(); @@ -45,7 +77,7 @@ namespace devices NETLIB_HANDLERI(sub) { - constexpr const netlist_time delay[2] = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) }; + constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(23), NLTIME_FROM_NS(18) }; if (!m_G()) { auto t = m_C[m_chan](); @@ -57,7 +89,6 @@ namespace devices } } - public: object_array_t<logic_input_t, 4> m_C; logic_input_t m_G; @@ -71,46 +102,6 @@ namespace devices nld_power_pins m_power_pins; }; - NETLIB_OBJECT(74153_dip) - { - NETLIB_CONSTRUCTOR(74153_dip) - , m_A(*this, "A") - , m_B(*this, "B") - { - register_subalias("1", m_A.m_G); - register_subalias("2", m_A.m_B); - register_subalias("3", m_A.m_C[3]); - register_subalias("4", m_A.m_C[2]); - register_subalias("5", m_A.m_C[1]); - register_subalias("6", m_A.m_C[0]); - register_subalias("7", m_A.m_Y); - register_subalias("8", "A.GND"); - - register_subalias("9", m_B.m_Y); - register_subalias("10", m_B.m_C[0]); - register_subalias("11", m_B.m_C[1]); - register_subalias("12", m_B.m_C[2]); - register_subalias("13", m_B.m_C[3]); - register_subalias("14", m_A.m_A); - - register_subalias("15", m_B.m_G); - register_subalias("16", "A.VCC"); - - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); - connect(m_A.m_A, m_B.m_A); - connect(m_A.m_B, m_B.m_B); - } - //NETLIB_RESETI(); - //NETLIB_UPDATEI(); - - protected: - NETLIB_SUB(74153) m_A; - NETLIB_SUB(74153) m_B; - }; - NETLIB_DEVICE_IMPL(74153, "TTL_74153", "+C0,+C1,+C2,+C3,+A,+B,+G,@VCC,@GND") - NETLIB_DEVICE_IMPL(74153_dip, "TTL_74153_DIP", "") -} //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74153.h b/src/lib/netlist/devices/nld_74153.h deleted file mode 100644 index 996ca5931af..00000000000 --- a/src/lib/netlist/devices/nld_74153.h +++ /dev/null @@ -1,65 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74153.h - * - * DM74153: Dual 4-Line to 1-Line Data Selectors Multiplexers - * - * +--------------+ - * G1 |1 ++ 16| VCC - * B |2 15| G2 - * 1C3 |3 14| A - * 1C2 |4 74153 13| 2C3 - * 1C1 |5 12| 2C2 - * 1C0 |6 11| 2C1 - * Y1 |7 10| 2C0 - * GND |8 9| Y2 - * +--------------+ - * - * - * Function table - * - * +-----+-----++----+----+----+----++----+----+ - * | B | A || C0 | C1 | C2 | C3 || G | Y | - * +=====+=====++====+====+====+====++====+====+ - * | X | X || X | X | X | X || H | L | - * | L | L || L | X | X | X || L | L | - * | L | L || H | X | X | X || L | H | - * | L | H || X | L | X | X || L | L | - * | L | H || X | H | X | X || L | H | - * | H | L || X | X | L | X || L | L | - * | H | L || X | X | H | X || L | H | - * | H | H || X | X | X | L || L | L | - * | H | H || X | X | X | H || L | H | - * +-----+-----++----+----+----+----++----+----+ - * - * A, B : Select Inputs - * C* : Data inputs - * G : Strobe - * Y : Output - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_74153_H_ -#define NLD_74153_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74153(name, cC0, cC1, cC2, cC3, cA, cB, cG) \ - NET_REGISTER_DEV(TTL_74153, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, C0, cC0) \ - NET_CONNECT(name, C1, cC1) \ - NET_CONNECT(name, C2, cC2) \ - NET_CONNECT(name, C3, cC3) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, G, cG) - -#define TTL_74153_DIP(name) \ - NET_REGISTER_DEV(TTL_74153_DIP, name) - -#endif /* NLD_74153_H_ */ diff --git a/src/lib/netlist/devices/nld_74161.cpp b/src/lib/netlist/devices/nld_74161.cpp index ae58a43feba..357746d102f 100644 --- a/src/lib/netlist/devices/nld_74161.cpp +++ b/src/lib/netlist/devices/nld_74161.cpp @@ -1,141 +1,26 @@ // license:BSD-3-Clause -// copyright-holders:Ryan Holtz +// copyright-holders:Couriersud /* * nld_74161.cpp * */ -#include "nld_74161.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" +#include "nl_factory.h" -#include <array> +#include "nld_9316_base.hxx" -namespace netlist -{ - namespace devices - { +// FIXME: All detail can be found in nld_9316_base.hxx +// At least gcc-7.x needs the implementations of the base device +// in different compilation units. If created in the same file +// performance degrades horrible. - static constexpr const unsigned MAXCNT = 15; +// FIXME: this file could be created programmatically - NETLIB_OBJECT(74161) - { - NETLIB_CONSTRUCTOR(74161) - , m_A(*this, "A") - , m_B(*this, "B") - , m_C(*this, "C") - , m_D(*this, "D") - , m_CLRQ(*this, "CLRQ") - , m_LOADQ(*this, "LOADQ") - , m_CLK(*this, "CLK") - , m_ENABLEP(*this, "ENABLEP") - , m_ENABLET(*this, "ENABLET") - , m_cnt(*this, "m_cnt", 0) - , m_last_CLK(*this, "m_last_CLK", 0) - , m_Q(*this, {{"QA", "QB", "QC", "QD"}}) - , m_RCO(*this, "RCO") - , m_power_pins(*this) - { - } +namespace netlist::devices { - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_DEVICE_IMPL(74161, "TTL_74161", "+CLK,+ENP,+ENT,+CLRQ,+LOADQ,+A,+B,+C,+D,@VCC,@GND") + // FIXME: This happens on copy/paste + NETLIB_DEVICE_IMPL(74161_fixme, "TTL_74161_FIXME", "+A,+B,+C,+D,+CLRQ,+LOADQ,+CLK,+ENP,+ENT,@VCC,@GND") - protected: - logic_input_t m_A; - logic_input_t m_B; - logic_input_t m_C; - logic_input_t m_D; - logic_input_t m_CLRQ; - logic_input_t m_LOADQ; - logic_input_t m_CLK; - logic_input_t m_ENABLEP; - logic_input_t m_ENABLET; - - state_var<unsigned> m_cnt; - state_var<unsigned> m_last_CLK; - - object_array_t<logic_output_t, 4> m_Q; - logic_output_t m_RCO; - - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(74161_dip, 74161) - { - NETLIB_CONSTRUCTOR_DERIVED(74161_dip, 74161) - { - register_subalias("1", m_CLRQ); - register_subalias("2", m_CLK); - register_subalias("3", m_A); - register_subalias("4", m_B); - register_subalias("5", m_C); - register_subalias("6", m_D); - register_subalias("7", m_ENABLEP); - register_subalias("8", "GND"); - - register_subalias("9", m_LOADQ); - register_subalias("10", m_ENABLET); - register_subalias("11", m_Q[3]); - register_subalias("12", m_Q[2]); - register_subalias("13", m_Q[1]); - register_subalias("14", m_Q[0]); - register_subalias("15", m_RCO); - register_subalias("16", "VCC"); - - } - }; - - NETLIB_RESET(74161) - { - m_cnt = 0; - m_last_CLK = 0; - } - - // FIXME: Timing - static constexpr const std::array<netlist_time, 4> delay = - { - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40) - }; - - NETLIB_UPDATE(74161) - { - netlist_sig_t tRippleCarryOut = 0; - if (!m_CLRQ()) - { - m_cnt = 0; - } - else if (m_CLK() && !m_last_CLK) - { - if (!m_LOADQ()) - { - m_cnt = (m_D() << 3) | (m_C() << 2) - | (m_B() << 1) | (m_A() << 0); - } - else if (m_ENABLET() && m_ENABLEP()) - { - ++m_cnt &= MAXCNT; - } - } - - if (m_ENABLET() && (m_cnt == MAXCNT)) - { - tRippleCarryOut = 1; - } - - m_last_CLK = m_CLK(); - - for (std::size_t i=0; i<4; i++) - m_Q[i].push((m_cnt >> i) & 1, delay[i]); - - m_RCO.push(tRippleCarryOut, NLTIME_FROM_NS(20)); //FIXME - } - - NETLIB_DEVICE_IMPL(74161, "TTL_74161", "+A,+B,+C,+D,+CLRQ,+LOADQ,+CLK,+ENABLEP,+ENABLET,@VCC,@GND") - NETLIB_DEVICE_IMPL(74161_dip, "TTL_74161_DIP", "") - - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74161.h b/src/lib/netlist/devices/nld_74161.h deleted file mode 100644 index 91025446891..00000000000 --- a/src/lib/netlist/devices/nld_74161.h +++ /dev/null @@ -1,47 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_74161.h - * - * DM74161: Synchronous 4-Bit Binary Counter with Clock - * - * +--------------+ - * CLEAR |1 ++ 16| VCC - * CLK |2 15| RCO - * A |3 14| QA - * B |4 74161 13| QB - * C |5 12| QC - * D |6 11| QD - * ENABLEP |7 10| ENABLET - * GND |8 9| LOAD - * +--------------+ - * - * RCO: Ripple carry output - * - * Naming convention attempts to follow National Semiconductor datasheet - * - */ - -#ifndef NLD_74161_H_ -#define NLD_74161_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74161(name, cA, cB, cC, cD, cCLRQ, cLOADQ, cCLK, cENABLEP, cENABLET) \ - NET_REGISTER_DEV(TTL_74161, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, CLRQ, cCLRQ) \ - NET_CONNECT(name, LOADQ, cLOADQ) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, ENABLEP, cENABLEP) \ - NET_CONNECT(name, ENABLET, cENABLET) - -#define TTL_74161_DIP(name) \ - NET_REGISTER_DEV(TTL_74161_DIP, name) - -#endif /* NLD_74161_H_ */ diff --git a/src/lib/netlist/devices/nld_74163.cpp b/src/lib/netlist/devices/nld_74163.cpp new file mode 100644 index 00000000000..5044b0aa7c4 --- /dev/null +++ b/src/lib/netlist/devices/nld_74163.cpp @@ -0,0 +1,24 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_74163.cpp + * + */ + +#include "nl_base.h" +#include "nl_factory.h" + +#include "nld_9316_base.hxx" + +// FIXME: All detail can be found in nld_9316_base.hxx +// At least gcc-7.x needs the implementations of the base device +// in different compilation units. If created in the same file +// performance degrades horrible. + +// FIXME: this file could be created programmatically + +namespace netlist::devices { + + NETLIB_DEVICE_IMPL(74163, "TTL_74163", "+CLK,+ENP,+ENT,+CLRQ,+LOADQ,+A,+B,+C,+D,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74164.cpp b/src/lib/netlist/devices/nld_74164.cpp index ed401603181..878e333df0f 100644 --- a/src/lib/netlist/devices/nld_74164.cpp +++ b/src/lib/netlist/devices/nld_74164.cpp @@ -7,106 +7,110 @@ * implementing this was simple. * */ +/***************************************************************************** + + 5/74164 8-bit parallel-out serial shift registers + +*********************************************************************** + + Connection Diagram: + ___ ___ + A 1 |* u | 14 Vcc + B 2 | | 13 QH + QA 3 | | 12 QG + QB 4 | | 11 QF + QC 5 | | 10 QE + QD 6 | | 9 *Clear + GND 7 |_______| 8 Clock + +*********************************************************************** + Function Table: + +-------------------------+----------------+ + | Inputs | Outputs* | + +-------+-------+---------+----------------+ + | Clear | Clock | A B | QA QB ... QH | + +-------+-------+---------+----------------+ + | L | X | X X | L L L | + | H | L | X X | QA0 QB0 QH0 | + | H | ^ | H H | H QAn QGn | + | H | ^ | L X | L QAn QGn | + | H | ^ | X L | L QAn QGn | + +-------+-------+---------+----------------+ + + H = High Level (steady state) + L = Low Level (steady state) + X = Don't Care + ^ = Transition from low to high level + QA0, QB0 ... QH0 = The level of QA, QB ... QH before the indicated steady-state input conditions were established. + QAn, QGn = The level of QA or QG before the most recent ^ transition of the clock; indicates a 1 bit shift. + +**********************************************************************/ + +#include "nl_base.h" + +// FIXME: clk input to be separated - only falling edge relevant + +namespace netlist::devices { -#include "nld_74164.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(74164) { NETLIB_CONSTRUCTOR(74164) - , m_A(*this, "A") - , m_B(*this, "B") - , m_CLRQ(*this, "CLRQ") - , m_CLK(*this, "CLK") + , m_AB(*this, {"A", "B"}, NETLIB_DELEGATE(ab)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(clrq)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) , m_cnt(*this, "m_cnt", 0) - , m_last_CLK(*this, "m_last_CLK", 0) - , m_Q(*this, {{"QA", "QB", "QC", "QD", "QE", "QF", "QG", "QH"}}) + , m_ab(*this, "m_ab", 0) + , m_Q(*this, {"QA", "QB", "QC", "QD", "QE", "QF", "QG", "QH"}) , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - protected: - logic_input_t m_A; - logic_input_t m_B; - logic_input_t m_CLRQ; - logic_input_t m_CLK; - - state_var<unsigned> m_cnt; - state_var<unsigned> m_last_CLK; - - object_array_t<logic_output_t, 8> m_Q; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(74164_dip, 74164) - { - NETLIB_CONSTRUCTOR_DERIVED(74164_dip, 74164) - { - register_subalias("1", m_A); - register_subalias("2", m_B); - register_subalias("3", m_Q[0]); - register_subalias("4", m_Q[1]); - register_subalias("5", m_Q[2]); - register_subalias("6", m_Q[3]); - register_subalias("7", "A.GND"); - - register_subalias("8", m_CLK); - register_subalias("9", m_CLRQ); - register_subalias("10", m_Q[4]); - register_subalias("11", m_Q[5]); - register_subalias("12", m_Q[6]); - register_subalias("13", m_Q[7]); - register_subalias("14", "A.VCC"); - - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); - - } - }; - - NETLIB_RESET(74164) - { - m_cnt = 0; - m_last_CLK = 0; - } - - NETLIB_UPDATE(74164) - { - if (!m_CLRQ()) + private: + NETLIB_RESETI() { + m_CLK.set_state(logic_t::STATE_INP_LH); m_cnt = 0; } - else if (m_CLK() && !m_last_CLK) + + NETLIB_HANDLERI(clrq) { - m_cnt = (m_cnt << 1) & 0xfe; - if (m_A() && m_B()) + if (m_CLRQ()) { - m_cnt |= 0x01; + m_CLK.activate_lh(); } else { - m_cnt &= 0xfe; + m_CLK.inactivate(); + if (m_cnt != 0) + { + m_cnt = 0; + m_Q.push(0, NLTIME_FROM_NS(30)); + } } } - m_last_CLK = m_CLK(); + NETLIB_HANDLERI(clk) + { + m_cnt = (m_cnt << 1) | m_ab; + m_Q.push(m_cnt, NLTIME_FROM_NS(30)); + } - for (std::size_t i=0; i<8; i++) + NETLIB_HANDLERI(ab) { - m_Q[i].push((m_cnt >> i) & 1, NLTIME_FROM_NS(30)); + m_ab = static_cast<unsigned>((m_AB() == 3) ? 1 : 0); } - } + + object_array_t<logic_input_t, 2> m_AB; + logic_input_t m_CLRQ; + logic_input_t m_CLK; + + state_var<unsigned> m_cnt; + state_var<unsigned> m_ab; + + object_array_t<logic_output_t, 8> m_Q; + nld_power_pins m_power_pins; + }; NETLIB_DEVICE_IMPL(74164, "TTL_74164", "+A,+B,+CLRQ,+CLK,@VCC,@GND") - NETLIB_DEVICE_IMPL(74164_dip, "TTL_74164_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74164.h b/src/lib/netlist/devices/nld_74164.h deleted file mode 100644 index 2efe339df2b..00000000000 --- a/src/lib/netlist/devices/nld_74164.h +++ /dev/null @@ -1,59 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Joakim Larsson Edstrom -/***************************************************************************** - - 5/74164 8-bit parallel-out serial shift registers - -*********************************************************************** - - Connection Diagram: - ___ ___ - A 1 |* u | 14 Vcc - B 2 | | 13 QH - QA 3 | | 12 QG - QB 4 | | 11 QF - QC 5 | | 10 QE - QD 6 | | 9 *Clear - GND 7 |_______| 8 Clock - -*********************************************************************** - Function Table: - +-------------------------+----------------+ - | Inputs | Qutputs* | - +-------+-------+---------+----------------+ - | Clear | Clock | A B | QA QB ... QH | - +-------+-------+---------+----------------+ - | L | X | X X | L L L | - | H | L | X X | QA0 QB0 QH0 | - | H | ^ | H H | H QAn QGn | - | H | ^ | L X | L QAn QGn | - | H | ^ | X L | L QAn QGn | - +-------+-------+---------+----------------+ - - H = High Level (steady state) - L = Low Level (steady state) - X = Don't Care - ^ = Transition from low to high level - QA0, QB0 ... QH0 = The level of QA, QB ... QH before the indicated steady-state input conditions were established. - QAn, QGn = The level of QA or QG before the most recent ^ transition of the clock; indicates a 1 bit shift. - -**********************************************************************/ - -#ifndef NLD_74164_H_ -#define NLD_74164_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74164(name, cA, cB, cCLRQ, cCLK) \ - NET_REGISTER_DEV(TTL_74164, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, CLRQ, cCLRQ) \ - NET_CONNECT(name, CLK, cCLK) - -#define TTL_74164_DIP(name) \ - NET_REGISTER_DEV(TTL_74164_DIP, name) - -#endif /* NLD_74164_H_ */ diff --git a/src/lib/netlist/devices/nld_74165.cpp b/src/lib/netlist/devices/nld_74165.cpp index 9e5d6607fbd..63fee9fdb13 100644 --- a/src/lib/netlist/devices/nld_74165.cpp +++ b/src/lib/netlist/devices/nld_74165.cpp @@ -3,36 +3,82 @@ /* * nld_74165.cpp * + * 74165: Parallel-Load 8-Bit Shift Register + * + * +--------------+ + * SH/LDQ |1 ++ 16| VCC + * CLK |2 15| CLKINH + * E |3 14| D + * F |4 74165 13| C + * G |5 12| B + * H |6 11| A + * QHQ |7 10| SER + * GND |8 9| QH + * +--------------+ + * + * SH/LDQ: Shift / !Load + * CLKINH: Clock Inhibit + * SER: Serial In + * + * Naming convention attempts to follow NTE Electronics datasheet + * */ -#include "nld_74165.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(74165) { NETLIB_CONSTRUCTOR(74165) - , m_DATA(*this, {{ "H", "G", "F", "E", "D", "C", "B", "A" }}) - , m_SER(*this, "SER") - , m_SH_LDQ(*this, "SH_LDQ") - , m_CLK(*this, "CLK") - , m_CLKINH(*this, "CLKINH") + , m_DATA(*this, { "H", "G", "F", "E", "D", "C", "B", "A" }, NETLIB_DELEGATE(inputs)) + , m_SER(*this, "SER", NETLIB_DELEGATE_NOOP()) + , m_SH_LDQ(*this, "SH_LDQ", NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_CLKINH(*this, "CLKINH", NETLIB_DELEGATE(inputs)) , m_QH(*this, "QH") , m_QHQ(*this, "QHQ") , m_shifter(*this, "m_shifter", 0) - , m_last_CLK(*this, "m_last_CLK", 0) , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + m_CLK.set_state(logic_t::STATE_INP_LH); + m_shifter = 0; + } + + NETLIB_HANDLERI(clk) + { + unsigned high_bit = m_SER() ? 0x80 : 0; + m_shifter = high_bit | (m_shifter >> 1); + + const auto qh = m_shifter & 1; + + m_QH.push(qh, NLTIME_FROM_NS(20)); // FIXME: Timing + m_QHQ.push(qh ^ 1, NLTIME_FROM_NS(20)); // FIXME: Timing + } + + NETLIB_HANDLERI(inputs) + { + if (!m_SH_LDQ()) + { + m_shifter = 0; + for (std::size_t i=0; i<8; i++) + m_shifter |= (m_DATA[i]() << i); + const auto qh = m_shifter & 1; + + m_QH.push(qh, NLTIME_FROM_NS(20)); // FIXME: Timing + m_QHQ.push(qh ^ 1, NLTIME_FROM_NS(20)); // FIXME: Timing + } + if (!m_SH_LDQ() || m_CLKINH()) + m_CLK.inactivate(); + else + m_CLK.activate_lh(); + } - protected: + private: object_array_t<logic_input_t, 8> m_DATA; logic_input_t m_SER; logic_input_t m_SH_LDQ; @@ -42,72 +88,10 @@ namespace netlist logic_output_t m_QHQ; state_var<unsigned> m_shifter; - state_var<unsigned> m_last_CLK; nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74165_dip, 74165) - { - NETLIB_CONSTRUCTOR_DERIVED(74165_dip, 74165) - { - register_subalias("1", m_SH_LDQ); - register_subalias("2", m_CLK); - register_subalias("3", m_DATA[4]); - register_subalias("4", m_DATA[5]); - register_subalias("5", m_DATA[6]); - register_subalias("6", m_DATA[7]); - register_subalias("7", m_QHQ); - register_subalias("8", "GND"); - - register_subalias("9", m_QH); - register_subalias("10", m_SER); - register_subalias("11", m_DATA[0]); - register_subalias("12", m_DATA[1]); - register_subalias("13", m_DATA[2]); - register_subalias("14", m_DATA[3]); - register_subalias("15", m_CLKINH); - register_subalias("16", "VCC"); - } - }; - - NETLIB_RESET(74165) - { - m_shifter = 0; - m_last_CLK = 0; - } - // FIXME: Timing - NETLIB_UPDATE(74165) - { - netlist_sig_t old_qh = m_QH.net().Q(); - netlist_sig_t qh = 0; - - if (!m_SH_LDQ()) - { - m_shifter = 0; - for (std::size_t i=0; i<8; i++) - m_shifter |= (m_DATA[i]() << i); - } - else if (!m_CLK() || m_CLKINH()) - { - // FIXME: qh is overwritten below? - qh = old_qh; - } - else if (!m_last_CLK) - { - unsigned high_bit = m_SER() ? 0x80 : 0; - m_shifter = high_bit | (m_shifter >> 1); - } - - qh = m_shifter & 1; - - m_last_CLK = m_CLK(); - - m_QH.push(qh, NLTIME_FROM_NS(20)); // FIXME: Timing - } - NETLIB_DEVICE_IMPL(74165, "TTL_74165", "+CLK,+CLKINH,+SH_LDQ,+SER,+A,+B,+C,+D,+E,+F,+G,+H,@VCC,@GND") - NETLIB_DEVICE_IMPL(74165_dip, "TTL_74165_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74165.h b/src/lib/netlist/devices/nld_74165.h deleted file mode 100644 index 51133157dbd..00000000000 --- a/src/lib/netlist/devices/nld_74165.h +++ /dev/null @@ -1,52 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_74165.h - * - * 74165: Parallel-Load 8-Bit Shift Register - * - * +--------------+ - * SH/LDQ |1 ++ 16| VCC - * CLK |2 15| CLKINH - * E |3 14| D - * F |4 74165 13| C - * G |5 12| B - * H |6 11| A - * QHQ |7 10| SER - * GND |8 9| QH - * +--------------+ - * - * SH/LDQ: Shift / !Load - * CLKINH: Clock Inhibit - * SER: Serial In - * - * Naming convention attempts to follow NTE Electronics datasheet - * - */ - -#ifndef NLD_74165_H_ -#define NLD_74165_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74165(name, cCLK, cCLKINH, cSH_LDQ, cSER, cA, cB, cC, cD, cE, cF, cG, cH) \ - NET_REGISTER_DEV(TTL_74165, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, CLKINH, cCLKINH) \ - NET_CONNECT(name, SH_LDQ, cSH_LDQ) \ - NET_CONNECT(name, SER, cSER) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, E, cE) \ - NET_CONNECT(name, F, cF) \ - NET_CONNECT(name, G, cG) \ - NET_CONNECT(name, H, cH) - -#define TTL_74165_DIP(name) \ - NET_REGISTER_DEV(TTL_74165_DIP, name) - -#endif /* NLD_74165_H_ */ diff --git a/src/lib/netlist/devices/nld_74166.cpp b/src/lib/netlist/devices/nld_74166.cpp index 2b9d6be1a3b..f12101a4737 100644 --- a/src/lib/netlist/devices/nld_74166.cpp +++ b/src/lib/netlist/devices/nld_74166.cpp @@ -3,25 +3,42 @@ /* * nld_74166.cpp * + * 74166: Parallel-Load 8-Bit Shift Register + * + * +--------------+ + * SER |1 ++ 16| VCC + * A |2 15| SH/LDQ + * B |3 14| H + * C |4 74166 13| QH + * D |5 12| G + * CLKINH |6 11| F + * CLK |7 10| E + * GND |8 9| CLRQ + * +--------------+ + * + * SH/LDQ: Shift / !Load + * CLKINH: Clock Inhibit + * SER: Serial In + * + * Naming convention attempts to follow Texas Instruments datasheet + * */ -#include "nld_74166.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +// FIXME: separate handlers for inputs + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(74166) { NETLIB_CONSTRUCTOR(74166) - , m_DATA(*this, {{ "H", "G", "F", "E", "D", "C", "B", "A" }}) - , m_SER(*this, "SER") - , m_CLRQ(*this, "CLRQ") - , m_SH_LDQ(*this, "SH_LDQ") - , m_CLK(*this, "CLK") - , m_CLKINH(*this, "CLKINH") + , m_DATA(*this, { "H", "G", "F", "E", "D", "C", "B", "A" }, NETLIB_DELEGATE(inputs)) + , m_SER(*this, "SER", NETLIB_DELEGATE(inputs)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(inputs)) + , m_SH_LDQ(*this, "SH_LDQ", NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(inputs)) + , m_CLKINH(*this, "CLKINH", NETLIB_DELEGATE(inputs)) , m_QH(*this, "QH") , m_shifter(*this, "m_shifter", 0) , m_last_CLRQ(*this, "m_last_CLRQ", 0) @@ -30,103 +47,74 @@ namespace netlist { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - protected: - object_array_t<logic_input_t, 8> m_DATA; - logic_input_t m_SER; - logic_input_t m_CLRQ; - logic_input_t m_SH_LDQ; - logic_input_t m_CLK; - logic_input_t m_CLKINH; - logic_output_t m_QH; - - state_var<unsigned> m_shifter; - state_var<unsigned> m_last_CLRQ; - state_var<unsigned> m_last_CLK; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(74166_dip, 74166) - { - NETLIB_CONSTRUCTOR_DERIVED(74166_dip, 74166) + private: + NETLIB_RESETI() { - register_subalias("1", m_SER); - register_subalias("2", m_DATA[7]); - register_subalias("3", m_DATA[6]); - register_subalias("4", m_DATA[5]); - register_subalias("5", m_DATA[4]); - register_subalias("6", m_CLKINH); - register_subalias("7", m_CLK); - register_subalias("8", "GND"); - - register_subalias("9", m_CLRQ); - register_subalias("10", m_DATA[3]); - register_subalias("11", m_DATA[2]); - register_subalias("12", m_DATA[1]); - register_subalias("13", m_QH); - register_subalias("14", m_DATA[0]); - register_subalias("15", m_SH_LDQ); - register_subalias("16", "VCC"); + m_shifter = 0; + m_last_CLRQ = 0; + m_last_CLK = 0; } - }; - NETLIB_RESET(74166) - { - m_shifter = 0; - m_last_CLRQ = 0; - m_last_CLK = 0; - } - - NETLIB_UPDATE(74166) - { - netlist_sig_t old_qh = m_QH.net().Q(); - netlist_sig_t qh = 0; - - netlist_time delay = NLTIME_FROM_NS(26); - if (m_CLRQ()) + NETLIB_HANDLERI(inputs) { - bool clear_unset = !m_last_CLRQ; - if (clear_unset) - { - delay = NLTIME_FROM_NS(35); - } + netlist_sig_t old_qh = m_QH.net().Q(); + netlist_sig_t qh = 0; - if (!m_CLK() || m_CLKINH()) + netlist_time delay = NLTIME_FROM_NS(26); + if (m_CLRQ()) { - qh = old_qh; - } - else if (!m_last_CLK) - { - if (!m_SH_LDQ()) + bool clear_unset = !m_last_CLRQ; + if (clear_unset) { - m_shifter = 0; - for (std::size_t i=0; i<8; i++) - m_shifter |= (m_DATA[i]() << i); + delay = NLTIME_FROM_NS(35); } - else + + if (!m_CLK() || m_CLKINH()) { - unsigned high_bit = m_SER() ? 0x80 : 0; - m_shifter = high_bit | (m_shifter >> 1); + qh = old_qh; } - - qh = m_shifter & 1; - if (!qh && !clear_unset) + else if (!m_last_CLK) { - delay = NLTIME_FROM_NS(30); + if (!m_SH_LDQ()) + { + m_shifter = 0; + for (std::size_t i=0; i<8; i++) + m_shifter |= (m_DATA[i]() << i); + } + else + { + unsigned high_bit = m_SER() ? 0x80 : 0; + m_shifter = high_bit | (m_shifter >> 1); + } + + qh = m_shifter & 1; + if (!qh && !clear_unset) + { + delay = NLTIME_FROM_NS(30); + } } } + + m_last_CLRQ = m_CLRQ(); + m_last_CLK = m_CLK(); + + m_QH.push(qh, delay); //FIXME } - m_last_CLRQ = m_CLRQ(); - m_last_CLK = m_CLK(); + object_array_t<logic_input_t, 8> m_DATA; + logic_input_t m_SER; + logic_input_t m_CLRQ; + logic_input_t m_SH_LDQ; + logic_input_t m_CLK; + logic_input_t m_CLKINH; + logic_output_t m_QH; - m_QH.push(qh, delay); //FIXME - } + state_var<unsigned> m_shifter; + state_var<unsigned> m_last_CLRQ; + state_var<unsigned> m_last_CLK; + nld_power_pins m_power_pins; + }; NETLIB_DEVICE_IMPL(74166, "TTL_74166", "+CLK,+CLKINH,+SH_LDQ,+SER,+A,+B,+C,+D,+E,+F,+G,+H,+CLRQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(74166_dip,"TTL_74166_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74166.h b/src/lib/netlist/devices/nld_74166.h deleted file mode 100644 index be9cb7fdc4c..00000000000 --- a/src/lib/netlist/devices/nld_74166.h +++ /dev/null @@ -1,53 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_74166.h - * - * 74166: Parallel-Load 8-Bit Shift Register - * - * +--------------+ - * SER |1 ++ 16| VCC - * A |2 15| SH/LDQ - * B |3 14| H - * C |4 74166 13| QH - * D |5 12| G - * CLKINH |6 11| F - * CLK |7 10| E - * GND |8 9| CLRQ - * +--------------+ - * - * SH/LDQ: Shift / !Load - * CLKINH: Clock Inhibit - * SER: Serial In - * - * Naming convention attempts to follow Texas Instruments datasheet - * - */ - -#ifndef NLD_74166_H_ -#define NLD_74166_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74166(name, cCLK, cCLKINH, cSH_LDQ, cSER, cA, cB, cC, cD, cE, cF, cG, cH, cCLRQ) \ - NET_REGISTER_DEV(TTL_74166, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, CLKINH, cCLKINH) \ - NET_CONNECT(name, SH_LDQ, cSH_LDQ) \ - NET_CONNECT(name, SER, cSER) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, E, cE) \ - NET_CONNECT(name, F, cF) \ - NET_CONNECT(name, G, cG) \ - NET_CONNECT(name, H, cH) \ - NET_CONNECT(name, CLRQ, cCLRQ) - -#define TTL_74166_DIP(name) \ - NET_REGISTER_DEV(TTL_74166_DIP, name) - -#endif /* NLD_74166_H_ */ diff --git a/src/lib/netlist/devices/nld_74174.cpp b/src/lib/netlist/devices/nld_74174.cpp index bb6ecc1510b..2789eef0bb5 100644 --- a/src/lib/netlist/devices/nld_74174.cpp +++ b/src/lib/netlist/devices/nld_74174.cpp @@ -1,122 +1,103 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* * nld_74174.cpp * + * DM74174: Hex D Flip-Flops with Clear + * + * +--------------+ + * CLR |1 ++ 16| VCC + * Q1 |2 15| Q6 + * D1 |3 14| D6 + * D2 |4 74174 13| D5 + * Q2 |5 12| Q5 + * D3 |6 11| D4 + * Q3 |7 10| Q4 + * GND |8 9| CLK + * +--------------+ + * + * +-----+-----+---++---+-----+ + * | CLR | CLK | D || Q | QQ | + * +=====+=====+===++===+=====+ + * | 0 | X | X || 0 | 1 | + * | 1 | R | 1 || 1 | 0 | + * | 1 | R | 0 || 0 | 1 | + * | 1 | 0 | X || Q0| Q0Q | + * +-----+-----+---++---+-----+ + * + * Q0 The output logic level of Q before the indicated input conditions were established + * + * R: 0 -> 1 + * + * Naming conventions follow National Semiconductor datasheet + * */ -#include "nld_74174.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ -namespace devices -{ NETLIB_OBJECT(74174) { NETLIB_CONSTRUCTOR(74174) - , m_CLK(*this, "CLK", NETLIB_DELEGATE(74174, sub)) - , m_Q(*this, {{"Q1", "Q2", "Q3", "Q4", "Q5", "Q6"}}) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_Q(*this, 1, "Q{}") , m_clrq(*this, "m_clr", 0) , m_data(*this, "m_data", 0) - , m_D(*this, {{"D1", "D2", "D3", "D4", "D5", "D6"}}) - , m_CLRQ(*this, "CLRQ") + , m_D(*this, 1, "D{}", NETLIB_DELEGATE(other)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(clrq)) , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + m_CLK.set_state(logic_t::STATE_INP_LH); + m_clrq = 0; + m_data = 0xFF; + } + + private: + NETLIB_HANDLERI(clrq) + { + m_clrq = m_CLRQ(); + if (!m_clrq) + { + m_data = 0; + m_Q.push(m_data, NLTIME_FROM_NS(40)); + m_CLK.inactivate(); + } + else + m_CLK.activate_lh(); + } + + NETLIB_HANDLERI(other) + { + m_data = m_D(); + if (m_clrq) + m_CLK.activate_lh(); + } - NETLIB_HANDLERI(sub) + NETLIB_HANDLERI(clk) { if (m_clrq) { - for (std::size_t i=0; i<6; i++) - { - netlist_sig_t d = (m_data >> i) & 1; - m_Q[i].push(d, NLTIME_FROM_NS(25)); - } + m_Q.push(m_data, NLTIME_FROM_NS(25)); m_CLK.inactivate(); } } - protected: logic_input_t m_CLK; object_array_t<logic_output_t, 6> m_Q; state_var<netlist_sig_t> m_clrq; - state_var<unsigned> m_data; + state_var<netlist_sig_t> m_data; object_array_t<logic_input_t, 6> m_D; logic_input_t m_CLRQ; nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74174_dip, 74174) - { - NETLIB_CONSTRUCTOR_DERIVED(74174_dip, 74174) - { - register_subalias("1", m_CLRQ); - register_subalias("9", m_CLK); - - register_subalias("3", m_D[0]); - register_subalias("2", m_Q[0]); - - register_subalias("4", m_D[1]); - register_subalias("5", m_Q[1]); - - register_subalias("6", m_D[2]); - register_subalias("7", m_Q[2]); - - register_subalias("11", m_D[3]); - register_subalias("10", m_Q[3]); - - register_subalias("13", m_D[4]); - register_subalias("12", m_Q[4]); - - register_subalias("14", m_D[5]); - register_subalias("15", m_Q[5]); - - register_subalias("8", "GND"); - register_subalias("16", "VCC"); - - } - }; - - NETLIB_UPDATE(74174) - { - uint_fast8_t d = 0; - for (std::size_t i=0; i<6; i++) - { - d |= (m_D[i]() << i); - } - m_clrq = m_CLRQ(); - if (!m_clrq) - { - for (std::size_t i=0; i<6; i++) - { - m_Q[i].push(0, NLTIME_FROM_NS(40)); - } - m_data = 0; - } else if (d != m_data) - { - m_data = d; - m_CLK.activate_lh(); - } - } - - - NETLIB_RESET(74174) - { - m_CLK.set_state(logic_t::STATE_INP_LH); - m_clrq = 0; - m_data = 0xFF; - } - - NETLIB_DEVICE_IMPL(74174, "TTL_74174", "+CLK,+D1,+D2,+D3,+D4,+D5,+D6,+CLRQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(74174_dip,"TTL_74174_DIP", "") + NETLIB_DEVICE_IMPL(74174, "TTL_74174", "+CLK,+D1,+D2,+D3,+D4,+D5,+D6,+CLRQ,@VCC,@GND") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74174.h b/src/lib/netlist/devices/nld_74174.h deleted file mode 100644 index 4fe23739aad..00000000000 --- a/src/lib/netlist/devices/nld_74174.h +++ /dev/null @@ -1,58 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74174.h - * - * DM74174: Hex D Flip-Flops with Clear - * - * +--------------+ - * CLR |1 ++ 16| VCC - * Q1 |2 15| Q6 - * D1 |3 14| D6 - * D2 |4 74174 13| D5 - * Q2 |5 12| Q5 - * D3 |6 11| D4 - * Q3 |7 10| Q4 - * GND |8 9| CLK - * +--------------+ - * - * +-----+-----+---++---+-----+ - * | CLR | CLK | D || Q | QQ | - * +=====+=====+===++===+=====+ - * | 0 | X | X || 0 | 1 | - * | 1 | R | 1 || 1 | 0 | - * | 1 | R | 0 || 0 | 1 | - * | 1 | 0 | X || Q0| Q0Q | - * +-----+-----+---++---+-----+ - * - * Q0 The output logic level of Q before the indicated input conditions were established - * - * R: 0 -> 1 - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_74174_H_ -#define NLD_74174_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74174(name, cCLK, cD1, cD2, cD3, cD4, cD5, cD6, cCLRQ) \ - NET_REGISTER_DEV(TTL_74174, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, D1, cD1) \ - NET_CONNECT(name, D2, cD2) \ - NET_CONNECT(name, D3, cD3) \ - NET_CONNECT(name, D4, cD4) \ - NET_CONNECT(name, D5, cD5) \ - NET_CONNECT(name, D6, cD6) \ - NET_CONNECT(name, CLRQ, cCLRQ) - -#define TTL_74174_DIP(name) \ - NET_REGISTER_DEV(TTL_74174_DIP, name) - - -#endif /* NLD_74174_H_ */ diff --git a/src/lib/netlist/devices/nld_74175.cpp b/src/lib/netlist/devices/nld_74175.cpp index 145c5887476..064e29cf6da 100644 --- a/src/lib/netlist/devices/nld_74175.cpp +++ b/src/lib/netlist/devices/nld_74175.cpp @@ -1,124 +1,115 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_74175.c + * nld_74175.cpp + * + * DM74175: Quad D Flip-Flops with Clear + * + * +--------------+ + * CLR |1 ++ 16| VCC + * Q1 |2 15| Q4 + * Q1Q |3 14| Q4Q + * D1 |4 74175 13| D4 + * D2 |5 12| D3 + * Q2Q |6 11| Q3Q + * Q2 |7 10| Q3 + * GND |8 9| CLK + * +--------------+ + * + * +-----+-----+---++---+-----+ + * | CLR | CLK | D || Q | QQ | + * +=====+=====+===++===+=====+ + * | 0 | X | X || 0 | 1 | + * | 1 | R | 1 || 1 | 0 | + * | 1 | R | 0 || 0 | 1 | + * | 1 | 0 | X || Q0| Q0Q | + * +-----+-----+---++---+-----+ + * + * Q0 The output logic level of Q before the indicated input conditions were established + * + * R: 0 -> 1 + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_74175.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +// FIXME: optimize + +namespace netlist::devices { + + static constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(25) }; + static constexpr const std::array<netlist_time, 2> delay_clear = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(74175) { NETLIB_CONSTRUCTOR(74175) - , m_D(*this, {{"D1", "D2", "D3", "D4"}}) - , m_CLRQ(*this, "CLRQ") - , m_CLK(*this, "CLK", NETLIB_DELEGATE(74175, clk)) - , m_Q(*this, {{"Q1", "Q2", "Q3", "Q4"}}) - , m_QQ(*this, {{"Q1Q", "Q2Q", "Q3Q", "Q4Q"}}) + , m_D(*this, {"D1", "D2", "D3", "D4"}, NETLIB_DELEGATE(other)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(other)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_Q(*this, {"Q1", "Q2", "Q3", "Q4"}) + , m_QQ(*this, {"Q1Q", "Q2Q", "Q3Q", "Q4Q"}) , m_data(*this, "m_data", 0) , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_HANDLERI(clk); - - protected: - object_array_t<logic_input_t, 4> m_D; - logic_input_t m_CLRQ; - - logic_input_t m_CLK; - object_array_t<logic_output_t, 4> m_Q; - object_array_t<logic_output_t, 4> m_QQ; - - state_var<unsigned> m_data; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(74175_dip, 74175) - { - NETLIB_CONSTRUCTOR_DERIVED(74175_dip, 74175) + private: + NETLIB_RESETI() { - register_subalias("9", m_CLK); - register_subalias("1", m_CLRQ); - - register_subalias("4", m_D[0]); - register_subalias("2", m_Q[0]); - register_subalias("3", m_QQ[0]); - - register_subalias("5", m_D[1]); - register_subalias("7", m_Q[1]); - register_subalias("6", m_QQ[1]); - - register_subalias("12", m_D[2]); - register_subalias("10", m_Q[2]); - register_subalias("11", m_QQ[2]); - - register_subalias("13", m_D[3]); - register_subalias("15", m_Q[3]); - register_subalias("14", m_QQ[3]); - - register_subalias("8", "GND"); - register_subalias("16", "VCC"); + m_CLK.set_state(logic_t::STATE_INP_LH); + m_data = 0xFF; } - }; - - constexpr const netlist_time delay[2] = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(25) }; - constexpr const netlist_time delay_clear[2] = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; - NETLIB_HANDLER(74175, clk) - { - if (m_CLRQ()) + NETLIB_HANDLERI(other) { + uint_fast8_t d = 0; for (std::size_t i=0; i<4; i++) { - netlist_sig_t d = (m_data >> i) & 1; - m_Q[i].push(d, delay[d]); - m_QQ[i].push(d ^ 1, delay[d ^ 1]); + d |= (m_D[i]() << i); + } + if (!m_CLRQ()) + { + for (std::size_t i=0; i<4; i++) + { + m_Q[i].push(0, delay_clear[0]); + m_QQ[i].push(1, delay_clear[1]); + } + m_data = 0; + } else if (d != m_data) + { + m_data = d; + m_CLK.activate_lh(); } - m_CLK.inactivate(); } - } - NETLIB_UPDATE(74175) - { - uint_fast8_t d = 0; - for (std::size_t i=0; i<4; i++) - { - d |= (m_D[i]() << i); - } - if (!m_CLRQ()) + NETLIB_HANDLERI(clk) { - for (std::size_t i=0; i<4; i++) + if (m_CLRQ()) { - m_Q[i].push(0, delay_clear[0]); - m_QQ[i].push(1, delay_clear[1]); + for (std::size_t i=0; i<4; i++) + { + netlist_sig_t d = (m_data >> i) & 1; + m_Q[i].push(d, delay[d]); + m_QQ[i].push(d ^ 1, delay[d ^ 1]); + } + m_CLK.inactivate(); } - m_data = 0; - } else if (d != m_data) - { - m_data = d; - m_CLK.activate_lh(); } - } + object_array_t<logic_input_t, 4> m_D; + logic_input_t m_CLRQ; - NETLIB_RESET(74175) - { - m_CLK.set_state(logic_t::STATE_INP_LH); - m_data = 0xFF; - } + logic_input_t m_CLK; + object_array_t<logic_output_t, 4> m_Q; + object_array_t<logic_output_t, 4> m_QQ; + + state_var<unsigned> m_data; + nld_power_pins m_power_pins; + }; NETLIB_DEVICE_IMPL(74175, "TTL_74175", "+CLK,+D1,+D2,+D3,+D4,+CLRQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(74175_dip,"TTL_74175_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74175.h b/src/lib/netlist/devices/nld_74175.h deleted file mode 100644 index b29d4680813..00000000000 --- a/src/lib/netlist/devices/nld_74175.h +++ /dev/null @@ -1,56 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74175.h - * - * DM74175: Quad D Flip-Flops with Clear - * - * +--------------+ - * CLR |1 ++ 16| VCC - * Q1 |2 15| Q4 - * Q1Q |3 14| Q4Q - * D1 |4 74175 13| D4 - * D2 |5 12| D3 - * Q2Q |6 11| Q3Q - * Q2 |7 10| Q3 - * GND |8 9| CLK - * +--------------+ - * - * +-----+-----+---++---+-----+ - * | CLR | CLK | D || Q | QQ | - * +=====+=====+===++===+=====+ - * | 0 | X | X || 0 | 1 | - * | 1 | R | 1 || 1 | 0 | - * | 1 | R | 0 || 0 | 1 | - * | 1 | 0 | X || Q0| Q0Q | - * +-----+-----+---++---+-----+ - * - * Q0 The output logic level of Q before the indicated input conditions were established - * - * R: 0 -> 1 - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_74175_H_ -#define NLD_74175_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74175(name, cCLK, cD1, cD2, cD3, cD4, cCLRQ) \ - NET_REGISTER_DEV(TTL_74175, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, D1, cD1) \ - NET_CONNECT(name, D2, cD2) \ - NET_CONNECT(name, D3, cD3) \ - NET_CONNECT(name, D4, cD4) \ - NET_CONNECT(name, CLRQ, cCLRQ) - -#define TTL_74175_DIP(name) \ - NET_REGISTER_DEV(TTL_74175_DIP, name) - - -#endif /* NLD_74175_H_ */ diff --git a/src/lib/netlist/devices/nld_74192.cpp b/src/lib/netlist/devices/nld_74192.cpp index bedc045164d..bee494a7e54 100644 --- a/src/lib/netlist/devices/nld_74192.cpp +++ b/src/lib/netlist/devices/nld_74192.cpp @@ -1,46 +1,78 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_74192.c + * nld_74192.cpp + * + * DM74192: Synchronous 4-Bit Binary Counter with Dual Clock + * Decade counter + * + * FIXME: This should be merged with the 74193 which counts to 16 + * + * +--------------+ + * B |1 ++ 16| VCC + * QB |2 15| A + * QA |3 14| CLEAR + * CD |4 74192 13| BORROWQ + * CU |5 12| CARRYQ + * QC |6 11| LOADQ + * QD |7 10| C + * GND |8 9| D + * +--------------+ + * + * CD: Count up + * CU: Count down + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_74192.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" -namespace netlist -{ - namespace devices - { +#include "nl_base.h" + +namespace netlist::devices { static constexpr const unsigned MAXCNT = 9; + // FIXME: Optimize + + // FIXME: Timing + static constexpr const std::array<netlist_time, 4> delay = + { + NLTIME_FROM_NS(40), + NLTIME_FROM_NS(40), + NLTIME_FROM_NS(40), + NLTIME_FROM_NS(40) + }; + NETLIB_OBJECT(74192) { NETLIB_CONSTRUCTOR(74192) - , m_CLEAR(*this, "CLEAR") - , m_LOADQ(*this, "LOADQ") - , m_CU(*this, "CU") - , m_CD(*this, "CD") + , m_CLEAR(*this, "CLEAR", NETLIB_DELEGATE(inputs)) + , m_LOADQ(*this, "LOADQ", NETLIB_DELEGATE(inputs)) + , m_CU(*this, "CU", NETLIB_DELEGATE(inputs)) + , m_CD(*this, "CD", NETLIB_DELEGATE(inputs)) , m_cnt(*this, "m_cnt", 0) , m_last_CU(*this, "m_last_CU", 0) , m_last_CD(*this, "m_last_CD", 0) - , m_Q(*this, {{"QA", "QB", "QC", "QD"}}) + , m_Q(*this, {"QA", "QB", "QC", "QD"}) , m_BORROWQ(*this, "BORROWQ") , m_CARRYQ(*this, "CARRYQ") - , m_A(*this, "A", NETLIB_DELEGATE(74192, sub)) - , m_B(*this, "B", NETLIB_DELEGATE(74192, sub)) - , m_C(*this, "C", NETLIB_DELEGATE(74192, sub)) - , m_D(*this, "D", NETLIB_DELEGATE(74192, sub)) + , m_A(*this, "A", NETLIB_DELEGATE(sub)) + , m_B(*this, "B", NETLIB_DELEGATE(sub)) + , m_C(*this, "C", NETLIB_DELEGATE(sub)) + , m_D(*this, "D", NETLIB_DELEGATE(sub)) , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + m_cnt = 0; + m_last_CU = 0; + m_last_CD = 0; + } - protected: + private: logic_input_t m_CLEAR; logic_input_t m_LOADQ; logic_input_t m_CU; @@ -60,104 +92,62 @@ namespace netlist logic_input_t m_D; nld_power_pins m_power_pins; - NETLIB_HANDLERI(sub) - { - // FIXME: can use more optimization - } - - unsigned read_ABCD() const + NETLIB_HANDLERI(inputs) { - return (m_D() << 3) | (m_C() << 2) | (m_B() << 1) | (m_A() << 0); - } + netlist_sig_t tCarry = 1; + netlist_sig_t tBorrow = 1; + if (m_CLEAR()) + { + m_cnt = 0; + } + else if (!m_LOADQ()) + { + m_cnt = read_ABCD(); + } + else + { + if (m_CD() && !m_last_CU && m_CU()) + { + if (++m_cnt > MAXCNT) + m_cnt = 0; + } + if (m_CU() && !m_last_CD && m_CD()) + { + if (m_cnt > 0) + --m_cnt; + else + m_cnt = MAXCNT; + } + } - }; + if (!m_CU() && (m_cnt == MAXCNT)) + tCarry = 0; - NETLIB_OBJECT_DERIVED(74192_dip, 74192) - { - NETLIB_CONSTRUCTOR_DERIVED(74192_dip, 74192) - { - register_subalias("1", m_B); - register_subalias("2", m_Q[1]); - register_subalias("3", m_Q[0]); - register_subalias("4", m_CD); - register_subalias("5", m_CU); - register_subalias("6", m_Q[2]); - register_subalias("7", m_Q[3]); - register_subalias("8", "GND"); - - register_subalias("9", m_D); - register_subalias("10", m_C); - register_subalias("11", m_LOADQ); - register_subalias("12", m_CARRYQ); - register_subalias("13", m_BORROWQ); - register_subalias("14", m_CLEAR); - register_subalias("15", m_A); - register_subalias("16", "VCC"); - } - }; + if (!m_CD() && (m_cnt == 0)) + tBorrow = 0; - NETLIB_RESET(74192) - { - m_cnt = 0; - m_last_CU = 0; - m_last_CD = 0; - } + m_last_CD = m_CD(); + m_last_CU = m_CU(); - // FIXME: Timing - static constexpr const netlist_time delay[4] = - { - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40) - }; + for (std::size_t i=0; i<4; i++) + m_Q[i].push((m_cnt >> i) & 1, delay[i]); - NETLIB_UPDATE(74192) - { - netlist_sig_t tCarry = 1; - netlist_sig_t tBorrow = 1; - if (m_CLEAR()) - { - m_cnt = 0; + m_BORROWQ.push(tBorrow, NLTIME_FROM_NS(20)); //FIXME + m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME } - else if (!m_LOADQ()) + + NETLIB_HANDLERI(sub) { - m_cnt = read_ABCD(); + // FIXME: can use more optimization } - else + + unsigned read_ABCD() const { - if (m_CD() && !m_last_CU && m_CU()) - { - if (++m_cnt > MAXCNT) - m_cnt = 0; - } - if (m_CU() && !m_last_CD && m_CD()) - { - if (m_cnt > 0) - --m_cnt; - else - m_cnt = MAXCNT; - } + return (m_D() << 3) | (m_C() << 2) | (m_B() << 1) | (m_A() << 0); } - if (!m_CU() && (m_cnt == MAXCNT)) - tCarry = 0; - - if (!m_CD() && (m_cnt == 0)) - tBorrow = 0; - - m_last_CD = m_CD(); - m_last_CU = m_CU(); - - for (std::size_t i=0; i<4; i++) - m_Q[i].push((m_cnt >> i) & 1, delay[i]); - - m_BORROWQ.push(tBorrow, NLTIME_FROM_NS(20)); //FIXME - m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME - } + }; NETLIB_DEVICE_IMPL(74192, "TTL_74192", "+A,+B,+C,+D,+CLEAR,+LOADQ,+CU,+CD,@VCC,@GND") - NETLIB_DEVICE_IMPL(74192_dip,"TTL_74192_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74192.h b/src/lib/netlist/devices/nld_74192.h deleted file mode 100644 index 81397f355ae..00000000000 --- a/src/lib/netlist/devices/nld_74192.h +++ /dev/null @@ -1,50 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74192.h - * - * DM74192: Synchronous 4-Bit Binary Counter with Dual Clock - * Decade counter - * - * FIXME: This should be merged with the 74193 which counts to 16 - * - * +--------------+ - * B |1 ++ 16| VCC - * QB |2 15| A - * QA |3 14| CLEAR - * CD |4 74192 13| BORROWQ - * CU |5 12| CARRYQ - * QC |6 11| LOADQ - * QD |7 10| C - * GND |8 9| D - * +--------------+ - * - * CD: Count up - * CU: Count down - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_74192_H_ -#define NLD_74192_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74192(name, cA, cB, cC, cD, cCLEAR, cLOADQ, cCU, cCD) \ - NET_REGISTER_DEV(TTL_74192, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, CLEAR, cCLEAR) \ - NET_CONNECT(name, LOADQ, cLOADQ) \ - NET_CONNECT(name, CU, cCU) \ - NET_CONNECT(name, CD, cCD) - -#define TTL_74192_DIP(name) \ - NET_REGISTER_DEV(TTL_74192_DIP, name) - -#endif /* NLD_74192_H_ */ diff --git a/src/lib/netlist/devices/nld_74193.cpp b/src/lib/netlist/devices/nld_74193.cpp index 5e919a78a9a..fa1a68f56b5 100644 --- a/src/lib/netlist/devices/nld_74193.cpp +++ b/src/lib/netlist/devices/nld_74193.cpp @@ -1,45 +1,118 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_74193.c + * nld_74193.cpp + * + * DM74193: Synchronous 4-Bit Binary Counter with Dual Clock + * + * +--------------+ + * B |1 ++ 16| VCC + * QB |2 15| A + * QA |3 14| CLEAR + * CD |4 74193 13| BORROWQ + * CU |5 12| CARRYQ + * QC |6 11| LOADQ + * QD |7 10| C + * GND |8 9| D + * +--------------+ + * + * CD: Count up + * CU: Count down + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_74193.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { static constexpr const unsigned MAXCNT = 15; + // FIXME: Timing, combine with 74192! + static constexpr const std::array<netlist_time, 4> delay = + { + NLTIME_FROM_NS(40), + NLTIME_FROM_NS(40), + NLTIME_FROM_NS(40), + NLTIME_FROM_NS(40) + }; + + // FIXME: Optimize! + NETLIB_OBJECT(74193) { NETLIB_CONSTRUCTOR(74193) - , m_A(*this, "A") - , m_B(*this, "B") - , m_C(*this, "C") - , m_D(*this, "D") - , m_CLEAR(*this, "CLEAR") - , m_LOADQ(*this, "LOADQ") - , m_CU(*this, "CU") - , m_CD(*this, "CD") + , m_A(*this, "A", NETLIB_DELEGATE(inputs)) + , m_B(*this, "B", NETLIB_DELEGATE(inputs)) + , m_C(*this, "C", NETLIB_DELEGATE(inputs)) + , m_D(*this, "D", NETLIB_DELEGATE(inputs)) + , m_CLEAR(*this, "CLEAR", NETLIB_DELEGATE(inputs)) + , m_LOADQ(*this, "LOADQ", NETLIB_DELEGATE(inputs)) + , m_CU(*this, "CU", NETLIB_DELEGATE(inputs)) + , m_CD(*this, "CD", NETLIB_DELEGATE(inputs)) , m_cnt(*this, "m_cnt", 0) , m_last_CU(*this, "m_last_CU", 0) , m_last_CD(*this, "m_last_CD", 0) - , m_Q(*this, {{"QA", "QB", "QC", "QD"}}) + , m_Q(*this, {"QA", "QB", "QC", "QD"}) , m_BORROWQ(*this, "BORROWQ") , m_CARRYQ(*this, "CARRYQ") , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + private: + NETLIB_RESETI() + { + m_cnt = 0; + m_last_CU = 0; + m_last_CD = 0; + } + + NETLIB_HANDLERI(inputs) + { + netlist_sig_t tCarry = 1; + netlist_sig_t tBorrow = 1; + if (m_CLEAR()) + { + m_cnt = 0; + } + else if (!m_LOADQ()) + { + m_cnt = (m_D() << 3) | (m_C() << 2) + | (m_B() << 1) | (m_A() << 0); + } + else + { + if (m_CD() && !m_last_CU && m_CU()) + { + ++m_cnt &= MAXCNT; + } + if (m_CU() && !m_last_CD && m_CD()) + { + if (m_cnt > 0) + --m_cnt; + else + m_cnt = MAXCNT; + } + } + + if (!m_CU() && (m_cnt == MAXCNT)) + tCarry = 0; + + if (!m_CD() && (m_cnt == 0)) + tBorrow = 0; + + m_last_CD = m_CD(); + m_last_CU = m_CU(); + + for (std::size_t i=0; i<4; i++) + m_Q[i].push((m_cnt >> i) & 1, delay[i]); + + m_BORROWQ.push(tBorrow, NLTIME_FROM_NS(20)); //FIXME timing + m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME timing + } - protected: logic_input_t m_A; logic_input_t m_B; logic_input_t m_C; @@ -59,92 +132,6 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74193_dip, 74193) - { - NETLIB_CONSTRUCTOR_DERIVED(74193_dip, 74193) - { - register_subalias("1", m_B); - register_subalias("2", m_Q[1]); - register_subalias("3", m_Q[0]); - register_subalias("4", m_CD); - register_subalias("5", m_CU); - register_subalias("6", m_Q[2]); - register_subalias("7", m_Q[3]); - register_subalias("8", "GND"); - - register_subalias("9", m_D); - register_subalias("10", m_C); - register_subalias("11", m_LOADQ); - register_subalias("12", m_CARRYQ); - register_subalias("13", m_BORROWQ); - register_subalias("14", m_CLEAR); - register_subalias("15", m_A); - register_subalias("16", "VCC"); - } - }; - - NETLIB_RESET(74193) - { - m_cnt = 0; - m_last_CU = 0; - m_last_CD = 0; - } - - // FIXME: Timing - static constexpr const netlist_time delay[4] = - { - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40), - NLTIME_FROM_NS(40) - }; - - NETLIB_UPDATE(74193) - { - netlist_sig_t tCarry = 1; - netlist_sig_t tBorrow = 1; - if (m_CLEAR()) - { - m_cnt = 0; - } - else if (!m_LOADQ()) - { - m_cnt = (m_D() << 3) | (m_C() << 2) - | (m_B() << 1) | (m_A() << 0); - } - else - { - if (m_CD() && !m_last_CU && m_CU()) - { - ++m_cnt &= MAXCNT; - } - if (m_CU() && !m_last_CD && m_CD()) - { - if (m_cnt > 0) - --m_cnt; - else - m_cnt = MAXCNT; - } - } - - if (!m_CU() && (m_cnt == MAXCNT)) - tCarry = 0; - - if (!m_CD() && (m_cnt == 0)) - tBorrow = 0; - - m_last_CD = m_CD(); - m_last_CU = m_CU(); - - for (std::size_t i=0; i<4; i++) - m_Q[i].push((m_cnt >> i) & 1, delay[i]); - - m_BORROWQ.push(tBorrow, NLTIME_FROM_NS(20)); //FIXME timing - m_CARRYQ.push(tCarry, NLTIME_FROM_NS(20)); //FIXME timing - } - - NETLIB_DEVICE_IMPL(74193, "TTL_74193", "+A,+B,+C,+D,+CLEAR,+LOADQ,+CU,+CD,@VCC,@GND") - NETLIB_DEVICE_IMPL(74193_dip, "TTL_74193_DIP", "") + NETLIB_DEVICE_IMPL(74193, "TTL_74193", "+A,+B,+C,+D,+CLEAR,+LOADQ,+CU,+CD,@VCC,@GND") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74193.h b/src/lib/netlist/devices/nld_74193.h deleted file mode 100644 index 493e6854266..00000000000 --- a/src/lib/netlist/devices/nld_74193.h +++ /dev/null @@ -1,47 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74193.h - * - * DM74193: Synchronous 4-Bit Binary Counter with Dual Clock - * - * +--------------+ - * B |1 ++ 16| VCC - * QB |2 15| A - * QA |3 14| CLEAR - * CD |4 74193 13| BORROWQ - * CU |5 12| CARRYQ - * QC |6 11| LOADQ - * QD |7 10| C - * GND |8 9| D - * +--------------+ - * - * CD: Count up - * CU: Count down - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_74193_H_ -#define NLD_74193_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74193(name, cA, cB, cC, cD, cCLEAR, cLOADQ, cCU, cCD) \ - NET_REGISTER_DEV(TTL_74193, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, CLEAR, cCLEAR) \ - NET_CONNECT(name, LOADQ, cLOADQ) \ - NET_CONNECT(name, CU, cCU) \ - NET_CONNECT(name, CD, cCD) - -#define TTL_74193_DIP(name) \ - NET_REGISTER_DEV(TTL_74193_DIP, name) - -#endif /* NLD_74193_H_ */ diff --git a/src/lib/netlist/devices/nld_74194.cpp b/src/lib/netlist/devices/nld_74194.cpp index f42032ef91b..4f9fbe69940 100644 --- a/src/lib/netlist/devices/nld_74194.cpp +++ b/src/lib/netlist/devices/nld_74194.cpp @@ -3,37 +3,97 @@ /* * nld_74194.cpp * + * 74194: Parallel-Load 8-Bit Shift Register + * + * +--------------+ + * CLRQ |1 ++ 16| VCC + * SRIN |2 15| QA + * A |3 14| QB + * B |4 74194 13| QC + * C |5 12| QD + * D |6 11| CLK + * SLIN |7 10| S1 + * GND |8 9| S0 + * +--------------+ + * + * CLR: Clear + * SRIN: Shift Right Serial Input + * SLIN: Shift Left Serial Input + * CLK: Clock + * */ -#include "nld_74194.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" -namespace netlist -{ - namespace devices - { +namespace netlist::devices { + + // FIXME: Optimize NETLIB_OBJECT(74194) { NETLIB_CONSTRUCTOR(74194) - , m_DATA(*this, {{"D", "C", "B", "A"}}) - , m_SLIN(*this, "SLIN") - , m_SRIN(*this, "SRIN") - , m_CLK(*this, "CLK") - , m_S0(*this, "S0") - , m_S1(*this, "S1") - , m_CLRQ(*this, "CLRQ") - , m_Q(*this, {{"QD", "QC", "QB", "QA"}}) + , m_DATA(*this, {"D", "C", "B", "A"}, NETLIB_DELEGATE(inputs)) + , m_SLIN(*this, "SLIN", NETLIB_DELEGATE(inputs)) + , m_SRIN(*this, "SRIN", NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(inputs)) + , m_S0(*this, "S0", NETLIB_DELEGATE(inputs)) + , m_S1(*this, "S1", NETLIB_DELEGATE(inputs)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(inputs)) + , m_Q(*this, {"QD", "QC", "QB", "QA"}) , m_last_CLK(*this, "m_last_CLK", 0) , m_last_Q(*this, "m_last_Q", 0) , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + private: + NETLIB_RESETI() + { + m_last_CLK = 0; + m_last_Q = 0; + } + + // FIXME: Timing + NETLIB_HANDLERI(inputs) + { + unsigned q = m_last_Q; + + if (!m_CLRQ()) + { + q = 0; + } + else + { + if (!m_last_CLK && m_CLK()) + { + unsigned s = (m_S1() << 1) | m_S0(); + switch (s) + { + case 0: // LL: Keep old value + break; + case 1: // LH: Shift right + q >>= 1; + q |= m_SRIN() ? 8 : 0; + break; + case 2: + q <<= 1; + q |= m_SLIN() ? 1 : 0; + break; + case 3: + q = 0; + for (std::size_t i=0; i<4; i++) + q |= m_DATA[i]() << i; + break; + } + } + } + + m_last_Q = q; + m_last_CLK = m_CLK(); + + for (std::size_t i=0; i<4; i++) + m_Q[i].push((q >> i) & 1, NLTIME_FROM_NS(26)); // FIXME: Timing + } - protected: object_array_t<logic_input_t, 4> m_DATA; logic_input_t m_SLIN; logic_input_t m_SRIN; @@ -48,81 +108,6 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74194_dip, 74194) - { - NETLIB_CONSTRUCTOR_DERIVED(74194_dip, 74194) - { - register_subalias("1", m_CLRQ); - register_subalias("2", m_SRIN); - register_subalias("3", m_DATA[3]); - register_subalias("4", m_DATA[2]); - register_subalias("5", m_DATA[1]); - register_subalias("6", m_DATA[0]); - register_subalias("7", m_SLIN); - register_subalias("8", "GND"); - - register_subalias("9", m_S0); - register_subalias("10", m_S1); - register_subalias("11", m_CLK); - register_subalias("12", m_Q[0]); - register_subalias("13", m_Q[1]); - register_subalias("14", m_Q[2]); - register_subalias("15", m_Q[3]); - register_subalias("16", "VCC"); - - } - }; - - NETLIB_RESET(74194) - { - m_last_CLK = 0; - m_last_Q = 0; - } - - // FIXME: Timing - NETLIB_UPDATE(74194) - { - unsigned q = m_last_Q; - - if (!m_CLRQ()) - { - q = 0; - } - else - { - if (!m_last_CLK && m_CLK()) - { - unsigned s = (m_S1() << 1) | m_S0(); - switch (s) - { - case 0: // LL: Keep old value - break; - case 1: // LH: Shift right - q >>= 1; - q |= m_SRIN() ? 8 : 0; - break; - case 2: - q <<= 1; - q |= m_SLIN() ? 1 : 0; - break; - case 3: - q = 0; - for (std::size_t i=0; i<4; i++) - q |= m_DATA[i]() << i; - break; - } - } - } - - m_last_Q = q; - m_last_CLK = m_CLK(); - - for (std::size_t i=0; i<4; i++) - m_Q[i].push((q >> i) & 1, NLTIME_FROM_NS(26)); // FIXME: Timing - } - NETLIB_DEVICE_IMPL(74194, "TTL_74194", "+CLK,+S0,+S1,+SRIN,+A,+B,+C,+D,+SLIN,+CLRQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(74194_dip, "TTL_74194_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74194.h b/src/lib/netlist/devices/nld_74194.h deleted file mode 100644 index 2432a6ece97..00000000000 --- a/src/lib/netlist/devices/nld_74194.h +++ /dev/null @@ -1,49 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_74194.h - * - * 74194: Parallel-Load 8-Bit Shift Register - * - * +--------------+ - * CLRQ |1 ++ 16| VCC - * SRIN |2 15| QA - * A |3 14| QB - * B |4 74194 13| QC - * C |5 12| QD - * D |6 11| CLK - * SLIN |7 10| S1 - * GND |8 9| S0 - * +--------------+ - * - * CLR: Clear - * SRIN: Shift Right Serial Input - * SLIN: Shift Left Serial Input - * CLK: Clock - * - */ - -#ifndef NLD_74194_H_ -#define NLD_74194_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74194(name, cCLK, cS0, cS1, cSRIN, cA, cB, cC, cD, cSLIN, cCLRQ) \ - NET_REGISTER_DEV(TTL_74194, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, S0, cS0) \ - NET_CONNECT(name, S1, cS1) \ - NET_CONNECT(name, SRIN, cSRIN) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, SLIN, cSLIN) \ - NET_CONNECT(name, CLRQ, cCLRQ) - -#define TTL_74194_DIP(name) \ - NET_REGISTER_DEV(TTL_74194_DIP, name) - -#endif /* NLD_74194_H_ */ diff --git a/src/lib/netlist/devices/nld_74365.cpp b/src/lib/netlist/devices/nld_74365.cpp index 85271d7861b..2cc582fbc8a 100644 --- a/src/lib/netlist/devices/nld_74365.cpp +++ b/src/lib/netlist/devices/nld_74365.cpp @@ -3,16 +3,28 @@ /* * nld_74365.cpp * + * SN74365: Hex Bus Driver with 3-State Outputs + * + * +--------------+ + * G1Q |1 ++ 16| VCC + * A1 |2 15| G2Q + * Y1 |3 14| A6 + * A2 |4 74365 13| Y6 + * Y2 |5 12| A5 + * A3 |6 11| Y5 + * Y3 |7 10| A4 + * GND |8 9| Y4 + * +--------------+ + * + * Naming conventions follow Texas Instruments datasheet + * + * Note: Currently the netlist system does not support proper tristate output, so this + * is not a "real" bus driver, it simply outputs 0 if the chip is not enabled. */ -#include "nld_74365.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" -namespace netlist -{ - namespace devices - { +namespace netlist::devices { /* FIXME: This should be a single device, i.e. one tristate buffer only. * @@ -24,17 +36,29 @@ namespace netlist NETLIB_OBJECT(74365) { NETLIB_CONSTRUCTOR(74365) - , m_G1Q(*this, "G1Q") - , m_G2Q(*this, "G2Q") - , m_A(*this, {{ "A1", "A2", "A3", "A4", "A5", "A6" }}) - , m_Y(*this, {{ "Y1", "Y2", "Y3", "Y4", "Y5", "Y6" }}) + , m_G1Q(*this, "G1Q", NETLIB_DELEGATE(inputs)) + , m_G2Q(*this, "G2Q", NETLIB_DELEGATE(inputs)) + , m_A(*this, { "A1", "A2", "A3", "A4", "A5", "A6" }, NETLIB_DELEGATE(inputs)) + , m_Y(*this, { "Y1", "Y2", "Y3", "Y4", "Y5", "Y6" }) , m_power_pins(*this) { } - NETLIB_UPDATEI(); + private: + NETLIB_HANDLERI(inputs) + { + if (!m_G1Q() && !m_G2Q()) + { + for (std::size_t i=0; i<6; i++) + m_Y[i].push(m_A[i](), NLTIME_FROM_NS(20)); // FIXME: Correct timing + } + else + { + for (std::size_t i=0; i<6; i++) + m_Y[i].push(0, NLTIME_FROM_NS(20)); // FIXME: Correct timing + } + } - protected: logic_input_t m_G1Q; logic_input_t m_G2Q; object_array_t<logic_input_t, 6> m_A; @@ -42,47 +66,6 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(74365_dip, 74365) - { - NETLIB_CONSTRUCTOR_DERIVED(74365_dip, 74365) - { - register_subalias("1", m_G1Q); - register_subalias("2", m_A[0]); - register_subalias("3", m_Y[0]); - register_subalias("4", m_A[1]); - register_subalias("5", m_Y[1]); - register_subalias("6", m_A[2]); - register_subalias("7", m_Y[2]); - register_subalias("8", "GND"); - - register_subalias("9", m_A[3]); - register_subalias("10", m_Y[3]); - register_subalias("11", m_A[4]); - register_subalias("12", m_Y[4]); - register_subalias("13", m_A[5]); - register_subalias("14", m_Y[5]); - register_subalias("15", m_G2Q); - register_subalias("16", "VCC"); - - } - }; - - NETLIB_UPDATE(74365) - { - if (!m_G1Q() && !m_G2Q()) - { - for (std::size_t i=0; i<6; i++) - m_Y[i].push(m_A[i](), NLTIME_FROM_NS(20)); // FIXME: Correct timing - } - else - { - for (std::size_t i=0; i<6; i++) - m_Y[i].push(0, NLTIME_FROM_NS(20)); // FIXME: Correct timing - } - } - NETLIB_DEVICE_IMPL(74365, "TTL_74365", "+G1Q,+G2Q,+A1,+A2,+A3,+A4,+A5,+A6,@VCC,@GND") - NETLIB_DEVICE_IMPL(74365_dip, "TTL_74365_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74365.h b/src/lib/netlist/devices/nld_74365.h deleted file mode 100644 index 1aeeddaff8d..00000000000 --- a/src/lib/netlist/devices/nld_74365.h +++ /dev/null @@ -1,46 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_74365.h - * - * SN74365: Hex Bus Driver with 3-State Outputs - * - * +--------------+ - * G1Q |1 ++ 16| VCC - * A1 |2 15| G2Q - * Y1 |3 14| A6 - * A2 |4 74365 13| Y6 - * Y2 |5 12| A5 - * A3 |6 11| Y5 - * Y3 |7 10| A4 - * GND |8 9| Y4 - * +--------------+ - * - * Naming conventions follow Texas Instruments datasheet - * - * Note: Currently the netlist system does not support proper tristate output, so this - * is not a "real" bus driver, it simply outputs 0 if the chip is not enabled. - */ - -#ifndef NLD_74365_H_ -#define NLD_74365_H_ - -#include "netlist/nl_setup.h" - -#define TTL_74365(name, cG1Q, cG2Q, cA1, cA2, cA3, cA4, cA5, cA6) \ - NET_REGISTER_DEV(TTL_74365, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, G1Q, cG1Q) \ - NET_CONNECT(name, G2Q, cG2Q) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, A5, cA5) \ - NET_CONNECT(name, A6, cA6) - -#define TTL_74365_DIP(name) \ - NET_REGISTER_DEV(TTL_74365_DIP, name) - -#endif /* NLD_74365_H_ */ diff --git a/src/lib/netlist/devices/nld_74377.cpp b/src/lib/netlist/devices/nld_74377.cpp new file mode 100644 index 00000000000..83da292737f --- /dev/null +++ b/src/lib/netlist/devices/nld_74377.cpp @@ -0,0 +1,101 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_74377.cpp + * + * DM74377: Octal D Flip-Flop With Enable + * + * +--------------+ + * /E |1 ++ 20| VCC + * Q0 |2 19| Q7 + * D0 |3 18| D7 + * D1 |4 74377 17| D6 + * Q1 |5 16| Q6 + * Q2 |6 15| Q5 + * D2 |7 14| D5 + * D3 |8 13| D4 + * Q3 |9 12| Q4 + * GND |10 11| CP + * +--------------+ + * + * DM74378: Hex D Flip-Flop With Enable + * + * +--------------+ + * /E |1 ++ 16| VCC + * Q0 |2 15| Q5 + * D0 |3 14| D5 + * D1 |4 74378 13| D4 + * Q1 |5 12| Q4 + * D2 |6 11| D3 + * Q2 |7 10| Q3 + * GND |8 9| CP + * +--------------+ + * + * DM74379: 4-bit D Flip-Flop With Enable + * + * +--------------+ + * /E |1 ++ 16| VCC + * Q0 |2 15| Q3 + * /Q0 |3 14| /Q3 + * D0 |4 74379 13| D3 + * D1 |5 12| D2 + * /Q1 |6 11| /Q2 + * Q1 |7 10| Q2 + * GND |8 9| CP + * +--------------+ + * + * Naming conventions follow Motorola datasheet + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(25), NLTIME_FROM_NS(25) }; + + NETLIB_OBJECT(74377_GATE) + { + NETLIB_CONSTRUCTOR(74377_GATE) + , m_E(*this, "E", NETLIB_DELEGATE(inputs)) + , m_D(*this, "D", NETLIB_DELEGATE(inputs)) + , m_CP(*this, "CP", NETLIB_DELEGATE(inputs)) + , m_Q(*this, "Q") + , m_QQ(*this, "QQ") + , m_cp(*this, "m_cp", 0) + , m_power_pins(*this) + { + } + + NETLIB_RESETI() + { + } + + private: + NETLIB_HANDLERI(inputs) + { + netlist_sig_t last_cp = m_cp; + + m_cp = m_CP(); + + if (!m_E() && !last_cp && m_cp) + { + netlist_sig_t d = m_D(); + m_Q.push(d, delay[d]); + m_QQ.push(d ^ 1, delay[d ^ 1]); + } + } + + logic_input_t m_E; + logic_input_t m_D; + logic_input_t m_CP; + logic_output_t m_Q; + logic_output_t m_QQ; + + state_var_sig m_cp; + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(74377_GATE, "TTL_74377_GATE", "") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74393.cpp b/src/lib/netlist/devices/nld_74393.cpp new file mode 100644 index 00000000000..4f8eac01634 --- /dev/null +++ b/src/lib/netlist/devices/nld_74393.cpp @@ -0,0 +1,88 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_74393.cpp + * + * DM74393: Dual 4-Stage Binary Counter + * + * +--------------+ + * /CP |1 ++ 14| VCC + * MR |2 13| /CP + * Q0 |3 12| MR + * Q1 |4 74393 11| Q0 + * Q2 |5 10| Q1 + * Q3 |6 9| Q2 + * GND |7 8| Q3 + * +--------------+ + * + * Naming conventions follow Motorola datasheet + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + static constexpr const unsigned MAXCNT = 15; + + NETLIB_OBJECT(74393) + { + NETLIB_CONSTRUCTOR(74393) + , m_CP(*this, "CP", NETLIB_DELEGATE(cp)) + , m_MR(*this, "MR", NETLIB_DELEGATE(mr)) + , m_Q(*this, {"Q0", "Q1", "Q2", "Q3"}) + , m_cnt(*this, "m_cnt", 0) + , m_cp(*this, "m_cp", 0) + , m_mr(*this, "m_mr", 0) + , m_power_pins(*this) + { + } + + private: + NETLIB_RESETI() + { + m_CP.set_state(logic_t::STATE_INP_HL); + m_cnt = 0; + } + + NETLIB_HANDLERI(mr) + { + if (!m_MR()) + { + m_CP.activate_hl(); + } + else + { + m_CP.inactivate(); + if (m_cnt != 0) + { + m_cnt = 0; + m_Q.push(0, NLTIME_FROM_NS(24)); + } + } + } + + NETLIB_HANDLERI(cp) + { + auto cnt = (m_cnt + 1) & MAXCNT; + m_cnt = cnt; + m_Q[0].push((cnt >> 0) & 1, NLTIME_FROM_NS(13)); + m_Q[1].push((cnt >> 1) & 1, NLTIME_FROM_NS(22)); + m_Q[2].push((cnt >> 2) & 1, NLTIME_FROM_NS(31)); + m_Q[3].push((cnt >> 3) & 1, NLTIME_FROM_NS(40)); + } + + logic_input_t m_CP; + logic_input_t m_MR; + object_array_t<logic_output_t, 4> m_Q; + + state_var<unsigned> m_cnt; + state_var_sig m_cp; + state_var_sig m_mr; + + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(74393, "TTL_74393", "+CP,+MR,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7448.cpp b/src/lib/netlist/devices/nld_7448.cpp index 23daf983174..c49038aca8e 100644 --- a/src/lib/netlist/devices/nld_7448.cpp +++ b/src/lib/netlist/devices/nld_7448.cpp @@ -1,42 +1,98 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_7448.c + * nld_7448.cpp + * + * DM7448: BCD to 7-Segment decoders/drivers + * + * +--------------+ + * B |1 ++ 16| VCC + * C |2 15| f + * LAMP TEST |3 14| g + * BI/RBQ |4 7448 13| a + * RBI |5 12| b + * D |6 11| c + * A |7 10| d + * GND |8 9| e + * +--------------+ + * + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_7448.h" -#include "nlid_system.h" -#include "nlid_truthtable.h" +#include "nl_base.h" +#include "nl_factory.h" #include <array> -namespace netlist -{ - namespace devices - { - #if !(USE_TRUTHTABLE_7448) +namespace netlist::devices { + NETLIB_OBJECT(7448) { NETLIB_CONSTRUCTOR(7448) - , m_A(*this, "A") - , m_B(*this, "B") - , m_C(*this, "C") - , m_D(*this, "D") - , m_LTQ(*this, "LTQ") - , m_BIQ(*this, "BIQ") - , m_RBIQ(*this, "RBIQ") + , m_A(*this, "A", NETLIB_DELEGATE(inputs)) + , m_B(*this, "B", NETLIB_DELEGATE(inputs)) + , m_C(*this, "C", NETLIB_DELEGATE(inputs)) + , m_D(*this, "D", NETLIB_DELEGATE(inputs)) + , m_LTQ(*this, "LTQ", NETLIB_DELEGATE(inputs)) + , m_BIQ(*this, "BIQ", NETLIB_DELEGATE(inputs)) + , m_RBIQ(*this, "RBIQ", NETLIB_DELEGATE(inputs)) , m_state(*this, "m_state", 0) - , m_Q(*this, {{"a", "b", "c", "d", "e", "f", "g"}}) + , m_Q(*this, {"a", "b", "c", "d", "e", "f", "g"}) , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + m_state = 0; + } - public: - void update_outputs(unsigned v); + private: + void update_outputs(unsigned v) noexcept + { + gsl_Expects(v<16); + if (v != m_state) + { + // max transfer time is 100 NS */ + + uint8_t t = tab7448[v]; + for (std::size_t i = 0; i < 7; i++) + m_Q[i].push((t >> (6-i)) & 1, NLTIME_FROM_NS(100)); + m_state = v; + } + } + + NETLIB_HANDLERI(inputs) + { + if (!m_BIQ() || (m_BIQ() && !m_LTQ())) + { + m_A.inactivate(); + m_B.inactivate(); + m_C.inactivate(); + m_D.inactivate(); + m_RBIQ.inactivate(); + if (m_BIQ() && !m_LTQ()) + { + update_outputs(8); + } + else if (!m_BIQ()) + { + update_outputs(15); + } + } else { + m_RBIQ.activate(); + m_D.activate(); + m_C.activate(); + m_B.activate(); + m_A.activate(); + unsigned v = (m_A() << 0) | (m_B() << 1) | (m_C() << 2) | (m_D() << 3); + if ((!m_RBIQ() && (v==0))) + v = 15; + update_outputs(v); + } + } logic_input_t m_A; logic_input_t m_B; @@ -51,39 +107,12 @@ namespace netlist object_array_t<logic_output_t, 7> m_Q; /* a .. g */ nld_power_pins m_power_pins; + static const std::array<uint8_t, 16> tab7448; }; - NETLIB_OBJECT_DERIVED(7448_dip, 7448) - { - NETLIB_CONSTRUCTOR_DERIVED(7448_dip, 7448) - { - register_subalias("1", m_B); - register_subalias("2", m_C); - register_subalias("3", m_LTQ); - register_subalias("4", m_BIQ); - register_subalias("5", m_RBIQ); - register_subalias("6", m_D); - register_subalias("7", m_A); - register_subalias("8", "GND"); - - register_subalias("9", m_Q[4]); // e - register_subalias("10", m_Q[3]); // d - register_subalias("11", m_Q[2]); // c - register_subalias("12", m_Q[1]); // b - register_subalias("13", m_Q[0]); // a - register_subalias("14", m_Q[6]); // g - register_subalias("15", m_Q[5]); // f - register_subalias("16", "VCC"); - } - }; - #endif - - - #if !(USE_TRUTHTABLE_7448) - #define BITS7(b6,b5,b4,b3,b2,b1,b0) ((b6)<<6) | ((b5)<<5) | ((b4)<<4) | ((b3)<<3) | ((b2)<<2) | ((b1)<<1) | ((b0)<<0) - static constexpr const std::array<uint8_t, 16> tab7448 = + const std::array<uint8_t, 16> NETLIB_NAME(7448)::tab7448 = { BITS7( 1, 1, 1, 1, 1, 1, 0 ), /* 00 - not blanked ! */ BITS7( 0, 1, 1, 0, 0, 0, 0 ), /* 01 */ @@ -103,67 +132,6 @@ namespace netlist BITS7( 0, 0, 0, 0, 0, 0, 0 ), /* 15 */ }; - NETLIB_UPDATE(7448) - { - if (!m_BIQ() || (m_BIQ() && !m_LTQ())) - { - m_A.inactivate(); - m_B.inactivate(); - m_C.inactivate(); - m_D.inactivate(); - m_RBIQ.inactivate(); - if (m_BIQ() && !m_LTQ()) - { - update_outputs(8); - } - else if (!m_BIQ()) - { - update_outputs(15); - } - } else { - m_RBIQ.activate(); - m_D.activate(); - m_C.activate(); - m_B.activate(); - m_A.activate(); - unsigned v = (m_A() << 0) | (m_B() << 1) | (m_C() << 2) | (m_D() << 3); - if ((!m_RBIQ() && (v==0))) - v = 15; - update_outputs(v); - } - } - - NETLIB_RESET(7448) - { - m_state = 0; -#if 0 - m_A.set_state(logic_t::STATE_INP_PASSIVE); - m_B.set_state(logic_t::STATE_INP_PASSIVE); - m_C.set_state(logic_t::STATE_INP_PASSIVE); - m_D.set_state(logic_t::STATE_INP_PASSIVE); - m_RBIQ.set_state(logic_t::STATE_INP_PASSIVE); -#endif - } - - NETLIB_FUNC_VOID(7448, update_outputs, (unsigned v)) - { - nl_assert(v<16); - if (v != m_state) - { - // max transfer time is 100 NS */ - - uint8_t t = tab7448[v]; - for (std::size_t i = 0; i < 7; i++) - m_Q[i].push((t >> (6-i)) & 1, NLTIME_FROM_NS(100)); - m_state = v; - } - } - NETLIB_DEVICE_IMPL(7448, "TTL_7448", "+A,+B,+C,+D,+LTQ,+BIQ,+RBIQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(7448_dip, "TTL_7448_DIP", "") - - #endif - - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7448.h b/src/lib/netlist/devices/nld_7448.h deleted file mode 100644 index 55ebfd8d6e4..00000000000 --- a/src/lib/netlist/devices/nld_7448.h +++ /dev/null @@ -1,49 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_7448.h - * - * DM7448: BCD to 7-Segment decoders/drivers - * - * +--------------+ - * B |1 ++ 16| VCC - * C |2 15| f - * LAMP TEST |3 14| g - * BI/RBQ |4 7448 13| a - * RBI |5 12| b - * D |6 11| c - * A |7 10| d - * GND |8 9| e - * +--------------+ - * - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_7448_H_ -#define NLD_7448_H_ - -#include "netlist/nl_setup.h" - -#ifndef NL_AUTO_DEVICES -#if !(USE_TRUTHTABLE_7448) -#define TTL_7448(name, cA0, cA1, cA2, cA3, cLTQ, cBIQ, cRBIQ) \ - NET_REGISTER_DEV(TTL_7448, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA0) \ - NET_CONNECT(name, B, cA1) \ - NET_CONNECT(name, C, cA2) \ - NET_CONNECT(name, D, cA3) \ - NET_CONNECT(name, LTQ, cLTQ) \ - NET_CONNECT(name, BIQ, cBIQ) \ - NET_CONNECT(name, RBIQ, cRBIQ) - -#define TTL_7448_DIP(name) \ - NET_REGISTER_DEV(TTL_7448_DIP, name) - -#endif -#endif - -#endif /* NLD_7448_H_ */ diff --git a/src/lib/netlist/devices/nld_7450.cpp b/src/lib/netlist/devices/nld_7450.cpp index 818dad40853..df420de69ea 100644 --- a/src/lib/netlist/devices/nld_7450.cpp +++ b/src/lib/netlist/devices/nld_7450.cpp @@ -1,111 +1,90 @@ - // license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_7450.c + * nld_7450.cpp + * + * DM7450: DUAL 2-WIDE 2-INPUT AND-OR-INVERT GATES (ONE GATE EXPANDABLE) + * + * +--------------+ + * 1A |1 ++ 14| VCC + * 2A |2 13| 1B + * 2B |3 12| 1XQ + * 2C |4 7450 11| 1X + * 2D |5 10| 1D + * 2Y |6 9| 1C + * GND |7 8| 1Y + * +--------------+ + * _________________ + * Y = (A & B) | (C & D) + * + * Naming conventions follow Texas Instruments datasheet * */ -#include "nld_7450.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { + + static constexpr const std::array<netlist_time, 2> times = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; + + // FIXME: timing, see 74107 for example, use template -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(7450) { NETLIB_CONSTRUCTOR(7450) - , m_A(*this, "A") - , m_B(*this, "B") - , m_C(*this, "C") - , m_D(*this, "D") + , m_A(*this, "A", NETLIB_DELEGATE(inputs)) + , m_B(*this, "B", NETLIB_DELEGATE(inputs)) + , m_C(*this, "C", NETLIB_DELEGATE(inputs)) + , m_D(*this, "D", NETLIB_DELEGATE(inputs)) , m_Q(*this, "Q") , m_power_pins(*this) { } - //NETLIB_RESETI(); - NETLIB_UPDATEI(); - - public: - logic_input_t m_A; - logic_input_t m_B; - logic_input_t m_C; - logic_input_t m_D; - logic_output_t m_Q; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT(7450_dip) - { - NETLIB_CONSTRUCTOR(7450_dip) - , m_A(*this, "A") - , m_B(*this, "B") - { - register_subalias("1", m_A.m_A); - register_subalias("2", m_B.m_A); - register_subalias("3", m_B.m_B); - register_subalias("4", m_B.m_C); - register_subalias("5", m_B.m_D); - register_subalias("6", m_B.m_Q); - register_subalias("7", "A.GND"); - - register_subalias("8", m_A.m_Q); - register_subalias("9", m_A.m_C); - register_subalias("10", m_A.m_D); - //register_subalias("11", m_1.m_X1); - //register_subalias("12", m_1.m_X1Q); - register_subalias("13", m_A.m_B); - register_subalias("14", "A.VCC"); - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); - - } //NETLIB_RESETI(); - //NETLIB_UPDATEI(); - - NETLIB_SUB(7450) m_A; - NETLIB_SUB(7450) m_B; - }; - - NETLIB_UPDATE(7450) - { - m_A.activate(); - m_B.activate(); - m_C.activate(); - m_D.activate(); - auto t1 = m_A() & m_B(); - auto t2 = m_C() & m_D(); - - const netlist_time times[2] = { NLTIME_FROM_NS(15), NLTIME_FROM_NS(22) }; - uint_fast8_t res = 0; - if (t1 ^ 1) + private: + NETLIB_HANDLERI(inputs) { - if (t2 ^ 1) + m_A.activate(); + m_B.activate(); + m_C.activate(); + m_D.activate(); + auto t1 = m_A() & m_B(); + auto t2 = m_C() & m_D(); + + uint_fast8_t res = 0; + if (t1 ^ 1) { - res = 1; + if (t2 ^ 1) + { + res = 1; + } + else + { + m_A.inactivate(); + m_B.inactivate(); + } } else { - m_A.inactivate(); - m_B.inactivate(); - } - } - else - { - if (t2 ^ 1) - { - m_C.inactivate(); - m_D.inactivate(); + if (t2 ^ 1) + { + m_C.inactivate(); + m_D.inactivate(); + } } + m_Q.push(res, times[res]);// ? 22000 : 15000); } - m_Q.push(res, times[res]);// ? 22000 : 15000); - } + + logic_input_t m_A; + logic_input_t m_B; + logic_input_t m_C; + logic_input_t m_D; + logic_output_t m_Q; + nld_power_pins m_power_pins; + }; NETLIB_DEVICE_IMPL(7450, "TTL_7450_ANDORINVERT", "+A,+B,+C,+D,@VCC,@GND") - NETLIB_DEVICE_IMPL(7450_dip, "TTL_7450_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7450.h b/src/lib/netlist/devices/nld_7450.h deleted file mode 100644 index 431eaaaa65d..00000000000 --- a/src/lib/netlist/devices/nld_7450.h +++ /dev/null @@ -1,41 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_7450.h - * - * DM7450: DUAL 2-WIDE 2-INPUT AND-OR-INVERT GATES (ONE GATE EXPANDABLE) - * - * +--------------+ - * 1A |1 ++ 14| VCC - * 2A |2 13| 1B - * 2B |3 12| 1XQ - * 2C |4 7450 11| 1X - * 2D |5 10| 1D - * 2Y |6 9| 1C - * GND |7 8| 1Y - * +--------------+ - * _________________ - * Y = (A & B) | (C & D) - * - * Naming conventions follow Texas Instruments datasheet - * - */ - -#ifndef NLD_7450_H_ -#define NLD_7450_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7450_ANDORINVERT(name, cI1, cI2, cI3, cI4) \ - NET_REGISTER_DEV(TTL_7450_ANDORINVERT, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) \ - NET_CONNECT(name, C, cI3) \ - NET_CONNECT(name, D, cI4) - -#define TTL_7450_DIP(name) \ - NET_REGISTER_DEV(TTL_7450_DIP, name) - -#endif /* NLD_7450_H_ */ diff --git a/src/lib/netlist/devices/nld_7473.cpp b/src/lib/netlist/devices/nld_7473.cpp index 5c75115c970..d5b859859a4 100644 --- a/src/lib/netlist/devices/nld_7473.cpp +++ b/src/lib/netlist/devices/nld_7473.cpp @@ -1,25 +1,73 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_7473.c + * nld_7473.cpp + * + * 7473: Dual Master-Slave J-K Flip-Flops with Clear and Complementary Outputs + * 7473A: Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flops with Clear and Complementary Outputs + * + * +----------+ + * 1CLK |1 ++ 14| 1J + * 1CLRQ |2 13| 1QQ + * 1K |3 12| 1Q + * VCC |4 7473 11| GND + * 2CLK |5 10| 2K + * 2CLRQ |6 9| 2Q + * 2J |7 8| 2QQ + * +----------+ + * + * + * Function table 73 + * + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | * | 0 | 0 || Q0| Q0Q | + * | 1 | * | 1 | 0 || 1 | 0 | + * | 1 | * | 0 | 1 || 0 | 1 | + * | 1 | * | 1 | 1 || TOGGLE | + * +-----+-----+-----+---++---+-----+ + * _ + * * = _| |_ + * + * This is positive triggered, J and K + * are latched during clock high and + * transferred when CLK falls. + * + * Function table 73A + * + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | F | 0 | 0 || Q0| Q0Q | + * | 1 | F | 1 | 0 || 1 | 0 | + * | 1 | F | 0 | 1 || 0 | 1 | + * | 1 | F | 1 | 1 || TOGGLE | + * | 1 | 1 | X | X || Q0| Q0Q | + * +-----+-----+-----+---++---+-----+ + * + * THe 73A is negative triggered. + * + * Naming conventions follow Texas instruments datasheet + * + * FIXME: Currently, only the 73 is implemented. + * The 73A uses the same model. * */ -#include "nld_7473.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(7473) { NETLIB_CONSTRUCTOR(7473) - , m_CLK(*this, "CLK") - , m_J(*this, "J") - , m_K(*this, "K") - , m_CLRQ(*this, "CLRQ") + , m_CLK(*this, "CLK", NETLIB_DELEGATE(inputs)) + , m_J(*this, "J", NETLIB_DELEGATE(inputs)) + , m_K(*this, "K", NETLIB_DELEGATE(inputs)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(inputs)) , m_last_CLK(*this, "m_last_CLK", 0) , m_q(*this, "m_q", 0) , m_Q(*this, "Q") @@ -28,10 +76,44 @@ namespace netlist { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + private: + NETLIB_RESETI() + { + m_last_CLK = 0; + } + + NETLIB_HANDLERI(inputs) + { + const auto JK = (m_J() << 1) | m_K(); + + if (m_CLRQ()) + { + if (!m_CLK() && m_last_CLK) + { + switch (JK) + { + case 1: // (!m_J) & m_K)) + m_q = 0; + break; + case 2: // (m_J) & !m_K)) + m_q = 1; + break; + case 3: // (m_J) & m_K)) + m_q ^= 1; + break; + default: + case 0: + break; + } + } + } + + m_last_CLK = m_CLK(); + + m_Q.push(m_q, NLTIME_FROM_NS(20)); // FIXME: timing + m_QQ.push(m_q ^ 1, NLTIME_FROM_NS(20)); // FIXME: timing + } - public: logic_input_t m_CLK; logic_input_t m_J; logic_input_t m_K; @@ -45,116 +127,9 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7473A, 7473) - { - public: - NETLIB_CONSTRUCTOR_DERIVED(7473A, 7473) { } - - }; - - NETLIB_OBJECT(7473_dip) - { - NETLIB_CONSTRUCTOR(7473_dip) - , m_A(*this, "A") - , m_B(*this, "B") - { - register_subalias("1", m_A.m_CLK); - register_subalias("2", m_A.m_CLRQ); - register_subalias("3", m_A.m_K); - register_subalias("4", "A.VCC"); - register_subalias("5", m_B.m_CLK); - register_subalias("6", m_B.m_CLRQ); - register_subalias("7", m_B.m_J); - - register_subalias("8", m_B.m_QQ); - register_subalias("9", m_B.m_Q); - register_subalias("10", m_B.m_K); - register_subalias("11", "A.GND"); - register_subalias("12", m_B.m_Q); - register_subalias("13", m_A.m_QQ); - register_subalias("14", m_A.m_J); - - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); - } - - private: - NETLIB_SUB(7473) m_A; - NETLIB_SUB(7473) m_B; - }; - - NETLIB_OBJECT(7473A_dip) - { - NETLIB_CONSTRUCTOR(7473A_dip) - , m_A(*this, "A") - , m_B(*this, "B") - { - register_subalias("1", m_A.m_CLK); - register_subalias("2", m_A.m_CLRQ); - register_subalias("3", m_A.m_K); - register_subalias("4", "A.VCC"); - register_subalias("5", m_B.m_CLK); - register_subalias("6", m_B.m_CLRQ); - register_subalias("7", m_B.m_J); - - register_subalias("8", m_B.m_QQ); - register_subalias("9", m_B.m_Q); - register_subalias("10", m_B.m_K); - register_subalias("11", "A.GND"); - register_subalias("12", m_B.m_Q); - register_subalias("13", m_A.m_QQ); - register_subalias("14", m_A.m_J); - - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); - } - - private: - NETLIB_SUB(7473A) m_A; - NETLIB_SUB(7473A) m_B; - }; - - NETLIB_RESET(7473) - { - m_last_CLK = 0; - } - - NETLIB_UPDATE(7473) - { - const auto JK = (m_J() << 1) | m_K(); - - if (m_CLRQ()) - { - if (!m_CLK() && m_last_CLK) - { - switch (JK) - { - case 1: // (!m_J) & m_K)) - m_q = 0; - break; - case 2: // (m_J) & !m_K)) - m_q = 1; - break; - case 3: // (m_J) & m_K)) - m_q ^= 1; - break; - default: - case 0: - break; - } - } - } - - m_last_CLK = m_CLK(); - - m_Q.push(m_q, NLTIME_FROM_NS(20)); // FIXME: timing - m_QQ.push(m_q ^ 1, NLTIME_FROM_NS(20)); // FIXME: timing - } + using NETLIB_NAME(7473A) = NETLIB_NAME(7473); NETLIB_DEVICE_IMPL(7473, "TTL_7473", "+CLK,+J,+K,+CLRQ,@VCC,@GND") NETLIB_DEVICE_IMPL(7473A, "TTL_7473A", "+CLK,+J,+K,+CLRQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(7473_dip, "TTL_7473_DIP", "") - NETLIB_DEVICE_IMPL(7473A_dip, "TTL_7473A_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7473.h b/src/lib/netlist/devices/nld_7473.h deleted file mode 100644 index e0dc8bdb428..00000000000 --- a/src/lib/netlist/devices/nld_7473.h +++ /dev/null @@ -1,84 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_7473.h - * - * 7473: Dual Master-Slave J-K Flip-Flops with Clear and Complementary Outputs - * 7473A: Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flops with Clear and Complementary Outputs - * - * +----------+ - * 1CLK |1 ++ 14| 1J - * 1CLRQ |2 13| 1QQ - * 1K |3 12| 1Q - * VCC |4 7473 11| GND - * 2CLK |5 10| 2K - * 2CLRQ |6 9| 2Q - * 2J |7 8| 2QQ - * +----------+ - * - * - * Function table 73 - * - * +-----+-----+-----+---++---+-----+ - * | CLRQ| CLK | J | K || Q | QQ | - * +=====+=====+=====+===++===+=====+ - * | 0 | X | X | X || 0 | 1 | - * | 1 | * | 0 | 0 || Q0| Q0Q | - * | 1 | * | 1 | 0 || 1 | 0 | - * | 1 | * | 0 | 1 || 0 | 1 | - * | 1 | * | 1 | 1 || TOGGLE | - * +-----+-----+-----+---++---+-----+ - * _ - * * = _| |_ - * - * This is positive triggered, J and K - * are latched during clock high and - * transferred when CLK falls. - * - * Function table 73A - * - * +-----+-----+-----+---++---+-----+ - * | CLRQ| CLK | J | K || Q | QQ | - * +=====+=====+=====+===++===+=====+ - * | 0 | X | X | X || 0 | 1 | - * | 1 | F | 0 | 0 || Q0| Q0Q | - * | 1 | F | 1 | 0 || 1 | 0 | - * | 1 | F | 0 | 1 || 0 | 1 | - * | 1 | F | 1 | 1 || TOGGLE | - * | 1 | 1 | X | X || Q0| Q0Q | - * +-----+-----+-----+---++---+-----+ - * - * THe 73A is negative triggered. - * - * Naming conventions follow Texas instruments datasheet - * - * FIXME: Currently, only the 73 is implemented. - * The 73A uses the same model. - * - */ - -#ifndef NLD_7473_H_ -#define NLD_7473_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7473(name, cCLK, cJ, cK, cCLRQ) \ - NET_REGISTER_DEV(TTL_7473, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, J, cJ) \ - NET_CONNECT(name, K, cK) \ - NET_CONNECT(name, CLRQ, cCLRQ) - -#define TTL_7473A(name, cCLK, cJ, cK, cCLRQ) \ - TTL_7473(name, cCLK, cJ, cK, cCLRQ) - -#define TTL_7473_DIP(name) \ - NET_REGISTER_DEV(TTL_7473_DIP, name) - - -#define TTL_7473A_DIP(name) \ - NET_REGISTER_DEV(TTL_7473A_DIP, name) - -#endif /* NLD_7473_H_ */ diff --git a/src/lib/netlist/devices/nld_7474.cpp b/src/lib/netlist/devices/nld_7474.cpp index 42d4d06b429..f79d38c5e0f 100644 --- a/src/lib/netlist/devices/nld_7474.cpp +++ b/src/lib/netlist/devices/nld_7474.cpp @@ -1,29 +1,58 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_7474.c + * nld_7474.cpp * + * DM7474: Dual Positive-Edge-Triggered D Flip-Flops + * with Preset, Clear and Complementary Outputs + * + * +--------------+ + * CLR1 |1 ++ 14| VCC + * D1 |2 13| CLR2 + * CLK1 |3 12| D2 + * PR1 |4 7474 11| CLK2 + * Q1 |5 10| PR2 + * Q1Q |6 9| Q2 + * GND |7 8| Q2Q + * +--------------+ + * + * +-----+-----+-----+---++---+-----+ + * | PR | CLR | CLK | D || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | 1 | X | X || 1 | 0 | + * | 1 | 0 | X | X || 0 | 1 | + * | 0 | 0 | X | X || 1 | 1 | (*) + * | 1 | 1 | R | 1 || 1 | 0 | + * | 1 | 1 | R | 0 || 0 | 1 | + * | 1 | 1 | 0 | X || Q0| Q0Q | + * +-----+-----+-----+---++---+-----+ + * + * (*) This configuration is not stable, i.e. it will not persist + * when either the preset and or clear inputs return to their inactive (high) level + * + * Q0 The output logic level of Q before the indicated input conditions were established + * + * R: 0 -. 1 + * + * Naming conventions follow National Semiconductor datasheet + * + * FIXME: Check that (*) is emulated properly */ -#include "nld_7474.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" #include <array> -namespace netlist -{ - namespace devices - { +namespace netlist::devices { NETLIB_OBJECT(7474) { NETLIB_CONSTRUCTOR(7474) - , m_D(*this, "D") - , m_CLRQ(*this, "CLRQ") - , m_PREQ(*this, "PREQ") - , m_CLK(*this, "CLK", NETLIB_DELEGATE(7474, clk)) + , m_D(*this, "D", NETLIB_DELEGATE(inputs)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(inputs)) + , m_PREQ(*this, "PREQ", NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) , m_Q(*this, "Q") , m_QQ(*this, "QQ") , m_nextD(*this, "m_nextD", 0) @@ -32,9 +61,36 @@ namespace netlist } private: - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_HANDLERI(clk); + NETLIB_RESETI() + { + m_CLK.set_state(logic_t::STATE_INP_LH); + m_D.set_state(logic_t::STATE_INP_ACTIVE); + m_nextD = 0; + } + + NETLIB_HANDLERI(clk) + { + newstate(m_nextD, !m_nextD); + m_CLK.inactivate(); + } + + NETLIB_HANDLERI(inputs) + { + const auto preq(m_PREQ()); + const auto clrq(m_CLRQ()); + if (preq & clrq) + { + m_D.activate(); + m_nextD = m_D(); + m_CLK.activate_lh(); + } + else + { + newstate(preq ^ 1, clrq ^ 1); + m_CLK.inactivate(); + m_D.inactivate(); + } + } logic_input_t m_D; logic_input_t m_CLRQ; @@ -47,7 +103,7 @@ namespace netlist nld_power_pins m_power_pins; - void newstate(const netlist_sig_t stateQ, const netlist_sig_t stateQQ) + void newstate(const netlist_sig_t stateQ, const netlist_sig_t stateQQ) noexcept { // 0: High-to-low 40 ns, 1: Low-to-high 25 ns static constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; @@ -56,80 +112,6 @@ namespace netlist } }; - NETLIB_OBJECT(7474_dip) - { - NETLIB_CONSTRUCTOR(7474_dip) - , m_A(*this, "A") - , m_B(*this, "B") - { - register_subalias("1", "A.CLRQ"); - register_subalias("2", "A.D"); - register_subalias("3", "A.CLK"); - register_subalias("4", "A.PREQ"); - register_subalias("5", "A.Q"); - register_subalias("6", "A.QQ"); - register_subalias("7", "A.GND"); - - register_subalias("8", "B.QQ"); - register_subalias("9", "B.Q"); - register_subalias("10", "B.PREQ"); - register_subalias("11", "B.CLK"); - register_subalias("12", "B.D"); - register_subalias("13", "B.CLRQ"); - register_subalias("14", "A.VCC"); - - connect("A.GND", "B.GND"); - connect("A.VCC", "B.VCC"); - } - NETLIB_UPDATEI(); - NETLIB_RESETI(); - - private: - NETLIB_SUB(7474) m_A; - NETLIB_SUB(7474) m_B; - }; - - NETLIB_HANDLER(7474, clk) - { - newstate(m_nextD, !m_nextD); - m_CLK.inactivate(); - } - - NETLIB_UPDATE(7474) - { - const auto preq(m_PREQ()); - const auto clrq(m_CLRQ()); - if (preq & clrq) - { - m_D.activate(); - m_nextD = m_D(); - m_CLK.activate_lh(); - } - else - { - newstate(preq ^ 1, clrq ^ 1); - m_CLK.inactivate(); - m_D.inactivate(); - } - } - - NETLIB_RESET(7474) - { - m_CLK.set_state(logic_t::STATE_INP_LH); - m_D.set_state(logic_t::STATE_INP_ACTIVE); - m_nextD = 0; - } - - NETLIB_RESET(7474_dip) - { - } - - NETLIB_UPDATE(7474_dip) - { - } - NETLIB_DEVICE_IMPL(7474, "TTL_7474", "+CLK,+D,+CLRQ,+PREQ,@VCC,@GND") - NETLIB_DEVICE_IMPL(7474_dip, "TTL_7474_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7474.h b/src/lib/netlist/devices/nld_7474.h deleted file mode 100644 index ccf75b42c6b..00000000000 --- a/src/lib/netlist/devices/nld_7474.h +++ /dev/null @@ -1,59 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_7474.h - * - * DM7474: Dual Positive-Edge-Triggered D Flip-Flops - * with Preset, Clear and Complementary Outputs - * - * +--------------+ - * CLR1 |1 ++ 14| VCC - * D1 |2 13| CLR2 - * CLK1 |3 12| D2 - * PR1 |4 7474 11| CLK2 - * Q1 |5 10| PR2 - * Q1Q |6 9| Q2 - * GND |7 8| Q2Q - * +--------------+ - * - * +-----+-----+-----+---++---+-----+ - * | PR | CLR | CLK | D || Q | QQ | - * +=====+=====+=====+===++===+=====+ - * | 0 | 1 | X | X || 1 | 0 | - * | 1 | 0 | X | X || 0 | 1 | - * | 0 | 0 | X | X || 1 | 1 | (*) - * | 1 | 1 | R | 1 || 1 | 0 | - * | 1 | 1 | R | 0 || 0 | 1 | - * | 1 | 1 | 0 | X || Q0| Q0Q | - * +-----+-----+-----+---++---+-----+ - * - * (*) This configuration is not stable, i.e. it will not persist - * when either the preset and or clear inputs return to their inactive (high) level - * - * Q0 The output logic level of Q before the indicated input conditions were established - * - * R: 0 -. 1 - * - * Naming conventions follow National Semiconductor datasheet - * - * FIXME: Check that (*) is emulated properly - */ - -#ifndef NLD_7474_H_ -#define NLD_7474_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7474(name, cCLK, cD, cCLRQ, cPREQ) \ - NET_REGISTER_DEV(TTL_7474, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, CLRQ, cCLRQ) \ - NET_CONNECT(name, PREQ, cPREQ) - -#define TTL_7474_DIP(name) \ - NET_REGISTER_DEV(TTL_7474_DIP, name) - -#endif /* NLD_7474_H_ */ diff --git a/src/lib/netlist/devices/nld_7475.cpp b/src/lib/netlist/devices/nld_7475.cpp index 22c99e18952..afe42e84c70 100644 --- a/src/lib/netlist/devices/nld_7475.cpp +++ b/src/lib/netlist/devices/nld_7475.cpp @@ -4,157 +4,95 @@ * nld_7475.cpp * * TODO: Correct timing for clock-induced state changes, rather than assuming timing is always due to data-induced state changes + * + * 7475: 4-Bit Bistable Latches with Complementary Outputs + * 7477: 4-Bit Bistable Latches + * + * +----------+ +----------+ + * 1QQ |1 ++ 16| 1Q 1D |1 ++ 14| 1Q + * 1D |2 15| 2Q 2D |2 13| 2Q + * 2D |3 14| 2QQ 3C4C |3 12| 1C2C + * 3C4C |4 7475 13| 1C2C VCC |4 7477 11| GND + * VCC |5 12| GND 3D |5 10| NC + * 3D |6 11| 3QQ 4D |6 9| 3Q + * 4D |7 10| 3Q NC |7 8| 4Q + * 4QQ |8 9| 4Q +----------+ + * +----------+ + * + * + * Function table + * + * +---+---++---+-----+ + * | D | C || Q | QQ | + * +===+===++===+=====+ + * | 0 | 1 || 0 | 1 | + * | 1 | 1 || 1 | 0 | + * | X | 0 || Q0| Q0Q | + * +---+---++---+-----+ + * + * Naming conventions follow Texas instruments datasheet + * */ -#include "nld_7475.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(7477) +namespace netlist::devices { + + template <bool HasQQ> + NETLIB_OBJECT(7475_GATE_BASE) { - NETLIB_CONSTRUCTOR(7477) - , m_C1C2(*this, "C1C2") - , m_C3C4(*this, "C3C4") - , m_last_Q(*this, "m_last_Q", 0) - , m_D(*this, {{"D1", "D2", "D3", "D4"}}) - , m_Q(*this, {{"Q1", "Q2", "Q3", "Q4"}}) + NETLIB_CONSTRUCTOR(7475_GATE_BASE) + , m_D(*this, "D", NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_Q(*this, "Q") + , m_QQ(*this, "QQ") + , m_nextD(*this, "m_nextD", 0) , m_power_pins(*this) { - register_subalias("Q1", m_Q[0]); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - void update_outputs(std::size_t start, std::size_t end); - - public: - logic_input_t m_C1C2; - logic_input_t m_C3C4; - state_var<unsigned> m_last_Q; - object_array_t<logic_input_t, 4> m_D; - object_array_t<logic_output_t, 4> m_Q; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(7475, 7477) - { - NETLIB_CONSTRUCTOR_DERIVED(7475, 7477) - , m_QQ(*this, {{"QQ1", "QQ2", "QQ3", "QQ4"}}) + NETLIB_RESETI() { + m_CLK.set_state(logic_t::STATE_INP_LH); + m_nextD = 0; } - NETLIB_UPDATEI(); - - public: - object_array_t<logic_output_t, 4> m_QQ; - }; - - NETLIB_OBJECT_DERIVED(7475_dip, 7475) - { - NETLIB_CONSTRUCTOR_DERIVED(7475_dip, 7475) + NETLIB_HANDLERI(clk) { - register_subalias("1", m_QQ[0]); - register_subalias("2", m_D[0]); - register_subalias("3", m_D[1]); - register_subalias("4", m_C3C4); - register_subalias("5", "VCC"); - register_subalias("6", m_D[2]); - register_subalias("7", m_D[3]); - register_subalias("8", m_QQ[3]); - - register_subalias("9", m_Q[3]); - register_subalias("10", m_Q[2]); - register_subalias("11", m_QQ[2]); - register_subalias("12", "GND"); - register_subalias("13", m_C1C2); - register_subalias("14", m_QQ[1]); - register_subalias("15", m_Q[1]); - register_subalias("16", m_Q[0]); + newstate(m_nextD, !m_nextD); + m_CLK.inactivate(); } - }; - NETLIB_OBJECT_DERIVED(7477_dip, 7477) - { - NETLIB_CONSTRUCTOR_DERIVED(7477_dip, 7477) + NETLIB_HANDLERI(inputs) { - register_subalias("1", m_D[0]); - register_subalias("2", m_D[1]); - register_subalias("3", m_C3C4); - //register_subalias("4", ); ==> VCC - register_subalias("5", m_D[2]); - register_subalias("6", m_D[3]); - //register_subalias("7", ); ==> NC - - register_subalias("8", m_Q[3]); - register_subalias("9", m_Q[2]); - //register_subalias("10", ); ==> NC - //register_subalias("11", ); ==> GND - register_subalias("12", m_C1C2); - register_subalias("13", m_Q[1]); - register_subalias("14", m_Q[0]); + m_nextD = m_D(); + m_CLK.activate_lh(); } - }; - - NETLIB_UPDATE(7475) - { - unsigned start_q = m_last_Q; - NETLIB_NAME(7477)::update(); + private: + logic_input_t m_D; + logic_input_t m_CLK; + logic_output_t m_Q; + logic_output_t m_QQ; - for (std::size_t i=0; i<4; i++) - { - unsigned last_bit = (m_last_Q >> i) & 1; - unsigned start_bit = (start_q >> i) & 1; - if (last_bit != start_bit) - m_QQ[i].push(last_bit ^ 1, last_bit != 0 ? NLTIME_FROM_NS(15) : NLTIME_FROM_NS(40)); - } - } - - void NETLIB_NAME(7477)::update_outputs(std::size_t start, std::size_t end) - { - for (std::size_t i=start; i<end; i++) - { - netlist_sig_t d = m_D[i](); - if (d != ((m_last_Q >> i) & 1)) - m_Q[i].push(d, d != 0 ? NLTIME_FROM_NS(30) : NLTIME_FROM_NS(25)); - m_last_Q &= ~(1 << i); - m_last_Q |= d << i; - } - } + state_var<netlist_sig_t> m_nextD; - NETLIB_RESET(7477) - { - m_last_Q = 0; - } + nld_power_pins m_power_pins; - NETLIB_UPDATE(7477) - { - netlist_sig_t c1c2 = m_C1C2(); - netlist_sig_t c3c4 = m_C3C4(); - if (c1c2 && c3c4) + void newstate(const netlist_sig_t stateQ, const netlist_sig_t stateQQ) { - update_outputs(0, 4); - } - else if (c1c2) - { - update_outputs(0, 2); - } - else if (c3c4) - { - update_outputs(2, 4); + // 0: High-to-low 40 ns, 1: Low-to-high 25 ns + static constexpr const std::array<netlist_time, 2> delay = { NLTIME_FROM_NS(40), NLTIME_FROM_NS(25) }; + m_Q.push(stateQ, delay[stateQ]); + if (HasQQ) + m_QQ.push(stateQQ, delay[stateQQ]); } + }; - } + using NETLIB_NAME(7475_GATE) = NETLIB_NAME(7475_GATE_BASE)<true>; + using NETLIB_NAME(7477_GATE) = NETLIB_NAME(7475_GATE_BASE)<false>; - NETLIB_DEVICE_IMPL(7475, "TTL_7475", "") - NETLIB_DEVICE_IMPL(7475_dip, "TTL_7475_DIP", "") - NETLIB_DEVICE_IMPL(7477, "TTL_7477", "") - NETLIB_DEVICE_IMPL(7477_dip, "TTL_7477_DIP", "") + NETLIB_DEVICE_IMPL(7475_GATE, "TTL_7475_GATE", "") + NETLIB_DEVICE_IMPL(7477_GATE, "TTL_7477_GATE", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7475.h b/src/lib/netlist/devices/nld_7475.h deleted file mode 100644 index 78ece9ff443..00000000000 --- a/src/lib/netlist/devices/nld_7475.h +++ /dev/null @@ -1,64 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_7475.h - * - * 7475: 4-Bit Bistable Latches with Complementary Outputs - * 7477: 4-Bit Bistable Latches - * - * +----------+ +----------+ - * 1QQ |1 ++ 16| 1Q 1D |1 ++ 14| 1Q - * 1D |2 15| 2Q 2D |2 13| 2Q - * 2D |3 14| 2QQ 3C4C |3 12| 1C2C - * 3C4C |4 7475 13| 1C2C VCC |4 7477 11| GND - * VCC |5 12| GND 3D |5 10| NC - * 3D |6 11| 3QQ 4D |6 9| 3Q - * 4D |7 10| 3Q NC |7 8| 4Q - * 4QQ |8 9| 4Q +----------+ - * +----------+ - * - * - * Function table - * - * +---+---++---+-----+ - * | D | C || Q | QQ | - * +===+===++===+=====+ - * | 0 | 1 || 0 | 1 | - * | 1 | 1 || 1 | 0 | - * | X | 0 || Q0| Q0Q | - * +---+---++---+-----+ - * - * Naming conventions follow Texas instruments datasheet - * - */ - -#ifndef NLD_7475_H_ -#define NLD_7475_H_ - -#include "netlist/nl_setup.h" - -#define PARAMS_7475_7477(name, cC1C2, cC3C4, cD1, cD2, cD3, cD4) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, C1C2, cC1C2) \ - NET_CONNECT(name, C3C4, cC3C4) \ - NET_CONNECT(name, D1, cD1) \ - NET_CONNECT(name, D2, cD2) \ - NET_CONNECT(name, D3, cD3) \ - NET_CONNECT(name, D4, cD4) - -#define TTL_7475(name, cC1C2, cC3C4, cD1, cD2, cD3, cD4) \ - NET_REGISTER_DEV(TTL_7475, name) \ - PARAMS_7475_7477(name, cC1C2, cC3C4, cD1, cD2, cD3, cD4) - -#define TTL_7477(name, cC1C2, cC3C4, cD1, cD2, cD3, cD4) \ - NET_REGISTER_DEV(TTL_7477, name) \ - PARAMS_7475_7477(name, cC1C2, cC3C4, cD1, cD2, cD3, cD4) - -#define TTL_7475_DIP(name) \ - NET_REGISTER_DEV(TTL_7475_DIP, name) - -#define TTL_7477_DIP(name) \ - NET_REGISTER_DEV(TTL_7477_DIP, name) - -#endif /* NLD_7475_H_ */ diff --git a/src/lib/netlist/devices/nld_7483.cpp b/src/lib/netlist/devices/nld_7483.cpp index a2c479a5488..866b8569284 100644 --- a/src/lib/netlist/devices/nld_7483.cpp +++ b/src/lib/netlist/devices/nld_7483.cpp @@ -1,30 +1,45 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_7483.c + * nld_7483.cpp + * + * DM7483: 4-Bit Binary Adder with Fast Carry + * + * +--------------+ + * A4 |1 ++ 16| B4 + * S3 |2 15| S4 + * A3 |3 14| C4 + * B3 |4 7483 13| C0 + * VCC |5 12| GND + * S2 |6 11| B1 + * B2 |7 10| A1 + * A2 |8 9| S1 + * +--------------+ + * + * S = (A + B + C0) & 0x0f + * + * C4 = (A + B + C) > 15 ? 1 : 0 + * + * Naming conventions follow Fairchild Semiconductor datasheet * */ -#include "nld_7483.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(7483) { NETLIB_CONSTRUCTOR(7483) - , m_C0(*this, "C0") - , m_A1(*this, "A1", NETLIB_DELEGATE(7483, upd_a)) - , m_A2(*this, "A2", NETLIB_DELEGATE(7483, upd_a)) - , m_A3(*this, "A3", NETLIB_DELEGATE(7483, upd_a)) - , m_A4(*this, "A4", NETLIB_DELEGATE(7483, upd_a)) - , m_B1(*this, "B1", NETLIB_DELEGATE(7483, upd_b)) - , m_B2(*this, "B2", NETLIB_DELEGATE(7483, upd_b)) - , m_B3(*this, "B3", NETLIB_DELEGATE(7483, upd_b)) - , m_B4(*this, "B4", NETLIB_DELEGATE(7483, upd_b)) + , m_C0(*this, "C0", NETLIB_DELEGATE(c0)) + , m_A1(*this, "A1", NETLIB_DELEGATE(upd_a)) + , m_A2(*this, "A2", NETLIB_DELEGATE(upd_a)) + , m_A3(*this, "A3", NETLIB_DELEGATE(upd_a)) + , m_A4(*this, "A4", NETLIB_DELEGATE(upd_a)) + , m_B1(*this, "B1", NETLIB_DELEGATE(upd_b)) + , m_B2(*this, "B2", NETLIB_DELEGATE(upd_b)) + , m_B3(*this, "B3", NETLIB_DELEGATE(upd_b)) + , m_B4(*this, "B4", NETLIB_DELEGATE(upd_b)) , m_a(*this, "m_a", 0) , m_b(*this, "m_b", 0) , m_lastr(*this, "m_lastr", 0) @@ -36,12 +51,40 @@ namespace netlist , m_power_pins(*this) { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_HANDLERI(upd_a); - NETLIB_HANDLERI(upd_b); + NETLIB_RESETI() + { + m_lastr = 0; + } + + private: + NETLIB_HANDLERI(c0) + { + auto r = static_cast<uint8_t>(m_a + m_b + m_C0()); + + if (r != m_lastr) + { + m_lastr = r; + m_S1.push((r >> 0) & 1, NLTIME_FROM_NS(23)); + m_S2.push((r >> 1) & 1, NLTIME_FROM_NS(23)); + m_S3.push((r >> 2) & 1, NLTIME_FROM_NS(23)); + m_S4.push((r >> 3) & 1, NLTIME_FROM_NS(23)); + m_C4.push((r >> 4) & 1, NLTIME_FROM_NS(23)); + } + } + + NETLIB_HANDLERI(upd_a) + { + m_a = static_cast<uint8_t>((m_A1() << 0) | (m_A2() << 1) | (m_A3() << 2) | (m_A4() << 3)); + c0(); + } + + NETLIB_HANDLERI(upd_b) + { + m_b = static_cast<uint8_t>((m_B1() << 0) | (m_B2() << 1) | (m_B3() << 2) | (m_B4() << 3)); + c0(); + } + - protected: logic_input_t m_C0; logic_input_t m_A1; logic_input_t m_A2; @@ -64,66 +107,6 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7483_dip, 7483) - { - NETLIB_CONSTRUCTOR_DERIVED(7483_dip, 7483) - { - register_subalias("1", m_A4); - register_subalias("2", m_S3); - register_subalias("3", m_A3); - register_subalias("4", m_B3); - register_subalias("5", "VCC"); - register_subalias("6", m_S2); - register_subalias("7", m_B2); - register_subalias("8", m_A2); - - register_subalias("9", m_S1); - register_subalias("10", m_A1); - register_subalias("11", m_B1); - register_subalias("12", "GND"); - register_subalias("13", m_C0); - register_subalias("14", m_C4); - register_subalias("15", m_S4); - register_subalias("16", m_B4); - } - //NETLIB_RESETI(); - //NETLIB_UPDATEI(); - }; - - NETLIB_RESET(7483) - { - m_lastr = 0; - } - - NETLIB_HANDLER(7483, upd_a) - { - m_a = static_cast<uint8_t>((m_A1() << 0) | (m_A2() << 1) | (m_A3() << 2) | (m_A4() << 3)); - NETLIB_NAME(7483)::update(); - } - - NETLIB_HANDLER(7483, upd_b) - { - m_b = static_cast<uint8_t>((m_B1() << 0) | (m_B2() << 1) | (m_B3() << 2) | (m_B4() << 3)); - NETLIB_NAME(7483)::update(); - } - - NETLIB_UPDATE(7483) - { - auto r = static_cast<uint8_t>(m_a + m_b + m_C0()); - - if (r != m_lastr) - { - m_lastr = r; - m_S1.push((r >> 0) & 1, NLTIME_FROM_NS(23)); - m_S2.push((r >> 1) & 1, NLTIME_FROM_NS(23)); - m_S3.push((r >> 2) & 1, NLTIME_FROM_NS(23)); - m_S4.push((r >> 3) & 1, NLTIME_FROM_NS(23)); - m_C4.push((r >> 4) & 1, NLTIME_FROM_NS(23)); - } - } - NETLIB_DEVICE_IMPL(7483, "TTL_7483", "+A1,+A2,+A3,+A4,+B1,+B2,+B3,+B4,+C0,@VCC,@GND") - NETLIB_DEVICE_IMPL(7483_dip, "TTL_7483_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7483.h b/src/lib/netlist/devices/nld_7483.h deleted file mode 100644 index fba46f32457..00000000000 --- a/src/lib/netlist/devices/nld_7483.h +++ /dev/null @@ -1,49 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_7483.h - * - * DM7483: 4-Bit Binary Adder with Fast Carry - * - * +--------------+ - * A4 |1 ++ 16| B4 - * S3 |2 15| S4 - * A3 |3 14| C4 - * B3 |4 7483 13| C0 - * VCC |5 12| GND - * S2 |6 11| B1 - * B2 |7 10| A1 - * A2 |8 9| S1 - * +--------------+ - * - * S = (A + B + C0) & 0x0f - * - * C4 = (A + B + C) > 15 ? 1 : 0 - * - * Naming conventions follow Fairchild Semiconductor datasheet - * - */ - -#ifndef NLD_7483_H_ -#define NLD_7483_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7483(name, cA1, cA2, cA3, cA4, cB1, cB2, cB3, cB4, cCI) \ - NET_REGISTER_DEV(TTL_7483, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, B1, cB1) \ - NET_CONNECT(name, B2, cB2) \ - NET_CONNECT(name, B3, cB3) \ - NET_CONNECT(name, B4, cB4) \ - NET_CONNECT(name, C0, cCI) - -#define TTL_7483_DIP(name) \ - NET_REGISTER_DEV(TTL_7483_DIP, name) - -#endif /* NLD_7483_H_ */ diff --git a/src/lib/netlist/devices/nld_7485.cpp b/src/lib/netlist/devices/nld_7485.cpp index 7cf166a807d..6d53854b4be 100644 --- a/src/lib/netlist/devices/nld_7485.cpp +++ b/src/lib/netlist/devices/nld_7485.cpp @@ -3,24 +3,37 @@ /* * nld_7485.cpp * + * FIXME: Truth table candidate + * + * DM7485: 4-bit Magnitude Comparators + * + * +------------+ + * B3 |1 ++ 16| VCC + * LTIN |2 15| A3 + * EQIN |3 14| B2 + * GTIN |4 7485 13| A2 + * GTOUT |5 12| A1 + * EQOUT |6 11| B1 + * LTOUT |7 10| A0 + * GND |8 9| B0 + * +------------+ + * + * Naming convention attempts to follow Texas Instruments datasheet + * */ -#include "nld_7485.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(7485) { NETLIB_CONSTRUCTOR(7485) - , m_A(*this, {{"A0", "A1", "A2", "A3"}}) - , m_B(*this, {{"B0", "B1", "B2", "B3"}}) - , m_LTIN(*this, "LTIN") - , m_EQIN(*this, "EQIN") - , m_GTIN(*this, "GTIN") + , m_A(*this, {"A0", "A1", "A2", "A3"}, NETLIB_DELEGATE(inputs)) + , m_B(*this, {"B0", "B1", "B2", "B3"}, NETLIB_DELEGATE(inputs)) + , m_LTIN(*this, "LTIN", NETLIB_DELEGATE(inputs)) + , m_EQIN(*this, "EQIN", NETLIB_DELEGATE(inputs)) + , m_GTIN(*this, "GTIN", NETLIB_DELEGATE(inputs)) , m_LTOUT(*this, "LTOUT") , m_EQOUT(*this, "EQOUT") , m_GTOUT(*this, "GTOUT") @@ -28,11 +41,45 @@ namespace netlist { } - NETLIB_UPDATEI(); + private: + // FIXME: Timing + NETLIB_HANDLERI(inputs) + { + for (std::size_t i = 4; i-- > 0; ) + { + if (m_A[i]() > m_B[i]()) + { + update_outputs(1, 0, 0); + return; + } + + if (m_A[i]() < m_B[i]()) + { + update_outputs(0, 1, 0); + return; + } + } - void update_outputs(unsigned gt, unsigned lt, unsigned eq); + // must be == if we got here + if (m_EQIN()) + update_outputs(0, 0, 1); + else if (m_GTIN() && m_LTIN()) + update_outputs(0, 0, 0); + else if (m_GTIN()) + update_outputs(1, 0, 0); + else if (m_LTIN()) + update_outputs(0, 1, 0); + else + update_outputs(1, 1, 0); + } + + void update_outputs(unsigned gt, unsigned lt, unsigned eq) + { + m_GTOUT.push(gt, NLTIME_FROM_NS(23)); + m_LTOUT.push(lt, NLTIME_FROM_NS(23)); + m_EQOUT.push(eq, NLTIME_FROM_NS(23)); + } - protected: object_array_t<logic_input_t, 4> m_A; object_array_t<logic_input_t, 4> m_B; logic_input_t m_LTIN; @@ -44,70 +91,6 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7485_dip, 7485) - { - NETLIB_CONSTRUCTOR_DERIVED(7485_dip, 7485) - { - register_subalias("1", m_B[3]); - register_subalias("2", m_LTIN); - register_subalias("3", m_EQIN); - register_subalias("4", m_GTIN); - register_subalias("5", m_GTOUT); - register_subalias("6", m_EQOUT); - register_subalias("7", m_LTOUT); - register_subalias("8", "GND"); - - register_subalias("9", m_B[0]); - register_subalias("10", m_A[0]); - register_subalias("11", m_B[1]); - register_subalias("12", m_A[1]); - register_subalias("13", m_A[2]); - register_subalias("14", m_B[2]); - register_subalias("15", m_A[3]); - register_subalias("16", "VCC"); - - } - }; - - void NETLIB_NAME(7485)::update_outputs(unsigned gt, unsigned lt, unsigned eq) - { - m_GTOUT.push(gt, NLTIME_FROM_NS(23)); - m_LTOUT.push(lt, NLTIME_FROM_NS(23)); - m_EQOUT.push(eq, NLTIME_FROM_NS(23)); - } - - // FIXME: Timing - NETLIB_UPDATE(7485) - { - for (std::size_t i = 4; i-- > 0; ) - { - if (m_A[i]() > m_B[i]()) - { - update_outputs(1, 0, 0); - return; - } - else if (m_A[i]() < m_B[i]()) - { - update_outputs(0, 1, 0); - return; - } - } - - // must be == if we got here - if (m_EQIN()) - update_outputs(0, 0, 1); - else if (m_GTIN() && m_LTIN()) - update_outputs(0, 0, 0); - else if (m_GTIN()) - update_outputs(1, 0, 0); - else if (m_LTIN()) - update_outputs(0, 1, 0); - else - update_outputs(1, 1, 0); - } - NETLIB_DEVICE_IMPL(7485, "TTL_7485", "+A0,+A1,+A2,+A3,+B0,+B1,+B2,+B3,+LTIN,+EQIN,+GTIN,@VCC,@GND") - NETLIB_DEVICE_IMPL(7485_dip, "TTL_7485_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7485.h b/src/lib/netlist/devices/nld_7485.h deleted file mode 100644 index d8fcb5c7701..00000000000 --- a/src/lib/netlist/devices/nld_7485.h +++ /dev/null @@ -1,47 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_7485.h - * - * DM7485: 4-bit Magnitude Comparators - * - * +------------+ - * B3 |1 ++ 16| VCC - * LTIN |2 15| A3 - * EQIN |3 14| B2 - * GTIN |4 7485 13| A2 - * GTOUT |5 12| A1 - * EQOUT |6 11| B1 - * LTOUT |7 10| A0 - * GND |8 9| B0 - * +------------+ - * - * Naming convention attempts to follow Texas Instruments datasheet - * - */ - -#ifndef NLD_7485_H_ -#define NLD_7485_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7485(name, cA0, cA1, cA2, cA3, cB0, cB1, cB2, cB3, cLTIN, cEQIN, cGTIN) \ - NET_REGISTER_DEV(TTL_7485, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, B0, cB0) \ - NET_CONNECT(name, B1, cB1) \ - NET_CONNECT(name, B2, cB2) \ - NET_CONNECT(name, B3, cB3) \ - NET_CONNECT(name, LTIN, cLTIN) \ - NET_CONNECT(name, EQIN, cEQIN) \ - NET_CONNECT(name, GTIN, cGTIN) - -#define TTL_7485_DIP(name) \ - NET_REGISTER_DEV(TTL_7485_DIP, name) - -#endif /* NLD_7485_H_ */ diff --git a/src/lib/netlist/devices/nld_7490.cpp b/src/lib/netlist/devices/nld_7490.cpp index 3bd06a58a3a..7bcf1f7b214 100644 --- a/src/lib/netlist/devices/nld_7490.cpp +++ b/src/lib/netlist/devices/nld_7490.cpp @@ -1,40 +1,127 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_7490.c + * nld_7490.cpp + * + * DM7490: Decade Counters + * + * +--------------+ + * B |1 ++ 14| A + * R01 |2 13| NC + * R02 |3 12| QA + * NC |4 7490 11| QD + * VCC |5 10| GND + * R91 |6 9| QB + * R92 |7 8| QC + * +--------------+ + * + * Counter Sequence + * + * +-------++----+----+----+----+ + * | COUNT || QD | QC | QB | QA | + * +=======++====+====+====+====+ + * | 0 || 0 | 0 | 0 | 0 | + * | 1 || 0 | 0 | 0 | 1 | + * | 2 || 0 | 0 | 1 | 0 | + * | 3 || 0 | 0 | 1 | 1 | + * | 4 || 0 | 1 | 0 | 0 | + * | 5 || 0 | 1 | 0 | 1 | + * | 6 || 0 | 1 | 1 | 0 | + * | 7 || 0 | 1 | 1 | 1 | + * | 8 || 1 | 0 | 0 | 0 | + * | 9 || 1 | 0 | 0 | 1 | + * +-------++----+----+----+----+ + * + * Note A Output QA is connected to input B for BCD count + * + * Reset Count Function table + * + * +-----+-----+-----+-----++----+----+----+----+ + * | R01 | R02 | R91 | R92 || QD | QC | QB | QA | + * +=====+=====+=====+=====++====+====+====+====+ + * | 1 | 1 | 0 | X || 0 | 0 | 0 | 0 | + * | 1 | 1 | X | 0 || 0 | 0 | 0 | 0 | + * | X | X | 1 | 1 || 1 | 0 | 0 | 1 | + * | X | 0 | X | 0 || COUNT | + * | 0 | X | 0 | X || COUNT | + * | 0 | X | X | 0 || COUNT | + * | X | 0 | 0 | X || COUNT | + * +-----+-----+-----+-----++----+----+----+----+ + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_7490.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" -namespace netlist -{ - namespace devices +namespace netlist::devices { + + static constexpr const std::array<const netlist_time, 4> delay = { + NLTIME_FROM_NS(18), + NLTIME_FROM_NS(36) - NLTIME_FROM_NS(18), + NLTIME_FROM_NS(54) - NLTIME_FROM_NS(18), + NLTIME_FROM_NS(72) - NLTIME_FROM_NS(18) + }; + NETLIB_OBJECT(7490) { NETLIB_CONSTRUCTOR(7490) - , m_A(*this, "A") - , m_B(*this, "B") - , m_R1(*this, "R1") - , m_R2(*this, "R2") - , m_R91(*this, "R91") - , m_R92(*this, "R92") + , m_A(*this, "A", NETLIB_DELEGATE(inputs)) + , m_B(*this, "B", NETLIB_DELEGATE(inputs)) + , m_R1(*this, "R1", NETLIB_DELEGATE(inputs)) + , m_R2(*this, "R2", NETLIB_DELEGATE(inputs)) + , m_R91(*this, "R91", NETLIB_DELEGATE(inputs)) + , m_R92(*this, "R92", NETLIB_DELEGATE(inputs)) , m_cnt(*this, "m_cnt", 0) , m_last_A(*this, "m_last_A", 0) , m_last_B(*this, "m_last_B", 0) - , m_Q(*this, {{"QA", "QB", "QC", "QD"}}) + , m_Q(*this, {"QA", "QB", "QC", "QD"}) , m_power_pins(*this) { } private: - NETLIB_UPDATEI(); - NETLIB_RESETI(); + NETLIB_HANDLERI(inputs) + { + const netlist_sig_t new_A = m_A(); + const netlist_sig_t new_B = m_B(); - void update_outputs(); + if (m_R91() & m_R92()) + { + m_cnt = 9; + m_Q.push(9, delay); + } + else if (m_R1() & m_R2()) + { + m_cnt = 0; + m_Q.push(0, delay); + } + else + { + if (m_last_A && !new_A) // High - Low + { + m_cnt ^= 1; + m_Q[0].push(m_cnt & 1, delay[0]); + } + if (m_last_B && !new_B) // High - Low + { + m_cnt += 2; + if (m_cnt >= 10) + m_cnt &= 1; /* Output A is not reset! */ + m_Q.push(m_cnt, delay); + } + } + m_last_A = new_A; + m_last_B = new_B; + } + + NETLIB_RESETI() + { + m_cnt = 0; + m_last_A = 0; + m_last_B = 0; + } logic_input_t m_A; logic_input_t m_B; @@ -51,86 +138,6 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(7490_dip, 7490) - { - NETLIB_CONSTRUCTOR_DERIVED(7490_dip, 7490) - { - register_subalias("1", "B"); - register_subalias("2", "R1"); - register_subalias("3", "R2"); - - // register_subalias("4", ); --> NC - register_subalias("5", "VCC"); - register_subalias("6", "R91"); - register_subalias("7", "R92"); - - register_subalias("8", "QC"); - register_subalias("9", "QB"); - register_subalias("10", "GND"); - register_subalias("11", "QD"); - register_subalias("12", "QA"); - // register_subalias("13", ); --> NC - register_subalias("14", "A"); - } - }; - - NETLIB_RESET(7490) - { - m_cnt = 0; - m_last_A = 0; - m_last_B = 0; - } - - static constexpr const netlist_time delay[4] = - { - NLTIME_FROM_NS(18), - NLTIME_FROM_NS(36) - NLTIME_FROM_NS(18), - NLTIME_FROM_NS(54) - NLTIME_FROM_NS(18), - NLTIME_FROM_NS(72) - NLTIME_FROM_NS(18) - }; - - NETLIB_UPDATE(7490) - { - const netlist_sig_t new_A = m_A(); - const netlist_sig_t new_B = m_B(); - - if (m_R91() & m_R92()) - { - m_cnt = 9; - update_outputs(); - } - else if (m_R1() & m_R2()) - { - m_cnt = 0; - update_outputs(); - } - else - { - if (m_last_A && !new_A) // High - Low - { - m_cnt ^= 1; - m_Q[0].push(m_cnt & 1, delay[0]); - } - if (m_last_B && !new_B) // High - Low - { - m_cnt += 2; - if (m_cnt >= 10) - m_cnt &= 1; /* Output A is not reset! */ - update_outputs(); - } - } - m_last_A = new_A; - m_last_B = new_B; - } - - NETLIB_FUNC_VOID(7490, update_outputs, ()) - { - for (std::size_t i=0; i<4; i++) - m_Q[i].push((m_cnt >> i) & 1, delay[i]); - } - NETLIB_DEVICE_IMPL(7490, "TTL_7490", "+A,+B,+R1,+R2,+R91,+R92,@VCC,@GND") - NETLIB_DEVICE_IMPL(7490_dip, "TTL_7490_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7490.h b/src/lib/netlist/devices/nld_7490.h deleted file mode 100644 index e0479ba14b0..00000000000 --- a/src/lib/netlist/devices/nld_7490.h +++ /dev/null @@ -1,74 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_7490.h - * - * DM7490: Decade Counters - * - * +--------------+ - * B |1 ++ 14| A - * R01 |2 13| NC - * R02 |3 12| QA - * NC |4 7490 11| QD - * VCC |5 10| GND - * R91 |6 9| QB - * R92 |7 8| QC - * +--------------+ - * - * Counter Sequence - * - * +-------++----+----+----+----+ - * | COUNT || QD | QC | QB | QA | - * +=======++====+====+====+====+ - * | 0 || 0 | 0 | 0 | 0 | - * | 1 || 0 | 0 | 0 | 1 | - * | 2 || 0 | 0 | 1 | 0 | - * | 3 || 0 | 0 | 1 | 1 | - * | 4 || 0 | 1 | 0 | 0 | - * | 5 || 0 | 1 | 0 | 1 | - * | 6 || 0 | 1 | 1 | 0 | - * | 7 || 0 | 1 | 1 | 1 | - * | 8 || 1 | 0 | 0 | 0 | - * | 9 || 1 | 0 | 0 | 1 | - * +-------++----+----+----+----+ - * - * Note A Output QA is connected to input B for BCD count - * - * Reset Count Function table - * - * +-----+-----+-----+-----++----+----+----+----+ - * | R01 | R02 | R91 | R92 || QD | QC | QB | QA | - * +=====+=====+=====+=====++====+====+====+====+ - * | 1 | 1 | 0 | X || 0 | 0 | 0 | 0 | - * | 1 | 1 | X | 0 || 0 | 0 | 0 | 0 | - * | X | X | 1 | 1 || 1 | 0 | 0 | 1 | - * | X | 0 | X | 0 || COUNT | - * | 0 | X | 0 | X || COUNT | - * | 0 | X | X | 0 || COUNT | - * | X | 0 | 0 | X || COUNT | - * +-----+-----+-----+-----++----+----+----+----+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_7490_H_ -#define NLD_7490_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7490(name, cA, cB, cR1, cR2, cR91, cR92) \ - NET_REGISTER_DEV(TTL_7490, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, R1, cR1) \ - NET_CONNECT(name, R2, cR2) \ - NET_CONNECT(name, R91, cR91) \ - NET_CONNECT(name, R92, cR92) - -#define TTL_7490_DIP(name) \ - NET_REGISTER_DEV(TTL_7490_DIP, name) - -#endif /* NLD_7490_H_ */ diff --git a/src/lib/netlist/devices/nld_7492.cpp b/src/lib/netlist/devices/nld_7492.cpp new file mode 100644 index 00000000000..1689ff0dd9d --- /dev/null +++ b/src/lib/netlist/devices/nld_7492.cpp @@ -0,0 +1,135 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_7492.cpp + * + * SN7492: Divide-by-12 Counter + * + * +--------------+ + * B |1 ++ 14| A + * NC |2 13| NC + * NC |3 12| QA + * NC |4 7492 11| QD + * VCC |5 10| GND + * R01 |6 9| QB + * R02 |7 8| QC + * +--------------+ + * + * Counter Sequence + * + * +-------++----+----+----+----+ + * | COUNT || QD | QC | QB | QA | + * +=======++====+====+====+====+ + * | 0 || 0 | 0 | 0 | 0 | + * | 1 || 0 | 0 | 0 | 1 | + * | 2 || 0 | 0 | 1 | 0 | + * | 3 || 0 | 0 | 1 | 1 | + * | 4 || 0 | 1 | 0 | 0 | + * | 5 || 0 | 1 | 0 | 1 | + * | 6 || 1 | 0 | 0 | 0 | + * | 7 || 1 | 0 | 0 | 1 | + * | 8 || 1 | 0 | 1 | 0 | + * | 9 || 1 | 0 | 1 | 1 | + * | 10 || 1 | 1 | 0 | 0 | + * | 11 || 1 | 1 | 0 | 1 | + * +-------++----+----+----+----+ + * + * Note A Output QA is connected to input B + * + * Reset Count Function table + * + * +-----+-----++----+----+----+----+ + * | R01 | R02 || QD | QC | QB | QA | + * +=====+=====++====+====+====+====+ + * | 1 | 1 || 0 | 0 | 0 | 0 | + * | 0 | X || COUNT | + * | X | 0 || COUNT | + * +-----+-----++----+----+----+----+ + * + * Naming conventions follow Texas Instruments datasheet + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + static constexpr const std::array<const netlist_time, 4> delay = + { + NLTIME_FROM_NS(18), + NLTIME_FROM_NS(36) - NLTIME_FROM_NS(18), + NLTIME_FROM_NS(54) - NLTIME_FROM_NS(18), + NLTIME_FROM_NS(72) - NLTIME_FROM_NS(18) + }; + + NETLIB_OBJECT(7492) + { + NETLIB_CONSTRUCTOR(7492) + , m_A(*this, "A", NETLIB_DELEGATE(inputs)) + , m_B(*this, "B", NETLIB_DELEGATE(inputs)) + , m_R1(*this, "R1", NETLIB_DELEGATE(inputs)) + , m_R2(*this, "R2", NETLIB_DELEGATE(inputs)) + , m_cnt(*this, "m_cnt", 0) + , m_last_A(*this, "m_last_A", 0) + , m_last_B(*this, "m_last_B", 0) + , m_Q(*this, {"QA", "QB", "QC", "QD"}) + , m_power_pins(*this) + { + } + + private: + + NETLIB_HANDLERI(inputs) + { + const netlist_sig_t new_A = m_A(); + const netlist_sig_t new_B = m_B(); + + if (m_R1() & m_R2()) + { + m_cnt = 0; + m_Q.push(0, delay); + } + else + { + if (m_last_A && !new_A) // High - Low + { + m_cnt ^= 1; + m_Q[0].push(m_cnt & 1, delay[0]); + } + if (m_last_B && !new_B) // High - Low + { + m_cnt += 2; + if (m_cnt == 6) + m_cnt = 8; + if (m_cnt == 14) + m_cnt = 0; + m_Q.push(m_cnt, delay); + } + } + m_last_A = new_A; + m_last_B = new_B; + } + + NETLIB_RESETI() + { + m_cnt = 0; + m_last_A = 0; + m_last_B = 0; + } + + logic_input_t m_A; + logic_input_t m_B; + logic_input_t m_R1; + logic_input_t m_R2; + + state_var_u8 m_cnt; + state_var<netlist_sig_t> m_last_A; + state_var<netlist_sig_t> m_last_B; + + object_array_t<logic_output_t, 4> m_Q; + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(7492, "TTL_7492", "+A,+B,+R1,+R2,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7493.cpp b/src/lib/netlist/devices/nld_7493.cpp index 003c3291096..a6d80fd551b 100644 --- a/src/lib/netlist/devices/nld_7493.cpp +++ b/src/lib/netlist/devices/nld_7493.cpp @@ -1,36 +1,77 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* * nld_7493.cpp * + * DM7493: Binary Counters + * + * +--------------+ + * B |1 ++ 14| A + * R01 |2 13| NC + * R02 |3 12| QA + * NC |4 7493 11| QD + * VCC |5 10| GND + * NC |6 9| QB + * NC |7 8| QC + * +--------------+ + * + * Counter Sequence + * + * +-------++----+----+----+----+ + * | COUNT || QD | QC | QB | QA | + * +=======++====+====+====+====+ + * | 0 || 0 | 0 | 0 | 0 | + * | 1 || 0 | 0 | 0 | 1 | + * | 2 || 0 | 0 | 1 | 0 | + * | 3 || 0 | 0 | 1 | 1 | + * | 4 || 0 | 1 | 0 | 0 | + * | 5 || 0 | 1 | 0 | 1 | + * | 6 || 0 | 1 | 1 | 0 | + * | 7 || 0 | 1 | 1 | 1 | + * | 8 || 1 | 0 | 0 | 0 | + * | 9 || 1 | 0 | 0 | 1 | + * | 10 || 1 | 0 | 1 | 0 | + * | 11 || 1 | 0 | 1 | 1 | + * | 12 || 1 | 1 | 0 | 0 | + * | 13 || 1 | 1 | 0 | 1 | + * | 14 || 1 | 1 | 1 | 0 | + * | 15 || 1 | 1 | 1 | 1 | + * +-------++----+----+----+----+ + * + * Note C Output QA is connected to input B + * + * Reset Count Function table + * + * +-----+-----++----+----+----+----+ + * | R01 | R02 || QD | QC | QB | QA | + * +=====+=====++====+====+====+====+ + * | 1 | 1 || 0 | 0 | 0 | 0 | + * | 0 | X || COUNT | + * | X | 0 || COUNT | + * +-----+-----++----+----+----+----+ + * + * Naming conventions follow National Semiconductor datasheet + * */ -#include "nld_7493.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" -namespace netlist -{ - namespace devices - { - static constexpr const netlist_time out_delay = NLTIME_FROM_NS(18); - static constexpr const netlist_time out_delay2 = NLTIME_FROM_NS(36); - static constexpr const netlist_time out_delay3 = NLTIME_FROM_NS(54); +namespace netlist::devices { + + static constexpr const std::array<const netlist_time, 3> out_delay { NLTIME_FROM_NS(18), NLTIME_FROM_NS(36), NLTIME_FROM_NS(54) }; NETLIB_OBJECT(7493) { NETLIB_CONSTRUCTOR(7493) - , m_R1(*this, "R1") - , m_R2(*this, "R2") - , m_a(*this, "_m_a", 0) - , m_bcd(*this, "_m_b", 0) - , m_CLKA(*this, "CLKA", NETLIB_DELEGATE(7493, updA)) - , m_CLKB(*this, "CLKB", NETLIB_DELEGATE(7493, updB)) + , m_CLKA(*this, "CLKA", NETLIB_DELEGATE(updA)) + , m_CLKB(*this, "CLKB", NETLIB_DELEGATE(updB)) , m_QA(*this, "QA") - , m_QB(*this, "QB") - , m_QC(*this, "QC") - , m_QD(*this, "QD") + , m_QBCD(*this, {"QB", "QC", "QD"}) + , m_a(*this, "m_a", 0) + , m_bcd(*this, "m_b", 0) + , m_R1(*this, "R1", NETLIB_DELEGATE(inputs)) + , m_R2(*this, "R2", NETLIB_DELEGATE(inputs)) , m_power_pins(*this) { } @@ -43,9 +84,9 @@ namespace netlist m_CLKB.set_state(logic_t::STATE_INP_HL); } - NETLIB_UPDATEI() + NETLIB_HANDLERI(inputs) { - if (!(m_R1() & m_R2())) + if (!(m_R1() && m_R2())) { m_CLKA.activate_hl(); m_CLKB.activate_hl(); @@ -55,9 +96,7 @@ namespace netlist m_CLKA.inactivate(); m_CLKB.inactivate(); m_QA.push(0, NLTIME_FROM_NS(40)); - m_QB.push(0, NLTIME_FROM_NS(40)); - m_QC.push(0, NLTIME_FROM_NS(40)); - m_QD.push(0, NLTIME_FROM_NS(40)); + m_QBCD.push(0, NLTIME_FROM_NS(40)); m_a = m_bcd = 0; } } @@ -65,59 +104,30 @@ namespace netlist NETLIB_HANDLERI(updA) { m_a ^= 1; - m_QA.push(m_a, out_delay); + m_QA.push(m_a, out_delay[0]); } NETLIB_HANDLERI(updB) { - auto cnt = (++m_bcd &= 0x07); - m_QD.push((cnt >> 2) & 1, out_delay3); - m_QC.push((cnt >> 1) & 1, out_delay2); - m_QB.push(cnt & 1, out_delay); + const auto cnt(++m_bcd &= 0x07); + m_QBCD.push(cnt, out_delay); } - logic_input_t m_R1; - logic_input_t m_R2; - - state_var_sig m_a; - state_var_u8 m_bcd; - logic_input_t m_CLKA; logic_input_t m_CLKB; logic_output_t m_QA; - logic_output_t m_QB; - logic_output_t m_QC; - logic_output_t m_QD; - nld_power_pins m_power_pins; - }; + object_array_t<logic_output_t, 3> m_QBCD; - NETLIB_OBJECT_DERIVED(7493_dip, 7493) - { - NETLIB_CONSTRUCTOR_DERIVED(7493_dip, 7493) - { - register_subalias("1", "CLKB"); - register_subalias("2", "R1"); - register_subalias("3", "R2"); - - // register_subalias("4", ); --> NC - register_subalias("5", "VCC"); - // register_subalias("6", ); --> NC - // register_subalias("7", ); --> NC - - register_subalias("8", "QC"); - register_subalias("9", "QB"); - register_subalias("10", "GND"); - register_subalias("11", "QD"); - register_subalias("12", "QA"); - // register_subalias("13", ); -. NC - register_subalias("14", "CLKA"); - } - }; + state_var<unsigned> m_a; + state_var<unsigned> m_bcd; + + logic_input_t m_R1; + logic_input_t m_R2; + nld_power_pins m_power_pins; + }; NETLIB_DEVICE_IMPL(7493, "TTL_7493", "+CLKA,+CLKB,+R1,+R2,@VCC,@GND") - NETLIB_DEVICE_IMPL(7493_dip, "TTL_7493_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7493.h b/src/lib/netlist/devices/nld_7493.h deleted file mode 100644 index 3498d216b08..00000000000 --- a/src/lib/netlist/devices/nld_7493.h +++ /dev/null @@ -1,74 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_7493.h - * - * DM7493: Binary Counters - * - * +--------------+ - * B |1 ++ 14| A - * R01 |2 13| NC - * R02 |3 12| QA - * NC |4 7493 11| QD - * VCC |5 10| GND - * NC |6 9| QB - * NC |7 8| QC - * +--------------+ - * - * Counter Sequence - * - * +-------++----+----+----+----+ - * | COUNT || QD | QC | QB | QA | - * +=======++====+====+====+====+ - * | 0 || 0 | 0 | 0 | 0 | - * | 1 || 0 | 0 | 0 | 1 | - * | 2 || 0 | 0 | 1 | 0 | - * | 3 || 0 | 0 | 1 | 1 | - * | 4 || 0 | 1 | 0 | 0 | - * | 5 || 0 | 1 | 0 | 1 | - * | 6 || 0 | 1 | 1 | 0 | - * | 7 || 0 | 1 | 1 | 1 | - * | 8 || 1 | 0 | 0 | 0 | - * | 9 || 1 | 0 | 0 | 1 | - * | 10 || 1 | 0 | 1 | 0 | - * | 11 || 1 | 0 | 1 | 1 | - * | 12 || 1 | 1 | 0 | 0 | - * | 13 || 1 | 1 | 0 | 1 | - * | 14 || 1 | 1 | 1 | 0 | - * | 15 || 1 | 1 | 1 | 1 | - * +-------++----+----+----+----+ - * - * Note C Output QA is connected to input B - * - * Reset Count Function table - * - * +-----+-----++----+----+----+----+ - * | R01 | R02 || QD | QC | QB | QA | - * +=====+=====++====+====+====+====+ - * | 1 | 1 || 0 | 0 | 0 | 0 | - * | 0 | X || COUNT | - * | X | 0 || COUNT | - * +-----+-----++----+----+----+----+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_7493_H_ -#define NLD_7493_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7493(name, cCLKA, cCLKB, cR1, cR2) \ - NET_REGISTER_DEV(TTL_7493, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLKA, cCLKA) \ - NET_CONNECT(name, CLKB, cCLKB) \ - NET_CONNECT(name, R1, cR1) \ - NET_CONNECT(name, R2, cR2) - -#define TTL_7493_DIP(name) \ - NET_REGISTER_DEV(TTL_7493_DIP, name) - -#endif /* NLD_7493_H_ */ diff --git a/src/lib/netlist/devices/nld_7497.cpp b/src/lib/netlist/devices/nld_7497.cpp index e9ac7833191..7d80c580d14 100644 --- a/src/lib/netlist/devices/nld_7497.cpp +++ b/src/lib/netlist/devices/nld_7497.cpp @@ -1,4 +1,4 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Sergey Svishchev /* * nld_7497.cpp @@ -7,50 +7,125 @@ * * - STRB and EN * - Timing + * + * SN7497: Synchronous 6-Bit Binary Rate Multiplier + * + * +--------------+ + * B1 |1 16| VCC + * B4 |2 15| B3 + * B5 |3 14| B2 + * B0 |4 7497 13| CLR + * Z |5 12| UNITY/CAS + * Y |6 11| ENin (EN) + * ENout |7 10| STRB + * GND |8 9| CLK + * +--------------+ + * + * Naming conventions follow TI datasheet + * + * The counter is enabled when the clear, strobe, and enable inputs are low. + * + * When the rate input is binary 0 (all rate inputs low), Z remains high [and Y low]. + * + * The unity/cascade input, when connected to the clock input, passes + * clock frequency (inverted) to the Y output when the rate input/decoding + * gates are inhibited by the strobe. + * + * When CLR is H, states of CLK and STRB can affect Y and Z. Default are + * Y L, Z H, ENout H. + * + * Unity/cascade is used to inhibit output Y (UNITY L -> Y H) */ -#include "nld_7497.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" -namespace netlist -{ - namespace devices - { +namespace netlist::devices { + + static constexpr const std::array<netlist_time, 2> out_delay_CLK_Y = { NLTIME_FROM_NS(20), NLTIME_FROM_NS(26) }; // tPHL, tPLH + static constexpr const std::array<netlist_time, 2> out_delay_CLK_Z = { NLTIME_FROM_NS(17), NLTIME_FROM_NS(12) }; - static constexpr const netlist_time out_delay_CLK_Y[2] = { NLTIME_FROM_NS(20), NLTIME_FROM_NS(26) }; // tPHL, tPLH - static constexpr const netlist_time out_delay_CLK_Z[2] = { NLTIME_FROM_NS(17), NLTIME_FROM_NS(12) }; + // FIXME: room for improvement -> clock handling NETLIB_OBJECT(7497) { NETLIB_CONSTRUCTOR(7497) - , m_B(*this, {{"B5", "B4", "B3", "B2", "B1", "B0"}}) - , m_CLK(*this, "CLK", NETLIB_DELEGATE(7497, clk_strb)) - , m_STRBQ(*this, "STRBQ", NETLIB_DELEGATE(7497, clk_strb)) - , m_ENQ(*this, "ENQ") - , m_UNITYQ(*this, "UNITYQ", NETLIB_DELEGATE(7497, unity)) - , m_CLR(*this, "CLR", NETLIB_DELEGATE(7497, clr)) + , m_B(*this, {"B5", "B4", "B3", "B2", "B1", "B0"}, NETLIB_DELEGATE(inputs)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk_strb)) + , m_STRBQ(*this, "STRBQ", NETLIB_DELEGATE(clk_strb)) + , m_ENQ(*this, "ENQ", NETLIB_DELEGATE(inputs)) + , m_UNITYQ(*this, "UNITYQ", NETLIB_DELEGATE(unity)) + , m_CLR(*this, "CLR", NETLIB_DELEGATE(clr)) , m_Y(*this, "Y") , m_ZQ(*this, "ZQ") , m_ENOUTQ(*this, "ENOUTQ") , m_cnt(*this, "_m_cnt", 0) , m_rate(*this, "_m_rate", 0) , m_state(*this, "_m_state", 0) - , m_lastclock(*this, "_m_lastclock", 0) + , m_last_clock(*this, "_m_lastclock", 0) , m_power_pins(*this) { } private: - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + m_cnt = 0; + m_rate = 0; + m_last_clock = 0; + } - NETLIB_HANDLERI(noop) { } - NETLIB_HANDLERI(unity); - NETLIB_HANDLERI(clr); - NETLIB_HANDLERI(clk_strb); + NETLIB_HANDLERI(unity) + { + newstate (m_state); + } + + NETLIB_HANDLERI(clr) + { + m_cnt = 0; + clk_strb(); + } + + NETLIB_HANDLERI(clk_strb) + { + netlist_sig_t clk = m_CLK(); + + if (!m_last_clock && clk && !m_ENQ() && !m_CLR()) + { + m_cnt++; + m_cnt &= 63; + } + m_last_clock = clk; + + const netlist_sig_t clk_strb = (clk ^ 1) & (m_STRBQ() ^ 1); + + const netlist_sig_t cntQ = m_cnt; + + // NOR GATE + netlist_sig_t p1 = ((cntQ & 63) == 31 && (m_rate & 32)) || + ((cntQ & 31) == 15 && (m_rate & 16)) || + ((cntQ & 15) == 7 && (m_rate & 8)) || + ((cntQ & 7) == 3 && (m_rate & 4)) || + ((cntQ & 3) == 1 && (m_rate & 2)) || + ((cntQ & 1) == 0 && (m_rate & 1)); + + p1 = (p1 & clk_strb) ^ 1; + + newstate(p1); + + // NAND gate + if ((m_cnt == 63) && !m_ENQ()) + m_ENOUTQ.push(0, out_delay_CLK_Y[0]); // XXX timing + else + m_ENOUTQ.push(1, out_delay_CLK_Y[1]); + + } + + NETLIB_HANDLERI(inputs) + { + m_rate = rate(); + clk_strb(); + } - protected: object_array_t<logic_input_t, 6> m_B; logic_input_t m_CLK; logic_input_t m_STRBQ; @@ -65,7 +140,7 @@ namespace netlist state_var_u8 m_cnt; state_var_u8 m_rate; state_var_sig m_state; - state_var_sig m_lastclock; + state_var_sig m_last_clock; nld_power_pins m_power_pins; void newstate(const netlist_sig_t state) @@ -88,92 +163,6 @@ namespace netlist } }; - NETLIB_RESET(7497) - { - m_cnt = 0; - m_rate = 0; - m_lastclock = 0; - } - - NETLIB_UPDATE(7497) - { - m_rate = rate(); - clk_strb(); - } - - NETLIB_HANDLER(7497, unity) - { - newstate (m_state); - } - - NETLIB_HANDLER(7497, clr) - { - m_cnt = 0; - clk_strb(); - } - - NETLIB_HANDLER(7497, clk_strb) - { - netlist_sig_t clk = m_CLK(); - - if (!m_lastclock && clk && !m_ENQ() && !m_CLR()) - { - m_cnt++; - m_cnt &= 63; - } - m_lastclock = clk; - - const netlist_sig_t clk_strb = (clk ^ 1) & (m_STRBQ() ^ 1); - - const netlist_sig_t cntQ = m_cnt; - - // NOR GATE - netlist_sig_t p1 = ((cntQ & 63) == 31 && (m_rate & 32)) || - ((cntQ & 31) == 15 && (m_rate & 16)) || - ((cntQ & 15) == 7 && (m_rate & 8)) || - ((cntQ & 7) == 3 && (m_rate & 4)) || - ((cntQ & 3) == 1 && (m_rate & 2)) || - ((cntQ & 1) == 0 && (m_rate & 1)); - - p1 = (p1 & clk_strb) ^ 1; - - newstate(p1); - - // NAND gate - if ((m_cnt == 63) && !m_ENQ()) - m_ENOUTQ.push(0, out_delay_CLK_Y[0]); // XXX timing - else - m_ENOUTQ.push(1, out_delay_CLK_Y[1]); - - } - - NETLIB_OBJECT_DERIVED(7497_dip, 7497) - { - NETLIB_CONSTRUCTOR_DERIVED(7497_dip, 7497) - { - register_subalias("1", m_B[4]); // B0 - register_subalias("2", m_B[1]); // B4 - register_subalias("3", m_B[0]); // B5 - register_subalias("4", m_B[5]); // B0 - register_subalias("5", m_ZQ); - register_subalias("6", m_Y); - register_subalias("7", m_ENOUTQ); - register_subalias("8", "GND"); - - register_subalias("9", m_CLK); - register_subalias("10", m_STRBQ); - register_subalias("11", m_UNITYQ); - register_subalias("12", m_ENQ); - register_subalias("13", m_CLR); - register_subalias("14", m_B[3]); // B2 - register_subalias("15", m_B[2]); // B3 - register_subalias("16", "VCC"); - } - }; - - - NETLIB_DEVICE_IMPL(7497, "TTL_7497", "+CLK,+STRBQ,+ENQ,+UNITYQ,+CLR,+B0,+B1,+B2,+B3,+B4,+B5, @VCC, @GND") - NETLIB_DEVICE_IMPL(7497_dip, "TTL_7497_DIP", "") + NETLIB_DEVICE_IMPL(7497, "TTL_7497", "+CLK,+STRBQ,+ENQ,+UNITYQ,+CLR,+B0,+B1,+B2,+B3,+B4,+B5,@VCC,@GND") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_7497.h b/src/lib/netlist/devices/nld_7497.h deleted file mode 100644 index 3e3e2e89e40..00000000000 --- a/src/lib/netlist/devices/nld_7497.h +++ /dev/null @@ -1,59 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Sergey Svishchev -/* - * nld_7497.h - * - * SN7497: Synchronous 6-Bit Binary Rate Multiplier - * - * +--------------+ - * B1 |1 16| VCC - * B4 |2 15| B3 - * B5 |3 14| B2 - * B0 |4 7497 13| CLR - * Z |5 12| UNITY/CAS - * Y |6 11| ENin (EN) - * ENout |7 10| STRB - * GND |8 9| CLK - * +--------------+ - * - * Naming conventions follow TI datasheet - * - * The counter is enabled when the clear, strobe, and enable inputs are low. - * - * When the rate input is binary 0 (all rate inputs low), Z remains high [and Y low]. - * - * The unity/cascade input, when connected to the clock input, passes - * clock frequency (inverted) to the Y output when the rate input/decoding - * gates are inhibited by the strobe. - * - * When CLR is H, states of CLK and STRB can affect Y and Z. Default are - * Y L, Z H, ENout H. - * - * Unity/cascade is used to inhibit output Y (UNITY L -> Y H) - */ - -#ifndef NLD_7497_H_ -#define NLD_7497_H_ - -#include "netlist/nl_setup.h" - -#define TTL_7497(name, cCLK, cSTRB, cEN, cUNITY, cCLR, cB0, cB1, cB2, cB3, cB4, cB5) \ - NET_REGISTER_DEV(TTL_7497, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, STRBQ, cSTRB) \ - NET_CONNECT(name, ENQ, cEN) \ - NET_CONNECT(name, UNITYQ,cUNITY) \ - NET_CONNECT(name, CLR, cCLR) \ - NET_CONNECT(name, B0, cB0) \ - NET_CONNECT(name, B1, cB1) \ - NET_CONNECT(name, B2, cB2) \ - NET_CONNECT(name, B3, cB3) \ - NET_CONNECT(name, B4, cB4) \ - NET_CONNECT(name, B5, cB5) - -#define TTL_7497_DIP(name) \ - NET_REGISTER_DEV(TTL_7497_DIP, name) - -#endif /* NLD_7497_H_ */ diff --git a/src/lib/netlist/devices/nld_74ls629.cpp b/src/lib/netlist/devices/nld_74ls629.cpp index 20798f7da69..11cbc8aeb0d 100644 --- a/src/lib/netlist/devices/nld_74ls629.cpp +++ b/src/lib/netlist/devices/nld_74ls629.cpp @@ -1,7 +1,27 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_SN74LS629.c + * nld_SN74LS629.cpp + * + * SN74LS629: VOLTAGE-CONTROLLED OSCILLATORS + * + * +--------------+ + * 2FC |1 ++ 16| VCC + * 1FC |2 15| QSC VCC + * 1RNG |3 14| 2RNG + * 1CX1 |4 74LS629 13| 2CX1 + * 1CX2 |5 12| 2CX2 + * 1ENQ |6 11| 2ENQ + * 1Y |7 10| 2Y + * OSC GND |8 9| GND + * +--------------+ + * + * Naming conventions follow Texas Instruments datasheet + * + * NOTE: The CX1 and CX2 pins are not connected! + * The capacitor value has to be specified as a parameter. + * There are more comments on the challenges of emulating this + * chip in the *.c file * */ @@ -38,35 +58,22 @@ * Then just use that to toggle a waveform. */ +#include "analog/nlid_twoterm.h" -#include "nld_74ls629.h" -#include "netlist/analog/nlid_twoterm.h" +namespace netlist::devices { -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(SN74LS629clk) + struct SN74LS629clk { - NETLIB_CONSTRUCTOR(SN74LS629clk) - , m_FB(*this, "FB") - , m_Y(*this, "Y") - , m_enableq(*this, "m_enableq", 1) - , m_out(*this, "m_out", 0) - , m_inc(*this, "m_inc", netlist_time::zero()) - { - connect(m_FB, m_Y); - } - - NETLIB_RESETI() + SN74LS629clk(device_t &owner) + : m_FB(owner, "FB", nl_delegate(&SN74LS629clk::fb, this)) + , m_Y(owner, "Y") + , m_enableq(owner, "m_enableq", 0) + , m_out(owner, "m_out", 0) + , m_inc(owner, "m_inc", netlist_time::zero()) { - m_enableq = 0; - m_out = 0; - m_inc = netlist_time::zero(); + owner.connect("FB", "Y"); } - NETLIB_UPDATEI(); - public: logic_input_t m_FB; logic_output_t m_Y; @@ -74,168 +81,127 @@ namespace netlist state_var<netlist_sig_t> m_enableq; state_var<netlist_sig_t> m_out; state_var<netlist_time> m_inc; + + private: + NETLIB_HANDLERI(fb) + { + if (!m_enableq) + { + m_out = m_out ^ 1; + m_Y.push(m_out, m_inc); + } + else + { + m_Y.push(1, m_inc); + } + } + }; NETLIB_OBJECT(SN74LS629) { NETLIB_CONSTRUCTOR(SN74LS629) - , m_clock(*this, "OSC") + , m_clock(*this) , m_R_FC(*this, "R_FC") , m_R_RNG(*this, "R_RNG") - , m_ENQ(*this, "ENQ") - , m_RNG(*this, "RNG") - , m_FC(*this, "FC") - , m_CAP(*this, "CAP", 1e-6) + , m_ENQ(*this, "ENQ", NETLIB_DELEGATE(inputs)) + , m_RNG(*this, "RNG", NETLIB_DELEGATE(inputs)) + , m_FC(*this, "FC", NETLIB_DELEGATE(inputs)) + , m_CAP(*this, "CAP", nlconst::magic(1e-6)) + , m_power_pins(*this) + , m_power_pins_osc(*this, "OSCVCC", "OSCGND") { - register_subalias("GND", m_R_FC.m_N); + connect("OSCGND", "R_FC.2"); - connect(m_FC, m_R_FC.m_P); - connect(m_RNG, m_R_RNG.m_P); - connect(m_R_FC.m_N, m_R_RNG.m_N); - - register_subalias("Y", m_clock.m_Y); + connect("FC", "R_FC.1"); + connect("RNG", "R_RNG.1"); + connect("R_FC.2", "R_RNG.2"); } + private: NETLIB_RESETI() { - m_R_FC.set_R(90000.0); - m_R_RNG.set_R(90000.0); - m_clock.reset(); + m_R_FC().set_R( nlconst::magic(90000.0)); + m_R_RNG().set_R(nlconst::magic(90000.0)); } - NETLIB_UPDATEI(); NETLIB_UPDATE_PARAMI() { /* update param may be called from anywhere, update_dev(time) is not a good idea */ } - public: - NETLIB_SUB(SN74LS629clk) m_clock; - analog::NETLIB_SUB(R_base) m_R_FC; - analog::NETLIB_SUB(R_base) m_R_RNG; + SN74LS629clk m_clock; + NETLIB_SUB_NS(analog, R_base) m_R_FC; + NETLIB_SUB_NS(analog, R_base) m_R_RNG; logic_input_t m_ENQ; analog_input_t m_RNG; analog_input_t m_FC; - param_double_t m_CAP; - }; - - NETLIB_OBJECT(SN74LS629_dip) - { - NETLIB_CONSTRUCTOR(SN74LS629_dip) - , m_A(*this, "A") - , m_B(*this, "B") - { - register_subalias("1", m_B.m_FC); - register_subalias("2", m_A.m_FC); - register_subalias("3", m_A.m_RNG); - - register_subalias("6", m_A.m_ENQ); - register_subalias("7", m_A.m_clock.m_Y); + param_fp_t m_CAP; + nld_power_pins m_power_pins; + nld_power_pins m_power_pins_osc; - register_subalias("8", m_A.m_R_FC.m_N); - register_subalias("9", m_A.m_R_FC.m_N); - connect(m_A.m_R_FC.m_N, m_B.m_R_FC.m_N); - - register_subalias("10", m_B.m_clock.m_Y); - - register_subalias("11", m_B.m_ENQ); - register_subalias("14", m_B.m_RNG); - } - - NETLIB_UPDATEI() { } - - NETLIB_RESETI() + NETLIB_HANDLERI(inputs) { - m_A.reset(); - m_B.reset(); + { + // recompute + nl_fptype v_freq = m_FC(); + nl_fptype v_rng = m_RNG(); + + /* coefficients */ + const nl_fptype k1 = nlconst::magic( 1.9904769024796283E+03); + const nl_fptype k2 = nlconst::magic( 1.2070059213983407E+03); + const nl_fptype k3 = nlconst::magic( 1.3266985579561108E+03); + const nl_fptype k4 = nlconst::magic(-1.5500979825922698E+02); + const nl_fptype k5 = nlconst::magic( 2.8184536266938172E+00); + const nl_fptype k6 = nlconst::magic(-2.3503421582744556E+02); + const nl_fptype k7 = nlconst::magic(-3.3836786704527788E+02); + const nl_fptype k8 = nlconst::magic(-1.3569136703258670E+02); + const nl_fptype k9 = nlconst::magic( 2.9914575453819188E+00); + const nl_fptype k10 = nlconst::magic( 1.6855569086173170E+00); + + /* scale due to input resistance */ + + /* Polyfunctional3D_model created by zunzun.com using sum of squared absolute error */ + + nl_fptype v_freq_2 = v_freq * v_freq; + nl_fptype v_freq_3 = v_freq_2 * v_freq; + nl_fptype v_freq_4 = v_freq_3 * v_freq; + nl_fptype freq = k1; + freq += k2 * v_freq; + freq += k3 * v_freq_2; + freq += k4 * v_freq_3; + freq += k5 * v_freq_4; + freq += k6 * v_rng; + freq += k7 * v_rng * v_freq; + freq += k8 * v_rng * v_freq_2; + freq += k9 * v_rng * v_freq_3; + freq += k10 * v_rng * v_freq_4; + + freq *= nlconst::magic(0.1e-6) / m_CAP(); + + // FIXME: we need a possibility to remove entries from queue ... + // or an exact model ... + m_clock.m_inc = netlist_time::from_fp(nlconst::half() / freq); + } + + if (!m_clock.m_enableq && m_ENQ()) + { + m_clock.m_enableq = 1; + m_clock.m_out = m_clock.m_out ^ 1; + m_clock.m_Y.push(m_clock.m_out, netlist_time::from_nsec(1)); + } + else if (m_clock.m_enableq && !m_ENQ()) + { + m_clock.m_enableq = 0; + m_clock.m_out = m_clock.m_out ^ 1; + m_clock.m_Y.push(m_clock.m_out, netlist_time::from_nsec(1)); + } } - private: - NETLIB_SUB(SN74LS629) m_A; - NETLIB_SUB(SN74LS629) m_B; }; + NETLIB_DEVICE_IMPL(SN74LS629, "SN74LS629", "CAP,@VCC,@GND") - NETLIB_UPDATE(SN74LS629clk) - { - if (!m_enableq) - { - m_out = m_out ^ 1; - m_Y.push(m_out, m_inc); - } - else - { - m_Y.push(1, m_inc); - } - } - - NETLIB_UPDATE(SN74LS629) - { - { - // recompute - nl_double freq; - nl_double v_freq_2, v_freq_3, v_freq_4; - nl_double v_freq = m_FC(); - nl_double v_rng = m_RNG(); - - /* coefficients */ - const nl_double k1 = 1.9904769024796283E+03; - const nl_double k2 = 1.2070059213983407E+03; - const nl_double k3 = 1.3266985579561108E+03; - const nl_double k4 = -1.5500979825922698E+02; - const nl_double k5 = 2.8184536266938172E+00; - const nl_double k6 = -2.3503421582744556E+02; - const nl_double k7 = -3.3836786704527788E+02; - const nl_double k8 = -1.3569136703258670E+02; - const nl_double k9 = 2.9914575453819188E+00; - const nl_double k10 = 1.6855569086173170E+00; - - /* scale due to input resistance */ - - /* Polyfunctional3D_model created by zunzun.com using sum of squared absolute error */ - - v_freq_2 = v_freq * v_freq; - v_freq_3 = v_freq_2 * v_freq; - v_freq_4 = v_freq_3 * v_freq; - freq = k1; - freq += k2 * v_freq; - freq += k3 * v_freq_2; - freq += k4 * v_freq_3; - freq += k5 * v_freq_4; - freq += k6 * v_rng; - freq += k7 * v_rng * v_freq; - freq += k8 * v_rng * v_freq_2; - freq += k9 * v_rng * v_freq_3; - freq += k10 * v_rng * v_freq_4; - - freq *= plib::constants<nl_double>::cast(0.1e-6) / m_CAP(); - - // FIXME: we need a possibility to remove entries from queue ... - // or an exact model ... - m_clock.m_inc = netlist_time::from_double(0.5 / freq); - //m_clock.update(); - - //NL_VERBOSE_OUT(("{1} {2} {3} {4}\n", name(), v_freq, v_rng, freq)); - } - - if (!m_clock.m_enableq && m_ENQ()) - { - m_clock.m_enableq = 1; - m_clock.m_out = m_clock.m_out ^ 1; - m_clock.m_Y.push(m_clock.m_out, netlist_time::from_nsec(1)); - } - else if (m_clock.m_enableq && !m_ENQ()) - { - m_clock.m_enableq = 0; - m_clock.m_out = m_clock.m_out ^ 1; - m_clock.m_Y.push(m_clock.m_out, netlist_time::from_nsec(1)); - } - } - - NETLIB_DEVICE_IMPL(SN74LS629, "SN74LS629", "CAP") - NETLIB_DEVICE_IMPL(SN74LS629_dip, "SN74LS629_DIP", "1.CAP1,2.CAP2") - - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_74ls629.h b/src/lib/netlist/devices/nld_74ls629.h deleted file mode 100644 index 30d15d70865..00000000000 --- a/src/lib/netlist/devices/nld_74ls629.h +++ /dev/null @@ -1,42 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_74LS629.h - * - * SN74LS629: VOLTAGE-CONTROLLED OSCILLATORS - * - * +--------------+ - * 2FC |1 ++ 16| VCC - * 1FC |2 15| QSC VCC - * 1RNG |3 14| 2RNG - * 1CX1 |4 74LS629 13| 2CX1 - * 1CX2 |5 12| 2CX2 - * 1ENQ |6 11| 2ENQ - * 1Y |7 10| 2Y - * OSC GND |8 9| GND - * +--------------+ - * - * Naming conventions follow Texas Instruments datasheet - * - * NOTE: The CX1 and CX2 pins are not connected! - * The capacitor value has to be specified as a parameter. - * There are more comments on the challenges of emulating this - * chip in the *.c file - * - */ - -#ifndef NLD_74LS629_H_ -#define NLD_74LS629_H_ - -#include "netlist/nl_setup.h" - -#define SN74LS629(name, p_cap) \ - NET_REGISTER_DEV(SN74LS629, name) \ - NETDEV_PARAMI(name, CAP, p_cap) - -#define SN74LS629_DIP(name, p_cap1, p_cap2) \ - NET_REGISTER_DEV(SN74LS629_DIP, name) \ - NETDEV_PARAMI(name, 1.CAP, p_cap1) \ - NETDEV_PARAMI(name, 2.CAP, p_cap2) - -#endif /* NLD_74LS629_H_ */ diff --git a/src/lib/netlist/devices/nld_8277.cpp b/src/lib/netlist/devices/nld_8277.cpp new file mode 100644 index 00000000000..c1c59e360fd --- /dev/null +++ b/src/lib/netlist/devices/nld_8277.cpp @@ -0,0 +1,166 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/* + * nld_8277.cpp + * + * 8277: Dual 8-Bit Shift Register + * + * +--------------+ + * RESET |1 ++ 16| VCC + * /Q7A |2 15| /Q7B + * Q7A |3 14| Q7B + * DSA |4 8277 13| DSB + * D1A |5 12| D1B + * D0A |6 11| D0B + * CLKA |7 10| CLKB + * GND |8 9| CLK + * +--------------+ + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + NETLIB_OBJECT(8277_shifter) + { + NETLIB_CONSTRUCTOR(8277_shifter) + , m_D0(*this, "D0", NETLIB_DELEGATE(inputs)) + , m_D1(*this, "D1", NETLIB_DELEGATE(inputs)) + , m_DS(*this, "DS", NETLIB_DELEGATE(inputs)) + , m_buffer(*this, "m_buffer", 0) + , m_Q7(*this, "Q7") + , m_Q7Q(*this, "Q7Q") + , m_power_pins(*this) + { + } + + public: + void reset_shifter() noexcept + { + m_buffer = 0; + m_Q7.push(0, NLTIME_FROM_NS(40)); + m_Q7Q.push(1, NLTIME_FROM_NS(40)); + } + + void shift() noexcept + { + uint32_t in = (m_DS() ? m_D1() : m_D0()); + m_buffer <<= 1; + m_buffer |= in; + uint32_t out = (m_buffer >> 7) & 1; + uint32_t outq = (~m_buffer >> 7) & 1; + m_Q7.push(out, NLTIME_FROM_NS(40)); + m_Q7Q.push(outq, NLTIME_FROM_NS(40)); + } + + logic_input_t m_D0; + logic_input_t m_D1; + logic_input_t m_DS; + + state_var<uint8_t> m_buffer; + + logic_output_t m_Q7; + logic_output_t m_Q7Q; + nld_power_pins m_power_pins; + private: + NETLIB_HANDLERI(inputs) + { + /* do nothing */ + } + }; + + NETLIB_OBJECT(8277) + { + NETLIB_CONSTRUCTOR(8277) + , m_A(*this, "A") + , m_B(*this, "B") + , m_RESET(*this, "RESET", NETLIB_DELEGATE(shifter_reset)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_CLKA(*this, "CLKA", NETLIB_DELEGATE(clka)) + , m_CLKB(*this, "CLKB", NETLIB_DELEGATE(clkb)) + , m_last_CLK(*this, "m_last_CLK", 0) + , m_last_CLKA(*this, "m_last_CLKA", 0) + , m_last_CLKB(*this, "m_last_CLKB", 0) + // FIXME: needs family! + { + register_sub_alias("D0A", "A.D0"); + register_sub_alias("D1A", "A.D1"); + register_sub_alias("DSA", "A.DS"); + register_sub_alias("Q7A", "A.Q7"); + register_sub_alias("Q7QA", "A.Q7Q"); + register_sub_alias("D0B", "B.D0"); + register_sub_alias("D1B", "B.D1"); + register_sub_alias("DSB", "B.DS"); + register_sub_alias("Q7B", "B.Q7"); + register_sub_alias("Q7QB", "B.Q7Q"); + + connect("A.VCC", "B.VCC"); + connect("A.GND", "B.GND"); + + register_sub_alias("VCC", "A.VCC"); + register_sub_alias("GND", "A.GND"); + } + + NETLIB_RESETI() + { + m_last_CLK = 0; + m_last_CLKA = 0; + m_last_CLKB = 0; + } + + private: + NETLIB_HANDLERI(shifter_reset) + { + if (!m_RESET()) + { + m_A().reset_shifter(); + m_B().reset_shifter(); + } + } + + NETLIB_HANDLERI(clk) + { + if (!m_last_CLK && m_CLK()) + { + m_A().shift(); + m_B().shift(); + } + m_last_CLK = m_CLK(); + m_last_CLKA = m_CLKA(); + m_last_CLKB = m_CLKB(); + } + + NETLIB_HANDLERI(clka) + { + if (!m_last_CLKA && m_CLKA()) + { + m_A().shift(); + } + m_last_CLKA = m_CLKA(); + } + + NETLIB_HANDLERI(clkb) + { + if (!m_last_CLKB && m_CLKB()) + { + m_B().shift(); + } + m_last_CLKB = m_CLKB(); + } + + NETLIB_SUB(8277_shifter) m_A; + NETLIB_SUB(8277_shifter) m_B; + logic_input_t m_RESET; + logic_input_t m_CLK; + logic_input_t m_CLKA; + logic_input_t m_CLKB; + + state_var<uint32_t> m_last_CLK; + state_var<uint32_t> m_last_CLKA; + state_var<uint32_t> m_last_CLKB; + }; + + NETLIB_DEVICE_IMPL(8277, "TTL_8277", "+RESET,+CLK,+CLKA,+D0A,+D1A,+DSA,+CLKB,+D0B,+D1B,+DSB,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_82S115.cpp b/src/lib/netlist/devices/nld_82S115.cpp deleted file mode 100644 index 85ba43fa1e6..00000000000 --- a/src/lib/netlist/devices/nld_82S115.cpp +++ /dev/null @@ -1,119 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_82S115.cpp - * - */ - -#include "nld_82S115.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(82S115) - { - NETLIB_CONSTRUCTOR(82S115) - , m_A(*this, {{"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8"}}) - , m_CE1Q(*this, "CE1Q") - , m_CE2(*this, "CE2") - , m_STROBE(*this, "STROBE") - , m_O(*this, {{"O1", "O2", "O3", "O4", "O5", "O6", "O7", "O8"}}) - , m_last_O(*this, "m_last_O", 0) - , m_ROM(*this, "ROM") - , m_power_pins(*this) - { - } - - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - protected: - object_array_t<logic_input_t, 9> m_A; - logic_input_t m_CE1Q; - logic_input_t m_CE2; - logic_input_t m_STROBE; - object_array_t<logic_output_t, 8> m_O; - - state_var<unsigned> m_last_O; - - param_rom_t<uint8_t, 9, 8> m_ROM; // 4096 bits, 512x8 - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(82S115_dip, 82S115) - { - NETLIB_CONSTRUCTOR_DERIVED(82S115_dip, 82S115) - { - register_subalias("21", m_A[0]); - register_subalias("22", m_A[1]); - register_subalias("23", m_A[2]); - register_subalias("1", m_A[3]); - register_subalias("2", m_A[4]); - register_subalias("3", m_A[5]); - register_subalias("4", m_A[6]); - register_subalias("5", m_A[7]); - register_subalias("6", m_A[8]); - - register_subalias("20", m_CE1Q); - register_subalias("19", m_CE2); - - // register_subalias("13", m_FE1); - // register_subalias("11", m_FE2); - - register_subalias("18", m_STROBE); - - register_subalias("7", m_O[0]); - register_subalias("8", m_O[1]); - register_subalias("9", m_O[2]); - register_subalias("10", m_O[3]); - register_subalias("14", m_O[4]); - register_subalias("15", m_O[5]); - register_subalias("16", m_O[6]); - register_subalias("17", m_O[7]); - - register_subalias("12", "GND"); - register_subalias("24", "VCC"); - } - }; - - NETLIB_RESET(82S115) - { - m_last_O = 0; - } - - // FIXME: timing! - NETLIB_UPDATE(82S115) - { - unsigned o = 0; - - if (!m_CE1Q() && m_CE2()) - { - if (m_STROBE()) - { - unsigned a = 0; - for (std::size_t i=0; i<9; i++) - a |= (m_A[i]() << i); - - o = m_ROM[a]; - } - else - { - o = m_last_O; - } - } - - m_last_O = o; - - // FIXME: Outputs are tristate. This needs to be properly implemented - for (std::size_t i=0; i<8; i++) - m_O[i].push((o >> i) & 1, NLTIME_FROM_NS(40)); // FIXME: Timing - } - - NETLIB_DEVICE_IMPL(82S115, "PROM_82S115", "+CE1Q,+CE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+STROBE,@VCC,@GND") - NETLIB_DEVICE_IMPL(82S115_dip, "PROM_82S115_DIP", "") - - } //namespace devices -} // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S115.h b/src/lib/netlist/devices/nld_82S115.h deleted file mode 100644 index da4c1209e81..00000000000 --- a/src/lib/netlist/devices/nld_82S115.h +++ /dev/null @@ -1,53 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_82S115.h - * - * 82S115: 4K-bit TTL bipolar PROM (512 x 8) - * - * +--------------+ - * A3 |1 ++ 24| VCC - * A4 |2 23| A2 - * A5 |3 22| A1 - * A6 |4 82S115 21| A0 - * A7 |5 20| CE1Q - * A8 |6 19| CE2 - * O1 |7 18| STROBE - * O2 |8 17| O8 - * O3 |9 16| O7 - * O4 |10 15| O6 - * FE2 |11 14| O5 - * GND |12 13| FE1 - * +--------------+ - * - * - * Naming conventions follow Signetics datasheet - * - */ - -#ifndef NLD_82S115_H_ -#define NLD_82S115_H_ - -#include "netlist/nl_setup.h" - -#define PROM_82S115(name, cCE1Q, cCE2, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cSTROBE) \ - NET_REGISTER_DEV(PROM_82S115, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CE1Q, cCE1Q) \ - NET_CONNECT(name, CE2, cCE2) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, A5, cA5) \ - NET_CONNECT(name, A6, cA6) \ - NET_CONNECT(name, A7, cA7) \ - NET_CONNECT(name, A8, cA8) \ - NET_CONNECT(name, STROBE, cSTROBE) - -#define PROM_82S115_DIP(name) \ - NET_REGISTER_DEV(PROM_82S115_DIP, name) - -#endif /* NLD_82S115_H_ */ diff --git a/src/lib/netlist/devices/nld_82S123.cpp b/src/lib/netlist/devices/nld_82S123.cpp deleted file mode 100644 index d20b3a7147d..00000000000 --- a/src/lib/netlist/devices/nld_82S123.cpp +++ /dev/null @@ -1,88 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_82S123.cpp - * - */ - -#include "nld_82S123.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(82S123) - { - NETLIB_CONSTRUCTOR(82S123) - , m_A(*this, {{"A0", "A1", "A2", "A3", "A4"}}) - , m_CEQ(*this, "CEQ") - , m_O(*this, {{"O1", "O2", "O3", "O4", "O5", "O6", "O7", "O8"}}) - , m_ROM(*this, "ROM") - , m_power_pins(*this) - { - } - - NETLIB_UPDATEI(); - - protected: - object_array_t<logic_input_t, 5> m_A; - logic_input_t m_CEQ; - object_array_t<logic_output_t, 8> m_O; - - param_rom_t<uint8_t, 5, 8> m_ROM; // 256 bits, 32x8 - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(82S123_dip, 82S123) - { - NETLIB_CONSTRUCTOR_DERIVED(82S123_dip, 82S123) - { - register_subalias("1", m_O[0]); - register_subalias("2", m_O[1]); - register_subalias("3", m_O[2]); - register_subalias("4", m_O[3]); - register_subalias("5", m_O[4]); - register_subalias("6", m_O[5]); - register_subalias("7", m_O[6]); - register_subalias("8", "GND"); - - register_subalias("9", m_O[7]); - register_subalias("10", m_A[0]); - register_subalias("11", m_A[1]); - register_subalias("12", m_A[2]); - register_subalias("13", m_A[3]); - register_subalias("14", m_A[4]); - register_subalias("15", m_CEQ); - register_subalias("16", "VCC"); - } - }; - - // FIXME: timing! - NETLIB_UPDATE(82S123) - { - unsigned o = 0xff; - - netlist_time delay = NLTIME_FROM_NS(35); - if (!m_CEQ()) - { - unsigned a = 0; - for (std::size_t i=0; i<5; i++) - a |= (m_A[i]() << i); - - o = m_ROM[a]; - - delay = NLTIME_FROM_NS(50); - } - - // FIXME: Outputs are tristate. This needs to be properly implemented - for (std::size_t i=0; i<8; i++) - m_O[i].push((o >> i) & 1, delay); - } - - NETLIB_DEVICE_IMPL(82S123, "PROM_82S123", "+CEQ,+A0,+A1,+A2,+A3,+A4,@VCC,@GND") - NETLIB_DEVICE_IMPL(82S123_dip, "PROM_82S123_DIP", "") - - } //namespace devices -} // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S123.h b/src/lib/netlist/devices/nld_82S123.h deleted file mode 100644 index 69088b03f6b..00000000000 --- a/src/lib/netlist/devices/nld_82S123.h +++ /dev/null @@ -1,44 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_82S123.h - * - * 82S23: 256-bit (32x8) TTL bipolar PROM with open-collector outputs - * 82S123: 256-bit (32x8) TTL bipolar PROM with tri-state outputs - * - * +--------------+ - * O1 |1 ++ 16| VCC - * O2 |2 15| CEQ - * O3 |3 14| A4 - * O4 |4 82S123 13| A3 - * O5 |5 12| A2 - * O6 |6 11| A1 - * O7 |7 10| A0 - * GND |8 9| O8 - * +--------------+ - * - * - * Naming conventions follow Philips datasheet - * - */ - -#ifndef NLD_82S123_H_ -#define NLD_82S123_H_ - -#include "netlist/nl_setup.h" - -#define PROM_82S123(name, cCEQ, cA0, cA1, cA2, cA3, cA4) \ - NET_REGISTER_DEV(PROM_82S123, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CEQ, cCEQ) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) - -#define PROM_82S123_DIP(name) \ - NET_REGISTER_DEV(PROM_82S123_DIP, name) - -#endif /* NLD_82S123_H_ */ diff --git a/src/lib/netlist/devices/nld_82S126.cpp b/src/lib/netlist/devices/nld_82S126.cpp deleted file mode 100644 index 9ce6697c82e..00000000000 --- a/src/lib/netlist/devices/nld_82S126.cpp +++ /dev/null @@ -1,92 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_82S126.cpp - * - */ - -#include "nld_82S126.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(82S126) - { - NETLIB_CONSTRUCTOR(82S126) - , m_A(*this, {{"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7" }}) - , m_CE1Q(*this, "CE1Q") - , m_CE2Q(*this, "CE2Q") - , m_O(*this, {{"O1", "O2", "O3", "O4" }}) - , m_ROM(*this, "ROM") - , m_power_pins(*this) - { - } - - NETLIB_UPDATEI(); - - protected: - object_array_t<logic_input_t, 8> m_A; - logic_input_t m_CE1Q; - logic_input_t m_CE2Q; - object_array_t<logic_output_t, 4> m_O; - - param_rom_t<uint8_t, 8, 4> m_ROM; // 1024 bits, 32x32, used as 256x4 - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(82S126_dip, 82S126) - { - NETLIB_CONSTRUCTOR_DERIVED(82S126_dip, 82S126) - { - register_subalias("5", m_A[0]); - register_subalias("6", m_A[1]); - register_subalias("7", m_A[2]); - register_subalias("4", m_A[3]); - register_subalias("3", m_A[4]); - register_subalias("2", m_A[5]); - register_subalias("1", m_A[6]); - register_subalias("15", m_A[7]); - - register_subalias("13", m_CE1Q); - register_subalias("14", m_CE2Q); - - register_subalias("12", m_O[0]); - register_subalias("11", m_O[1]); - register_subalias("10", m_O[2]); - register_subalias("9", m_O[3]); - - register_subalias("8", "GND"); - register_subalias("16", "VCC"); - } - }; - - // FIXME: timing! - NETLIB_UPDATE(82S126) - { - unsigned o = 0xf; - - netlist_time delay = NLTIME_FROM_NS(25); - if (!m_CE1Q() && !m_CE2Q()) - { - unsigned a = 0; - for (std::size_t i=0; i<8; i++) - a |= (m_A[i]() << i); - - o = m_ROM[a]; - - delay = NLTIME_FROM_NS(50); - } - - // FIXME: Outputs are tristate. This needs to be properly implemented - for (std::size_t i=0; i<4; i++) - m_O[i].push((o >> i) & 1, delay); - } - - NETLIB_DEVICE_IMPL(82S126, "PROM_82S126", "+CE1Q,+CE2Q,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,@VCC,@GND") - NETLIB_DEVICE_IMPL(82S126_dip, "PROM_82S126_DIP", "") - - } //namespace devices -} // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S126.h b/src/lib/netlist/devices/nld_82S126.h deleted file mode 100644 index 35f2c0dd725..00000000000 --- a/src/lib/netlist/devices/nld_82S126.h +++ /dev/null @@ -1,47 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_82S126.h - * - * 82S126: 1K-bit TTL bipolar PROM - * - * +--------------+ - * A6 |1 ++ 16| VCC - * A5 |2 15| Q7 - * A4 |3 14| CE2Q - * A3 |4 82S126 13| CE1Q - * A0 |5 12| O1 - * A1 |6 11| O2 - * A2 |7 10| O3 - * GND |8 9| O4 - * +--------------+ - * - * - * Naming conventions follow Signetics datasheet - * - */ - -#ifndef NLD_82S126_H_ -#define NLD_82S126_H_ - -#include "netlist/nl_setup.h" - -#define PROM_82S126(name, cCE1Q, cCE2Q, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7) \ - NET_REGISTER_DEV(PROM_82S126, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CE1Q, cCE1Q) \ - NET_CONNECT(name, CE2Q, cCE2Q) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, A5, cA5) \ - NET_CONNECT(name, A6, cA6) \ - NET_CONNECT(name, A7, cA7) - -#define PROM_82S126_DIP(name) \ - NET_REGISTER_DEV(PROM_82S126_DIP, name) - -#endif /* NLD_82S126_H_ */ diff --git a/src/lib/netlist/devices/nld_82S16.cpp b/src/lib/netlist/devices/nld_82S16.cpp deleted file mode 100644 index cce10063061..00000000000 --- a/src/lib/netlist/devices/nld_82S16.cpp +++ /dev/null @@ -1,143 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_82S16.c - * - */ - -#include "nld_82S16.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { - NETLIB_OBJECT(82S16) - { - NETLIB_CONSTRUCTOR(82S16) - , m_A(*this, {{"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7" }}, NETLIB_DELEGATE(82S16, addr)) - , m_CE1Q(*this, "CE1Q", NETLIB_DELEGATE(82S16, enq)) - , m_CE2Q(*this, "CE2Q", NETLIB_DELEGATE(82S16, enq)) - , m_CE3Q(*this, "CE3Q", NETLIB_DELEGATE(82S16, enq)) - , m_WEQ(*this, "WEQ") - , m_DIN(*this, "DIN") - , m_DOUTQ(*this, "DOUTQ") - , m_ram(*this, "m_ram", 0) - , m_addr(*this, "m_addr", 0) - , m_enq(*this, "m_enq", 0) - , m_power_pins(*this) - { - } - - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_HANDLERI(addr) - { - uint8_t adr = 0; - for (std::size_t i=0; i<8; i++) - { - //m_A[i].activate(); - adr |= (m_A[i]() << i); - } - m_addr = adr; - NETLIB_NAME(82S16)::update(); - } - NETLIB_HANDLERI(enq) - { - const auto last = m_enq; - m_enq = m_CE1Q() || m_CE2Q() || m_CE3Q(); - if (!last && m_enq) - { - // FIXME: Outputs are tristate. This needs to be properly implemented - m_DOUTQ.push(1, NLTIME_FROM_NS(20)); - for (std::size_t i=0; i<8; i++) - m_A[i].inactivate(); - m_WEQ.inactivate(); - m_DIN.inactivate(); - } - else if (last && !m_enq) - { - for (std::size_t i=0; i<8; i++) - m_A[i].activate(); - m_WEQ.activate(); - m_DIN.activate(); - NETLIB_NAME(82S16)::update(); - } - } - - - protected: - object_array_t<logic_input_t, 8> m_A; - logic_input_t m_CE1Q; - logic_input_t m_CE2Q; - logic_input_t m_CE3Q; - logic_input_t m_WEQ; - logic_input_t m_DIN; - logic_output_t m_DOUTQ; - - state_array<uint64_t, 4> m_ram; // 256 bits - state_var_u8 m_addr; // 256 bits - state_var_sig m_enq; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(82S16_dip, 82S16) - { - NETLIB_CONSTRUCTOR_DERIVED(82S16_dip, 82S16) - { - register_subalias("2", m_A[0]); - register_subalias("1", m_A[1]); - register_subalias("15", m_A[2]); - register_subalias("14", m_A[3]); - register_subalias("7", m_A[4]); - register_subalias("9", m_A[5]); - register_subalias("10", m_A[6]); - register_subalias("11", m_A[7]); - - register_subalias("3", m_CE1Q); - register_subalias("4", m_CE2Q); - register_subalias("5", m_CE3Q); - - register_subalias("12", m_WEQ); - register_subalias("13", m_DIN); - - register_subalias("6", m_DOUTQ); - - register_subalias("8", "GND"); - register_subalias("16", "VCC"); - } - }; - - // FIXME: timing! - // FIXME: optimize device (separate address decoder!) - NETLIB_UPDATE(82S16) - { - if (!m_enq) - { - const auto adr(m_addr); - if (!m_WEQ()) - { - m_ram[adr >> 6] = (m_ram[adr >> 6] - & ~(static_cast<uint64_t>(1) << (adr & 0x3f))) - | (static_cast<uint64_t>(m_DIN()) << (adr & 0x3f)); - } - m_DOUTQ.push(((m_ram[adr >> 6] >> (adr & 0x3f)) & 1) ^ 1, NLTIME_FROM_NS(20)); - } - } - - NETLIB_RESET(82S16) - { - for (std::size_t i=0; i<4; i++) - { - m_ram[i] = 0; - } - m_addr = 0; - m_enq = 0; - } - - NETLIB_DEVICE_IMPL(82S16, "TTL_82S16", "") - NETLIB_DEVICE_IMPL(82S16_dip, "TTL_82S16_DIP", "") - - } //namespace devices -} // namespace netlist diff --git a/src/lib/netlist/devices/nld_82S16.h b/src/lib/netlist/devices/nld_82S16.h deleted file mode 100644 index 47d6189a79b..00000000000 --- a/src/lib/netlist/devices/nld_82S16.h +++ /dev/null @@ -1,34 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_82S16.h - * - * DM82S16: 256 Bit bipolar ram - * - * +--------------+ - * A1 |1 ++ 16| VCC - * A0 |2 15| A2 - * CE1Q |3 14| A3 - * CE2Q |4 82S16 13| DIN - * CE3Q |5 12| WEQ - * DOUTQ |6 11| A7 - * A4 |7 10| A6 - * GND |8 9| A5 - * +--------------+ - * - * - * Naming conventions follow Signetics datasheet - * - */ - -#ifndef NLD_82S16_H_ -#define NLD_82S16_H_ - -#include "netlist/nl_setup.h" - -#define TTL_82S16(name) \ - NET_REGISTER_DEV(TTL_82S16, name) -#define TTL_82S16_DIP(name) \ - NET_REGISTER_DEV(TTL_82S16_DIP, name) - -#endif /* NLD_82S16_H_ */ diff --git a/src/lib/netlist/devices/nld_82s115.cpp b/src/lib/netlist/devices/nld_82s115.cpp new file mode 100644 index 00000000000..5c7db00f347 --- /dev/null +++ b/src/lib/netlist/devices/nld_82s115.cpp @@ -0,0 +1,94 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/* + * nld_82S115.cpp + * + * 82S115: 4K-bit TTL bipolar PROM (512 x 8) + * + * +--------------+ + * A3 |1 ++ 24| VCC + * A4 |2 23| A2 + * A5 |3 22| A1 + * A6 |4 82S115 21| A0 + * A7 |5 20| CE1Q + * A8 |6 19| CE2 + * O1 |7 18| STROBE + * O2 |8 17| O8 + * O3 |9 16| O7 + * O4 |10 15| O6 + * FE2 |11 14| O5 + * GND |12 13| FE1 + * +--------------+ + * + * + * Naming conventions follow Signetics datasheet + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + NETLIB_OBJECT(82S115) + { + NETLIB_CONSTRUCTOR(82S115) + , m_A(*this, {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8"}, NETLIB_DELEGATE(inputs)) + , m_CE1Q(*this, "CE1Q", NETLIB_DELEGATE(inputs)) + , m_CE2(*this, "CE2", NETLIB_DELEGATE(inputs)) + , m_STROBE(*this, "STROBE", NETLIB_DELEGATE(inputs)) + , m_O(*this, {"O1", "O2", "O3", "O4", "O5", "O6", "O7", "O8"}) + , m_last_O(*this, "m_last_O", 0) + , m_ROM(*this, "ROM") + , m_power_pins(*this) + { + } + + NETLIB_RESETI() + { + m_last_O = 0; + } + + private: + // FIXME: timing! + NETLIB_HANDLERI(inputs) + { + unsigned o = 0; + + if (!m_CE1Q() && m_CE2()) + { + if (m_STROBE()) + { + unsigned a = 0; + for (std::size_t i=0; i<9; i++) + a |= (m_A[i]() << i); + + o = m_ROM[a]; + } + else + { + o = m_last_O; + } + } + + m_last_O = o; + + // FIXME: Outputs are tristate. This needs to be properly implemented + for (std::size_t i=0; i<8; i++) + m_O[i].push((o >> i) & 1, NLTIME_FROM_NS(40)); // FIXME: Timing + } + + object_array_t<logic_input_t, 9> m_A; + logic_input_t m_CE1Q; + logic_input_t m_CE2; + logic_input_t m_STROBE; + object_array_t<logic_output_t, 8> m_O; + + state_var<unsigned> m_last_O; + + param_rom_t<uint8_t, 9, 8> m_ROM; // 4096 bits, 512x8 + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(82S115, "PROM_82S115", "+CE1Q,+CE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+STROBE,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_82s16.cpp b/src/lib/netlist/devices/nld_82s16.cpp new file mode 100644 index 00000000000..9ebc7c370c1 --- /dev/null +++ b/src/lib/netlist/devices/nld_82s16.cpp @@ -0,0 +1,124 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_82S16.cpp + * + * + * DM82S16: 256 Bit bipolar ram + * + * +--------------+ + * A1 |1 ++ 16| VCC + * A0 |2 15| A2 + * CE1Q |3 14| A3 + * CE2Q |4 82S16 13| DIN + * CE3Q |5 12| WEQ + * DOUTQ |6 11| A7 + * A4 |7 10| A6 + * GND |8 9| A5 + * +--------------+ + * + * + * Naming conventions follow Signetics datasheet + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + NETLIB_OBJECT(82S16) + { + NETLIB_CONSTRUCTOR(82S16) + , m_A(*this, {"A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7"}, NETLIB_DELEGATE(addr)) + , m_CE1Q(*this, "CE1Q", NETLIB_DELEGATE(enq)) + , m_CE2Q(*this, "CE2Q", NETLIB_DELEGATE(enq)) + , m_CE3Q(*this, "CE3Q", NETLIB_DELEGATE(enq)) + , m_WEQ(*this, "WEQ", NETLIB_DELEGATE(inputs)) + , m_DIN(*this, "DIN", NETLIB_DELEGATE(inputs)) + , m_DOUTQ(*this, "DOUTQ") + , m_ram(*this, "m_ram", 0) + , m_addr(*this, "m_addr", 0) + , m_enq(*this, "m_enq", 0) + , m_power_pins(*this) + { + } + + NETLIB_RESETI() + { + for (std::size_t i=0; i<4; i++) + { + m_ram[i] = 0; + } + m_addr = 0; + m_enq = 0; + } + + private: + // FIXME: timing! + // FIXME: optimize device (separate address decoder!) + NETLIB_HANDLERI(inputs) + { + if (!m_enq) + { + const decltype(m_addr)::value_type adr(m_addr); + if (!m_WEQ()) + { + m_ram[adr >> 6] = (m_ram[adr >> 6] + & ~(static_cast<uint64_t>(1) << (adr & 0x3f))) + | (static_cast<uint64_t>(m_DIN()) << (adr & 0x3f)); + } + m_DOUTQ.push(((m_ram[adr >> 6] >> (adr & 0x3f)) & 1) ^ 1, NLTIME_FROM_NS(20)); + } + } + + NETLIB_HANDLERI(addr) + { + uint8_t adr = 0; + for (std::size_t i=0; i<8; i++) + { + //m_A[i].activate(); + adr |= (m_A[i]() << i); + } + m_addr = adr; + inputs(); + } + NETLIB_HANDLERI(enq) + { + const decltype(m_enq)::value_type last = m_enq; + m_enq = m_CE1Q() || m_CE2Q() || m_CE3Q(); + if (!last && m_enq) + { + // FIXME: Outputs are tristate. This needs to be properly implemented + m_DOUTQ.push(1, NLTIME_FROM_NS(20)); + for (std::size_t i=0; i<8; i++) + m_A[i].inactivate(); + m_WEQ.inactivate(); + m_DIN.inactivate(); + } + else if (last && !m_enq) + { + for (std::size_t i=0; i<8; i++) + m_A[i].activate(); + m_WEQ.activate(); + m_DIN.activate(); + inputs(); + } + } + + object_array_t<logic_input_t, 8> m_A; + logic_input_t m_CE1Q; + logic_input_t m_CE2Q; + logic_input_t m_CE3Q; + logic_input_t m_WEQ; + logic_input_t m_DIN; + logic_output_t m_DOUTQ; + + state_container<std::array<uint64_t, 4>> m_ram; // 256 bits + state_var_u8 m_addr; // 256 bits + state_var_sig m_enq; + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(82S16, "TTL_82S16", "") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_9310.cpp b/src/lib/netlist/devices/nld_9310.cpp index bb1e9cc46e3..c9b51b08985 100644 --- a/src/lib/netlist/devices/nld_9310.cpp +++ b/src/lib/netlist/devices/nld_9310.cpp @@ -1,223 +1,24 @@ -// license:GPL-2.0+ -//+opyright-holders:Couriersud +// license:BSD-3-Clause +// copyright-holders:Couriersud /* - * nld_9310.c + * nld_9310.cpp * */ -#include "nld_9310.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" +#include "nl_factory.h" -#define MAXCNT 9 +#include "nld_9316_base.hxx" -namespace netlist -{ - namespace devices - { +// FIXME: All detail can be found in nld_9316_base.hxx +// At least gcc-7.x needs the implementations of the base device +// in different compilation units. If created in the same file +// performance degrades horrible. - NETLIB_OBJECT(9310) - { - NETLIB_CONSTRUCTOR(9310) - , m_ENP(*this, "ENP") - , m_ENT(*this, "ENT") - , m_CLRQ(*this, "CLRQ") - , m_LOADQ(*this, "LOADQ") - , m_A(*this, "A", NETLIB_DELEGATE(9310, abcd)) - , m_B(*this, "B", NETLIB_DELEGATE(9310, abcd)) - , m_C(*this, "C", NETLIB_DELEGATE(9310, abcd)) - , m_D(*this, "D", NETLIB_DELEGATE(9310, abcd)) - , m_CLK(*this, "CLK", NETLIB_DELEGATE(9310, sub)) - , m_QA(*this, "QA") - , m_QB(*this, "QB") - , m_QC(*this, "QC") - , m_QD(*this, "QD") - , m_RC(*this, "RC") - , m_cnt(*this, "m_cnt", 0) - , m_loadq(*this, "m_loadq", 0) - , m_ent(*this, "m_ent", 0) - , m_power_pins(*this) - { - } +// FIXME: this file could be created programmatically - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - NETLIB_HANDLERI(abcd) { } // do nothing - - NETLIB_HANDLERI(sub) - { - auto cnt(m_cnt); - - if (m_loadq) - { - if (cnt < MAXCNT - 1) - { - ++cnt; - update_outputs(cnt); - } - else if (cnt == MAXCNT - 1) - { - cnt = MAXCNT; - m_RC.push(m_ent, NLTIME_FROM_NS(20)); - m_QA.push(1, NLTIME_FROM_NS(20)); - } - else // MAXCNT - { - m_RC.push(0, NLTIME_FROM_NS(20)); - cnt = 0; - update_outputs_all(cnt, NLTIME_FROM_NS(20)); - } - } - else - { - cnt = read_ABCD(); - m_RC.push(m_ent & (cnt == MAXCNT), NLTIME_FROM_NS(27)); - update_outputs_all(cnt, NLTIME_FROM_NS(22)); - } - m_cnt = cnt; - } - - protected: - - unsigned read_ABCD() const - { - return (m_D() << 3) | (m_C() << 2) | (m_B() << 1) | (m_A() << 0); - } - - void update_outputs_all(const unsigned cnt, const netlist_time out_delay) - { - m_QA.push((cnt >> 0) & 1, out_delay); - m_QB.push((cnt >> 1) & 1, out_delay); - m_QC.push((cnt >> 2) & 1, out_delay); - m_QD.push((cnt >> 3) & 1, out_delay); - } - - void update_outputs(const unsigned cnt) - { - /* static */ const netlist_time out_delay = NLTIME_FROM_NS(20); - #if 0 - // for (int i=0; i<4; i++) - // m_Q[i], (cnt >> i) & 1, delay[i]); - m_QA.push((cnt >> 0) & 1, out_delay); - m_QB.push((cnt >> 1) & 1, out_delay); - m_QC.push((cnt >> 2) & 1, out_delay); - m_QD.push((cnt >> 3) & 1, out_delay); - #else - if ((cnt & 1) == 1) - m_QA.push(1, out_delay); - else - { - m_QA.push(0, out_delay); - switch (cnt) - { - case 0x00: - m_QB.push(0, out_delay); - m_QC.push(0, out_delay); - m_QD.push(0, out_delay); - break; - case 0x02: - case 0x06: - case 0x0A: - case 0x0E: - m_QB.push(1, out_delay); - break; - case 0x04: - case 0x0C: - m_QB.push(0, out_delay); - m_QC.push(1, out_delay); - break; - case 0x08: - m_QB.push(0, out_delay); - m_QC.push(0, out_delay); - m_QD.push(1, out_delay); - break; - } - - } - #endif - } - - logic_input_t m_ENP; - logic_input_t m_ENT; - logic_input_t m_CLRQ; - logic_input_t m_LOADQ; - logic_input_t m_A; - logic_input_t m_B; - logic_input_t m_C; - logic_input_t m_D; - logic_input_t m_CLK; - - logic_output_t m_QA; - logic_output_t m_QB; - logic_output_t m_QC; - logic_output_t m_QD; - logic_output_t m_RC; - - state_var<unsigned> m_cnt; - state_var<netlist_sig_t> m_loadq; - state_var<netlist_sig_t> m_ent; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(9310_dip, 9310) - { - NETLIB_CONSTRUCTOR_DERIVED(9310_dip, 9310) - { - register_subalias("1", m_CLRQ); - register_subalias("2", m_CLK); - register_subalias("3", m_A); - register_subalias("4", m_B); - register_subalias("5", m_C); - register_subalias("6", m_D); - register_subalias("7", m_ENP); - register_subalias("8", "GND"); - - register_subalias("9", m_LOADQ); - register_subalias("10", m_ENT); - register_subalias("11", m_QD); - register_subalias("12", m_QC); - register_subalias("13", m_QB); - register_subalias("14", m_QA); - register_subalias("15", m_RC); - register_subalias("16", "VCC"); - } - }; - - NETLIB_RESET(9310) - { - m_CLK.set_state(logic_t::STATE_INP_LH); - m_cnt = 0; - m_loadq = 1; - m_ent = 1; - } - - NETLIB_UPDATE(9310) - { - m_loadq = m_LOADQ(); - m_ent = m_ENT(); - const netlist_sig_t clrq = m_CLRQ(); - - if ((!m_loadq || (m_ent & m_ENP())) && clrq) - { - m_CLK.activate_lh(); - m_RC.push(m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); - } - else - { - m_CLK.inactivate(); - if (!clrq && (m_cnt>0)) - { - update_outputs_all(0, NLTIME_FROM_NS(36)); - m_cnt = 0; - //return; - } - m_RC.push(m_ent & (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); - } - } +namespace netlist::devices { NETLIB_DEVICE_IMPL(9310, "TTL_9310", "+CLK,+ENP,+ENT,+CLRQ,+LOADQ,+A,+B,+C,+D,@VCC,@GND") - NETLIB_DEVICE_IMPL(9310_dip, "TTL_9310_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_9310.h b/src/lib/netlist/devices/nld_9310.h deleted file mode 100644 index fa6dc0a3351..00000000000 --- a/src/lib/netlist/devices/nld_9310.h +++ /dev/null @@ -1,67 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_9310.h - * - * DM9310: Synchronous 4-Bit Counters - * - * FIXME: This should be merged with the 9316. The only difference is MAXCNT! - * - * +--------------+ - * CLEAR |1 ++ 16| VCC - * CLOCK |2 15| RC (Ripple Carry) - * A |3 14| QA - * B |4 9310 13| QB - * C |5 12| QC - * D |6 11| QD - * Enable P |7 10| Enable T - * GND |8 9| LOAD - * +--------------+ - * - * Counter Sequence - * - * +-------++----+----+----+----+----+ - * | COUNT || QD | QC | QB | QA | RC | - * +=======++====+====+====+====+====+ - * | 0 || 0 | 0 | 0 | 0 | 0 | - * | 1 || 0 | 0 | 0 | 1 | 0 | - * | 2 || 0 | 0 | 1 | 0 | 0 | - * | 3 || 0 | 0 | 1 | 1 | 0 | - * | 4 || 0 | 1 | 0 | 0 | 0 | - * | 5 || 0 | 1 | 0 | 1 | 0 | - * | 6 || 0 | 1 | 1 | 0 | 0 | - * | 7 || 0 | 1 | 1 | 1 | 0 | - * | 8 || 1 | 0 | 0 | 0 | 0 | - * | 9 || 1 | 0 | 0 | 1 | 0 | - * +-------++----+----+----+----+----+ - * - * Reset count function: Please refer to - * National Semiconductor datasheet (timing diagram) - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_9310_H_ -#define NLD_9310_H_ - -#include "netlist/nl_setup.h" - -#define TTL_9310(name, cCLK, cENP, cENT, cCLRQ, cLOADQ, cA, cB, cC, cD) \ - NET_REGISTER_DEV(TTL_9310, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, ENP, cENP) \ - NET_CONNECT(name, ENT, cENT) \ - NET_CONNECT(name, CLRQ, cCLRQ) \ - NET_CONNECT(name, LOADQ,_LOADQ) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) - -#define TTL_9310_DIP(name) \ - NET_REGISTER_DEV(TTL_9310_DIP, name) - -#endif /* NLD_9310_H_ */ diff --git a/src/lib/netlist/devices/nld_9316.cpp b/src/lib/netlist/devices/nld_9316.cpp index 8977f9d0364..54dcb7cc39e 100644 --- a/src/lib/netlist/devices/nld_9316.cpp +++ b/src/lib/netlist/devices/nld_9316.cpp @@ -1,141 +1,100 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_9316.c + * nld_9316.cpp + * + * DM9316: Synchronous 4-Bit Counters + * + * +--------------+ + * /CLEAR |1 ++ 16| VCC + * CLOCK |2 15| RC (Ripple Carry) + * A |3 14| QA + * B |4 9316 13| QB + * C |5 12| QC + * D |6 11| QD + * Enable P |7 10| Enable T + * GND |8 9| /LOAD + * +--------------+ + * + * Counter Sequence + * + * +-------++----+----+----+----+----+ + * | COUNT || QD | QC | QB | QA | RC | + * +=======++====+====+====+====+====+ + * | 0 || 0 | 0 | 0 | 0 | 0 | + * | 1 || 0 | 0 | 0 | 1 | 0 | + * | 2 || 0 | 0 | 1 | 0 | 0 | + * | 3 || 0 | 0 | 1 | 1 | 0 | + * | 4 || 0 | 1 | 0 | 0 | 0 | + * | 5 || 0 | 1 | 0 | 1 | 0 | + * | 6 || 0 | 1 | 1 | 0 | 0 | + * | 7 || 0 | 1 | 1 | 1 | 0 | + * | 8 || 1 | 0 | 0 | 0 | 0 | + * | 9 || 1 | 0 | 0 | 1 | 0 | + * | 10 || 1 | 0 | 1 | 0 | 0 | + * | 11 || 1 | 0 | 1 | 1 | 0 | + * | 12 || 1 | 1 | 0 | 0 | 0 | + * | 13 || 1 | 1 | 0 | 1 | 0 | + * | 14 || 1 | 1 | 1 | 0 | 0 | + * | 15 || 1 | 1 | 1 | 1 | 1 | + * +-------++----+----+----+----+----+ + * + * Reset count function: Please refer to + * National Semiconductor datasheet (timing diagram) + * + * Naming conventions follow National Semiconductor datasheet + * + * DM9310: Synchronous 4-Bit Counters + * + * +--------------+ + * CLEAR |1 ++ 16| VCC + * CLOCK |2 15| RC (Ripple Carry) + * A |3 14| QA + * B |4 9310 13| QB + * C |5 12| QC + * D |6 11| QD + * Enable P |7 10| Enable T + * GND |8 9| LOAD + * +--------------+ + * + * Counter Sequence + * + * +-------++----+----+----+----+----+ + * | COUNT || QD | QC | QB | QA | RC | + * +=======++====+====+====+====+====+ + * | 0 || 0 | 0 | 0 | 0 | 0 | + * | 1 || 0 | 0 | 0 | 1 | 0 | + * | 2 || 0 | 0 | 1 | 0 | 0 | + * | 3 || 0 | 0 | 1 | 1 | 0 | + * | 4 || 0 | 1 | 0 | 0 | 0 | + * | 5 || 0 | 1 | 0 | 1 | 0 | + * | 6 || 0 | 1 | 1 | 0 | 0 | + * | 7 || 0 | 1 | 1 | 1 | 0 | + * | 8 || 1 | 0 | 0 | 0 | 0 | + * | 9 || 1 | 0 | 0 | 1 | 0 | + * +-------++----+----+----+----+----+ + * + * Reset count function: Please refer to + * National Semiconductor datasheet (timing diagram) + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_9316.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" - -namespace netlist -{ - namespace devices - { - - static constexpr const unsigned MAXCNT = 15; - - NETLIB_OBJECT(9316) - { - NETLIB_CONSTRUCTOR(9316) - , m_CLK(*this, "CLK", NETLIB_DELEGATE(9316, clk)) - , m_ENT(*this, "ENT") - , m_RC(*this, "RC") - , m_LOADQ(*this, "LOADQ") - , m_ENP(*this, "ENP") - , m_CLRQ(*this, "CLRQ") - , m_ABCD(*this, {{"A", "B", "C", "D"}}, NETLIB_DELEGATE(9316, abcd)) - , m_Q(*this, {{ "QA", "QB", "QC", "QD" }}) - , m_cnt(*this, "m_cnt", 0) - , m_abcd(*this, "m_abcd", 0) - , m_loadq(*this, "m_loadq", 0) - , m_ent(*this, "m_ent", 0) - , m_power_pins(*this) - { - } - - private: - NETLIB_RESETI() - { - m_CLK.set_state(logic_t::STATE_INP_LH); - m_cnt = 0; - m_abcd = 0; - } - - NETLIB_UPDATEI() - { - const auto CLRQ(m_CLRQ()); - m_ent = m_ENT(); - m_loadq = m_LOADQ(); - - if (((m_loadq ^ 1) || (m_ent && m_ENP())) && CLRQ) - { - m_CLK.activate_lh(); - } - else - { - m_CLK.inactivate(); - if (!CLRQ && (m_cnt>0)) - { - update_outputs_all(0, NLTIME_FROM_NS(36)); - m_cnt = 0; - } - } - m_RC.push(m_ent && (m_cnt == MAXCNT), NLTIME_FROM_NS(27)); - } - - - NETLIB_HANDLERI(clk) - { - auto cnt = (m_loadq ? (m_cnt + 1) & MAXCNT: m_abcd); - m_RC.push(m_ent && (cnt == MAXCNT), NLTIME_FROM_NS(27)); - update_outputs_all(cnt, NLTIME_FROM_NS(20)); - m_cnt = cnt; - } - - NETLIB_HANDLERI(abcd) - { - m_abcd = static_cast<unsigned>((m_ABCD[0]() << 0) | (m_ABCD[1]() << 1) | (m_ABCD[2]() << 2) | (m_ABCD[3]() << 3)); - } - - logic_input_t m_CLK; - logic_input_t m_ENT; - - logic_output_t m_RC; - - logic_input_t m_LOADQ; - - logic_input_t m_ENP; - logic_input_t m_CLRQ; - - object_array_t<logic_input_t, 4> m_ABCD; - object_array_t<logic_output_t, 4> m_Q; - - /* counter state */ - state_var<unsigned> m_cnt; - /* cached pins */ - state_var<unsigned> m_abcd; - state_var_sig m_loadq; - state_var_sig m_ent; - nld_power_pins m_power_pins; +#include "nl_base.h" +#include "nl_factory.h" - void update_outputs_all(unsigned cnt, netlist_time out_delay) noexcept - { - m_Q[0].push((cnt >> 0) & 1, out_delay); - m_Q[1].push((cnt >> 1) & 1, out_delay); - m_Q[2].push((cnt >> 2) & 1, out_delay); - m_Q[3].push((cnt >> 3) & 1, out_delay); - } - }; +#include "nld_9316_base.hxx" - NETLIB_OBJECT_DERIVED(9316_dip, 9316) - { - NETLIB_CONSTRUCTOR_DERIVED(9316_dip, 9316) - { - register_subalias("1", "CLRQ"); - register_subalias("2", "CLK"); - register_subalias("3", "A"); - register_subalias("4", "B"); - register_subalias("5", "C"); - register_subalias("6", "D"); - register_subalias("7", "ENP"); - register_subalias("8", "GND"); +// FIXME: All detail can be found in nld_9316_base.hxx +// At least gcc-7.x needs the implementations of the base device +// in different compilation units. If created in the same file +// performance degrades horrible. - register_subalias("9", "LOADQ"); - register_subalias("10", "ENT"); - register_subalias("11", "QD"); - register_subalias("12", "QC"); - register_subalias("13", "QB"); - register_subalias("14", "QA"); - register_subalias("15", "RC"); - register_subalias("16", "VCC"); - } - }; +// FIXME: this file could be created programmatically +namespace netlist::devices { NETLIB_DEVICE_IMPL(9316, "TTL_9316", "+CLK,+ENP,+ENT,+CLRQ,+LOADQ,+A,+B,+C,+D,@VCC,@GND") - NETLIB_DEVICE_IMPL(9316_dip, "TTL_9316_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_9316.h b/src/lib/netlist/devices/nld_9316.h deleted file mode 100644 index bdd925fa9f5..00000000000 --- a/src/lib/netlist/devices/nld_9316.h +++ /dev/null @@ -1,73 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_9316.h - * - * DM9316: Synchronous 4-Bit Counters - * - * +--------------+ - * /CLEAR |1 ++ 16| VCC - * CLOCK |2 15| RC (Ripple Carry) - * A |3 14| QA - * B |4 9316 13| QB - * C |5 12| QC - * D |6 11| QD - * Enable P |7 10| Enable T - * GND |8 9| /LOAD - * +--------------+ - * - * Counter Sequence - * - * +-------++----+----+----+----+----+ - * | COUNT || QD | QC | QB | QA | RC | - * +=======++====+====+====+====+====+ - * | 0 || 0 | 0 | 0 | 0 | 0 | - * | 1 || 0 | 0 | 0 | 1 | 0 | - * | 2 || 0 | 0 | 1 | 0 | 0 | - * | 3 || 0 | 0 | 1 | 1 | 0 | - * | 4 || 0 | 1 | 0 | 0 | 0 | - * | 5 || 0 | 1 | 0 | 1 | 0 | - * | 6 || 0 | 1 | 1 | 0 | 0 | - * | 7 || 0 | 1 | 1 | 1 | 0 | - * | 8 || 1 | 0 | 0 | 0 | 0 | - * | 9 || 1 | 0 | 0 | 1 | 0 | - * | 10 || 1 | 0 | 1 | 0 | 0 | - * | 11 || 1 | 0 | 1 | 1 | 0 | - * | 12 || 1 | 1 | 0 | 0 | 0 | - * | 13 || 1 | 1 | 0 | 1 | 0 | - * | 14 || 1 | 1 | 1 | 0 | 0 | - * | 15 || 1 | 1 | 1 | 1 | 1 | - * +-------++----+----+----+----+----+ - * - * Reset count function: Please refer to - * National Semiconductor datasheet (timing diagram) - * - * Naming conventions follow National Semiconductor datasheet - * - * TODO: DM74161 is compatible to DM9316 (both asynchronous clear) - * DM74163 has asynchronous clear (on L to H transition of clock) - */ - -#ifndef NLD_9316_H_ -#define NLD_9316_H_ - -#include "netlist/nl_setup.h" - -#define TTL_9316(name, cCLK, cENP, cENT, cCLRQ, cLOADQ, cA, cB, cC, cD) \ - NET_REGISTER_DEV(TTL_9316, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, ENP, cENP) \ - NET_CONNECT(name, ENT, cENT) \ - NET_CONNECT(name, CLRQ, cCLRQ) \ - NET_CONNECT(name, LOADQ, cLOADQ) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) - -#define TTL_9316_DIP(name) \ - NET_REGISTER_DEV(TTL_9316_DIP, name) - -#endif /* NLD_9316_H_ */ diff --git a/src/lib/netlist/devices/nld_9316_base.hxx b/src/lib/netlist/devices/nld_9316_base.hxx new file mode 100644 index 00000000000..881d9986ed5 --- /dev/null +++ b/src/lib/netlist/devices/nld_9316_base.hxx @@ -0,0 +1,155 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_9316_base.hxx + * + */ + +#include "nl_base.h" +#include "nl_factory.h" + +namespace netlist::devices +{ + + template <unsigned N> + static constexpr unsigned rollover(unsigned v) noexcept { return v <= N ? v : 0; } + + template <> + constexpr unsigned rollover<15>(unsigned v) noexcept { return v & 15; } + + template <typename D> + NETLIB_OBJECT(9316_base) + { + NETLIB_CONSTRUCTOR(9316_base) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(clk)) + , m_ENT(*this, "ENT", NETLIB_DELEGATE(other)) + , m_LOADQ(*this, "LOADQ", NETLIB_DELEGATE(other)) + , m_ENP(*this, "ENP", NETLIB_DELEGATE(other)) + , m_CLRQ(*this, "CLRQ", NETLIB_DELEGATE(other)) + , m_ABCD(*this, {"A", "B", "C", "D"}, NETLIB_DELEGATE(abcd)) + , m_RC(*this, "RC") + , m_Q(*this, { "QA", "QB", "QC", "QD" }) + , m_cnt(*this, "m_cnt", 0) + , m_abcd(*this, "m_abcd", 0) + , m_loadq(*this, "m_loadq", 0) + , m_ent(*this, "m_ent", 0) + , m_power_pins(*this) + { + } + + private: + NETLIB_RESETI() + { + m_CLK.set_state(logic_t::STATE_INP_LH); + m_cnt = 0; + m_abcd = 0; + } + + NETLIB_HANDLERI(other) + { + const auto CLRQ(m_CLRQ()); + m_ent = m_ENT(); + m_loadq = m_LOADQ(); + + if (((m_loadq ^ 1) || (m_ent && m_ENP())) && (!D::ASYNC::value || CLRQ)) + { + m_CLK.activate_lh(); + } + else + { + m_CLK.inactivate(); + if (D::ASYNC::value && !CLRQ && (m_cnt>0)) + { + m_cnt = 0; + m_Q.push(0, D::tCLR::value(0)); + } + } + m_RC.push(m_ent && (m_cnt == D::MAXCNT::value), D::tRC::value(0)); + } + + NETLIB_HANDLERI(clk) + { + if (!D::ASYNC::value && !m_CLRQ()) + { + m_Q.push(0, D::tCLR::value(0)); + m_cnt = 0; + } + else + { + const unsigned cnt(m_loadq ? rollover<D::MAXCNT::value>(m_cnt + 1) : m_abcd); + m_RC.push(m_ent && (cnt == D::MAXCNT::value), D::tRC::value(0)); + m_Q.push(cnt, D::tLDCNT::value(0)); + m_cnt = cnt; + } + } + + NETLIB_HANDLERI(abcd) + { + m_abcd = static_cast<unsigned>(m_ABCD()); + } + + logic_input_t m_CLK; + logic_input_t m_ENT; + + logic_input_t m_LOADQ; + + logic_input_t m_ENP; + logic_input_t m_CLRQ; + + object_array_t<logic_input_t, 4> m_ABCD; + + logic_output_t m_RC; + object_array_t<logic_output_t, 4> m_Q; + + /* counter state */ + state_var<unsigned> m_cnt; + /* cached pins */ + state_var<unsigned> m_abcd; + state_var<unsigned> m_loadq; + state_var<unsigned> m_ent; + nld_power_pins m_power_pins; + + }; + struct desc_9316 : public desc_base + { + using ASYNC = desc_const_t<bool, true>; + using MAXCNT = desc_const_t<unsigned, 15>; + using tRC = time_ns<27>; + using tCLR = time_ns<36>; + using tLDCNT = time_ns<20>; + }; + + struct desc_9310 : public desc_base + { + using ASYNC = desc_const_t<bool, true>; + using MAXCNT = desc_const_t<unsigned, 9>; + using tRC = time_ns<27>; + using tCLR = time_ns<36>; + using tLDCNT = time_ns<20>; + }; + + struct desc_74161 : public desc_base + { + using ASYNC = desc_const_t<bool, true>; + using MAXCNT = desc_const_t<unsigned, 15>; + using tRC = time_ns<27>; + using tCLR = time_ns<36>; + using tLDCNT = time_ns<20>; + }; + + struct desc_74163 : public desc_base + { + using ASYNC = desc_const_t<bool, false>; + using MAXCNT = desc_const_t<unsigned, 15>; + using tRC = time_ns<27>; + using tCLR = time_ns<36>; + using tLDCNT = time_ns<20>; + }; + + using NETLIB_NAME(9310) = NETLIB_NAME(9316_base)<desc_9310>; + using NETLIB_NAME(9316) = NETLIB_NAME(9316_base)<desc_9316>; + using NETLIB_NAME(74161) = NETLIB_NAME(9316_base)<desc_74161>; + using NETLIB_NAME(74161_fixme) = NETLIB_NAME(9316_base)<desc_74161>; + using NETLIB_NAME(74163) = NETLIB_NAME(9316_base)<desc_74163>; + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_9321.cpp b/src/lib/netlist/devices/nld_9321.cpp new file mode 100644 index 00000000000..479b83d497e --- /dev/null +++ b/src/lib/netlist/devices/nld_9321.cpp @@ -0,0 +1,66 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +/* + * nld_9321.cpp + * + * 9321: Dual One-of-Four Decoder + * + * +------------+ + * /E |1 ++ 16| VCC + * A0 |2 15| /E + * A1 |3 14| A0 + * /D0 |4 9321 13| A1 + * /D1 |5 12| /D0 + * /D2 |6 11| /D1 + * /D3 |7 10| /D2 + * GND |8 9| /D3 + * +------------+ + * + */ + +#include "nl_base.h" + +namespace netlist::devices { + + // FIXME: m_E should activate deactivate m_A + + NETLIB_OBJECT(9321) + { + NETLIB_CONSTRUCTOR(9321) + , m_enable(*this, "m_enable", true) + , m_o(*this, "m_o", 0) + , m_A(*this, 0, "A{}", NETLIB_DELEGATE(in)) + , m_D(*this, 0, "D{}") + , m_E(*this, "E", NETLIB_DELEGATE(e)) + , m_power_pins(*this) + { + } + + private: + NETLIB_HANDLERI(in) + { + m_enable = m_E() ? false : true; // NOLINT + m_o = (m_A[1]() << 1) | m_A[0](); + for (std::size_t i=0; i<4; i++) + m_D[i].push((i == m_o && m_enable) ? 0 : 1, NLTIME_FROM_NS(21)); + } + + NETLIB_HANDLERI(e) + { + m_enable = m_E() ? false : true; // NOLINT + m_o = (m_A[1]() << 1) | m_A[0](); + for (std::size_t i=0; i<4; i++) + m_D[i].push((i == m_o && m_enable) ? 0 : 1, NLTIME_FROM_NS(18)); + } + + state_var<bool> m_enable; + state_var<uint32_t> m_o; + object_array_t<logic_input_t, 2> m_A; + object_array_t<logic_output_t, 4> m_D; + logic_input_t m_E; + nld_power_pins m_power_pins; + }; + + NETLIB_DEVICE_IMPL(9321, "TTL_9321", "+E,+A0,+A1") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_9322.cpp b/src/lib/netlist/devices/nld_9322.cpp index 14b0a846053..c7ac59be619 100644 --- a/src/lib/netlist/devices/nld_9322.cpp +++ b/src/lib/netlist/devices/nld_9322.cpp @@ -3,35 +3,55 @@ /* * nld_9322.cpp * + * 9322: Quad 2-Line to 1-Line Data Selectors/Multiplexers + * + * +------------+ + * SELECT |1 ++ 16| VCC + * A1 |2 15| STROBE + * B1 |3 14| A4 + * Y1 |4 9322 13| B4 + * A2 |5 12| Y4 + * B2 |6 11| A3 + * Y2 |7 10| B3 + * GND |8 9| Y3 + * +------------+ + * */ -#include "nld_9322.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { class NETLIB_NAME(9322); - NETLIB_OBJECT(9322_selector) + NETLIB_OBJECT(9322_GATE) { - NETLIB_CONSTRUCTOR(9322_selector) - , m_parent(owner) - , m_A(*this, "A") - , m_B(*this, "B") + NETLIB_CONSTRUCTOR(9322_GATE) + , m_A(*this, "A", NETLIB_DELEGATE(inputs)) + , m_B(*this, "B", NETLIB_DELEGATE(inputs)) + , m_SELECT(*this, "SELECT", NETLIB_DELEGATE(inputs)) + , m_STROBE(*this, "STROBE", NETLIB_DELEGATE(inputs)) , m_Y(*this, "Y") , m_power_pins(*this) { } - NETLIB_UPDATEI(); + // FIXME: Timing + NETLIB_HANDLERI(inputs) + { + if (m_STROBE()) + m_Y.push(0, NLTIME_FROM_NS(21)); + else if (m_SELECT()) + m_Y.push(m_B(), NLTIME_FROM_NS(14)); + else + m_Y.push(m_A(), NLTIME_FROM_NS(14)); + } public: - NETLIB_NAME(9322) &m_parent; logic_input_t m_A; logic_input_t m_B; + logic_input_t m_SELECT; + logic_input_t m_STROBE; logic_output_t m_Y; nld_power_pins m_power_pins; }; @@ -39,25 +59,23 @@ namespace netlist NETLIB_OBJECT(9322) { NETLIB_CONSTRUCTOR(9322) - , m_SELECT(*this, "SELECT") - , m_STROBE(*this, "STROBE") , m_1(*this, "A") , m_2(*this, "B") , m_3(*this, "C") , m_4(*this, "D") { - register_subalias("A1", m_1.m_A); - register_subalias("B1", m_1.m_B); - register_subalias("Y1", m_1.m_Y); - register_subalias("A2", m_2.m_A); - register_subalias("B2", m_2.m_B); - register_subalias("Y2", m_2.m_Y); - register_subalias("A3", m_3.m_A); - register_subalias("B3", m_3.m_B); - register_subalias("Y3", m_3.m_Y); - register_subalias("A4", m_4.m_A); - register_subalias("B4", m_4.m_B); - register_subalias("Y4", m_4.m_Y); + register_sub_alias("A1", "A.A"); + register_sub_alias("B1", "A.B"); + register_sub_alias("Y1", "A.Y"); + register_sub_alias("A2", "B.A"); + register_sub_alias("B2", "B.B"); + register_sub_alias("Y2", "B.Y"); + register_sub_alias("A3", "C.A"); + register_sub_alias("B3", "C.B"); + register_sub_alias("Y3", "C.Y"); + register_sub_alias("A4", "D.A"); + register_sub_alias("B4", "D.B"); + register_sub_alias("Y4", "D.Y"); connect("A.VCC", "B.VCC"); connect("A.VCC", "C.VCC"); @@ -65,70 +83,27 @@ namespace netlist connect("A.GND", "B.GND"); connect("A.GND", "C.GND"); connect("A.GND", "D.GND"); - - register_subalias("GND", "A.GND"); - register_subalias("VCC", "B.VCC"); - + connect("A.SELECT", "B.SELECT"); + connect("A.SELECT", "C.SELECT"); + connect("A.SELECT", "D.SELECT"); + connect("A.STROBE", "B.STROBE"); + connect("A.STROBE", "C.STROBE"); + connect("A.STROBE", "D.STROBE"); + + register_sub_alias("SELECT", "A.SELECT"); + register_sub_alias("STROBE", "A.STROBE"); + register_sub_alias("GND", "A.GND"); + register_sub_alias("VCC", "B.VCC"); } - NETLIB_UPDATEI(); - - public: - logic_input_t m_SELECT; - logic_input_t m_STROBE; - protected: - NETLIB_SUB(9322_selector) m_1; - NETLIB_SUB(9322_selector) m_2; - NETLIB_SUB(9322_selector) m_3; - NETLIB_SUB(9322_selector) m_4; - - }; - - NETLIB_OBJECT_DERIVED(9322_dip, 9322) - { - NETLIB_CONSTRUCTOR_DERIVED(9322_dip, 9322) - { - register_subalias("1", m_SELECT); - register_subalias("2", m_1.m_A); - register_subalias("3", m_1.m_B); - register_subalias("4", m_1.m_Y); - register_subalias("5", m_2.m_A); - register_subalias("6", m_2.m_B); - register_subalias("7", m_2.m_Y); - register_subalias("8", "GND"); + private: + NETLIB_SUB(9322_GATE) m_1; + NETLIB_SUB(9322_GATE) m_2; + NETLIB_SUB(9322_GATE) m_3; + NETLIB_SUB(9322_GATE) m_4; - register_subalias("9", m_3.m_Y); - register_subalias("10", m_3.m_B); - register_subalias("11", m_3.m_A); - register_subalias("12", m_4.m_Y); - register_subalias("13", m_4.m_B); - register_subalias("14", m_4.m_A); - register_subalias("15", m_STROBE); - register_subalias("16", "VCC"); - } }; - // FIXME: Timing - NETLIB_UPDATE(9322_selector) - { - if (m_parent.m_STROBE()) - m_Y.push(0, NLTIME_FROM_NS(21)); - else if (m_parent.m_SELECT()) - m_Y.push(m_B(), NLTIME_FROM_NS(14)); - else - m_Y.push(m_A(), NLTIME_FROM_NS(14)); - } - - NETLIB_UPDATE(9322) - { - m_1.update(); - m_2.update(); - m_3.update(); - m_4.update(); - } - - NETLIB_DEVICE_IMPL(9322, "TTL_9322", "+SELECT,+A1,+B1,+A2,+B2,+A3,+B3,+A4,+B4,+STROBE,@VCC,@GND") - NETLIB_DEVICE_IMPL(9322_dip, "TTL_9322_DIP", "") + NETLIB_DEVICE_IMPL(9322, "TTL_9322", "+SELECT,+A1,+B1,+A2,+B2,+A3,+B3,+A4,+B4,+STROBE,@VCC,@GND") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_9322.h b/src/lib/netlist/devices/nld_9322.h deleted file mode 100644 index e55c73847b3..00000000000 --- a/src/lib/netlist/devices/nld_9322.h +++ /dev/null @@ -1,44 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_9322.h - * - * 9322: Quad 2-Line to 1-Line Data Selectors/Multiplexers - * - * +------------+ - * SELECT |1 ++ 16| VCC - * A1 |2 15| STROBE - * B1 |3 14| A4 - * Y1 |4 9322 13| B4 - * A2 |5 12| Y4 - * B2 |6 11| A3 - * Y2 |7 10| B3 - * GND |8 9| Y3 - * +------------+ - * - */ - -#ifndef NLD_9322_H_ -#define NLD_9322_H_ - -#include "netlist/nl_setup.h" - -#define TTL_9322(name, cSELECT, cA1, cB1, cA2, cB2, cA3, cB3, cA4, cB4, cSTROBE) \ - NET_REGISTER_DEV(TTL_9322, name) \ - NET_CONNECT(name, SELECT, cSELECT) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, B1, cB1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, B2, cB2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, B3, cB3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, B4, cB4) \ - NET_CONNECT(name, STROBE, cSTROBE) - -#define TTL_9322_DIP(name) \ - NET_REGISTER_DEV(TTL_9322_DIP, name) - -#endif /* NLD_9322_H_ */ diff --git a/src/lib/netlist/devices/nld_am2847.cpp b/src/lib/netlist/devices/nld_am2847.cpp index d4a7cbe53b7..07b811ab0a9 100644 --- a/src/lib/netlist/devices/nld_am2847.cpp +++ b/src/lib/netlist/devices/nld_am2847.cpp @@ -3,39 +3,63 @@ /* * nld_am2847.cpp * + * Am2847: Quad 80-Bit Static Shift Register + * + * +--------------+ + * OUTA |1 ++ 16| VSS + * RCA |2 15| IND + * INA |3 14| RCD + * OUTB |4 Am2847 13| OUTD + * RCB |5 12| VGG + * INB |6 11| CP + * OUTC |7 10| INC + * VDD |8 9| RCC + * +--------------+ + * */ -#include "nld_am2847.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(Am2847_shifter) { - NETLIB_CONSTRUCTOR(Am2847_shifter) - , m_RC(*this, "RC") - , m_IN(*this, "IN") + NETLIB_CONSTRUCTOR_MODEL(Am2847_shifter, "CD4XXX") + , m_RC(*this, "RC", NETLIB_DELEGATE(inputs)) + , m_IN(*this, "IN", NETLIB_DELEGATE(inputs)) , m_buffer(*this, "m_buffer", 0) , m_OUT(*this, "OUT") - , m_power_pins(*this, "VSS", "VDD") + , m_power_pins(*this) { } - NETLIB_UPDATEI(); - public: - void shift(); + void shift() noexcept + { + uint32_t out = m_buffer[0] & 1; + uint32_t in = (m_RC() ? out : m_IN()); + for (std::size_t i=0; i < 5; i++) + { + uint32_t shift_in = (i == 4) ? in : m_buffer[i + 1]; + m_buffer[i] >>= 1; + m_buffer[i] |= shift_in << 15; + } + + m_OUT.push(out, NLTIME_FROM_NS(200)); + } logic_input_t m_RC; logic_input_t m_IN; - state_array<uint16_t, 5> m_buffer; + state_container<std::array<uint16_t, 5>> m_buffer; logic_output_t m_OUT; nld_power_pins m_power_pins; + private: + NETLIB_HANDLERI(inputs) + { + /* do nothing */ + } }; NETLIB_OBJECT(AM2847) @@ -45,22 +69,22 @@ namespace netlist , m_B(*this, "B") , m_C(*this, "C") , m_D(*this, "D") - , m_CP(*this, "CP") + , m_CP(*this, "CP", NETLIB_DELEGATE(cp)) , m_last_CP(*this, "m_last_CP", 0) // FIXME: needs family! { - register_subalias("OUTA", m_A.m_OUT); - register_subalias("OUTB", m_B.m_OUT); - register_subalias("OUTC", m_C.m_OUT); - register_subalias("OUTD", m_D.m_OUT); - register_subalias("INA", m_A.m_IN); - register_subalias("INB", m_B.m_IN); - register_subalias("INC", m_C.m_IN); - register_subalias("IND", m_D.m_IN); - register_subalias("RCA", m_A.m_RC); - register_subalias("RCB", m_B.m_RC); - register_subalias("RCC", m_C.m_RC); - register_subalias("RCD", m_D.m_RC); + register_sub_alias("OUTA", "A.OUT"); + register_sub_alias("OUTB", "B.OUT"); + register_sub_alias("OUTC", "C.OUT"); + register_sub_alias("OUTD", "D.OUT"); + register_sub_alias("INA", "A.IN"); + register_sub_alias("INB", "B.IN"); + register_sub_alias("INC", "C.IN"); + register_sub_alias("IND", "D.IN"); + register_sub_alias("RCA", "A.RC"); + register_sub_alias("RCB", "B.RC"); + register_sub_alias("RCC", "C.RC"); + register_sub_alias("RCD", "D.RC"); connect("A.VSS", "B.VSS"); connect("A.VSS", "C.VSS"); @@ -69,14 +93,28 @@ namespace netlist connect("A.VDD", "C.VDD"); connect("A.VDD", "D.VDD"); - register_subalias("VSS", "A.VSS"); - register_subalias("VDD", "A.VDD"); + register_sub_alias("VSS", "A.VSS"); + register_sub_alias("VDD", "A.VDD"); + } + + NETLIB_RESETI() + { + m_last_CP = 0; } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + private: + NETLIB_HANDLERI(cp) + { + if (m_last_CP && !m_CP()) + { + m_A().shift(); + m_B().shift(); + m_C().shift(); + m_D().shift(); + } + m_last_CP = m_CP(); + } - protected: NETLIB_SUB(Am2847_shifter) m_A; NETLIB_SUB(Am2847_shifter) m_B; NETLIB_SUB(Am2847_shifter) m_C; @@ -86,67 +124,6 @@ namespace netlist state_var<uint32_t> m_last_CP; }; - NETLIB_OBJECT_DERIVED(AM2847_dip, AM2847) - { - NETLIB_CONSTRUCTOR_DERIVED(AM2847_dip, AM2847) - { - register_subalias("1", m_A.m_OUT); - register_subalias("2", m_A.m_RC); - register_subalias("3", m_A.m_IN); - register_subalias("4", m_B.m_OUT); - register_subalias("5", m_B.m_RC); - register_subalias("6", m_B.m_IN); - register_subalias("7", m_C.m_OUT); - register_subalias("8", "VDD"); - - register_subalias("9", m_C.m_RC); - register_subalias("10", m_C.m_IN); - register_subalias("11", m_CP); - register_subalias("13", m_D.m_OUT); - register_subalias("14", m_D.m_RC); - register_subalias("15", m_D.m_IN); - register_subalias("16", "VSS"); - } - }; - - NETLIB_RESET(AM2847) - { - m_last_CP = 0; - } - - NETLIB_UPDATE(AM2847) - { - if (m_last_CP && !m_CP()) - { - m_A.shift(); - m_B.shift(); - m_C.shift(); - m_D.shift(); - } - m_last_CP = m_CP(); - } - - NETLIB_UPDATE(Am2847_shifter) - { - /* do nothing */ - } - - NETLIB_FUNC_VOID(Am2847_shifter, shift, ()) - { - uint32_t out = m_buffer[0] & 1; - uint32_t in = (m_RC() ? out : m_IN()); - for (std::size_t i=0; i < 5; i++) - { - uint32_t shift_in = (i == 4) ? in : m_buffer[i + 1]; - m_buffer[i] >>= 1; - m_buffer[i] |= shift_in << 15; - } - - m_OUT.push(out, NLTIME_FROM_NS(200)); - } - NETLIB_DEVICE_IMPL(AM2847, "TTL_AM2847", "+CP,+INA,+INB,+INC,+IND,+RCA,+RCB,+RCC,+RCD,@VSS,@VDD") - NETLIB_DEVICE_IMPL(AM2847_dip, "TTL_AM2847_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_am2847.h b/src/lib/netlist/devices/nld_am2847.h deleted file mode 100644 index f1347545984..00000000000 --- a/src/lib/netlist/devices/nld_am2847.h +++ /dev/null @@ -1,43 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_am2847.h - * - * Am2847: Quad 80-Bit Static Shift Register - * - * +--------------+ - * OUTA |1 ++ 16| VSS - * RCA |2 15| IND - * INA |3 14| RCD - * OUTB |4 Am2847 13| OUTD - * RCB |5 12| VGG - * INB |6 11| CP - * OUTC |7 10| INC - * VDD |8 9| RCC - * +--------------+ - * - */ - -#ifndef NLD_AM2847_H_ -#define NLD_AM2847_H_ - -#include "netlist/nl_setup.h" - -#define TTL_AM2847(name, cCP, cINA, cINB, cINC, cIND, cRCA, cRCB, cRCC, cRCD) \ - NET_REGISTER_DEV(TTL_AM2847, name) \ - NET_CONNECT(name, VDD, VDD) \ - NET_CONNECT(name, VSS, VSS) \ - NET_CONNECT(name, CP, cCP) \ - NET_CONNECT(name, INA, cINA) \ - NET_CONNECT(name, INB, cINB) \ - NET_CONNECT(name, INC, cINC) \ - NET_CONNECT(name, IND, cIND) \ - NET_CONNECT(name, RCA, cRCA) \ - NET_CONNECT(name, RCB, cRCB) \ - NET_CONNECT(name, RCC, cRCC) \ - NET_CONNECT(name, RCD, cRCD) - -#define TTL_AM2847_DIP(name) \ - NET_REGISTER_DEV(TTL_AM2847_DIP, name) - -#endif /* NLD_AM2847_H_ */ diff --git a/src/lib/netlist/devices/nld_dm9314.cpp b/src/lib/netlist/devices/nld_dm9314.cpp index e193fd08f46..e8241af09de 100644 --- a/src/lib/netlist/devices/nld_dm9314.cpp +++ b/src/lib/netlist/devices/nld_dm9314.cpp @@ -3,24 +3,33 @@ /* * nld_dm9314.cpp * + * DM9314: 4-Bit Latches + * + * +--------------+ + * /E |1 ++ 16| VCC + * /S0 |2 15| Q0 + * D0 |3 14| /S1 + * D1 |4 DM9314 13| Q1 + * /S2 |5 12| Q2 + * D2 |6 11| /S3 + * D3 |7 10| Q3 + * GND |8 9| /MR + * +--------------+ + * */ -#include "nld_dm9314.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(9314) { NETLIB_CONSTRUCTOR(9314) - , m_EQ(*this, "EQ") - , m_MRQ(*this, "MRQ") - , m_SQ(*this, {{"S0Q", "S1Q", "S2Q", "S3Q"}}) - , m_D(*this, {{"D0", "D1", "D2", "D3"}}) - , m_Q(*this, {{"Q0", "Q1", "Q2", "Q3"}}) + , m_EQ(*this, "EQ", NETLIB_DELEGATE(inputs)) + , m_MRQ(*this, "MRQ", NETLIB_DELEGATE(inputs)) + , m_SQ(*this, {"S0Q", "S1Q", "S2Q", "S3Q"}, NETLIB_DELEGATE(inputs)) + , m_D(*this, {"D0", "D1", "D2", "D3"}, NETLIB_DELEGATE(inputs)) + , m_Q(*this, {"Q0", "Q1", "Q2", "Q3"}) , m_last_EQ(*this, "m_last_EQ", 0) , m_last_MRQ(*this, "m_last_MRQ", 0) , m_last_SQ(*this, "m_last_SQ", 0) @@ -30,10 +39,59 @@ namespace netlist { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + private: + + NETLIB_RESETI() + { + m_last_MRQ = 0; + m_last_EQ = 0; + m_last_SQ = 0; + m_last_D = 0; + m_last_Q = 0; + } + + NETLIB_HANDLERI(inputs) + { + netlist_time delay = NLTIME_FROM_NS(24); //FIXME! + if (!m_MRQ()) + { + /* Reset! */ + for (std::size_t i=0; i<4; i++) + m_Q[i].push(0, delay); + } else { + for (std::size_t i=0; i<4; i++) + { + if (m_SQ[i]()) + { + /* R-S Mode */ + // RS mode is just an "extension of regular D mode" + // The way RS mode works is that D and S bar go high (keeps old value) + // S bar going low sets output high + // D going low and S bar high sets output low + // S bar going low AND D going low sets output low (D takes precedence) + if (!m_EQ()) + { + if (!m_D[i]()) // if D low and SQ high we clear the bit + { + m_last_Q &= ~(1 << i); + m_Q[i].push((m_last_Q & (1<<i))>>i, delay); + } + } + } + else + { + /* D Mode */ + if (!m_EQ()) + { + m_Q[i].push(m_D[i](), delay); + m_last_Q &= ~(1 << i); + m_last_Q |= (m_D[i]() << i); + } + } + } + } + } - protected: logic_input_t m_EQ; logic_input_t m_MRQ; object_array_t<logic_input_t, 4> m_SQ; @@ -48,72 +106,6 @@ namespace netlist nld_power_pins m_power_pins; }; - NETLIB_OBJECT_DERIVED(9314_dip, 9314) - { - NETLIB_CONSTRUCTOR_DERIVED(9314_dip, 9314) - { - register_subalias("1", m_EQ); - register_subalias("2", m_SQ[0]); - register_subalias("3", m_D[0]); - register_subalias("4", m_D[1]); - register_subalias("5", m_SQ[2]); - register_subalias("6", m_D[2]); - register_subalias("7", m_D[3]); - register_subalias("8", "GND"); - - register_subalias("9", m_MRQ); - register_subalias("10", m_Q[3]); - register_subalias("11", m_SQ[3]); - register_subalias("12", m_Q[2]); - register_subalias("13", m_Q[1]); - register_subalias("14", m_SQ[1]); - register_subalias("15", m_Q[0]); - register_subalias("16", "VCC"); - - } - }; - - NETLIB_RESET(9314) - { - m_last_MRQ = 0; - m_last_EQ = 0; - m_last_SQ = 0; - m_last_D = 0; - m_last_Q = 0; - } - - NETLIB_UPDATE(9314) - { - netlist_time delay = NLTIME_FROM_NS(24); //FIXME! - if (!m_MRQ()) - { - /* Reset! */ - for (std::size_t i=0; i<4; i++) - m_Q[i].push(0, delay); - } else { - for (std::size_t i=0; i<4; i++) - { - if (m_SQ[i]()) - { - /* R-S Mode */ - // FIXME: R-S mode is not yet implemented! - } - else - { - /* D Mode */ - if (!m_EQ()) - { - m_Q[i].push(m_D[i](), delay); - m_last_Q &= ~(1 << i); - m_last_Q |= (m_D[i]() << i); - } - } - } - } - } - NETLIB_DEVICE_IMPL(9314, "TTL_9314", "+EQ,+MRQ,+S0Q,+S1Q,+S2Q,+S3Q,+D0,+D1,+D2,+D3,@VCC,@GND") - NETLIB_DEVICE_IMPL(9314_dip, "TTL_9314_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_dm9314.h b/src/lib/netlist/devices/nld_dm9314.h deleted file mode 100644 index 73edfaa1205..00000000000 --- a/src/lib/netlist/devices/nld_dm9314.h +++ /dev/null @@ -1,44 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Felipe Sanches -/* - * nld_DM9314.h - * - * DM9314: 4-Bit Latches - * - * +--------------+ - * /E |1 ++ 16| VCC - * /S0 |2 15| Q0 - * D0 |3 14| /S1 - * D1 |4 DM9314 13| Q1 - * /S2 |5 12| Q2 - * D2 |6 11| /S3 - * D3 |7 10| Q3 - * GND |8 9| /MR - * +--------------+ - * - */ - -#ifndef NLD_DM9314_H_ -#define NLD_DM9314_H_ - -#include "netlist/nl_setup.h" - -#define TTL_9314(name, cEQ, cMRQ, cS0Q, cS1Q, cS2Q, cS3Q, cD0, cD1, cD2, cD3) \ - NET_REGISTER_DEV(TTL_9314, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, EQ, cEQ) \ - NET_CONNECT(name, MRQ, cMRQ) \ - NET_CONNECT(name, S0Q, cS0Q) \ - NET_CONNECT(name, S1Q, cS1Q) \ - NET_CONNECT(name, S2Q, cS2Q) \ - NET_CONNECT(name, S3Q, cS3Q) \ - NET_CONNECT(name, D0, cD0) \ - NET_CONNECT(name, D1, cD1) \ - NET_CONNECT(name, D2, cD2) \ - NET_CONNECT(name, D3, cD3) - -#define TTL_9314_DIP(name) \ - NET_REGISTER_DEV(TTL_9314_DIP, name) - -#endif /* NLD_DM9314_H_ */ diff --git a/src/lib/netlist/devices/nld_dm9334.cpp b/src/lib/netlist/devices/nld_dm9334.cpp index 56226b36fe6..1631ed99264 100644 --- a/src/lib/netlist/devices/nld_dm9334.cpp +++ b/src/lib/netlist/devices/nld_dm9334.cpp @@ -3,24 +3,77 @@ /* * nld_dm9334.cpp * + * DM9334: 8-Bit Addressable Latch + * + * +--------------+ + * A0 |1 ++ 16| VCC + * A1 |2 15| /C + * A2 |3 14| /E + * Q0 |4 DM9334 13| D + * Q1 |5 12| Q7 + * Q2 |6 11| Q6 + * Q3 |7 10| Q5 + * GND |8 9| Q4 + * +--------------+ + * + * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ + * | C | E || D || A0| A1| A2|| Q0| Q1| Q2| Q3| Q4| Q5| Q6| Q7| + * +===+===++===++===+===+===++===+===+===+===+===+===+===+===+ + * | 1 | 0 || X || X | X | X || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ + * | 1 | 1 || 0 || 0 | 0 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 0 | 0 | 0 || 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 0 || 0 | 0 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 0 | 0 | 1 || 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 0 || 0 | 1 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 0 | 1 | 0 || 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 0 || 0 | 1 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 0 | 1 | 1 || 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 0 || 1 | 0 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 1 | 0 | 0 || 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | + * | 1 | 1 || 0 || 1 | 0 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 1 | 0 | 1 || 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | + * | 1 | 1 || 0 || 1 | 1 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 1 | 1 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | + * | 1 | 1 || 0 || 1 | 1 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | + * | 1 | 1 || 1 || 1 | 1 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | + * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ + * | 0 | 0 || X || X | X | X || P | P | P | P | P | P | P | P | + * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ + * | 0 | 1 || 0 || 0 | 0 | 0 || 0 | P | P | P | P | P | P | P | + * | 0 | 1 || 1 || 0 | 0 | 0 || 1 | P | P | P | P | P | P | P | + * | 0 | 1 || 0 || 0 | 0 | 1 || P | 0 | P | P | P | P | P | P | + * | 0 | 1 || 1 || 0 | 0 | 1 || P | 1 | P | P | P | P | P | P | + * | 0 | 1 || 0 || 0 | 1 | 0 || P | P | 0 | P | P | P | P | P | + * | 0 | 1 || 1 || 0 | 1 | 0 || P | P | 1 | P | P | P | P | P | + * | 0 | 1 || 0 || 0 | 1 | 1 || P | P | P | 0 | P | P | P | P | + * | 0 | 1 || 1 || 0 | 1 | 1 || P | P | P | 1 | P | P | P | P | + * | 0 | 1 || 0 || 1 | 0 | 0 || P | P | P | P | 0 | P | P | P | + * | 0 | 1 || 1 || 1 | 0 | 0 || P | P | P | P | 1 | P | P | P | + * | 0 | 1 || 0 || 1 | 0 | 1 || P | P | P | P | P | 0 | P | P | + * | 0 | 1 || 1 || 1 | 0 | 1 || P | P | P | P | P | 1 | P | P | + * | 0 | 1 || 0 || 1 | 1 | 0 || P | P | P | P | P | P | 0 | P | + * | 0 | 1 || 1 || 1 | 1 | 0 || P | P | P | P | P | P | 1 | P | + * | 0 | 1 || 0 || 1 | 1 | 1 || P | P | P | P | P | P | P | 0 | + * | 0 | 1 || 1 || 1 | 1 | 1 || P | P | P | P | P | P | P | 1 | + * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ + * + * Naming convention attempts to follow Texas Instruments / National Semiconductor datasheet Literature Number SNOS382A + * */ -#include "nld_dm9334.h" -#include "netlist/nl_base.h" -#include "nlid_system.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(9334) { NETLIB_CONSTRUCTOR(9334) - , m_CQ(*this, "CQ") - , m_EQ(*this, "EQ") - , m_D(*this, "D") - , m_A(*this, {{"A0", "A1", "A2"}}) - , m_Q(*this, {{"Q0", "Q1", "Q2", "Q3", "Q4", "Q5", "Q6", "Q7"}}) + , m_CQ(*this, "CQ", NETLIB_DELEGATE(inputs)) + , m_EQ(*this, "EQ", NETLIB_DELEGATE(inputs)) + , m_D(*this, "D", NETLIB_DELEGATE(inputs)) + , m_A(*this, {"A0", "A1", "A2"}, NETLIB_DELEGATE(inputs)) + , m_Q(*this, {"Q0", "Q1", "Q2", "Q3", "Q4", "Q5", "Q6", "Q7"}) , m_last_CQ(*this, "m_last_CQ", 0) , m_last_EQ(*this, "m_last_EQ", 0) , m_last_D(*this, "m_last_D", 0) @@ -30,126 +83,96 @@ namespace netlist { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - - protected: - logic_input_t m_CQ; - logic_input_t m_EQ; - logic_input_t m_D; - object_array_t<logic_input_t, 3> m_A; - object_array_t<logic_output_t, 8> m_Q; - - state_var<unsigned> m_last_CQ; - state_var<unsigned> m_last_EQ; - state_var<unsigned> m_last_D; - state_var<unsigned> m_last_A; - state_var<unsigned> m_last_Q; - nld_power_pins m_power_pins; - }; - - NETLIB_OBJECT_DERIVED(9334_dip, 9334) - { - NETLIB_CONSTRUCTOR_DERIVED(9334_dip, 9334) - { - register_subalias("1", m_A[0]); - register_subalias("2", m_A[1]); - register_subalias("3", m_A[2]); - register_subalias("4", m_Q[0]); - register_subalias("5", m_Q[1]); - register_subalias("6", m_Q[2]); - register_subalias("7", m_Q[3]); - register_subalias("8", "GND"); - - register_subalias("9", m_Q[4]); - register_subalias("10", m_Q[5]); - register_subalias("11", m_Q[6]); - register_subalias("12", m_Q[7]); - register_subalias("13", m_D); - register_subalias("14", m_EQ); - register_subalias("15", m_CQ); - register_subalias("16", "VCC"); - - } - }; - - NETLIB_RESET(9334) - { - m_last_CQ = 0; - m_last_EQ = 0; - m_last_D = 0; - m_last_A = 0; - m_last_Q = 0; - } - - NETLIB_UPDATE(9334) - { - uint_fast8_t a = 0; - for (std::size_t i=0; i<3; i++) + private: + NETLIB_RESETI() { - a |= (m_A[i]() << i); + m_last_CQ = 0; + m_last_EQ = 0; + m_last_D = 0; + m_last_A = 0; + m_last_Q = 0; } - netlist_time delay = NLTIME_FROM_NS(27); // Clear Low to High Level Output (not documented, making reasonable guess) - - if (a != m_last_A) + NETLIB_HANDLERI(inputs) { - delay = NLTIME_FROM_NS(35); - } - else if (m_D() != m_last_D) - { - if (m_last_D) + uint_fast8_t a = 0; + for (std::size_t i=0; i<3; i++) { - delay = NLTIME_FROM_NS(28); + a |= (m_A[i]() << i); } - else + + netlist_time delay = NLTIME_FROM_NS(27); // Clear Low to High Level Output (not documented, making reasonable guess) + + if (a != m_last_A) { delay = NLTIME_FROM_NS(35); } - } - else if (m_EQ() != m_last_EQ) - { - if (m_last_EQ) + else if (m_D() != m_last_D) { - delay = NLTIME_FROM_NS(27); + if (m_last_D) + { + delay = NLTIME_FROM_NS(28); + } + else + { + delay = NLTIME_FROM_NS(35); + } } - else + else if (m_EQ() != m_last_EQ) { - delay = NLTIME_FROM_NS(28); + if (m_last_EQ) + { + delay = NLTIME_FROM_NS(27); + } + else + { + delay = NLTIME_FROM_NS(28); + } } - } - unsigned q = m_last_Q; + unsigned q = m_last_Q; - if (!m_CQ()) - { - if (m_EQ()) + if (!m_CQ()) { - q = 0; + if (m_EQ()) + { + q = 0; + } + else + { + q = m_D() << a; + } } - else + else if(!m_EQ()) { - q = m_D() << a; + q &= ~(1 << a); + q |= (m_D() << a); } - } - else if(!m_EQ()) - { - q &= ~(1 << a); - q |= (m_D() << a); + + m_last_CQ = m_CQ(); + m_last_EQ = m_EQ(); + m_last_D = m_D(); + m_last_A = a; + m_last_Q = q; + + for (std::size_t i=0; i<8; i++) + m_Q[i].push((q >> i) & 1, delay); } - m_last_CQ = m_CQ(); - m_last_EQ = m_EQ(); - m_last_D = m_D(); - m_last_A = a; - m_last_Q = q; + logic_input_t m_CQ; + logic_input_t m_EQ; + logic_input_t m_D; + object_array_t<logic_input_t, 3> m_A; + object_array_t<logic_output_t, 8> m_Q; - for (std::size_t i=0; i<8; i++) - m_Q[i].push((q >> i) & 1, delay); - } + state_var<unsigned> m_last_CQ; + state_var<unsigned> m_last_EQ; + state_var<unsigned> m_last_D; + state_var<unsigned> m_last_A; + state_var<unsigned> m_last_Q; + nld_power_pins m_power_pins; + }; NETLIB_DEVICE_IMPL(9334, "TTL_9334", "+CQ,+EQ,+D,+A0,+A1,+A2,@VCC,@GND") - NETLIB_DEVICE_IMPL(9334_dip, "TTL_9334_DIP", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_dm9334.h b/src/lib/netlist/devices/nld_dm9334.h deleted file mode 100644 index 2f4ab1f18c1..00000000000 --- a/src/lib/netlist/devices/nld_dm9334.h +++ /dev/null @@ -1,84 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_DM9334.h - * - * DM9334: 8-Bit Addressable Latch - * - * +--------------+ - * A0 |1 ++ 16| VCC - * A1 |2 15| /C - * A2 |3 14| /E - * Q0 |4 DM9334 13| D - * Q1 |5 12| Q7 - * Q2 |6 11| Q6 - * Q3 |7 10| Q5 - * GND |8 9| Q4 - * +--------------+ - * - * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ - * | C | E || D || A0| A1| A2|| Q0| Q1| Q2| Q3| Q4| Q5| Q6| Q7| - * +===+===++===++===+===+===++===+===+===+===+===+===+===+===+ - * | 1 | 0 || X || X | X | X || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ - * | 1 | 1 || 0 || 0 | 0 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 0 | 0 | 0 || 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 0 || 0 | 0 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 0 | 0 | 1 || 0 | 1 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 0 || 0 | 1 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 0 | 1 | 0 || 0 | 0 | 1 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 0 || 0 | 1 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 0 | 1 | 1 || 0 | 0 | 0 | 1 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 0 || 1 | 0 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 1 | 0 | 0 || 0 | 0 | 0 | 0 | 1 | 0 | 0 | 0 | - * | 1 | 1 || 0 || 1 | 0 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 1 | 0 | 1 || 0 | 0 | 0 | 0 | 0 | 1 | 0 | 0 | - * | 1 | 1 || 0 || 1 | 1 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 1 | 1 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 1 | 0 | - * | 1 | 1 || 0 || 1 | 1 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | - * | 1 | 1 || 1 || 1 | 1 | 1 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 1 | - * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ - * | 0 | 0 || X || X | X | X || P | P | P | P | P | P | P | P | - * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ - * | 0 | 1 || 0 || 0 | 0 | 0 || 0 | P | P | P | P | P | P | P | - * | 0 | 1 || 1 || 0 | 0 | 0 || 1 | P | P | P | P | P | P | P | - * | 0 | 1 || 0 || 0 | 0 | 1 || P | 0 | P | P | P | P | P | P | - * | 0 | 1 || 1 || 0 | 0 | 1 || P | 1 | P | P | P | P | P | P | - * | 0 | 1 || 0 || 0 | 1 | 0 || P | P | 0 | P | P | P | P | P | - * | 0 | 1 || 1 || 0 | 1 | 0 || P | P | 1 | P | P | P | P | P | - * | 0 | 1 || 0 || 0 | 1 | 1 || P | P | P | 0 | P | P | P | P | - * | 0 | 1 || 1 || 0 | 1 | 1 || P | P | P | 1 | P | P | P | P | - * | 0 | 1 || 0 || 1 | 0 | 0 || P | P | P | P | 0 | P | P | P | - * | 0 | 1 || 1 || 1 | 0 | 0 || P | P | P | P | 1 | P | P | P | - * | 0 | 1 || 0 || 1 | 0 | 1 || P | P | P | P | P | 0 | P | P | - * | 0 | 1 || 1 || 1 | 0 | 1 || P | P | P | P | P | 1 | P | P | - * | 0 | 1 || 0 || 1 | 1 | 0 || P | P | P | P | P | P | 0 | P | - * | 0 | 1 || 1 || 1 | 1 | 0 || P | P | P | P | P | P | 1 | P | - * | 0 | 1 || 0 || 1 | 1 | 1 || P | P | P | P | P | P | P | 0 | - * | 0 | 1 || 1 || 1 | 1 | 1 || P | P | P | P | P | P | P | 1 | - * +---+---++---++---+---+---++---+---+---+---+---+---+---+---+ - * - * Naming convention attempts to follow Texas Instruments / National Semiconductor datasheet Literature Number SNOS382A - * - */ - -#ifndef NLD_DM9334_H_ -#define NLD_DM9334_H_ - -#include "netlist/nl_setup.h" - -#define TTL_9334(name, cCQ, cEQ, cD, cA0, cA1, cA2) \ - NET_REGISTER_DEV(TTL_9334, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CQ, cCQ) \ - NET_CONNECT(name, EQ, cEQ) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) - -#define TTL_9334_DIP(name) \ - NET_REGISTER_DEV(TTL_9334_DIP, name) - -#endif /* NLD_DM9334_H_ */ diff --git a/src/lib/netlist/devices/nld_legacy.cpp b/src/lib/netlist/devices/nld_legacy.cpp index 738230646e0..cbc44f589a8 100644 --- a/src/lib/netlist/devices/nld_legacy.cpp +++ b/src/lib/netlist/devices/nld_legacy.cpp @@ -1,31 +1,45 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* * nld_legacy.c * */ -#include "nld_legacy.h" -#include "netlist/nl_base.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(nicRSFF) { NETLIB_CONSTRUCTOR(nicRSFF) - , m_S(*this, "S") - , m_R(*this, "R") + , m_S(*this, "S", NETLIB_DELEGATE(inputs)) + , m_R(*this, "R", NETLIB_DELEGATE(inputs)) , m_Q(*this, "Q") , m_QQ(*this, "QQ") { } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + m_Q.initial(0); + m_QQ.initial(1); + } private: + NETLIB_HANDLERI(inputs) + { + if (!m_S()) + { + m_Q.push(1, NLTIME_FROM_NS(20)); + m_QQ.push(0, NLTIME_FROM_NS(20)); + } + else if (!m_R()) + { + m_Q.push(0, NLTIME_FROM_NS(20)); + m_QQ.push(1, NLTIME_FROM_NS(20)); + } + } + logic_input_t m_S; logic_input_t m_R; @@ -37,7 +51,7 @@ namespace netlist NETLIB_OBJECT(nicDelay) { NETLIB_CONSTRUCTOR(nicDelay) - , m_I(*this, "1") + , m_I(*this, "1", NETLIB_DELEGATE(input)) , m_Q(*this, "2") , m_L_to_H(*this, "L_TO_H", 10) , m_H_to_L(*this, "H_TO_L", 10) @@ -46,10 +60,28 @@ namespace netlist } //NETLIB_UPDATE_PARAMI(); - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_RESETI() + { + //m_Q.initial(0); + } private: + NETLIB_HANDLERI(input) + { + netlist_sig_t nval = m_I(); + if (nval && !m_last) + { + // L_to_H + m_Q.push(1, NLTIME_FROM_NS(static_cast<unsigned>(m_L_to_H()))); + } + else if (!nval && m_last) + { + // H_to_L + m_Q.push(0, NLTIME_FROM_NS(static_cast<unsigned>(m_H_to_L()))); + } + m_last = nval; + } + logic_input_t m_I; logic_output_t m_Q; @@ -59,49 +91,7 @@ namespace netlist state_var<netlist_sig_t> m_last; }; - NETLIB_RESET(nicRSFF) - { - m_Q.initial(0); - m_QQ.initial(1); - } - - NETLIB_UPDATE(nicRSFF) - { - if (!m_S()) - { - m_Q.push(1, NLTIME_FROM_NS(20)); - m_QQ.push(0, NLTIME_FROM_NS(20)); - } - else if (!m_R()) - { - m_Q.push(0, NLTIME_FROM_NS(20)); - m_QQ.push(1, NLTIME_FROM_NS(20)); - } - } - - NETLIB_RESET(nicDelay) - { - //m_Q.initial(0); - } - - NETLIB_UPDATE(nicDelay) - { - netlist_sig_t nval = m_I(); - if (nval && !m_last) - { - // L_to_H - m_Q.push(1, NLTIME_FROM_NS(static_cast<unsigned>(m_L_to_H()))); - } - else if (!nval && m_last) - { - // H_to_L - m_Q.push(0, NLTIME_FROM_NS(static_cast<unsigned>(m_H_to_L()))); - } - m_last = nval; - } - NETLIB_DEVICE_IMPL(nicRSFF, "NETDEV_RSFF", "") NETLIB_DEVICE_IMPL(nicDelay, "NETDEV_DELAY", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_legacy.h b/src/lib/netlist/devices/nld_legacy.h deleted file mode 100644 index aa3aec6f147..00000000000 --- a/src/lib/netlist/devices/nld_legacy.h +++ /dev/null @@ -1,39 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_legacy.h - * - * All of the devices below needs to disappear at some time ..... - * - * - */ - -#pragma once - -#ifndef NLD_LEGACY_H_ -#define NLD_LEGACY_H_ - -#include "netlist/nl_setup.h" - -// ---------------------------------------------------------------------------------------- -// Macros -// ---------------------------------------------------------------------------------------- - -#define NETDEV_RSFF(name) \ - NET_REGISTER_DEV(NETDEV_RSFF, name) - -#define NETDEV_DELAY(name) \ - NET_REGISTER_DEV(NETDEV_DELAY, name) - -// ---------------------------------------------------------------------------------------- -// Devices ... -// ---------------------------------------------------------------------------------------- - -namespace netlist -{ - namespace devices - { - } //namespace devices -} // namespace netlist - -#endif /* NLD_LEGACY_H_ */ diff --git a/src/lib/netlist/devices/nld_log.cpp b/src/lib/netlist/devices/nld_log.cpp index c8569f473c3..a3dae6a4b39 100644 --- a/src/lib/netlist/devices/nld_log.cpp +++ b/src/lib/netlist/devices/nld_log.cpp @@ -1,59 +1,152 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_log.c + * nld_log.cpp + * + * Devices supporting analysis and logging + * + * nld_log: + * + * +---------+ + * | ++ | + * I | | ==> Log to file "netlist_" + name() + ".log" + * | | + * +---------+ * */ -#include "netlist/nl_base.h" -#include "nld_log.h" +#include "nl_base.h" #include "plib/pfmtlog.h" +#include "plib/pmulti_threading.h" #include "plib/pstream.h" //#include "sound/wavwrite.h" -namespace netlist -{ - namespace devices - { +#include <array> +#include <atomic> +#include <functional> +#include <mutex> +#include <thread> +#include <vector> + +namespace netlist::devices { + NETLIB_OBJECT(log) { NETLIB_CONSTRUCTOR(log) - , m_I(*this, "I") + , m_I(*this, "I", NETLIB_DELEGATE(input)) , m_strm(plib::filesystem::u8path(plib::pfmt("{1}.log")(this->name()))) , m_writer(&m_strm) + , m_reset(false) + , m_done(false) + , m_sem_w(0) + , m_sem_r(0) + , m_w(0) + , m_r(0) { if (m_strm.fail()) throw plib::file_open_e(plib::pfmt("{1}.log")(this->name())); m_strm.imbue(std::locale::classic()); + + //m_write_thread = std::thread(std::bind(&nld_log::thread_writer, this)); + m_write_thread = std::thread([this]{this->thread_writer(); }); + m_sem_r.acquire(); + } + + PCOPYASSIGNMOVE(NETLIB_NAME(log), delete) + + NETLIB_DESTRUCTOR(log) + { + if (m_reset) + log_value(m_I()); + m_sem_w.release(); + m_done = true; + m_write_thread.join(); } - NETLIB_UPDATEI() + NETLIB_HANDLERI(input) { - /* use pstring::sprintf, it is a LOT faster */ - m_writer.writeline(plib::pfmt("{1:.9} {2}").e(exec().time().as_double()).e(static_cast<double>(m_I()))); + log_value(static_cast<nl_fptype>(m_I())); } - NETLIB_RESETI() { } + void log_value(nl_fptype val) + { + if (m_buffers[m_w].size() == BUF_SIZE) + { + m_sem_w.release(); + m_sem_r.acquire(); + m_w++; + if (m_w >= BUFFERS) + m_w = 0; + } + m_buffers[m_w].push_back({exec().time(), val}); + } + + NETLIB_RESETI() { m_reset = true; } protected: + + void thread_writer() + { + m_sem_r.release(BUFFERS); + while (true) + { + if (!m_sem_w.try_acquire()) + { + if (m_done) + break; + m_sem_w.acquire(); + } + auto &b = m_buffers[m_r]; + + for (auto &e : b) + /* use pstring::sprintf, it is a LOT faster */ + m_writer.write_line(plib::pfmt("{1:.9} {2}").e(e.t.as_fp<nl_fptype>()).e(e.v)); + b.clear(); + m_sem_r.release(); + m_r++; + if (m_r >= BUFFERS) + m_r = 0; + } + } + + struct entry + { + netlist_time_ext t; + nl_fptype v; + }; + static constexpr std::size_t BUF_SIZE=16384; + static constexpr std::size_t BUFFERS=4; analog_input_t m_I; - std::ofstream m_strm; + private: + plib::ofstream m_strm; plib::putf8_writer m_writer; + bool m_reset; + std::array<std::vector<entry>, BUFFERS> m_buffers; + std::atomic<bool> m_done; + plib::psemaphore m_sem_w; + plib::psemaphore m_sem_r; + std::size_t m_w; + std::size_t m_r; + std::thread m_write_thread; }; - NETLIB_OBJECT_DERIVED(logD, log) + class NETLIB_NAME(logD) : public NETLIB_NAME(log) { - NETLIB_CONSTRUCTOR_DERIVED(logD, log) - , m_I2(*this, "I2") + public: + NETLIB_NAME(logD)(constructor_param_t data) + : NETLIB_NAME(log)(data) + , m_I2(*this, "I2", nl_delegate(&NETLIB_NAME(logD)::input, this)) { + m_I.set_delegate(nl_delegate(&NETLIB_NAME(logD)::input, this)); } - NETLIB_UPDATEI() + private: + NETLIB_HANDLERI(input) { - m_writer.writeline(plib::pfmt("{1:.9} {2}").e(exec().time().as_double()).e(static_cast<double>(m_I() - m_I2()))); + log_value(static_cast<nl_fptype>(m_I() - m_I2())); } - NETLIB_RESETI() { } + //NETLIB_RESETI() {} analog_input_t m_I2; }; @@ -62,7 +155,7 @@ namespace netlist ~NETLIB_NAME(wav)(); analog_input_t m_I; private: - // FIXME: rewrite sound/wavwrite.h to be an object ... + // FIXME: rewrite `sound/wavwrite.h` to be an object ... void *m_file; ); #endif @@ -71,7 +164,7 @@ namespace netlist // FIXME: Implement wav later, this must be clock triggered device where the input to be written - // is on a subdevice .. + // is on a sub device .. #if 0 NETLIB_START(wav) { @@ -83,7 +176,7 @@ namespace netlist NETLIB_UPDATE(wav) { - fprintf(m_file, "%e %e\n", netlist().time().as_double(), m_I()); + fprintf(m_file, "%e %e\n", netlist().time().as_fp<nl_fptype>(), m_I()); } NETLIB_NAME(log)::~NETLIB_NAME(wav)() @@ -96,5 +189,4 @@ namespace netlist NETLIB_DEVICE_IMPL(log, "LOG", "+I") NETLIB_DEVICE_IMPL(logD, "LOGD", "+I,+I2") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_log.h b/src/lib/netlist/devices/nld_log.h deleted file mode 100644 index 13c71ea7257..00000000000 --- a/src/lib/netlist/devices/nld_log.h +++ /dev/null @@ -1,32 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_log.h - * - * Devices supporting analysis and logging - * - * nld_log: - * - * +---------+ - * | ++ | - * I | | ==> Log to file "netlist_" + name() + ".log" - * | | - * +---------+ - * - */ - -#ifndef NLD_LOG_H_ -#define NLD_LOG_H_ - -#include "netlist/nl_setup.h" - -#define LOG(name, cI) \ - NET_REGISTER_DEV(LOG, name) \ - NET_CONNECT(name, I, cI) - -#define LOGD(name, cI, cI2) \ - NET_REGISTER_DEV(LOGD, name) \ - NET_CONNECT(name, I, cI) \ - NET_CONNECT(name, I2, cI2) - -#endif /* NLD_LOG_H_ */ diff --git a/src/lib/netlist/devices/nld_mm5837.cpp b/src/lib/netlist/devices/nld_mm5837.cpp index a8add5aaeea..cd92ce1e5df 100644 --- a/src/lib/netlist/devices/nld_mm5837.cpp +++ b/src/lib/netlist/devices/nld_mm5837.cpp @@ -1,57 +1,106 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_MM5837.c + * nld_MM5837.cpp + * + * MM5837: Digital noise source + * + * +--------+ + * VDD |1 ++ 8| NC + * VGG |2 7| NC + * OUT |3 6| NC + * VSS |4 5| NC + * +--------+ + * + * Naming conventions follow National Semiconductor datasheet * */ -#include "nld_mm5837.h" -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/solver/nld_matrix_solver.h" +#include "analog/nlid_twoterm.h" +#include "solver/nld_matrix_solver.h" -#define R_LOW (1000.0) -#define R_HIGH (1000.0) +namespace netlist::devices { -namespace netlist -{ - namespace devices + NETLIB_OBJECT(MM5837) { - NETLIB_OBJECT(MM5837_dip) - { - NETLIB_CONSTRUCTOR(MM5837_dip) + NETLIB_CONSTRUCTOR(MM5837) , m_RV(*this, "_RV") - , m_VDD(*this, "1") - , m_VGG(*this, "2") - , m_VSS(*this, "4") - , m_FREQ(*this, "FREQ", 24000) + , m_VDD(*this, "VDD", NETLIB_DELEGATE(inputs)) + , m_VGG(*this, "VGG", NETLIB_DELEGATE(inputs)) + , m_VSS(*this, "VSS", NETLIB_DELEGATE(inputs)) + , m_FREQ(*this, "FREQ", 24000 * 2) + , m_R_LOW(*this, "R_LOW", 1000) + , m_R_HIGH(*this, "R_HIGH", 1000) /* clock */ - , m_feedback(*this, "_FB") + , m_feedback(*this, "_FB", NETLIB_DELEGATE(inputs)) , m_Q(*this, "_Q") - , m_inc(netlist_time::from_hz(24000)) + , m_inc(netlist_time::from_hz(24000 * 2)) , m_shift(*this, "m_shift", 0) - , m_is_timestep(false) { - connect(m_feedback, m_Q); + connect("_FB", "_Q"); + + // output + connect("_RV.2", "VDD"); + register_sub_alias("OUT", "_RV.1"); + } - /* output */ - //register_term("_RV1", m_RV.m_P); - //register_term("_RV2", m_RV.m_N); - connect(m_RV.m_N, m_VDD); + NETLIB_RESETI() + { + //m_V0.initial(0.0); + //m_RV.do_reset(); + m_RV().set_G_V_I(plib::reciprocal(m_R_LOW()), + nlconst::zero(), + nlconst::zero()); + m_inc = netlist_time::from_fp(plib::reciprocal(m_FREQ())); + if (m_FREQ() < nlconst::magic(24000*2) || m_FREQ() > nlconst::magic(56000*2)) + log().warning(MW_FREQUENCY_OUTSIDE_OF_SPECS_1(m_FREQ())); + + m_shift = 0x1ffff; + } - /* device */ - register_subalias("3", m_RV.m_P); + NETLIB_UPDATE_PARAMI() + { + m_inc = netlist_time::from_fp(plib::reciprocal(m_FREQ())); + if (m_FREQ() < nlconst::magic(24000*2) || m_FREQ() > nlconst::magic(56000*2)) + log().warning(MW_FREQUENCY_OUTSIDE_OF_SPECS_1(m_FREQ())); } - NETLIB_RESETI(); - NETLIB_UPDATEI(); - NETLIB_UPDATE_PARAMI(); + private: + NETLIB_HANDLERI(inputs) + { + m_Q.push(!m_feedback(), m_inc); + + /* shift register + * + * 17 bits, bits 17 & 14 feed back to input + * + */ + + const auto last_state = m_shift & 0x01; + /* shift */ + m_shift = (m_shift >> 1) | (((m_shift & 0x01) ^ ((m_shift >> 3) & 0x01)) << 16); + const auto state = m_shift & 0x01; + + if (state != last_state) + { + const nl_fptype R = state ? m_R_HIGH : m_R_LOW; + const nl_fptype V = state ? m_VDD() : m_VSS(); + + m_RV().change_state([this, &R, &V]() + { + m_RV().set_G_V_I(plib::reciprocal(R), V, nlconst::zero()); + }); + } + + } - protected: - analog::NETLIB_SUB(twoterm) m_RV; + NETLIB_SUB_NS(analog, two_terminal) m_RV; analog_input_t m_VDD; analog_input_t m_VGG; analog_input_t m_VSS; - param_double_t m_FREQ; + param_fp_t m_FREQ; + param_fp_t m_R_LOW; + param_fp_t m_R_HIGH; /* clock stage */ logic_input_t m_feedback; @@ -60,61 +109,8 @@ namespace netlist /* state */ state_var_u32 m_shift; - - /* cache */ - bool m_is_timestep; }; - NETLIB_RESET(MM5837_dip) - { - //m_V0.initial(0.0); - //m_RV.do_reset(); - m_RV.set_G_V_I(plib::constants<nl_double>::one() / R_LOW, 0.0, 0.0); - m_inc = netlist_time::from_double(1.0 / m_FREQ()); - if (m_FREQ() < 24000 || m_FREQ() > 56000) - log().warning(MW_FREQUENCY_OUTSIDE_OF_SPECS_1(m_FREQ())); - - m_shift = 0x1ffff; - m_is_timestep = m_RV.m_P.net().solver()->has_timestep_devices(); - } - - NETLIB_UPDATE_PARAM(MM5837_dip) - { - m_inc = netlist_time::from_double(1.0 / m_FREQ()); - if (m_FREQ() < 24000 || m_FREQ() > 56000) - log().warning(MW_FREQUENCY_OUTSIDE_OF_SPECS_1(m_FREQ())); - } - - NETLIB_UPDATE(MM5837_dip) - { - m_Q.push(!m_feedback(), m_inc); - - /* shift register - * - * 17 bits, bits 17 & 14 feed back to input - * - */ - - const auto last_state = m_shift & 0x01; - /* shift */ - m_shift = (m_shift >> 1) | (((m_shift & 0x01) ^ ((m_shift >> 3) & 0x01)) << 16); - const auto state = m_shift & 0x01; - - if (state != last_state) - { - const nl_double R = state ? R_HIGH : R_LOW; - const nl_double V = state ? m_VDD() : m_VSS(); - - // We only need to update the net first if this is a time stepping net - if (m_is_timestep) - m_RV.update(); - m_RV.set_G_V_I(plib::constants<nl_double>::one() / R, V, plib::constants<nl_double>::zero()); - m_RV.solve_later(NLTIME_FROM_NS(1)); - } - - } - - NETLIB_DEVICE_IMPL(MM5837_dip, "MM5837_DIP", "") + NETLIB_DEVICE_IMPL(MM5837, "MM5837", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_mm5837.h b/src/lib/netlist/devices/nld_mm5837.h deleted file mode 100644 index 8f764aa651f..00000000000 --- a/src/lib/netlist/devices/nld_mm5837.h +++ /dev/null @@ -1,27 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_MM5837.h - * - * MM5837: Digital noise source - * - * +--------+ - * VDD |1 ++ 8| NC - * VGG |2 7| NC - * OUT |3 6| NC - * VSS |4 5| NC - * +--------+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef NLD_MM5837_H_ -#define NLD_MM5837_H_ - -#include "netlist/nl_setup.h" - -#define MM5837_DIP(name) \ - NET_REGISTER_DEV(MM5837_DIP, name) - -#endif /* NLD_MM5837_H_ */ diff --git a/src/lib/netlist/devices/nld_ne555.cpp b/src/lib/netlist/devices/nld_ne555.cpp index dc6e3e5696a..a94d868373d 100644 --- a/src/lib/netlist/devices/nld_ne555.cpp +++ b/src/lib/netlist/devices/nld_ne555.cpp @@ -1,61 +1,17 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*! - * \file nld_NE555.cpp - * - * \page NE555 NE555: PRECISION TIMERS - * - * The Swiss army knife for timing purposes - * - * \section ne555_1 Synopsis - * - * \snippet devsyn.dox.h NE555 synopsis - * \snippet devsyn.dox.h NE555_DIP synopsis - - * \section ne555_11 "C" Synopsis - * - * \snippet devsyn.dox.h NE555 csynopsis - * \snippet devsyn.dox.h NE555_DIP csynopsis - * - * For the \c NE555 use verbose pin assignments like \c name.TRIG or \c name.OUT. - * For the \c NE555_DIP use pin numbers like \c name.1. - * - * \section ne555_2 Connection Diagram - * - * <pre> - * +--------+ - * GND |1 ++ 8| VCC - * TRIG |2 7| DISCH - * OUT |3 6| THRES - * RESET |4 5| CONT - * +--------+ - * </pre> - * - * Naming conventions follow Texas Instruments datasheet - * - * \section ne555_3 Function Table - * - * Please refer to the datasheet. - * - * \section ne555_4 Limitations - * - * Internal resistor network currently fixed to 5k. - * - * \section ne555_5 Example - * \snippet ne555_astable.c ne555 example - */ - -#include "nld_ne555.h" -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/solver/nld_solver.h" + + +#include "analog/nlid_twoterm.h" +#include "solver/nld_solver.h" + +#include "plib/pmath.h" #define R_OFF (1E20) -#define R_ON (25) // Datasheet states a maximum discharge of 200mA, R = 5V / 0.2 +#define R_ON (1) + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(NE555) { NETLIB_CONSTRUCTOR(NE555) @@ -64,35 +20,122 @@ namespace netlist , m_R3(*this, "R3") , m_ROUT(*this, "ROUT") , m_RDIS(*this, "RDIS") - , m_RESET(*this, "RESET") // Pin 4 - , m_THRES(*this, "THRESH") // Pin 6 - , m_TRIG(*this, "TRIG") // Pin 2 + , m_RESET(*this, "RESET", NETLIB_DELEGATE(inputs)) // Pin 4 + , m_THRES(*this, "THRESH", NETLIB_DELEGATE(inputs)) // Pin 6 + , m_TRIG(*this, "TRIG", NETLIB_DELEGATE(inputs)) // Pin 2 , m_OUT(*this, "_OUT") // to Pin 3 via ROUT , m_last_out(*this, "m_last_out", false) , m_ff(*this, "m_ff", false) , m_last_reset(*this, "m_last_reset", false) + , m_overshoot(*this, "m_overshoot", 0.0) + , m_undershoot(*this, "m_undershoot", 0.0) + , m_overshoot_limit(0.0) { - register_subalias("GND", m_R3.m_N); // Pin 1 - register_subalias("CONT", m_R1.m_N); // Pin 5 - register_subalias("DISCH", m_RDIS.m_P); // Pin 7 - register_subalias("VCC", m_R1.m_P); // Pin 8 - register_subalias("OUT", m_ROUT.m_P); // Pin 3 - - connect(m_R1.m_N, m_R2.m_P); - connect(m_R2.m_N, m_R3.m_P); - connect(m_RDIS.m_N, m_R3.m_N); - connect(m_OUT, m_ROUT.m_N); + register_sub_alias("GND", "R3.2"); // Pin 1 + register_sub_alias("CONT", "R1.2"); // Pin 5 + register_sub_alias("DISCH", "RDIS.1"); // Pin 7 + register_sub_alias("VCC", "R1.1"); // Pin 8 + register_sub_alias("OUT", "ROUT.1"); // Pin 3 + + connect("R1.2", "R2.1"); + connect("R2.2", "R3.1"); + connect("RDIS.2", "R3.2"); + connect("_OUT", "ROUT.2"); } - NETLIB_UPDATEI(); - NETLIB_RESETI(); + NETLIB_RESETI() + { + /* FIXME make resistances a parameter, properly model other variants */ + m_R1().set_R(nlconst::magic(5000)); + m_R2().set_R(nlconst::magic(5000)); + m_R3().set_R(nlconst::magic(5000)); + m_ROUT().set_R(nlconst::magic(20)); + m_RDIS().set_R(nlconst::magic(R_OFF)); + + m_last_out = true; + // Check for astable setup, usually TRIG AND THRES connected. Enable + // overshoot compensation in this case. + if (m_TRIG.net() == m_THRES.net()) + m_overshoot_limit = nlconst::magic(0.5); + } private: - analog::NETLIB_SUB(R_base) m_R1; - analog::NETLIB_SUB(R_base) m_R2; - analog::NETLIB_SUB(R_base) m_R3; - analog::NETLIB_SUB(R_base) m_ROUT; - analog::NETLIB_SUB(R_base) m_RDIS; + NETLIB_HANDLERI(inputs) + { + // FIXME: assumes GND is connected to 0V. + + const auto reset = m_RESET(); + + const nl_fptype v_threshold = clamp_hl(m_R2().P()(), nlconst::magic(0.7), nlconst::magic(1.4)); + const nl_fptype v_trigger = clamp_hl(m_R2().N()(), nlconst::magic(0.7), nlconst::magic(1.4)); + + // avoid artificial oscillation due to overshoot compensation when + // the control input is used. + const auto overshoot_limit = std::min(m_overshoot_limit, std::max(0.0, (v_threshold - v_trigger) / 3.0)); + + if (!reset && m_last_reset) + { + m_ff = false; + } + else + { +#if (NL_USE_BACKWARD_EULER) + const bool threshold_exceeded = (m_THRES() + m_overshoot > v_threshold); + const bool trigger_exceeded = (m_TRIG() - m_overshoot > v_trigger); +#else + const bool threshold_exceeded = (m_THRES() + m_overshoot > v_threshold); + const bool trigger_exceeded = (m_TRIG() - m_undershoot > v_trigger); +#endif + if (!trigger_exceeded) + m_ff = true; + else if (threshold_exceeded) + { + m_ff = false; + } + } + + const bool out = (!reset ? false : m_ff); + + if (m_last_out && !out) + { +#if (NL_USE_BACKWARD_EULER) + m_overshoot += ((m_THRES() - v_threshold)) * 2.0; +#else + m_overshoot += ((m_THRES() - v_threshold)); +#endif + m_overshoot = plib::clamp(m_overshoot(), nlconst::zero(), overshoot_limit); + //if (this->name() == "IC6_2") + // printf("%f %s %f %f %f\n", exec().time().as_double(), this->name().c_str(), m_overshoot(), m_R2.P()(), m_THRES()); + m_RDIS().change_state([this]() + { + m_RDIS().set_R(nlconst::magic(R_ON)); + }); + m_OUT.push(m_R3().N()()); + } + else if (!m_last_out && out) + { +#if (NL_USE_BACKWARD_EULER) + m_overshoot += (v_trigger - m_TRIG()) * 2.0; + m_overshoot = plib::clamp(m_overshoot(), nlconst::zero(), overshoot_limit); +#else + m_undershoot += (v_trigger - m_TRIG()); + m_undershoot = plib::clamp(m_undershoot(), nlconst::zero(), overshoot_limit); +#endif + m_RDIS().change_state([this]() + { + m_RDIS().set_R(nlconst::magic(R_OFF)); + }); + // FIXME: Should be delayed by 100ns + m_OUT.push(m_R1().P()()); + } + m_last_reset = reset; + m_last_out = out; + } + NETLIB_SUB_NS(analog, R_base) m_R1; + NETLIB_SUB_NS(analog, R_base) m_R2; + NETLIB_SUB_NS(analog, R_base) m_R3; + NETLIB_SUB_NS(analog, R_base) m_ROUT; + NETLIB_SUB_NS(analog, R_base) m_RDIS; logic_input_t m_RESET; analog_input_t m_THRES; @@ -102,98 +145,19 @@ namespace netlist state_var<bool> m_last_out; state_var<bool> m_ff; state_var<bool> m_last_reset; + state_var<nl_fptype> m_overshoot; + state_var<nl_fptype> m_undershoot; + nl_fptype m_overshoot_limit; - nl_double clamp(const nl_double v, const nl_double a, const nl_double b) - { - nl_double ret = v; - nl_double vcc = m_R1.m_P(); - - if (ret > vcc - a) - ret = vcc - a; - if (ret < b) - ret = b; - return ret; - } - }; - - NETLIB_OBJECT_DERIVED(NE555_dip, NE555) - { - NETLIB_CONSTRUCTOR_DERIVED(NE555_dip, NE555) + nl_fptype clamp_hl(const nl_fptype v, const nl_fptype a, const nl_fptype b) noexcept { - register_subalias("1", "GND"); // Pin 1 - register_subalias("2", "TRIG"); // Pin 2 - register_subalias("3", "OUT"); // Pin 3 - register_subalias("4", "RESET"); // Pin 4 - register_subalias("5", "CONT"); // Pin 5 - register_subalias("6", "THRESH"); // Pin 6 - register_subalias("7", "DISCH"); // Pin 7 - register_subalias("8", "VCC"); // Pin 8 + const nl_fptype vcc = m_R1().P()(); + return plib::clamp(v, b, vcc - a); } }; - NETLIB_RESET(NE555) - { - m_R1.reset(); - m_R2.reset(); - m_R3.reset(); - m_ROUT.reset(); - m_RDIS.reset(); - - /* FIXME make resistances a parameter, properly model other variants */ - m_R1.set_R(5000); - m_R2.set_R(5000); - m_R3.set_R(5000); - m_ROUT.set_R(20); - m_RDIS.set_R(R_OFF); - - m_last_out = true; - } - - NETLIB_UPDATE(NE555) - { - // FIXME: assumes GND is connected to 0V. - - const auto reset = m_RESET(); - - if (!reset && m_last_reset) - { - m_ff = false; - } - else - { - const nl_double vt = clamp(m_R2.m_P(), 0.7, 1.4); - const bool bthresh = (m_THRES() > vt); - const bool btrig = (m_TRIG() > clamp(m_R2.m_N(), 0.7, 1.4)); - - if (!btrig) - m_ff = true; - else if (bthresh) - m_ff = false; - } - - const bool out = (!reset ? false : m_ff); - - if (m_last_out && !out) - { - m_RDIS.update(); - m_OUT.push(m_R3.m_N()); - m_RDIS.set_R(R_ON); - } - else if (!m_last_out && out) - { - m_RDIS.update(); - // FIXME: Should be delayed by 100ns - m_OUT.push(m_R1.m_P()); - m_RDIS.set_R(R_OFF); - } - m_last_reset = reset; - m_last_out = out; - } - NETLIB_DEVICE_IMPL(NE555, "NE555", "") - NETLIB_DEVICE_IMPL(NE555_dip, "NE555_DIP", "") NETLIB_DEVICE_IMPL_ALIAS(MC1455P, NE555, "MC1455P", "") - NETLIB_DEVICE_IMPL_ALIAS(MC1455P_dip, NE555_dip, "MC1455P_DIP", "") - } //namespace devices -} // namespace netlist + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_ne555.h b/src/lib/netlist/devices/nld_ne555.h deleted file mode 100644 index fc575d914b7..00000000000 --- a/src/lib/netlist/devices/nld_ne555.h +++ /dev/null @@ -1,21 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud - -#ifndef NLD_NE555_H_ -#define NLD_NE555_H_ - -#include "netlist/nl_setup.h" - -#define NE555(name) \ - NET_REGISTER_DEV(NE555, name) - -#define NE555_DIP(name) \ - NET_REGISTER_DEV(NE555_DIP, name) - -#define MC1455P(name) \ - NET_REGISTER_DEV(MC1455P, name) - -#define MC1455P_DIP(name) \ - NET_REGISTER_DEV(MC1455P_DIP, name) - -#endif /* NLD_NE555_H_ */ diff --git a/src/lib/netlist/devices/nld_r2r_dac.cpp b/src/lib/netlist/devices/nld_r2r_dac.cpp index 284b6673f76..efff78d9ca8 100644 --- a/src/lib/netlist/devices/nld_r2r_dac.cpp +++ b/src/lib/netlist/devices/nld_r2r_dac.cpp @@ -1,55 +1,94 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_R2R_dac.c + * nld_r2r_dac.cpp + * + * DMR2R_DAC: R-2R DAC + * + * Generic R-2R DAC ... This is fast. + * 2R + * Bit n >----RRR----+---------> Vout + * | + * R + * R R + * R + * | + * . + * . + * 2R | + * Bit 2 >----RRR----+ + * | + * R + * R R + * R + * | + * 2R | + * Bit 1 >----RRR----+ + * | + * R + * R 2R + * R + * | + * V0 + * + * Using Thevenin's Theorem, this can be written as + * + * +---RRR-----------> Vout + * | + * V + * V V = VAL / 2^n * Vin + * V + * | + * V0 * */ -#include "netlist/nl_base.h" -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/nl_factory.h" +#include "nl_base.h" +#include "nl_factory.h" + +#include "analog/nlid_twoterm.h" -namespace netlist +namespace netlist::analog { - namespace analog - { - NETLIB_OBJECT_DERIVED(r2r_dac, twoterm) + + class nld_r2r_dac : public nld_two_terminal { - NETLIB_CONSTRUCTOR_DERIVED(r2r_dac, twoterm) - , m_VIN(*this, "VIN", 1.0) - , m_R(*this, "R", 1.0) + public: + nld_r2r_dac(constructor_param_t data) + : nld_two_terminal(data) + , m_VIN(*this, "VIN", nlconst::one()) + , m_R(*this, "R", nlconst::one()) , m_num(*this, "N", 1) , m_val(*this, "VAL", 1) { - register_subalias("VOUT", m_P); - register_subalias("VGND", m_N); + register_sub_alias("VOUT", P()); + register_sub_alias("VGND", N()); } NETLIB_UPDATE_PARAMI(); - //NETLIB_RESETI(); - //NETLIB_UPDATEI(); + // NETLIB_RESETI(); protected: - param_double_t m_VIN; - param_double_t m_R; + param_fp_t m_VIN; + param_fp_t m_R; param_int_t m_num; param_int_t m_val; }; - NETLIB_UPDATE_PARAM(r2r_dac) { - solve_now(); + nl_fptype V = m_VIN() / static_cast<nl_fptype>(1 << m_num()) + * static_cast<nl_fptype>(m_val()); + change_state( + [this, &V]() + { this->set_G_V_I(plib::reciprocal(m_R()), V, nlconst::zero()); }); + } - double V = m_VIN() / static_cast<double>(1 << m_num()) - * static_cast<double>(m_val()); +} // namespace netlist::analog - this->set_G_V_I(1.0 / m_R(), V, 0.0); - } - } //namespace analog +namespace netlist::devices +{ - namespace devices { - NETLIB_DEVICE_IMPL_NS(analog, r2r_dac, "R2R_DAC", "VIN,R,N") - } // namespace devices + NETLIB_DEVICE_IMPL_NS(analog, r2r_dac, "R2R_DAC", "VIN,R,N") -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_r2r_dac.h b/src/lib/netlist/devices/nld_r2r_dac.h deleted file mode 100644 index 8a4257a3cbf..00000000000 --- a/src/lib/netlist/devices/nld_r2r_dac.h +++ /dev/null @@ -1,57 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_R2R_DAC.h - * - * DMR2R_DAC: R-2R DAC - * - * Generic R-2R DAC ... This is fast. - * 2R - * Bit n >----RRR----+---------> Vout - * | - * R - * R R - * R - * | - * . - * . - * 2R | - * Bit 2 >----RRR----+ - * | - * R - * R R - * R - * | - * 2R | - * Bit 1 >----RRR----+ - * | - * R - * R 2R - * R - * | - * V0 - * - * Using Thevenin's Theorem, this can be written as - * - * +---RRR-----------> Vout - * | - * V - * V V = VAL / 2^n * Vin - * V - * | - * V0 - * - */ - -#ifndef NLD_R2R_DAC_H_ -#define NLD_R2R_DAC_H_ - -#include "netlist/nl_setup.h" - -#define R2R_DAC(name, p_VIN, p_R, p_N) \ - NET_REGISTER_DEV(R2R_DAC, name) \ - NETDEV_PARAMI(name, VIN, p_VIN) \ - NETDEV_PARAMI(name, R, p_R) \ - NETDEV_PARAMI(name, N, p_N) - -#endif /* NLD_R2R_DAC_H_ */ diff --git a/src/lib/netlist/devices/nld_roms.cpp b/src/lib/netlist/devices/nld_roms.cpp new file mode 100644 index 00000000000..a9d52850dba --- /dev/null +++ b/src/lib/netlist/devices/nld_roms.cpp @@ -0,0 +1,311 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud +/* + * nld_roms.cpp + * + */ + +#include "nl_base.h" +#include "nl_factory.h" + +template <typename N, typename T> +constexpr bool TOR(N n, T &a) +{ + return (n == 0) ? false : (TOR(n - 1, a) || a[n - 1]()); +} + +template <typename T> +constexpr bool TOR(T &a) +{ + return TOR(a.size(), a); +} + +namespace netlist::devices { + + NETLIB_OBJECT(mk28000_prom) + { + NETLIB_CONSTRUCTOR(mk28000_prom) + , m_TE(*this, "FORCE_TRISTATE_LOGIC", 0) + , m_enable_lo(*this, "m_enable_lo", false) + , m_enable_hi(*this, "m_enable_hi", false) + , m_latched_rom(*this, "m_latched_rom", 0) + , m_A(*this, 1, "A{}", NETLIB_DELEGATE(addr)) + , m_ARQ(*this, "ARQ", NETLIB_DELEGATE(addr)) + , m_OE1(*this, "OE1", NETLIB_DELEGATE(oe1)) + , m_OE2(*this, "OE2", NETLIB_DELEGATE(oe2)) + , m_O(*this, 1, "O{}", m_TE()) + , m_ROM(*this, "ROM") + , m_power_pins(*this) + { + } + + private: + NETLIB_HANDLERI(oe1) + { + m_enable_lo = m_OE1(); + uint8_t o = m_enable_lo ? m_latched_rom : 0; + for (std::size_t i=0; i<4; i++) + { + m_O.set_tristate(!m_enable_lo, NLTIME_FROM_NS(600), NLTIME_FROM_NS(600)); + m_O[i].push((o >> i) & 1, NLTIME_FROM_NS(600)); + } + } + + NETLIB_HANDLERI(oe2) + { + m_enable_hi = m_OE2(); + uint8_t o = m_enable_hi ? m_latched_rom : 0; + for (std::size_t i=4; i<8; i++) + { + m_O.set_tristate(!m_enable_hi, NLTIME_FROM_NS(600), NLTIME_FROM_NS(600)); + m_O[i].push((o >> i) & 1, NLTIME_FROM_NS(600)); + } + } + + NETLIB_HANDLERI(addr) + { + if (!m_ARQ()) + { + const auto addr = m_A(); + m_latched_rom = m_ROM[addr]; + } + uint8_t o = (m_enable_hi || m_enable_lo) ? m_latched_rom : 0; + for (std::size_t i=0; i<4; i++) + { + m_O.set_tristate(!m_enable_lo, NLTIME_FROM_NS(600), NLTIME_FROM_NS(600)); + m_O[i].push((o >> i) & 1, NLTIME_FROM_NS(600)); + } + for (std::size_t i=4; i<8; i++) + { + m_O.set_tristate(!m_enable_hi, NLTIME_FROM_NS(600), NLTIME_FROM_NS(600)); + m_O[i].push((o >> i) & 1, NLTIME_FROM_NS(600)); + } + } + + param_logic_t m_TE; + state_var<bool> m_enable_lo; + state_var<bool> m_enable_hi; + state_var<uint8_t> m_latched_rom; + object_array_t<logic_input_t, 11> m_A; + logic_input_t m_ARQ; + logic_input_t m_OE1; + logic_input_t m_OE2; + object_array_t<tristate_output_t, 8> m_O; + + param_rom_t<uint8_t, 11, 8> m_ROM; + nld_power_pins m_power_pins; + }; + + NETLIB_OBJECT(mcm14524_rom) + { + NETLIB_CONSTRUCTOR_MODEL(mcm14524_rom, "CD4XXX") + , m_enabled(*this, "m_enabled", true) + , m_latched_rom(*this, "m_latched_rom", 0) + , m_A(*this, 1, "A{}", NETLIB_DELEGATE(addr)) + , m_CLK(*this, "CLK", NETLIB_DELEGATE(addr)) + , m_clk_old(*this, "m_clk_old", true) + , m_EN(*this, "EN", NETLIB_DELEGATE(en)) + , m_B(*this, 1, "B{}", 0) + , m_ROM(*this, "ROM") + , m_taccc(*this, "m_taccc", netlist_time::from_nsec(1350)) + , m_taccen(*this, "m_taccen", netlist_time::from_nsec(245)) + , m_power_pins(*this, NETLIB_DELEGATE(vdd_vss)) + { + } + + private: + NETLIB_HANDLERI(en) + { + m_enabled = m_EN(); + uint8_t o = m_enabled ? m_latched_rom : 0; // outputs are forced to 0 by enable going low; this chip does not have tri-state outputs! + for (std::size_t i=0; i<4; i++) + { + m_B[i].push((o >> i) & 1, m_taccen); + } + } + + NETLIB_HANDLERI(addr) + { + if (!m_CLK() && m_clk_old) // latch on falling edge + { + const auto addr = m_A(); + m_latched_rom = m_ROM[addr]; + } + m_clk_old = m_CLK(); + uint8_t o = m_enabled ? m_latched_rom : 0; // outputs are forced to 0 by enable going low; this chip does not have tri-state outputs! + for (std::size_t i=0; i<4; i++) + { + m_B[i].push((o >> i) & 1, m_taccc); + } + } + + NETLIB_HANDLERI(vdd_vss) + { + auto d = m_power_pins.VCC()() - m_power_pins.GND()(); + if (d > 0.1) // avoid unrealistic values + { + m_taccc = netlist_time::from_nsec(gsl::narrow_cast<unsigned>(7615.5 / d - 181)); + m_taccen = netlist_time::from_nsec(gsl::narrow_cast<unsigned>(1292.5 / d - 14.6)); + } + } + + state_var<bool> m_enabled; + state_var<uint8_t> m_latched_rom; + object_array_t<logic_input_t, 8> m_A; + logic_input_t m_CLK; + state_var<bool> m_clk_old; + logic_input_t m_EN; + object_array_t<tristate_output_t, 4> m_B; + param_rom_t<uint8_t, 8, 4> m_ROM; + state_var<netlist_time> m_taccc; // propagation time for data vs CLK + state_var<netlist_time> m_taccen; // propagation time for data vs /EN + nld_power_pins m_power_pins; + }; + + template <typename D> + NETLIB_OBJECT(generic_prom) + { + NETLIB_CONSTRUCTOR(generic_prom) + , m_enabled(*this, "m_enabled", true) + , m_TE(*this, "FORCE_TRISTATE_LOGIC", 0) + , m_A(*this, 0, "A{}", NETLIB_DELEGATE(addr)) + , m_CEQ(*this, 1, + D::chip_enable_mask::value ^ static_cast<size_t>(0xffff), pstring("CE{}"), + // Causes a expected primary expression before { with gcc9 + //std::array<nl_delegate, 3>{NETLIB_DELEGATE(ce<0>), + // NETLIB_DELEGATE(ce<1>), + // NETLIB_DELEGATE(ce<2>)}) + std::array<nl_delegate, 3>{nl_delegate(& NETLIB_NAME(generic_prom) :: ce<0>, this), + nl_delegate(& NETLIB_NAME(generic_prom) :: ce<1>, this), + nl_delegate(& NETLIB_NAME(generic_prom) :: ce<2>, this)}) + , m_O(*this, D::data_name_offset::value, "O{}", m_TE()) + , m_ROM(*this, "ROM") + , m_power_pins(*this) + { + } + + using data_type = typename plib::least_type_for_bits<D::data_width::value>::type; + + private: + + template <std::size_t N> + NETLIB_HANDLERI(ce) + { + using cet = typename D::chip_enable_time; + m_enabled = (m_CEQ() == D::chip_enable_mask::value); + switch (D::output_id::value) + { + case 0: // logic + { + m_O.push(m_ROM[m_A()], D::access_time::value()); + } + break; + case 1: // tristate + { + m_O.set_tristate(!m_enabled, cet::value(N), cet::value(N)); + m_O.push(m_ROM[m_A()], D::access_time::value()); + } + break; + default: // 2, open collector + { + const auto delay = m_enabled ? D::access_time::value() : cet::value(N); + const data_type o = m_enabled ? m_ROM[m_A()] : + (1 << D::data_width::value) - 1; + m_O.push(o, delay); + } + break; + } + + } + + NETLIB_HANDLERI(addr) + { + if (m_enabled) + { + m_O.push(m_ROM[m_A()], D::access_time::value()); + } + } + + state_var<bool> m_enabled; + param_logic_t m_TE; + object_array_t<logic_input_t, D::address_width::value> m_A; + object_array_t<logic_input_t, D::chip_enable_inputs::value> m_CEQ; + object_array_t<typename D::output_type, D::data_width::value> m_O; + + param_rom_t<uint8_t, D::address_width::value, D::data_width::value> m_ROM; + nld_power_pins m_power_pins; + }; + + struct desc_82S126 : public desc_base + { + using address_width = desc_const<8>; + using data_width = desc_const<4>; + using data_name_offset = desc_const<1>; // O1, O2, .. + using chip_enable_inputs = desc_const<2>; + // MATCH_MASK : all 0 ==> all bits inverted + using chip_enable_mask = desc_const<0x00>; + + using chip_enable_time = times_ns2<25, 25>; + using access_time = time_ns<40>; + + using output_type = tristate_output_t; + using output_id = desc_const<1>; // 0: logic, 1: tristate, 2: open collector + }; + + struct desc_74S287 : public desc_82S126 + { + using data_name_offset = desc_const<0>; // O0, O1, ... according to National Semiconductor datasheet + using chip_enable_time = times_ns2<15, 15>; + using access_time = time_ns<35>; + }; + + struct desc_82S123 : public desc_base + { + // FIXME: tristate outputs, add 82S23 (open collector) + using address_width = desc_const<5>; + using data_width = desc_const<8>; + using data_name_offset = desc_const<0>; // O0, O1, .. + using chip_enable_inputs = desc_const<1>; + // MATCH_MASK : all 0 ==> all bits inverted + using chip_enable_mask = desc_const<0x00>; + + using chip_enable_time = times_ns1<35>; + using access_time = time_ns<45>; + + using output_type = tristate_output_t; + using output_id = desc_const<1>; // 0: logic, 1: tristate, 2: open collector + }; + + struct desc_2716 : public desc_base + { + // FIXME: tristate outputs + using address_width = desc_const<11>; + using data_width = desc_const<8>; + using data_name_offset = desc_const<0>; // O0, O1, .. + + using chip_enable_inputs = desc_const<2>; + // MATCH_MASK : all 0 ==> all bits inverted + using chip_enable_mask = desc_const<0x00>; + + using chip_enable_time = times_ns2<450, 100>; //CE, OE + using access_time = time_ns<450>; + + using output_type = tristate_output_t; + using output_id = desc_const<1>; // 0: logic, 1: tristate, 2: open collector + }; + + using NETLIB_NAME(82S123) = NETLIB_NAME(generic_prom)<desc_82S123>; // 256 bits, 32x8, used as 256x4 + using NETLIB_NAME(82S126) = NETLIB_NAME(generic_prom)<desc_82S126>; // 1024 bits, 32x32, used as 256x4 + using NETLIB_NAME(74S287) = NETLIB_NAME(generic_prom)<desc_74S287>; // 1024 bits, 32x32, used as 256x4 + using NETLIB_NAME(2716) = NETLIB_NAME(generic_prom)<desc_2716>; // CE2Q = OE, CE1Q = CE + using NETLIB_NAME(MK28000) = NETLIB_NAME(mk28000_prom); // 16384 bits, either 2048x8 or 4096x4, determined by OE1/OE2 use + using NETLIB_NAME(MCM14524) = NETLIB_NAME(mcm14524_rom); // 1024 bits, 256x4, latched address + + NETLIB_DEVICE_IMPL(82S126, "PROM_82S126", "+CE1Q,+CE2Q,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,@VCC,@GND") + NETLIB_DEVICE_IMPL(74S287, "PROM_74S287", "+CE1Q,+CE2Q,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,@VCC,@GND") + NETLIB_DEVICE_IMPL(82S123, "PROM_82S123", "+CEQ,+A0,+A1,+A2,+A3,+A4,@VCC,@GND") + NETLIB_DEVICE_IMPL(2716, "EPROM_2716", "+CE2Q,+CE1Q,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10,@VCC,@GND") + NETLIB_DEVICE_IMPL(MK28000, "PROM_MK28000", "+OE1,+OE2,+ARQ,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10,+A11,@VCC,@GND") + NETLIB_DEVICE_IMPL(MCM14524, "ROM_MCM14524", "+EN,+CLK,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,@VCC,@GND") + +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_schmitt.cpp b/src/lib/netlist/devices/nld_schmitt.cpp index f219d215520..a6134f3a953 100644 --- a/src/lib/netlist/devices/nld_schmitt.cpp +++ b/src/lib/netlist/devices/nld_schmitt.cpp @@ -5,127 +5,118 @@ * */ -#include "nld_schmitt.h" +#include "analog/nlid_twoterm.h" +#include "nl_base.h" +#include "nl_errstr.h" +#include "solver/nld_solver.h" -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/nl_base.h" -#include "netlist/nl_errstr.h" -#include "netlist/solver/nld_solver.h" +namespace netlist::devices { -#include <cmath> + /* + * Over-simplified TTL Schmitt trigger model + * It's good enough to work for 74xx/74LSxx if it isn't abused too badly + * It would need major changes to support 4000 or 74HCxx behaviour + * The input is over-simplified - it's actually more like a resistor in series with a diode, and can only source current + * Similarly, high output can only source current and low output can only sink current + * Propagation delays are ignored + * + */ - -namespace netlist -{ - namespace devices + class schmitt_trigger_model_t { - - /* - * Over-simplified TTL Schmitt trigger model - * It's good enough to work for 74xx/74LSxx if it isn't abused too badly - * It would need major changes to support 4000 or 74HCxx behaviour - * The input is over-simplified - it's actually more like a resistor in series with a diode, and can only source current - * Similarly, high output can only source current and low output can only sink current - * Propagation delays are ignored - * - */ - - class schmitt_trigger_model_t : public param_model_t + public: + schmitt_trigger_model_t(param_model_t &model) + : m_VTP(model, "VTP") + , m_VTM(model, "VTM") + , m_VI(model, "VI") + , m_RI(model, "RI") + , m_VOH(model, "VOH") + , m_ROH(model, "ROH") + , m_VOL(model, "VOL") + , m_ROL(model, "ROL") + , m_TPLH(model, "TPLH") + , m_TPHL(model, "TPHL") { - public: - schmitt_trigger_model_t(device_t &device, const pstring &name, const pstring &val) - : param_model_t(device, name, val) - , m_VTP(*this, "VTP") - , m_VTM(*this, "VTM") - , m_VI(*this, "VI") - , m_RI(*this, "RI") - , m_VOH(*this, "VOH") - , m_ROH(*this, "ROH") - , m_VOL(*this, "VOL") - , m_ROL(*this, "ROL") - , m_TPLH(*this, "TPLH") - , m_TPHL(*this, "TPHL") - { - } + } - value_t m_VTP; - value_t m_VTM; - value_t m_VI; - value_t m_RI; - value_t m_VOH; - value_t m_ROH; - value_t m_VOL; - value_t m_ROL; - value_t m_TPLH; - value_t m_TPHL; - }; + param_model_t::value_t m_VTP; + param_model_t::value_t m_VTM; + param_model_t::value_t m_VI; + param_model_t::value_t m_RI; + param_model_t::value_t m_VOH; + param_model_t::value_t m_ROH; + param_model_t::value_t m_VOL; + param_model_t::value_t m_ROL; + param_model_t::value_t m_TPLH; + param_model_t::value_t m_TPHL; + }; - NETLIB_OBJECT(schmitt_trigger) + NETLIB_OBJECT(schmitt_trigger) + { + NETLIB_CONSTRUCTOR(schmitt_trigger) + , m_A(*this, "A", NETLIB_DELEGATE(input)) + , m_supply(*this) + , m_RVI(*this, "RVI") + , m_RVO(*this, "RVO") + , m_stmodel(*this, "STMODEL", "TTL_7414_GATE") + , m_modacc(m_stmodel) + , m_last_state(*this, "m_last_var", 1) { - NETLIB_CONSTRUCTOR(schmitt_trigger) - , m_A(*this, "A") - , m_GND(*this, "GND") - , m_RVI(*this, "RVI") - , m_RVO(*this, "RVO") - , m_model(*this, "MODEL", "TTL_7414_GATE") - , m_last_state(*this, "m_last_var", 1) - , m_is_timestep(false) - { - register_subalias("Q", m_RVO.m_P); + register_sub_alias("Q", "RVO.1"); - connect(m_A, m_RVI.m_P); - connect(m_GND, m_RVI.m_N); - connect(m_GND, m_RVO.m_N); - } + connect("A", "RVI.1"); + // FIXME: need a symbolic reference from connect as well + connect(m_supply.GND(), m_RVI().N()); + connect(m_supply.GND(), m_RVO().N()); + } - protected: - NETLIB_RESETI() - { - m_last_state = 1; - m_RVI.reset(); - m_RVO.reset(); - m_is_timestep = m_RVO.m_P.net().solver()->has_timestep_devices(); - m_RVI.set_G_V_I(plib::constants<nl_double>::one() / m_model.m_RI, m_model.m_VI, 0.0); - m_RVO.set_G_V_I(plib::constants<nl_double>::one() / m_model.m_ROL, m_model.m_VOL, 0.0); - } + protected: + NETLIB_RESETI() + { + m_last_state = 1; + m_RVI().reset(); + m_RVO().reset(); + m_RVI().set_G_V_I(plib::reciprocal(m_modacc.m_RI()), m_modacc.m_VI, nlconst::zero()); + m_RVO().set_G_V_I(plib::reciprocal(m_modacc.m_ROL()), m_modacc.m_VOL, nlconst::zero()); + } - NETLIB_UPDATEI() + private: + NETLIB_HANDLERI(input) + { + const auto va(m_A.Q_Analog() - m_supply.GND().Q_Analog()); + if (m_last_state) { - if (m_last_state) + if (va < m_modacc.m_VTM) { - if (m_A.Q_Analog() < m_model.m_VTM) + m_last_state = 0; + m_RVO().change_state([this]() { - m_last_state = 0; - if (m_is_timestep) - m_RVO.update(); - m_RVO.set_G_V_I(plib::constants<nl_double>::one() / m_model.m_ROH, m_model.m_VOH, 0.0); - m_RVO.solve_later(); - } + m_RVO().set_G_V_I(plib::reciprocal(m_modacc.m_ROH()), m_modacc.m_VOH, nlconst::zero()); + }); } - else + } + else + { + if (va > m_modacc.m_VTP) { - if (m_A.Q_Analog() > m_model.m_VTP) + m_last_state = 1; + m_RVO().change_state([this]() { - m_last_state = 1; - if (m_is_timestep) - m_RVO.update(); - m_RVO.set_G_V_I(plib::constants<nl_double>::one() / m_model.m_ROL, m_model.m_VOL, 0.0); - m_RVO.solve_later(); - } + m_RVO().set_G_V_I(plib::reciprocal(m_modacc.m_ROL()), m_modacc.m_VOL, nlconst::zero()); + }); } } + } - private: - analog_input_t m_A; - analog_input_t m_GND; - analog::NETLIB_SUB(twoterm) m_RVI; - analog::NETLIB_SUB(twoterm) m_RVO; - schmitt_trigger_model_t m_model; - state_var<int> m_last_state; - bool m_is_timestep; - }; + analog_input_t m_A; + NETLIB_NAME(power_pins) m_supply; + NETLIB_SUB_NS(analog, two_terminal) m_RVI; + NETLIB_SUB_NS(analog, two_terminal) m_RVO; + param_model_t m_stmodel; + schmitt_trigger_model_t m_modacc; + state_var<int> m_last_state; + }; - NETLIB_DEVICE_IMPL(schmitt_trigger, "SCHMITT_TRIGGER", "MODEL") + NETLIB_DEVICE_IMPL(schmitt_trigger, "SCHMITT_TRIGGER", "STMODEL") - } // namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_schmitt.h b/src/lib/netlist/devices/nld_schmitt.h deleted file mode 100644 index 20666b29cf7..00000000000 --- a/src/lib/netlist/devices/nld_schmitt.h +++ /dev/null @@ -1,25 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Vas Crabb -/* - * nld_schmitt.h - * - */ - -//#pragma once - -#ifndef NLD_SCHMITT_H_ -#define NLD_SCHMITT_H_ - - -#include "netlist/nl_setup.h" - -// ---------------------------------------------------------------------------------------- -// Macros -// ---------------------------------------------------------------------------------------- - -#define SCHMITT_TRIGGER(name, model) \ - NET_REGISTER_DEV(SCHMITT_TRIGGER, name) \ - NETDEV_PARAMI(name, MODEL, model) - - -#endif /* NLD_SCHMITT_H_ */ diff --git a/src/lib/netlist/devices/nld_system.cpp b/src/lib/netlist/devices/nld_system.cpp index 5a1868bb775..e2580a296c6 100644 --- a/src/lib/netlist/devices/nld_system.cpp +++ b/src/lib/netlist/devices/nld_system.cpp @@ -1,123 +1,197 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* - * nld_system.c + * nld_system.cpp * */ -#include "netlist/solver/nld_solver.h" -#include "netlist/solver/nld_matrix_solver.h" +#include "solver/nld_solver.h" #include "nlid_system.h" +#include "solver/nld_matrix_solver.h" -namespace netlist -{ - namespace devices - { - // ---------------------------------------------------------------------------------------- - // netlistparams - // ---------------------------------------------------------------------------------------- +#include "plib/pstrutil.h" +namespace netlist::devices { - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // extclock - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - NETLIB_RESET(extclock) + NETLIB_OBJECT(extclock) { - m_cnt = 0; - m_off = netlist_time::from_double(m_offset()); - m_feedback.m_delegate = NETLIB_DELEGATE(extclock, update); + NETLIB_CONSTRUCTOR(extclock) + , m_freq(*this, "FREQ", nlconst::magic(7159000.0 * 5.0)) + , m_pattern(*this, "PATTERN", "1,1") + , m_offset(*this, "OFFSET", nlconst::zero()) + , m_feedback(*this, "FB", NETLIB_DELEGATE(first)) + , m_Q(*this, "Q") + , m_cnt(*this, "m_cnt", 0) + , m_off(*this, "m_off", netlist_time::zero()) + { + m_inc[0] = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); + + connect("FB", "Q"); + + netlist_time base = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); + std::vector<pstring> pat(plib::psplit(m_pattern(),',')); + m_off = netlist_time::from_fp(m_offset()); + + std::array<std::int64_t, 32> pati = { 0 }; + + m_size = static_cast<std::uint8_t>(pat.size()); + netlist_time::mult_type total = 0; + for (unsigned i=0; i<m_size; i++) + { + pati[i] = plib::pstonum<std::int64_t>(pat[i]); + total += pati[i]; + } + netlist_time ttotal = netlist_time::zero(); + auto sm1 = static_cast<uint8_t>(m_size - 1); + for (unsigned i=0; i < sm1; i++) + { + m_inc[i] = base * pati[i]; + ttotal += m_inc[i]; + } + m_inc[sm1] = base * total - ttotal; - //m_feedback.m_delegate .set(&NETLIB_NAME(extclock)::update, this); - //m_Q.initial(0); - } + } - NETLIB_HANDLER(extclock, clk2) - { - m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt]); - if (++m_cnt >= m_size) + NETLIB_RESETI() + { m_cnt = 0; - } + m_off = netlist_time::from_fp<param_fp_t::value_type>(m_offset()); + m_feedback.set_delegate(NETLIB_DELEGATE(first)); + } + //NETLIB_UPDATE_PARAMI(); - NETLIB_HANDLER(extclock, clk2_pow2) - { - m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt]); - m_cnt = (++m_cnt) & (m_size-1); - } + private: - NETLIB_UPDATE(extclock) - { - m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off); - m_off = netlist_time::zero(); - if (++m_cnt >= m_size) - m_cnt = 0; + NETLIB_HANDLERI(clk2) + { + m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt]); + if (++m_cnt >= m_size) + m_cnt = 0; + } - // continue with optimized clock handlers .... + NETLIB_HANDLERI(clk2_pow2) + { + m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt]); + m_cnt = (++m_cnt) & (m_size-1); + } - if ((m_size & (m_size-1)) == 0) // power of 2? - m_feedback.m_delegate.set(&NETLIB_NAME(extclock)::clk2_pow2, this); - else - m_feedback.m_delegate.set(&NETLIB_NAME(extclock)::clk2, this); - } + NETLIB_HANDLERI(first) + { + m_Q.push((m_cnt & 1) ^ 1, m_inc[m_cnt] + m_off()); + m_off = netlist_time::zero(); + if (++m_cnt >= m_size) + m_cnt = 0; - // ----------------------------------------------------------------------------- - // nld_res_sw - // ----------------------------------------------------------------------------- + // continue with optimized clock handlers .... - NETLIB_RESET(res_sw) - { - m_last_state = 0; - m_R.set_R(m_ROFF()); - } + if ((m_size & (m_size-1)) == 0) // power of 2? + m_feedback.set_delegate(nl_delegate(&NETLIB_NAME(extclock)::clk2_pow2, this)); + else + m_feedback.set_delegate(nl_delegate(&NETLIB_NAME(extclock)::clk2, this)); + } + + + param_fp_t m_freq; + param_str_t m_pattern; + param_fp_t m_offset; + + logic_input_t m_feedback; + logic_output_t m_Q; + state_var_u8 m_cnt; + std::uint8_t m_size; + state_var<netlist_time> m_off; + std::array<netlist_time, 32> m_inc; + }; - NETLIB_UPDATE(res_sw) + // ------------------------------------------------------------------------- + // sys_pulse + // ------------------------------------------------------------------------- + + NETLIB_OBJECT(sys_pulse) { - const netlist_sig_t state = m_I(); - if (state != m_last_state) + NETLIB_CONSTRUCTOR(sys_pulse) + , m_I(*this, "I", NETLIB_DELEGATE(input)) + , m_FB(*this, "FB", NETLIB_DELEGATE(feedback)) + , m_Q(*this, "Q") + , m_delay(*this, "DELAY", 10) + , m_duration(*this, "DURATION", 100) + , m_invert_input(*this, "INVERT_INPUT", 1) + , m_invert_output(*this, "INVERT_OUTPUT", 1) + , m_last(*this, "m_last", 0) { - m_last_state = state; - const nl_double R = state ? m_RON() : m_ROFF(); - - // FIXME: We only need to update the net first if this is a time stepping net - m_R.update(); - m_R.set_R(R); - m_R.solve_later(); + connect(m_Q, m_FB); } - } - /* ----------------------------------------------------------------------------- - * nld_function - * ----------------------------------------------------------------------------- */ + //NETLIB_UPDATE_PARAMI(); + NETLIB_RESETI() + { + //m_Q.initial(0); + } - NETLIB_RESET(function) - { - //m_Q.initial(0.0); - } + private: + NETLIB_HANDLERI(input) + { + netlist_sig_t nval = m_I() ^ m_invert_input; + if (nval && !m_last) + { + // L_to_H + m_Q.push(1 ^ m_invert_output, NLTIME_FROM_NS(static_cast<unsigned>(m_delay()))); + } + m_last = nval; + } - NETLIB_UPDATE(function) - { - for (std::size_t i=0; i < static_cast<unsigned>(m_N()); i++) + NETLIB_HANDLERI(feedback) { - m_vals[i] = (*m_I[i])(); + if (m_FB() == (1 ^ m_invert_output)) + m_Q.push(0 ^ m_invert_output, NLTIME_FROM_NS(static_cast<unsigned>(m_duration()))); } - m_Q.push(m_compiled.evaluate(m_vals)); - } + logic_input_t m_I; + logic_input_t m_FB; + logic_output_t m_Q; + + param_int_t m_delay; + param_int_t m_duration; + param_logic_t m_invert_input; + param_logic_t m_invert_output; - NETLIB_DEVICE_IMPL(dummy_input, "DUMMY_INPUT", "") - NETLIB_DEVICE_IMPL(frontier, "FRONTIER_DEV", "+I,+G,+Q") - NETLIB_DEVICE_IMPL(function, "AFUNC", "N,FUNC") + state_var<netlist_sig_t> m_last; + }; + + + NETLIB_DEVICE_IMPL(netlistparams, "PARAMETER", "") + NETLIB_DEVICE_IMPL(nc_pin, "NC_PIN", "") + + NETLIB_DEVICE_IMPL(frontier, "FRONTIER_DEV", "+I,+G,+Q") + NETLIB_DEVICE_IMPL(function, "AFUNC", "N,FUNC") NETLIB_DEVICE_IMPL(analog_input, "ANALOG_INPUT", "IN") NETLIB_DEVICE_IMPL(clock, "CLOCK", "FREQ") - NETLIB_DEVICE_IMPL(varclock, "VARCLOCK", "FUNC") + NETLIB_DEVICE_IMPL(varclock, "VARCLOCK", "N,FUNC") NETLIB_DEVICE_IMPL(extclock, "EXTCLOCK", "FREQ,PATTERN") - NETLIB_DEVICE_IMPL(res_sw, "RES_SWITCH", "+IN,+P1,+P2") + NETLIB_DEVICE_IMPL(sys_dsw1, "SYS_DSW", "+I,+1,+2") + NETLIB_DEVICE_IMPL(sys_dsw2, "SYS_DSW2", "") + NETLIB_DEVICE_IMPL(sys_compd, "SYS_COMPD", "") + NETLIB_DEVICE_IMPL(sys_pulse, "SYS_PULSE", "DELAY,DURATION,INVERT_INPUT,INVERT_OUTPUT") + + using NETLIB_NAME(sys_noise_mt_u) = + NETLIB_NAME(sys_noise)<plib::mt19937_64, plib::uniform_distribution_t>; + NETLIB_DEVICE_IMPL(sys_noise_mt_u, "SYS_NOISE_MT_U", "SIGMA") + + using NETLIB_NAME(sys_noise_mt_n) = + NETLIB_NAME(sys_noise)<plib::mt19937_64, plib::normal_distribution_t>; + NETLIB_DEVICE_IMPL(sys_noise_mt_n, "SYS_NOISE_MT_N", "SIGMA") + NETLIB_DEVICE_IMPL(mainclock, "MAINCLOCK", "FREQ") - NETLIB_DEVICE_IMPL(gnd, "GND", "") - NETLIB_DEVICE_IMPL(netlistparams, "PARAMETER", "") + NETLIB_DEVICE_IMPL(gnd, "GNDA", "") + + using NETLIB_NAME(logic_input8) = NETLIB_NAME(logic_inputN)<8>; + NETLIB_DEVICE_IMPL(logic_input8, "LOGIC_INPUT8", "IN,MODEL") - NETLIB_DEVICE_IMPL(logic_input, "LOGIC_INPUT", "IN,FAMILY") + NETLIB_DEVICE_IMPL(logic_input, "LOGIC_INPUT", "IN,MODEL") NETLIB_DEVICE_IMPL_ALIAS(logic_input_ttl, logic_input, "TTL_INPUT", "IN") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_system.h b/src/lib/netlist/devices/nld_system.h deleted file mode 100644 index e2b70455411..00000000000 --- a/src/lib/netlist/devices/nld_system.h +++ /dev/null @@ -1,77 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_system.h - * - * netlist devices defined in the core - */ - -#ifndef NLD_SYSTEM_H_ -#define NLD_SYSTEM_H_ - -#include "netlist/nl_setup.h" - -// ----------------------------------------------------------------------------- -// Macros -// ----------------------------------------------------------------------------- - -#define TTL_INPUT(name, v) \ - NET_REGISTER_DEV(TTL_INPUT, name) \ - PARAM(name.IN, v) - -#define LOGIC_INPUT(name, v, family) \ - NET_REGISTER_DEV(LOGIC_INPUT, name) \ - PARAM(name.IN, v) \ - PARAM(name.FAMILY, family) - -#define ANALOG_INPUT(name, v) \ - NET_REGISTER_DEV(ANALOG_INPUT, name) \ - PARAM(name.IN, v) - -#define MAINCLOCK(name, freq) \ - NET_REGISTER_DEV(MAINCLOCK, name) \ - PARAM(name.FREQ, freq) - -#define CLOCK(name, freq) \ - NET_REGISTER_DEV(CLOCK, name) \ - PARAM(name.FREQ, freq) - -#define VARCLOCK(name, func) \ - NET_REGISTER_DEV(VARCLOCK, name) \ - PARAM(name.FUNC, func) - -#define EXTCLOCK(name, freq, pattern) \ - NET_REGISTER_DEV(EXTCLOCK, name) \ - PARAM(name.FREQ, freq) \ - PARAM(name.PATTERN, pattern) - -#define GNDA() \ - NET_REGISTER_DEV(GNDA, GND) - -#define DUMMY_INPUT(name) \ - NET_REGISTER_DEV(DUMMY_INPUT, name) - -//FIXME: Usage discouraged, use OPTIMIZE_FRONTIER instead -#define FRONTIER_DEV(name, cIN, cG, cOUT) \ - NET_REGISTER_DEV(FRONTIER_DEV, name) \ - NET_C(cIN, name.I) \ - NET_C(cG, name.G) \ - NET_C(cOUT, name.Q) - -#define RES_SWITCH(name, cIN, cP1, cP2) \ - NET_REGISTER_DEV(RES_SWITCH, name) \ - NET_C(cIN, name.I) \ - NET_C(cP1, name.1) \ - NET_C(cP2, name.2) - -/* Default device to hold netlist parameters */ -#define PARAMETERS(name) \ - NET_REGISTER_DEV(PARAMETERS, name) - -#define AFUNC(name, p_N, p_F) \ - NET_REGISTER_DEV(AFUNC, name) \ - PARAM(name.N, p_N) \ - PARAM(name.FUNC, p_F) - - -#endif /* NLD_SYSTEM_H_ */ diff --git a/src/lib/netlist/devices/nld_tms4800.cpp b/src/lib/netlist/devices/nld_tms4800.cpp index 24729b10e72..55b14921b2d 100644 --- a/src/lib/netlist/devices/nld_tms4800.cpp +++ b/src/lib/netlist/devices/nld_tms4800.cpp @@ -3,31 +3,74 @@ /* * nld_tms4800.cpp * + * TMS-4800: 16 Kbit (2Kb x 8) READ ONLY MEMORY + * + * +----------------+ + * VSS |1 ++ 24| OE1 + * A1 |2 23| O1 + * A2 |3 22| O2 + * A3 |4 TMS-4800 21| O3 + * A4 |5 20| O4 + * A5 |6 19| O5 + * A6 |7 18| O6 + * A10 |8 17| O7 + * VGG |9 16| O8 + * A9 |10 15| A11 + * A8 |11 14| OE2 + * A7 |12 13| AR + * +----------------+ + * + * + * Naming conventions follow Texas Instruments datasheet: + * http://bitsavers.trailing-edge.com/components/ti/_dataBooks/1975_TI_The_Semiconductor_Memory_Data_Book.pdf */ -#include "nld_tms4800.h" -#include "netlist/nl_base.h" +#include "nl_base.h" + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(TMS4800) { NETLIB_CONSTRUCTOR(TMS4800) - , m_A(*this, {{ "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10" }}) - , m_AR(*this, "AR") - , m_OE1(*this, "OE1") - , m_OE2(*this, "OE2") - , m_D(*this, {{ "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7" }}) + , m_A(*this, { "A0", "A1", "A2", "A3", "A4", "A5", "A6", "A7", "A8", "A9", "A10" }, NETLIB_DELEGATE(inputs)) + , m_AR(*this, "AR", NETLIB_DELEGATE(inputs)) + , m_OE1(*this, "OE1", NETLIB_DELEGATE(inputs)) + , m_OE2(*this, "OE2", NETLIB_DELEGATE(inputs)) + , m_D(*this, { "D0", "D1", "D2", "D3", "D4", "D5", "D6", "D7" }) , m_last_data(*this, "m_last_data", 1) , m_ROM(*this, "ROM") + , m_supply(*this) { } - NETLIB_UPDATEI(); + private: + // FIXME: timing! + // FIXME: CS: The code looks odd, looks like m_last_data should be pushed out. + NETLIB_HANDLERI(inputs) + { + netlist_time delay = NLTIME_FROM_NS(450); + if (m_AR()) + { + unsigned a = 0; + for (std::size_t i=0; i<11; i++) + a |= (m_A[i]() << i); + + m_last_data = m_ROM[a]; + } + else + { + unsigned d = 0x00; + for (std::size_t i=0; i<4; i++) + { + if (m_OE1()) + m_D[i].push((d >> i) & 1, delay); + + if (m_OE2()) + m_D[i+4].push((d >> (i+4)) & 1, delay); + } + } + } - protected: object_array_t<logic_input_t, 11> m_A; logic_input_t m_AR; logic_input_t m_OE1; @@ -37,68 +80,10 @@ namespace netlist state_var<unsigned> m_last_data; param_rom_t<uint8_t, 11, 8> m_ROM; // 16 Kbits, used as 2 Kbit x 8 + NETLIB_NAME(power_pins) m_supply; }; - NETLIB_OBJECT_DERIVED(TMS4800_dip, TMS4800) - { - NETLIB_CONSTRUCTOR_DERIVED(TMS4800_dip, TMS4800) - { - register_subalias("2", m_A[0]); - register_subalias("3", m_A[1]); - register_subalias("4", m_A[2]); - register_subalias("5", m_A[3]); - register_subalias("6", m_A[4]); - register_subalias("7", m_A[5]); - register_subalias("12", m_A[6]); - register_subalias("11", m_A[7]); - register_subalias("10", m_A[8]); - register_subalias("8", m_A[9]); - register_subalias("15", m_A[10]); - - register_subalias("13", m_AR); - register_subalias("24", m_OE1); - register_subalias("14", m_OE2); - - register_subalias("23", m_D[0]); - register_subalias("22", m_D[1]); - register_subalias("21", m_D[2]); - register_subalias("20", m_D[3]); - register_subalias("19", m_D[4]); - register_subalias("18", m_D[5]); - register_subalias("17", m_D[6]); - register_subalias("16", m_D[7]); - } - }; - - // FIXME: timing! - NETLIB_UPDATE(TMS4800) - { - unsigned d = 0x00; - - netlist_time delay = NLTIME_FROM_NS(450); - if (m_AR()) - { - unsigned a = 0; - for (std::size_t i=0; i<11; i++) - a |= (m_A[i]() << i); - - m_last_data = m_ROM[a]; - } - else - { - for (std::size_t i=0; i<4; i++) - { - if (m_OE1()) - m_D[i].push((d >> i) & 1, delay); - - if (m_OE2()) - m_D[i+4].push((d >> (i+4)) & 1, delay); - } - } - } - NETLIB_DEVICE_IMPL(TMS4800, "ROM_TMS4800", "+AR,+OE1,+OE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10") - NETLIB_DEVICE_IMPL(TMS4800_dip, "ROM_TMS4800_DIP", "") + NETLIB_DEVICE_IMPL(TMS4800, "ROM_TMS4800", "+AR,+OE1,+OE2,+A0,+A1,+A2,+A3,+A4,+A5,+A6,+A7,+A8,+A9,+A10,@VCC,@GND") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_tms4800.h b/src/lib/netlist/devices/nld_tms4800.h deleted file mode 100644 index c5bcd1337f0..00000000000 --- a/src/lib/netlist/devices/nld_tms4800.h +++ /dev/null @@ -1,53 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Felipe Sanches -/* - * nld_tms4800.h - * - * TMS-4800: 16 Kbit (2Kb x 8) READ ONLY MEMORY - * - * +----------------+ - * VSS |1 ++ 24| OE1 - * A1 |2 23| O1 - * A2 |3 22| O2 - * A3 |4 TMS-4800 21| O3 - * A4 |5 20| O4 - * A5 |6 19| O5 - * A6 |7 18| O6 - * A10 |8 17| O7 - * VGG |9 16| O8 - * A9 |10 15| A11 - * A8 |11 14| OE2 - * A7 |12 13| AR - * +----------------+ - * - * - * Naming conventions follow Texas Instruments datasheet: - * http://bitsavers.trailing-edge.com/components/ti/_dataBooks/1975_TI_The_Semiconductor_Memory_Data_Book.pdf - */ - -#ifndef NLD_TMS4800_H_ -#define NLD_TMS4800_H_ - -#include "netlist/nl_setup.h" - -#define ROM_TMS4800(name, cAR, cOE1, cOE2, cA0, cA1, cA2, cA3, cA4, cA5, cA6, cA7, cA8, cA9, cA10) \ - NET_REGISTER_DEV(ROM_TMS4800, name) \ - NET_CONNECT(name, AR, cAR) \ - NET_CONNECT(name, OE1, cOE1) \ - NET_CONNECT(name, OE2, cOE2) \ - NET_CONNECT(name, A0, cA0) \ - NET_CONNECT(name, A1, cA1) \ - NET_CONNECT(name, A2, cA2) \ - NET_CONNECT(name, A3, cA3) \ - NET_CONNECT(name, A4, cA4) \ - NET_CONNECT(name, A5, cA5) \ - NET_CONNECT(name, A6, cA6) \ - NET_CONNECT(name, A7, cA7) \ - NET_CONNECT(name, A8, cA8) \ - NET_CONNECT(name, A9, cA9) \ - NET_CONNECT(name, A10, cA10) - -#define ROM_TMS4800_DIP(name) \ - NET_REGISTER_DEV(ROM_TMS4800_DIP, name) - -#endif /* NLD_TMS4800_H_ */ diff --git a/src/lib/netlist/devices/nld_tristate.cpp b/src/lib/netlist/devices/nld_tristate.cpp index b05d09ea71e..75576313af5 100644 --- a/src/lib/netlist/devices/nld_tristate.cpp +++ b/src/lib/netlist/devices/nld_tristate.cpp @@ -3,75 +3,72 @@ /* * nld_tristate.cpp * + * tristate: Hack to merge two tri-stated outputs together + * */ -#include "nld_tristate.h" -#include "netlist/nl_base.h" +#include "nl_base.h" + +// FIXME: netlist now supports proper tristate outputs. All of this is legacy +// now and needs to be removed at some time. + +namespace netlist::devices { -namespace netlist -{ - namespace devices - { NETLIB_OBJECT(tristate) { NETLIB_CONSTRUCTOR(tristate) - , m_CEQ(*this, {{ "CEQ1", "CEQ2" }}) - , m_D(*this, {{ "D1", "D2" }}) + , m_CEQ(*this, { "CEQ1", "CEQ2" }, NETLIB_DELEGATE(inputs)) + , m_D(*this, { "D1", "D2" }, NETLIB_DELEGATE(inputs)) , m_Q(*this, "Q") { } - NETLIB_UPDATEI(); - protected: object_array_t<logic_input_t, 2> m_CEQ; object_array_t<logic_input_t, 2> m_D; logic_output_t m_Q; + private: + NETLIB_HANDLERI(inputs) + { + unsigned q = 0; + if (!m_CEQ[0]()) + q |= m_D[0](); + if (!m_CEQ[1]()) + q |= m_D[1](); + + m_Q.push(q, NLTIME_FROM_NS(1)); + } }; NETLIB_OBJECT(tristate3) { NETLIB_CONSTRUCTOR(tristate3) - , m_CEQ(*this, {{ "CEQ1", "CEQ2", "CEQ3" }} ) - , m_D(*this, {{ "D1", "D2", "D3" }} ) + , m_CEQ(*this, { "CEQ1", "CEQ2", "CEQ3" }, NETLIB_DELEGATE(inputs) ) + , m_D(*this, { "D1", "D2", "D3" }, NETLIB_DELEGATE(inputs) ) , m_Q(*this, "Q") { } - NETLIB_UPDATEI(); - protected: object_array_t<logic_input_t, 3> m_CEQ; object_array_t<logic_input_t, 3> m_D; logic_output_t m_Q; - }; - - NETLIB_UPDATE(tristate) - { - unsigned q = 0; - if (!m_CEQ[0]()) - q |= m_D[0](); - if (!m_CEQ[1]()) - q |= m_D[1](); - - m_Q.push(q, NLTIME_FROM_NS(1)); - } - - NETLIB_UPDATE(tristate3) - { - unsigned q = 0; - if (!m_CEQ[0]()) - q |= m_D[0](); - if (!m_CEQ[1]()) - q |= m_D[1](); - if (!m_CEQ[2]()) - q |= m_D[2](); + private: + NETLIB_HANDLERI(inputs) + { + unsigned q = 0; + if (!m_CEQ[0]()) + q |= m_D[0](); + if (!m_CEQ[1]()) + q |= m_D[1](); + if (!m_CEQ[2]()) + q |= m_D[2](); - m_Q.push(q, NLTIME_FROM_NS(1)); - } + m_Q.push(q, NLTIME_FROM_NS(1)); + } + }; NETLIB_DEVICE_IMPL(tristate, "TTL_TRISTATE", "+CEQ1,+D1,+CEQ2,+D2") NETLIB_DEVICE_IMPL(tristate3, "TTL_TRISTATE3", "") - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nld_tristate.h b/src/lib/netlist/devices/nld_tristate.h deleted file mode 100644 index 71f97d9812d..00000000000 --- a/src/lib/netlist/devices/nld_tristate.h +++ /dev/null @@ -1,31 +0,0 @@ -// license:BSD-3-Clause -// copyright-holders:Ryan Holtz -/* - * nld_tristate.h - * - * tristate: Hack to merge two tri-stated outputs together - * - */ - -#ifndef NLD_TRISTATE_H_ -#define NLD_TRISTATE_H_ - -#include "netlist/nl_setup.h" - -#define TTL_TRISTATE(name, cCEQ1, cD1, cCEQ2, cD2) \ - NET_REGISTER_DEV(TTL_TRISTATE, name) \ - NET_CONNECT(name, CEQ1, cCEQ1) \ - NET_CONNECT(name, D1, cD1) \ - NET_CONNECT(name, CEQ2, cCEQ2) \ - NET_CONNECT(name, D2, cD2) - -#define TTL_TRISTATE3(name, cCEQ1, cD1, cCEQ2, cD2, cCEQ3, cD3) \ - NET_REGISTER_DEV(TTL_TRISTATE3, name) \ - NET_CONNECT(name, CEQ1, cCEQ1) \ - NET_CONNECT(name, D1, cD1) \ - NET_CONNECT(name, CEQ2, cCEQ2) \ - NET_CONNECT(name, D2, cD2) \ - NET_CONNECT(name, CEQ3, cCEQ3) \ - NET_CONNECT(name, D3, cD3) - -#endif /* NLD_TRISTATE_H_ */ diff --git a/src/lib/netlist/devices/nlid_cmos.h b/src/lib/netlist/devices/nlid_cmos.h deleted file mode 100644 index 06388a73535..00000000000 --- a/src/lib/netlist/devices/nlid_cmos.h +++ /dev/null @@ -1,41 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nld_cmos.h - * - */ - -#ifndef NLID_CMOS_H_ -#define NLID_CMOS_H_ - -#include "netlist/nl_base.h" -#include "netlist/nl_setup.h" - -namespace netlist -{ -namespace devices -{ - // FIXME: this needs to be removed - NETLIB_OBJECT(vdd_vss) - { - NETLIB_CONSTRUCTOR(vdd_vss) - , m_vdd(*this, "VDD") - , m_vss(*this, "VSS") - { - } - - NETLIB_UPDATEI() {} - NETLIB_RESETI() {} - - public: - nl_double vdd() { return m_vdd(); } - nl_double vss() { return m_vss(); } - - analog_input_t m_vdd; - analog_input_t m_vss; - }; - -} //namespace devices -} // namespace netlist - -#endif /* NLID_CMOS_H_ */ diff --git a/src/lib/netlist/devices/nlid_proxy.cpp b/src/lib/netlist/devices/nlid_proxy.cpp index 2a9fccd1dc6..0ab77e84e7d 100644 --- a/src/lib/netlist/devices/nlid_proxy.cpp +++ b/src/lib/netlist/devices/nlid_proxy.cpp @@ -1,62 +1,100 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nlid_proxy.cpp - * - */ + +/// +/// \file nlid_proxy.cpp +/// +/// #include "nlid_proxy.h" -#include "netlist/solver/nld_solver.h" +#include "core/setup.h" +#include "nl_errstr.h" +#include "solver/nld_solver.h" -namespace netlist -{ - namespace devices - { +#include <array> + +namespace netlist::devices { // ----------------------------------------------------------------------------- // nld_base_proxy // ----------------------------------------------------------------------------- - nld_base_proxy::nld_base_proxy(netlist_state_t &anetlist, const pstring &name, - logic_t *inout_proxied, detail::core_terminal_t *proxy_inout) - : device_t(anetlist, name) + static constexpr std::array<std::pair<const char *, const char *>, 3> power_syms = {{ {"VCC", "VEE"}, {"VCC", "GND"}, {"VDD", "VSS"}}}; + + nld_base_proxy::nld_base_proxy(device_param_t data, + const logic_t *inout_proxied) + : device_t(data, inout_proxied->logic_family()) + , m_tp(nullptr) + , m_tn(nullptr) { - m_logic_family = inout_proxied->logic_family(); - m_term_proxied = inout_proxied; - m_proxy_term = proxy_inout; + if (logic_family() == nullptr) + { + throw nl_exception(MF_NULLPTR_FAMILY_NP("nld_base_proxy")); + } + + bool f = false; + for (const auto & pwr_sym : power_syms) + { + pstring devname = inout_proxied->device().name(); + + auto *tp_ct(state().setup().find_terminal(devname + "." + pstring(pwr_sym.first), + /*detail::terminal_type::INPUT,*/ false)); + auto *tp_cn(state().setup().find_terminal(devname + "." + pstring(pwr_sym.second), + /*detail::terminal_type::INPUT,*/ false)); + if ((tp_ct != nullptr) && (tp_cn != nullptr)) + { + if (!tp_ct->is_analog()) + throw nl_exception(plib::pfmt("Not an analog terminal: {1}")(tp_ct->name())); + if (!tp_cn->is_analog()) + throw nl_exception(plib::pfmt("Not an analog terminal: {1}")(tp_cn->name())); + + auto tp_t = plib::dynamic_downcast<analog_t* >(tp_ct); + auto tn_t = plib::dynamic_downcast<analog_t *>(tp_cn); + if (f && (tp_t && tn_t)) + log().warning(MI_MULTIPLE_POWER_TERMINALS_ON_DEVICE(inout_proxied->device().name(), + m_tp->name(), m_tn->name(), + tp_t ? (*tp_t)->name() : "", + tn_t ? (*tn_t)->name() : "")); + else if (tp_t && tn_t) + { + m_tp = *tp_t; + m_tn = *tn_t; + f = true; + } + } + } + if (!f) + throw nl_exception(MF_NO_POWER_TERMINALS_ON_DEVICE_2(name(), state().setup().de_alias(inout_proxied->device().name()))); + + log().verbose("D/A Proxy: Found power terminals on device {1}", inout_proxied->device().name()); } // ---------------------------------------------------------------------------------------- // nld_a_to_d_proxy // ---------------------------------------------------------------------------------------- - nld_base_a_to_d_proxy::nld_base_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name, - logic_input_t *in_proxied, detail::core_terminal_t *in_proxy) - : nld_base_proxy(anetlist, name, in_proxied, in_proxy) - , m_Q(*this, "Q") - { - } - - nld_a_to_d_proxy::nld_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *in_proxied) - : nld_base_a_to_d_proxy(anetlist, name, in_proxied, &m_I) - , m_I(*this, "I") + nld_base_a_to_d_proxy::nld_base_a_to_d_proxy(device_param_t data, + const logic_input_t *in_proxied) + : nld_base_proxy(data, in_proxied) { } - NETLIB_RESET(a_to_d_proxy) + nld_a_to_d_proxy::nld_a_to_d_proxy(device_param_t data, const logic_input_t *in_proxied) + : nld_base_a_to_d_proxy(data, in_proxied) + , m_Q(*this, "Q") + , m_I(*this, "I", nl_delegate(&nld_a_to_d_proxy::input, this)) { } - NETLIB_UPDATE(a_to_d_proxy) + NETLIB_HANDLER(a_to_d_proxy, input) { - nl_assert(m_logic_family != nullptr); - // FIXME: Variable supply voltage! - double supply_V = logic_family()->fixed_V(); - if (supply_V == 0.0) supply_V = 5.0; + const auto v(m_I.Q_Analog()); + const auto vn(m_tn->net().Q_Analog()); + const auto vp(m_tp->net().Q_Analog()); - if (m_I.Q_Analog() > logic_family()->high_thresh_V(0.0, supply_V)) + if (logic_family()->is_above_high_threshold_V(v, vn, vp)) out().push(1, netlist_time::quantum()); - else if (m_I.Q_Analog() < logic_family()->low_thresh_V(0.0, supply_V)) + else if (logic_family()->is_below_low_threshold_V(v, vn, vp)) out().push(0, netlist_time::quantum()); else { @@ -68,132 +106,79 @@ namespace netlist // nld_d_to_a_proxy // ---------------------------------------------------------------------------------------- - nld_base_d_to_a_proxy::nld_base_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name, - logic_output_t *out_proxied, detail::core_terminal_t &proxy_out) - : nld_base_proxy(anetlist, name, out_proxied, &proxy_out) - , m_I(*this, "I") + nld_base_d_to_a_proxy::nld_base_d_to_a_proxy(device_param_t data, + const logic_output_t *out_proxied) + : nld_base_proxy(data, out_proxied) { } - nld_d_to_a_proxy::nld_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *out_proxied) - : nld_base_d_to_a_proxy(anetlist, name, out_proxied, m_RN.m_P) + nld_d_to_a_proxy::nld_d_to_a_proxy(device_param_t data, const logic_output_t *out_proxied) + : nld_base_d_to_a_proxy(data, out_proxied) + , m_I(*this, "I", nl_delegate(&nld_d_to_a_proxy :: input, this)) , m_RP(*this, "RP") , m_RN(*this, "RN") - , m_last_state(*this, "m_last_var", -1) - , m_is_timestep(false) + , m_last_state(*this, "m_last_var", terminal_t::OUT_TRISTATE()) { - const std::vector<std::pair<pstring, pstring>> power_syms = { {"VCC", "VEE"}, {"VCC", "GND"}, {"VDD", "VSS"}}; + register_sub_alias("Q", "RN.1"); - register_subalias("Q", m_RN.m_P); + connect(m_RN().N(), *m_tn); + connect(m_RP().P(), *m_tp); - bool f = false; - detail::core_terminal_t *tp(nullptr); - detail::core_terminal_t *tn(nullptr); - for (auto & pwr_sym : power_syms) - { - pstring devname = out_proxied->device().name(); - auto tp_t = setup().find_terminal(devname + "." + pwr_sym.first, - /*detail::terminal_type::INPUT,*/ false); - auto tn_t = setup().find_terminal(devname + "." + pwr_sym.second, - /*detail::terminal_type::INPUT,*/ false); - if (f && (tp_t != nullptr && tn_t != nullptr)) - log().warning(MI_MULTIPLE_POWER_TERMINALS_ON_DEVICE(out_proxied->device().name(), - tp->name(), tn->name(), - tp_t ? tp_t->name() : "", - tn_t ? tn_t->name() : "")); - else if (tp_t != nullptr && tn_t != nullptr) - { - /* alternative logic */ - tp = tp_t; - tn = tn_t; - f = true; - } - } - //FIXME: Use power terminals and change info to warning or error - if (!f) - { - if (logic_family()->fixed_V() == 0.0) - log().error(MI_NO_POWER_TERMINALS_ON_DEVICE_1(setup().de_alias(out_proxied->device().name()))); - else - log().info(MI_NO_POWER_TERMINALS_ON_DEVICE_1(setup().de_alias(out_proxied->device().name()))); - m_GNDHack = plib::make_unique<analog_output_t>(*this, "_QGND"); - m_VCCHack = plib::make_unique<analog_output_t>(*this, "_QVCC"); - - connect(m_RN.m_N, *m_GNDHack); - connect(m_RP.m_P, *m_VCCHack); - connect(m_RN.m_P, m_RP.m_N); - } - else - { - log().verbose("D/A Proxy: Found power terminals on device {1}", out_proxied->device().name()); - if (setup().is_validation()) - { - // During validation, don't connect to terminals found - // This will cause terminals not connected to a rail net to - // fail connection stage. - connect(m_RN.m_N, m_RP.m_P); - } - else - { - connect(m_RN.m_N, *tn); - connect(m_RP.m_P, *tp); - } - connect(m_RN.m_P, m_RP.m_N); - } - //printf("vcc: %f\n", logic_family()->fixed_V()); + connect(m_RN().P(), m_RP().N()); } void nld_d_to_a_proxy::reset() { - // FIXME: Variable voltage - double supply_V = logic_family()->fixed_V(); - if (supply_V == 0.0) supply_V = 5.0; - //m_Q.initial(0.0); - m_last_state = -1; - m_RN.reset(); - m_RP.reset(); - if (m_GNDHack) - m_GNDHack->initial(0); - if (m_VCCHack) - m_VCCHack->initial(supply_V); - m_is_timestep = m_RN.m_P.net().solver()->has_timestep_devices(); - m_RN.set_G_V_I(plib::constants<nl_double>::one() / logic_family()->R_low(), - logic_family()->low_offset_V(), 0.0); - m_RP.set_G_V_I(G_OFF, - 0.0, 0.0); + m_last_state = terminal_t::OUT_TRISTATE(); + m_RN().reset(); + m_RP().reset(); + m_RN().set_G_V_I(plib::reciprocal(logic_family()->R_low()), + logic_family()->low_offset_V(), nlconst::zero()); + m_RP().set_G_V_I(G_OFF, + nlconst::zero(), + nlconst::zero()); } - NETLIB_UPDATE(d_to_a_proxy) + NETLIB_HANDLER(d_to_a_proxy ,input) { - const auto state = static_cast<int>(m_I()); + const auto state = m_I(); if (state != m_last_state) { - // We only need to update the net first if this is a time stepping net - if (m_is_timestep) - { - m_RN.update(); // RN, RP are connected ... - } - if (state) - { - m_RN.set_G_V_I(G_OFF, - 0.0, 0.0); - m_RP.set_G_V_I(plib::constants<nl_double>::one() / logic_family()->R_high(), - logic_family()->high_offset_V(), 0.0); - } - else + // RN, RP are connected ... + m_RN().change_state([this, &state]() { - m_RN.set_G_V_I(plib::constants<nl_double>::one() / logic_family()->R_low(), - logic_family()->low_offset_V(), 0.0); - m_RP.set_G_V_I(G_OFF, - 0.0, 0.0); - } - m_RN.solve_later(); // RN, RP are connected ... + switch (state) + { + case 0: + m_RN().set_G_V_I(plib::reciprocal(logic_family()->R_low()), + logic_family()->low_offset_V(), nlconst::zero()); + m_RP().set_G_V_I(G_OFF, + nlconst::zero(), + nlconst::zero()); + break; + case 1: + m_RN().set_G_V_I(G_OFF, + nlconst::zero(), + nlconst::zero()); + m_RP().set_G_V_I(plib::reciprocal(logic_family()->R_high()), + logic_family()->high_offset_V(), nlconst::zero()); + break; + case terminal_t::OUT_TRISTATE(): + m_RN().set_G_V_I(G_OFF, + nlconst::zero(), + nlconst::zero()); + m_RP().set_G_V_I(G_OFF, + nlconst::zero(), + nlconst::zero()); + break; + default: + plib::terminate("unknown state for proxy: this should never happen!"); + } + }); m_last_state = state; } } - - } //namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/devices/nlid_proxy.h b/src/lib/netlist/devices/nlid_proxy.h index 7a8377276a1..0f1b2ffeacd 100644 --- a/src/lib/netlist/devices/nlid_proxy.h +++ b/src/lib/netlist/devices/nlid_proxy.h @@ -1,120 +1,120 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nlid_proxy.h - * - * netlist proxy devices - * - * This file contains internal headers - */ #ifndef NLID_PROXY_H_ #define NLID_PROXY_H_ -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/nl_setup.h" +/// +/// \file nlid_proxy.h +/// +/// netlist proxy devices +/// +/// This file contains internal headers +/// -namespace netlist -{ - namespace devices - { + +#include "analog/nlid_twoterm.h" +#include "nl_base.h" + +namespace netlist::devices { // ----------------------------------------------------------------------------- // nld_base_proxy // ----------------------------------------------------------------------------- - NETLIB_OBJECT(base_proxy) + class nld_base_proxy : public device_t { public: - nld_base_proxy(netlist_state_t &anetlist, const pstring &name, - logic_t *inout_proxied, detail::core_terminal_t *proxy_inout); + nld_base_proxy(device_param_t data, const logic_t *inout_proxied); - logic_t &term_proxied() const { return *m_term_proxied; } - detail::core_terminal_t &proxy_term() const { return *m_proxy_term; } + // only used during setup + virtual detail::core_terminal_t &proxy_term() noexcept = 0; protected: + // FIXME: these should be core_terminal_t and only used for connecting + // inputs. Fix, once the ugly hacks have been removed + analog_t *m_tp; + analog_t *m_tn; - private: - logic_t *m_term_proxied; - detail::core_terminal_t *m_proxy_term; }; // ----------------------------------------------------------------------------- // nld_a_to_d_proxy // ----------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(base_a_to_d_proxy, base_proxy) + class nld_base_a_to_d_proxy : public nld_base_proxy { public: - - virtual logic_output_t &out() { return m_Q; } + virtual logic_output_t &out() noexcept = 0; protected: - - nld_base_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name, - logic_input_t *in_proxied, detail::core_terminal_t *in_proxy); - - private: - - logic_output_t m_Q; + nld_base_a_to_d_proxy(device_param_t data, const logic_input_t *in_proxied); }; - NETLIB_OBJECT_DERIVED(a_to_d_proxy, base_a_to_d_proxy) + class nld_a_to_d_proxy : public nld_base_a_to_d_proxy { public: - nld_a_to_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *in_proxied); - - analog_input_t m_I; + nld_a_to_d_proxy(device_param_t data, const logic_input_t *in_proxied); - protected: + logic_output_t &out() noexcept override { return m_Q; } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + detail::core_terminal_t &proxy_term() noexcept override + { + return m_I; + } + protected: + //NETLIB_RESETI(); private: + NETLIB_HANDLERI(input); + + logic_output_t m_Q; + analog_input_t m_I; }; // ----------------------------------------------------------------------------- // nld_base_d_to_a_proxy // ----------------------------------------------------------------------------- - NETLIB_OBJECT_DERIVED(base_d_to_a_proxy, base_proxy) + class nld_base_d_to_a_proxy : public nld_base_proxy { public: - - virtual logic_input_t &in() { return m_I; } + // only used in setup + virtual logic_input_t &in() noexcept = 0; protected: - nld_base_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name, - logic_output_t *out_proxied, detail::core_terminal_t &proxy_out); + nld_base_d_to_a_proxy(device_param_t data, const logic_output_t *out_proxied); - logic_input_t m_I; }; - NETLIB_OBJECT_DERIVED(d_to_a_proxy, base_d_to_a_proxy) + class nld_d_to_a_proxy : public nld_base_d_to_a_proxy { public: - nld_d_to_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *out_proxied); + nld_d_to_a_proxy(device_param_t data, const logic_output_t *out_proxied); + + logic_input_t &in() noexcept override { return m_I; } + + detail::core_terminal_t &proxy_term() noexcept override + { + return m_RN().setup_P(); + } protected: NETLIB_RESETI(); - NETLIB_UPDATEI(); private: + NETLIB_HANDLERI(input); - static constexpr const nl_double G_OFF = 1e-9; + static constexpr const nl_fptype G_OFF = nlconst::cgmin(); - plib::unique_ptr<analog_output_t> m_GNDHack; // FIXME: Long term, we need to connect proxy gnd to device gnd - plib::unique_ptr<analog_output_t> m_VCCHack; // FIXME: Long term, we need to connect proxy gnd to device gnd - analog::NETLIB_NAME(twoterm) m_RP; - analog::NETLIB_NAME(twoterm) m_RN; - state_var<int> m_last_state; - bool m_is_timestep; -}; + logic_input_t m_I; + NETLIB_SUB_NS(analog, two_terminal) m_RP; + NETLIB_SUB_NS(analog, two_terminal) m_RN; + state_var<netlist_sig_t> m_last_state; + }; - } //namespace devices -} // namespace netlist +} // namespace netlist::devices -#endif /* NLD_PROXY_H_ */ +#endif // NLD_PROXY_H_ diff --git a/src/lib/netlist/devices/nlid_system.h b/src/lib/netlist/devices/nlid_system.h index 89a525ef69f..fee4fad0333 100644 --- a/src/lib/netlist/devices/nlid_system.h +++ b/src/lib/netlist/devices/nlid_system.h @@ -1,86 +1,22 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nlid_system.h - * - * netlist devices defined in the core - * - * This file contains internal headers - */ - #ifndef NLID_SYSTEM_H_ #define NLID_SYSTEM_H_ -#include "netlist/analog/nlid_twoterm.h" -#include "netlist/nl_base.h" -#include "netlist/nl_setup.h" -#include "plib/putil.h" +/// +/// \file nlid_system.h +/// -namespace netlist -{ -namespace devices -{ - // ----------------------------------------------------------------------------- - // netlistparams - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(netlistparams) - { - NETLIB_CONSTRUCTOR(netlistparams) - , m_use_deactivate(*this, "USE_DEACTIVATE", false) - , m_startup_strategy(*this, "STARTUP_STRATEGY", 1) - , m_mos_capmodel(*this, "DEFAULT_MOS_CAPMODEL", 2) - , m_max_link_loops(*this, "MAX_LINK_RESOLVE_LOOPS", 100) - { - } - NETLIB_UPDATEI() { } - //NETLIB_RESETI() { } - //NETLIB_UPDATE_PARAMI() { } - public: - param_logic_t m_use_deactivate; - param_num_t<unsigned> m_startup_strategy; - param_num_t<unsigned> m_mos_capmodel; - //! How many times do we try to resolve links (connections) - param_num_t<unsigned> m_max_link_loops; - }; - - // ----------------------------------------------------------------------------- - // mainclock - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(mainclock) - { - NETLIB_CONSTRUCTOR(mainclock) - , m_Q(*this, "Q") - , m_freq(*this, "FREQ", 7159000.0 * 5) - { - m_inc = netlist_time::from_double(1.0 / (m_freq()*2.0)); - } - - NETLIB_RESETI() - { - m_Q.net().set_next_scheduled_time(netlist_time::zero()); - } - - NETLIB_UPDATE_PARAMI() - { - m_inc = netlist_time::from_double(1.0 / (m_freq()*2.0)); - } +#include "analog/nlid_twoterm.h" +#include "nl_base.h" +#include "nl_factory.h" +#include "plib/prandom.h" +#include "plib/pstonum.h" +#include "plib/putil.h" - NETLIB_UPDATEI() - { - logic_net_t &net = m_Q.net(); - // this is only called during setup ... - net.toggle_new_Q(); - net.set_next_scheduled_time(exec().time() + m_inc); - } +#include <random> - public: - logic_output_t m_Q; - netlist_time m_inc; - private: - param_double_t m_freq; - }; +namespace netlist::devices { // ----------------------------------------------------------------------------- // clock @@ -89,134 +25,99 @@ namespace devices NETLIB_OBJECT(clock) { NETLIB_CONSTRUCTOR(clock) - , m_feedback(*this, "FB") + , m_feedback(*this, "FB", NETLIB_DELEGATE(fb)) , m_Q(*this, "Q") - , m_freq(*this, "FREQ", 7159000.0 * 5.0) + , m_freq(*this, "FREQ", nlconst::magic(7159000.0 * 5.0)) + , m_supply(*this) { - m_inc = netlist_time::from_double(1.0 / (m_freq()*2.0)); + m_inc = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); - connect(m_feedback, m_Q); + connect("FB", "Q"); } - //NETLIB_RESETI(); NETLIB_UPDATE_PARAMI() { - m_inc = netlist_time::from_double(1.0 / (m_freq() * 2.0)); + m_inc = netlist_time::from_fp(plib::reciprocal(m_freq()*nlconst::two())); } - NETLIB_UPDATEI() + NETLIB_HANDLERI(fb) { - m_Q.push(!m_feedback(), m_inc); + m_Q.push(m_feedback() ^ 1, m_inc); } private: logic_input_t m_feedback; logic_output_t m_Q; - param_double_t m_freq; + param_fp_t m_freq; netlist_time m_inc; - }; + + NETLIB_NAME(power_pins) m_supply; +}; // ----------------------------------------------------------------------------- - // varclock + // variable clock // ----------------------------------------------------------------------------- NETLIB_OBJECT(varclock) { NETLIB_CONSTRUCTOR(varclock) - , m_feedback(*this, "FB") + , m_N(*this, "N", 1) + , m_func(*this,"FUNC", "T") + , m_feedback(*this, "FB", NETLIB_DELEGATE(fb)) , m_Q(*this, "Q") - , m_func(*this,"FUNC", "") - , m_compiled(this->name() + ".FUNCC", this, this->state().run_state_manager()) - , m_funcparam({0.0}) + , m_compiled(*this, "m_compiled") + , m_supply(*this) { - if (m_func() != "") - m_compiled.compile(std::vector<pstring>({{"T"}}), m_func()); - connect(m_feedback, m_Q); + if (!m_func().empty()) + { + std::vector<pstring> inputs; + + m_I.reserve(m_N()); + inputs.reserve(m_N() + 1); + m_vals.reserve(m_N() + 1); + + // add time parameter to the front + inputs.emplace_back("T"); + m_vals.push_back(nlconst::zero()); + + for (std::uint64_t i=0; i < m_N(); i++) + { + pstring input_name = plib::pfmt("A{1}")(i); + m_I.push_back(state().make_pool_object<analog_input_t>(*this, input_name, NETLIB_DELEGATE(fb))); + inputs.push_back(input_name); + m_vals.push_back(nlconst::zero()); + } + m_compiled->compile(m_func(), inputs); + } + connect("FB", "Q"); } //NETLIB_RESETI(); //NETLIB_UPDATE_PARAMI() - NETLIB_UPDATEI() - { - m_funcparam[0] = exec().time().as_double(); - const netlist_time m_inc = netlist_time::from_double(m_compiled.evaluate(m_funcparam)); - m_Q.push(!m_feedback(), m_inc); - } - private: - logic_input_t m_feedback; - logic_output_t m_Q; - - param_str_t m_func; - plib::pfunction m_compiled; - std::vector<double> m_funcparam; - }; - - // ----------------------------------------------------------------------------- - // extclock - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(extclock) - { - NETLIB_CONSTRUCTOR(extclock) - , m_freq(*this, "FREQ", 7159000.0 * 5.0) - , m_pattern(*this, "PATTERN", "1,1") - , m_offset(*this, "OFFSET", 0.0) - , m_feedback(*this, "FB") - , m_Q(*this, "Q") - , m_cnt(*this, "m_cnt", 0) - , m_off(*this, "m_off", netlist_time::zero()) + NETLIB_HANDLERI(fb) { - m_inc[0] = netlist_time::from_double(1.0 / (m_freq() * 2.0)); - - connect(m_feedback, m_Q); - - netlist_time base = netlist_time::from_double(1.0 / (m_freq()*2.0)); - std::vector<pstring> pat(plib::psplit(m_pattern(),",")); - m_off = netlist_time::from_double(m_offset()); - - std::array<std::int64_t, 32> pati = { 0 }; - - m_size = static_cast<std::uint8_t>(pat.size()); - netlist_time::mult_type total = 0; - for (unsigned i=0; i<m_size; i++) - { - // FIXME: use pstonum_ne - //pati[i] = plib::pstonum<decltype(pati[i])>(pat[i]); - pati[i] = plib::pstonum<std::int64_t>(pat[i]); - total += pati[i]; - } - netlist_time ttotal = netlist_time::zero(); - auto sm1 = static_cast<uint8_t>(m_size - 1); - for (unsigned i=0; i < sm1; i++) + m_vals[0] = exec().time().as_fp<nl_fptype>(); + for (std::size_t i = 0; i < static_cast<unsigned>(m_N()); i++) { - m_inc[i] = base * pati[i]; - ttotal += m_inc[i]; + m_vals[i+1] = (*m_I[i])(); } - m_inc[sm1] = base * total - ttotal; - + const netlist_time m_inc = netlist_time::from_fp(m_compiled->evaluate(m_vals)); + m_Q.push(m_feedback() ^ 1, m_inc); } - NETLIB_UPDATEI(); - NETLIB_RESETI(); - //NETLIB_UPDATE_PARAMI(); - - NETLIB_HANDLERI(clk2); - NETLIB_HANDLERI(clk2_pow2); - - private: - - param_double_t m_freq; - param_str_t m_pattern; - param_double_t m_offset; - + using pf_type = plib::pfunction<nl_fptype>; + param_num_t<std::uint64_t> m_N; + param_str_t m_func; logic_input_t m_feedback; logic_output_t m_Q; - state_var_u8 m_cnt; - std::uint8_t m_size; - state_var<netlist_time> m_off; - std::array<netlist_time, 32> m_inc; + std::vector<device_arena::unique_ptr<analog_input_t>> m_I; + + pf_type::values_container m_vals; + state_var<pf_type> m_compiled; + + NETLIB_NAME(power_pins) m_supply; }; // ----------------------------------------------------------------------------- @@ -228,241 +129,466 @@ namespace devices NETLIB_CONSTRUCTOR(logic_input) , m_Q(*this, "Q") , m_IN(*this, "IN", false) - /* make sure we get the family first */ - , m_FAMILY(*this, "FAMILY", "FAMILY(TYPE=TTL)") + , m_supply(*this) { - set_logic_family(setup().family_from_model(m_FAMILY())); - m_Q.set_logic_family(this->logic_family()); } - NETLIB_UPDATEI() { } NETLIB_RESETI() { m_Q.initial(0); } - NETLIB_UPDATE_PARAMI() { m_Q.push(m_IN() & 1, netlist_time::from_nsec(1)); } + NETLIB_UPDATE_PARAMI() + { + //printf("%s %d\n", name().c_str(), m_IN()); + m_Q.push(m_IN() & 1, netlist_time::from_nsec(1)); + } private: logic_output_t m_Q; param_logic_t m_IN; - param_model_t m_FAMILY; + NETLIB_NAME(power_pins) m_supply; }; - NETLIB_OBJECT(analog_input) + template<std::size_t N> + NETLIB_OBJECT(logic_inputN) { - NETLIB_CONSTRUCTOR(analog_input) - , m_Q(*this, "Q") - , m_IN(*this, "IN", 0.0) + NETLIB_CONSTRUCTOR(logic_inputN) + , m_Q(*this, "Q{}") + , m_IN(*this, "IN", 0) + , m_supply(*this) { } - NETLIB_UPDATEI() { } - NETLIB_RESETI() { m_Q.initial(0.0); } - NETLIB_UPDATE_PARAMI() { m_Q.push(m_IN()); } + NETLIB_RESETI() { for (auto &q : m_Q) q.initial(0); } + NETLIB_UPDATE_PARAMI() + { + //printf("%s %d\n", name().c_str(), m_IN()); + for (std::size_t i=0; i<N; i++) + m_Q[i].push((m_IN()>>i) & 1, netlist_time::from_nsec(1)); + } private: - analog_output_t m_Q; - param_double_t m_IN; - }; + object_array_t<logic_output_t, N> m_Q; - // ----------------------------------------------------------------------------- - // nld_gnd - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(gnd) - { - NETLIB_CONSTRUCTOR(gnd) - , m_Q(*this, "Q") - { - } - NETLIB_UPDATEI() - { - m_Q.push(0.0); - } - NETLIB_RESETI() { } - protected: - analog_output_t m_Q; + param_int_t m_IN; + NETLIB_NAME(power_pins) m_supply; }; - // ----------------------------------------------------------------------------- - // nld_dummy_input - // ----------------------------------------------------------------------------- - - NETLIB_OBJECT(dummy_input) + NETLIB_OBJECT(analog_input) { - public: - NETLIB_CONSTRUCTOR(dummy_input) - , m_I(*this, "I") + NETLIB_CONSTRUCTOR(analog_input) + , m_Q(*this, "Q") + , m_IN(*this, "IN", nlconst::zero()) { } - protected: - - NETLIB_RESETI() { } - NETLIB_UPDATEI() { } + NETLIB_RESETI() { m_Q.initial(nlconst::zero()); } + NETLIB_UPDATE_PARAMI() { m_Q.push(m_IN()); } private: - analog_input_t m_I; - + analog_output_t m_Q; + param_fp_t m_IN; }; + // ----------------------------------------------------------------------------- // nld_frontier // ----------------------------------------------------------------------------- + + /// \brief Frontiers divides a netlist into sub netlist + /// + /// Example: + /// + /// Consider the following mixing stage + /// + /// R1 + /// I1 >-----1RRRR2---------+ + /// | + /// R2 | + /// I2 >-----1RRRR2---------+----------> Out + /// | + /// R + /// R3 R + /// R + /// | + /// GND + /// + /// With OPTIMIZE_FRONTIER(R2.1, R2, RX) where RX is the impedance of the + /// output connected to I2 this becomes: + /// + /// R1 + /// I1 >-----1RRRR2--------------------------------+ + /// | + /// ########################## | + /// # RX # R2 | + /// I2 >----->--+-AnIn AnOut>--RRRR--->---1RRRR2---+----------> Out + /// # | # | + /// # R # R + /// # R R2 # R3 R + /// # R # R + /// # | # | + /// # GND Frontier # GND + /// # # + /// ########################## + /// + /// As a result, provided there are no other connections between the parts + /// generating S1 and S2 the "S2 part" will now have a separate solver. + /// + /// The size (aka number of nets) of the solver for I1 will be smaller. + /// The size of the solver for I2 and the rest of the circuit will be smaller + /// as well. + /// + NETLIB_OBJECT(frontier) { - public: NETLIB_CONSTRUCTOR(frontier) - , m_RIN(*this, "m_RIN", true) - , m_ROUT(*this, "m_ROUT", true) - , m_I(*this, "_I") + , m_RIN(*this, "m_RIN", NETLIB_DELEGATE(input)) // FIXME: does not look right + , m_ROUT(*this, "m_ROUT", NETLIB_DELEGATE(input)) // FIXME: does not look right + , m_I(*this, "_I", NETLIB_DELEGATE(input)) , m_Q(*this, "_Q") - , m_p_RIN(*this, "RIN", 1.0e6) - , m_p_ROUT(*this, "ROUT", 50.0) + , m_p_RIN(*this, "RIN", nlconst::magic(1.0e6)) + , m_p_ROUT(*this, "ROUT", nlconst::magic(50.0)) { - register_subalias("I", m_RIN.m_P); - register_subalias("G", m_RIN.m_N); - connect(m_I, m_RIN.m_P); + register_sub_alias("I", "m_RIN.1"); + register_sub_alias("G", "m_RIN.2"); + connect("_I", "m_RIN.1"); - register_subalias("_OP", m_ROUT.m_P); - register_subalias("Q", m_ROUT.m_N); - connect(m_Q, m_ROUT.m_P); + register_sub_alias("_OP", "m_ROUT.1"); + register_sub_alias("Q", "m_ROUT.2"); + connect("_Q", "m_ROUT.1"); } + private: NETLIB_RESETI() { - m_RIN.set_G_V_I(1.0 / m_p_RIN(),0,0); - m_ROUT.set_G_V_I(1.0 / m_p_ROUT(),0,0); + //printf("%s: in %f out %f\n", name().c_str(), m_p_RIN(), m_p_ROUT()); + m_RIN.set_G_V_I(plib::reciprocal(m_p_RIN()),0,0); + m_ROUT.set_G_V_I(plib::reciprocal(m_p_ROUT()),0,0); } - NETLIB_UPDATEI() + NETLIB_HANDLERI(input) { m_Q.push(m_I()); } - private: - analog::NETLIB_NAME(twoterm) m_RIN; - /* Fixme: only works if the device is time-stepped - need to rework */ - analog::NETLIB_NAME(twoterm) m_ROUT; + analog::NETLIB_NAME(two_terminal) m_RIN; + analog::NETLIB_NAME(two_terminal) m_ROUT; analog_input_t m_I; analog_output_t m_Q; - param_double_t m_p_RIN; - param_double_t m_p_ROUT; + param_fp_t m_p_RIN; + param_fp_t m_p_ROUT; }; - /* ----------------------------------------------------------------------------- - * nld_function - * - * FIXME: Currently a proof of concept to get congo bongo working - * ----------------------------------------------------------------------------- */ + // ----------------------------------------------------------------------------- + // nld_function + // ----------------------------------------------------------------------------- */ NETLIB_OBJECT(function) { NETLIB_CONSTRUCTOR(function) , m_N(*this, "N", 1) - , m_func(*this, "FUNC", "A0") + , m_function(*this, "FUNC", "A0") + , m_thresh(*this, "THRESH", nlconst::zero()) , m_Q(*this, "Q") - , m_compiled(this->name() + ".FUNCC", this, this->state().run_state_manager()) + , m_compiled(*this, "m_compiled") + , m_last(*this, "m_last") { - std::vector<pstring> inps; - for (int i=0; i < m_N(); i++) + std::vector<pstring> inputs; + + m_I.reserve(m_N()); + inputs.reserve(m_N()); + m_values.reserve(m_N()); + + for (uint64_t i=0; i < m_N(); i++) { - pstring n = plib::pfmt("A{1}")(i); - m_I.push_back(pool().make_poolptr<analog_input_t>(*this, n)); - inps.push_back(n); - m_vals.push_back(0.0); + pstring input_name = plib::pfmt("A{1}")(i); + m_I.push_back(state().make_pool_object<analog_input_t>(*this, input_name, NETLIB_DELEGATE(inputs))); + inputs.push_back(input_name); + m_values.push_back(nlconst::zero()); } - m_compiled.compile(inps, m_func()); + m_compiled->compile(m_function(), inputs); } protected: + NETLIB_RESETI() + { + //m_Q.initial(0.0); + } - NETLIB_RESETI(); - NETLIB_UPDATEI(); + NETLIB_HANDLERI(inputs) + { + for (std::size_t i = 0; i < static_cast<unsigned>(m_N()); i++) + { + m_values[i] = (*m_I[i])(); + } + auto result = m_compiled->evaluate(m_values); + if (plib::abs(m_last - result) >= m_thresh) + { + m_Q.push(result); + m_last = result; + } + } private: - - param_int_t m_N; - param_str_t m_func; + using pf_type = plib::pfunction<nl_fptype>; + param_num_t<std::uint64_t> m_N; + param_str_t m_function; + param_fp_t m_thresh; analog_output_t m_Q; - std::vector<pool_owned_ptr<analog_input_t>> m_I; + std::vector<device_arena::unique_ptr<analog_input_t>> m_I; + + pf_type::values_container m_values; + state_var<pf_type> m_compiled; + state_var<nl_fptype> m_last; - std::vector<double> m_vals; - plib::pfunction m_compiled; }; // ----------------------------------------------------------------------------- - // nld_res_sw + // nld_sys_dsw1 // ----------------------------------------------------------------------------- - NETLIB_OBJECT(res_sw) + NETLIB_OBJECT(sys_dsw1) { - public: - NETLIB_CONSTRUCTOR(res_sw) + NETLIB_CONSTRUCTOR(sys_dsw1) + , m_RON(*this, "RON", nlconst::one()) + , m_ROFF(*this, "ROFF", nlconst::magic(1.0E20)) , m_R(*this, "_R") - , m_I(*this, "I") - , m_RON(*this, "RON", 1.0) - , m_ROFF(*this, "ROFF", 1.0E20) + , m_I(*this, "I", NETLIB_DELEGATE(input)) , m_last_state(*this, "m_last_state", 0) { - register_subalias("1", m_R.m_P); - register_subalias("2", m_R.m_N); + register_sub_alias("1", "_R.1"); + register_sub_alias("2", "_R.2"); + } + + NETLIB_RESETI() + { + m_last_state = 0; + m_R().set_R(m_ROFF()); } - NETLIB_RESETI(); //NETLIB_UPDATE_PARAMI(); - NETLIB_UPDATEI(); - analog::NETLIB_SUB(R_base) m_R; - logic_input_t m_I; - param_double_t m_RON; - param_double_t m_ROFF; + //FIXME: used by 74123 + + const terminal_t &P() const noexcept { return m_R().P(); } + const terminal_t &N() const noexcept { return m_R().N(); } + const logic_input_t &I() const noexcept { return m_I; } + + param_fp_t m_RON; + param_fp_t m_ROFF; private: + NETLIB_HANDLERI(input) + { + const netlist_sig_t state = m_I(); + if (state != m_last_state) + { + m_last_state = state; + const nl_fptype R = (state != 0) ? m_RON() : m_ROFF(); + + m_R().change_state([this, &R]() + { + m_R().set_R(R); + }); + } + } + + NETLIB_SUB_NS(analog, R_base) m_R; + logic_input_t m_I; state_var<netlist_sig_t> m_last_state; }; // ----------------------------------------------------------------------------- - // power pins - not a device, but a helper + // nld_sys_dsw2 // ----------------------------------------------------------------------------- - /** - * Power Pins are passive inputs. Delegate noop will silently ignore any - * updates. - */ - class nld_power_pins + NETLIB_OBJECT(sys_dsw2) { - public: - nld_power_pins(device_t &owner, const char *sVCC = "VCC", const char *sGND = "GND", bool force_analog_input = false) + NETLIB_CONSTRUCTOR(sys_dsw2) + , m_R1(*this, "_R1") + , m_R2(*this, "_R2") + , m_I(*this, "I", NETLIB_DELEGATE(input)) + , m_GON(*this, "GON", nlconst::magic(1e9)) // FIXME: all switches should have some on value + , m_GOFF(*this, "GOFF", nlconst::cgmin()) + , m_power_pins(*this) + { + // connect and register pins + register_sub_alias("1", "_R1.1"); + register_sub_alias("2", "_R1.2"); + register_sub_alias("3", "_R2.2"); + connect("_R1.2", "_R2.1"); + } + + private: + NETLIB_RESETI() + { + m_R1().set_G(m_GOFF()); + m_R2().set_G(m_GON()); + } + + //NETLIB_UPDATE_PARAMI(); + + NETLIB_HANDLERI(input) { - if (owner.setup().is_validation() || force_analog_input) + const netlist_sig_t state = m_I(); + + //printf("Here %d\n", state); + const nl_fptype G1 = (state != 0) ? m_GON() : m_GOFF(); + const nl_fptype G2 = (state != 0) ? m_GOFF() : m_GON(); + if (m_R1().solver() == m_R2().solver()) { - m_GND = plib::make_unique<analog_input_t>(owner, sGND, NETLIB_DELEGATE(power_pins, noop)); - m_VCC = plib::make_unique<analog_input_t>(owner, sVCC, NETLIB_DELEGATE(power_pins, noop)); + m_R1().change_state([this, &G1, &G2]() + { + m_R1().set_G(G1); + m_R2().set_G(G2); + }); } else { - owner.create_and_register_subdevice(sPowerDevRes, m_RVG); - owner.register_subalias(sVCC, "_RVG.1"); - owner.register_subalias(sGND, "_RVG.2"); + m_R1().change_state([this, &G1]() + { + m_R1().set_G(G1); + }); + m_R2().change_state([this, &G2]() + { + m_R2().set_G(G2); + }); + } + } + + NETLIB_SUB_NS(analog, R_base) m_R1; + NETLIB_SUB_NS(analog, R_base) m_R2; + logic_input_t m_I; + param_fp_t m_GON; + param_fp_t m_GOFF; + + nld_power_pins m_power_pins; + }; + + + // ----------------------------------------------------------------------------- + // nld_sys_comp + // ----------------------------------------------------------------------------- + + NETLIB_OBJECT(sys_compd) + { + NETLIB_CONSTRUCTOR(sys_compd) + , m_IP(*this, "IP", NETLIB_DELEGATE(inputs)) + , m_IN(*this, "IN", NETLIB_DELEGATE(inputs)) + , m_Q(*this, "Q") + , m_QQ(*this, "QQ") + , m_power_pins(*this) + , m_last_state(*this, "m_last_state", 2) // ensure first execution + { + } + + private: + NETLIB_RESETI() + { + m_last_state = 0; + } + + //NETLIB_UPDATE_PARAMI(); + + NETLIB_HANDLERI(inputs) + { + const netlist_sig_t state = (m_IP() > m_IN()); + if (state != m_last_state) + { + m_last_state = state; + // FIXME: make timing a parameter + m_Q.push(state, NLTIME_FROM_NS(10)); + m_QQ.push(!state, NLTIME_FROM_NS(10)); } } - /* FIXME: this will seg-fault if force_analog_input = false */ - nl_double VCC() const NL_NOEXCEPT { return m_VCC->Q_Analog(); } - nl_double GND() const NL_NOEXCEPT { return m_GND->Q_Analog(); } + analog_input_t m_IP; + analog_input_t m_IN; + logic_output_t m_Q; + logic_output_t m_QQ; + nld_power_pins m_power_pins; - NETLIB_SUBXX(analog, R) m_RVG; // dummy resistor between VCC and GND + state_var<netlist_sig_t> m_last_state; + }; + + /// + /// \brief noise source + /// + /// An externally clocked noise source. The noise acts as a voltage source + /// with internal resistance RI. + /// + /// Since a new random value is used on each state change on I the effective + /// frequency is clock source frequency times two! + /// + /// Typical application: + /// + /// VCC + /// | + /// R + /// R + /// R + /// | + /// +-----> Output + /// | + /// +-------+ + /// | 1 | + /// --->| I | + /// | 2 | + /// +-------+ + /// | + /// R + /// R + /// R + /// | + /// GND + /// + // ----------------------------------------------------------------------------- + template <typename E, template<class> class D> + NETLIB_OBJECT(sys_noise) + { + public: + + using engine = E; + using distribution = D<nl_fptype>; + + NETLIB_CONSTRUCTOR(sys_noise) + , m_T(*this, "m_T") + , m_I(*this, "I", NETLIB_DELEGATE(input)) + , m_RI(*this, "RI", nlconst::magic(0.1)) + , m_sigma(*this, "SIGMA", nlconst::zero()) + , m_mt(*this, "m_mt") + , m_dis(*this, "m_dis",m_sigma()) + { + + register_sub_alias("1", "m_T.1"); + register_sub_alias("2", "m_T.2"); + } private: - void noop() { } - plib::unique_ptr<analog_input_t> m_VCC; // only used during validation or force_analog_input - plib::unique_ptr<analog_input_t> m_GND; // only used during validation or force_analog_input + NETLIB_HANDLERI(input) + { + nl_fptype val = m_dis()(m_mt()); + m_T().change_state([this, val]() + { + m_T().set_G_V_I(plib::reciprocal(m_RI()), val, nlconst::zero()); + }); + } + + NETLIB_RESETI() + { + m_T().set_G_V_I(plib::reciprocal(m_RI()), nlconst::zero(), nlconst::zero()); + } + + NETLIB_SUB_NS(analog, two_terminal) m_T; + logic_input_t m_I; + param_fp_t m_RI; + param_fp_t m_sigma; + state_var<engine> m_mt; + state_var<distribution> m_dis; }; -} //namespace devices -} // namespace netlist +} // namespace netlist::devices -#endif /* NLD_SYSTEM_H_ */ +#endif // NLD_SYSTEM_H_ diff --git a/src/lib/netlist/devices/nlid_truthtable.cpp b/src/lib/netlist/devices/nlid_truthtable.cpp index c62c67da3c1..072fa148d75 100644 --- a/src/lib/netlist/devices/nlid_truthtable.cpp +++ b/src/lib/netlist/devices/nlid_truthtable.cpp @@ -1,43 +1,232 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_truthtable.c - * - */ -#include "nlid_truthtable.h" -#include "netlist/nl_setup.h" -#include "plib/palloc.h" -#include "plib/plists.h" +#include "plib/pstonum.h" +#include "plib/pstrutil.h" + +#include "nl_base.h" +#include "nl_factory.h" +#include "nlid_truthtable.h" #include <bitset> +#include <cstdint> +#include <vector> + +namespace netlist::devices { -namespace netlist -{ - namespace devices + template<std::size_t m_NI, std::size_t m_NO> + class NETLIB_NAME(truth_table_t) : public device_t { + public: + + using type_t = typename plib::fast_type_for_bits<m_NO + m_NI>::type; + + static constexpr const std::size_t m_num_bits = m_NI; + static constexpr const std::size_t m_size = (1 << (m_num_bits)); + static constexpr const type_t m_outmask = ((1 << m_NO) - 1); + + struct truth_table_t + { + truth_table_t() + : m_timing_index{0} + {} + + std::array<type_t, m_size> m_out_state; + std::array<uint_least8_t, m_size * m_NO> m_timing_index; + std::array<netlist_time, 16> m_timing_nt; + }; + + nld_truth_table_t(device_param_t data, const pstring &model, + truth_table_t &ttp, const std::vector<pstring> &desc) + : device_t(data, model) +#if NL_USE_TT_ALTERNATIVE + , m_state(*this, "m_state", 0) +#endif + , m_ign(*this, "m_ign", 0) + , m_ttp(ttp) + /* FIXME: the family should provide the names of the power-terminals! */ + , m_power_pins(*this) + { + m_activate = activate_delegate(& NETLIB_NAME(truth_table_t) :: incdec_active, this); + set_hint_deactivate(true); + init(desc); + } + + private: + void init(const std::vector<pstring> &desc); + + NETLIB_RESETI() + { + int active_outputs = 0; + m_ign = 0; +#if NL_USE_TT_ALTERNATIVE + m_state = 0; +#endif + for (std::size_t i = 0; i < m_NI; ++i) + { + m_I[i].activate(); +#if NL_USE_TT_ALTERNATIVE + m_state |= (m_I[i]() << i); +#endif + } + for (auto &q : m_Q) + if (q.has_net()) + if (!q.net().core_terms_empty()) + active_outputs++; + set_active_outputs(active_outputs); + } + + NETLIB_HANDLERI(inputs) + { +#if NL_USE_TT_ALTERNATIVE + m_state = 0; + for (std::size_t i = 0; i < m_NI; ++i) + { + m_state |= (m_I[i]() << i); + } +#endif + process<true>(); + } + +#if NL_USE_TT_ALTERNATIVE + template <std::size_t N> + void update_N() noexcept + { + m_state &= ~(1<<N); + m_state |= (m_I[N]() << N); + process<true>(); + } +#endif + + void incdec_active(bool a) noexcept + { + if (a) + { + process<false>(); + } + else + { + for (std::size_t i = 0; i< m_NI; i++) + m_I[i].inactivate(); + m_ign = (1<<m_NI)-1; + } + } + + template<bool doOUT> + void process() noexcept + { + netlist_time_ext mt(netlist_time_ext::zero()); + type_t new_state(0); + type_t ign(m_ign); + + if (doOUT) + { +#if !NL_USE_TT_ALTERNATIVE + for (auto I = m_I.begin(); ign != 0; ign >>= 1, ++I) + if (ign & 1) + I->activate(); + for (std::size_t i = 0; i < m_NI; i++) + new_state |= (m_I[i]() << i); +#else + new_state = m_state; + for (std::size_t i = 0; ign != 0; ign >>= 1, ++i) + { + if (ign & 1) + { + new_state &= ~(1 << i); + m_I[i].activate(); + new_state |= (m_I[i]() << i); + } + } +#endif + } + else + for (std::size_t i = 0; i < m_NI; i++) + { + m_I[i].activate(); + new_state |= (m_I[i]() << i); + mt = std::max(this->m_I[i].net().next_scheduled_time(), mt); + } + + const type_t output_state(m_ttp.m_out_state[new_state]); + const type_t out(output_state & m_outmask); + + m_ign = output_state >> m_NO; + + const auto *t(&m_ttp.m_timing_index[new_state * m_NO]); + + if (doOUT) + //for (std::size_t i = 0; i < m_NO; ++i) + // m_Q[i].push((out >> i) & 1, tim[t[i]]); + this->push(out, t); + else + { + const auto *tim = m_ttp.m_timing_nt.data(); + for (std::size_t i = 0; i < m_NO; ++i) + m_Q[i].set_Q_time((out >> i) & 1, mt + tim[t[i]]); + } + + ign = m_ign; + for (auto I = m_I.begin(); ign != 0; ign >>= 1, ++I) + if (ign & 1) + I->inactivate(); +#if NL_USE_TT_ALTERNATIVE + m_state = new_state; +#endif + } + + template<typename T> + void push(const T &v, const std::uint_least8_t * t) + { + if (m_NO >= 1) m_Q[0].push((v >> 0) & 1, m_ttp.m_timing_nt[t[0]]); + if (m_NO >= 2) m_Q[1].push((v >> 1) & 1, m_ttp.m_timing_nt[t[1]]); + if (m_NO >= 3) m_Q[2].push((v >> 2) & 1, m_ttp.m_timing_nt[t[2]]); + if (m_NO >= 4) m_Q[3].push((v >> 3) & 1, m_ttp.m_timing_nt[t[3]]); + if (m_NO >= 5) m_Q[4].push((v >> 4) & 1, m_ttp.m_timing_nt[t[4]]); + if (m_NO >= 6) m_Q[5].push((v >> 5) & 1, m_ttp.m_timing_nt[t[5]]); + if (m_NO >= 7) m_Q[6].push((v >> 6) & 1, m_ttp.m_timing_nt[t[6]]); + if (m_NO >= 8) m_Q[7].push((v >> 7) & 1, m_ttp.m_timing_nt[t[7]]); + for (std::size_t i = 8; i < m_NO; i++) + m_Q[i].push((v >> i) & 1, m_ttp.m_timing_nt[t[i]]); + } + + + plib::static_vector<logic_input_t, m_NI> m_I; + plib::static_vector<logic_output_t, m_NO> m_Q; + +#if NL_USE_TT_ALTERNATIVE + state_var<type_t> m_state; +#endif + state_var<type_t> m_ign; + const truth_table_t m_ttp; + /* FIXME: the family should provide the names of the power-terminals! */ + nld_power_pins m_power_pins; + }; + // ---------------------------------------------------------------------------------------- // int compatible bitset .... // ---------------------------------------------------------------------------------------- template <typename T> - struct sbitset + struct pbitset { using type = T; - sbitset() : m_bs(0) { } - /* explicit */ sbitset(T v) : m_bs(v) { } + constexpr pbitset() noexcept : m_bs(0) { } + constexpr pbitset(T v) noexcept : m_bs(v) { } - sbitset &set() { *this = all_bits(); return *this; } - sbitset &set(const std::size_t bit) { m_bs |= (static_cast<T>(1) << bit); return *this; } - sbitset &reset() { *this = no_bits(); return *this; } - sbitset &reset(const std::size_t bit) { m_bs &= ~(static_cast<T>(1) << bit); return *this; } + constexpr pbitset &set() noexcept { *this = all_bits(); return *this; } + constexpr pbitset &set(std::size_t bit) noexcept { m_bs |= (static_cast<T>(1) << bit); return *this; } + constexpr pbitset &reset() noexcept { *this = no_bits(); return *this; } + constexpr pbitset &reset(std::size_t bit) noexcept { m_bs &= ~(static_cast<T>(1) << bit); return *this; } - sbitset invert() const { return sbitset(~m_bs); } - std::size_t count() + constexpr pbitset flip() const noexcept { return pbitset(~m_bs); } + constexpr pbitset flip(std::size_t bit) const noexcept { return pbitset(m_bs ^ (static_cast<T>(1) << bit)); } + + constexpr std::size_t count() const noexcept { - std::size_t ret = 0; + std::size_t ret(0); for (T v = m_bs; v != 0; v = v >> 1) { ret += (v & 1); @@ -46,23 +235,27 @@ namespace netlist } constexpr bool test(const std::size_t bit) const { return ((m_bs >> bit) & 1) == 1; } - operator T&() { return m_bs; } - operator const T&() const { return m_bs; } - constexpr T as_uint() const { return m_bs; } - - constexpr bool all() const { return *this == all_bits(); } - - /* - * And all bits set with compressed bits from b - * - * Example: b = {b3,b2,b1,b0} - * v = {v7, 0, v5, 0, v3, v2, 0, 0} - * Returns {v7 & b3, 0, v5 & b2, 0, v3 & b1, v2 & b0, 0, 0} - */ - - sbitset expand_and(sbitset b) const + constexpr operator T&() noexcept { return m_bs; } + constexpr operator const T&() const noexcept { return m_bs; } + constexpr T as_uint() const noexcept { return m_bs; } + + constexpr bool all() const noexcept { return *this == all_bits(); } + + /// \brief And all bits set with compressed bits from b + /// + /// Example: + /// + /// \code + /// b = {b3,b2,b1,b0} + /// v = {v7, 0, v5, 0, v3, v2, 0, 0} + /// return {v7 & b3, 0, v5 & b2, 0, v3 & b1, v2 & b0, 0, 0} + /// \endcode + /// + /// \returns pbitset + /// + constexpr pbitset expand_and(pbitset b) const noexcept { - sbitset ret; + pbitset ret; T v( m_bs); for (size_t i = 0; v != 0; v = v >> 1, ++i) @@ -77,59 +270,58 @@ namespace netlist return ret; } - static constexpr const sbitset all_bits() noexcept { return sbitset(~static_cast<T>(0)); } - static constexpr const sbitset no_bits() noexcept{ return sbitset(static_cast<T>(0)); } + static constexpr pbitset all_bits() noexcept { return pbitset(~static_cast<T>(0)); } + static constexpr pbitset no_bits() noexcept{ return pbitset(static_cast<T>(0)); } private: T m_bs; }; + // ---------------------------------------------------------------------------------------- - // Truthtable parsing .... + // Truth table parsing .... // ---------------------------------------------------------------------------------------- - //static const uint_least64_t all_set = ~(static_cast<uint_least64_t>(0)); - - using tt_bitset = sbitset<uint_least64_t>; + using tt_bitset = pbitset<std::uint_least64_t>; struct packed_int { - packed_int(void *data, std::size_t bits) + constexpr packed_int(void *data, std::size_t bits) noexcept : m_data(data) , m_size(bits) {} - void set(const size_t pos, const uint_least64_t val) + constexpr void set(size_t pos, std::uint_least64_t val) noexcept { switch (m_size) { - case 8: static_cast<uint_least8_t *>(m_data)[pos] = static_cast<uint_least8_t>(val); break; - case 16: static_cast<uint_least16_t *>(m_data)[pos] = static_cast<uint_least16_t>(val); break; - case 32: static_cast<uint_least32_t *>(m_data)[pos] = static_cast<uint_least32_t>(val); break; - case 64: static_cast<uint_least64_t *>(m_data)[pos] = static_cast<uint_least64_t>(val); break; + case 8: static_cast<std::uint_least8_t *>(m_data)[pos] = static_cast<std::uint_least8_t>(val); break; + case 16: static_cast<std::uint_least16_t *>(m_data)[pos] = static_cast<std::uint_least16_t>(val); break; + case 32: static_cast<std::uint_least32_t *>(m_data)[pos] = static_cast<std::uint_least32_t>(val); break; + case 64: static_cast<std::uint_least64_t *>(m_data)[pos] = static_cast<std::uint_least64_t>(val); break; default: { } } } - uint_least64_t operator[] (size_t pos) const + constexpr std::uint_least64_t operator[] (size_t pos) const noexcept { switch (m_size) { - case 8: return static_cast<uint_least8_t *>(m_data)[pos]; - case 16: return static_cast<uint_least16_t *>(m_data)[pos]; - case 32: return static_cast<uint_least32_t *>(m_data)[pos]; - case 64: return static_cast<uint_least64_t *>(m_data)[pos]; + case 8: return static_cast<std::uint_least8_t *>(m_data)[pos]; + case 16: return static_cast<std::uint_least16_t *>(m_data)[pos]; + case 32: return static_cast<std::uint_least32_t *>(m_data)[pos]; + case 64: return static_cast<std::uint_least64_t *>(m_data)[pos]; default: return 0; //should never happen } } - uint_least64_t mask() const + constexpr std::uint_least64_t mask() const noexcept { switch (m_size) { - case 8: return static_cast<uint_least8_t>(-1); - case 16: return static_cast<uint_least16_t>(-1); - case 32: return static_cast<uint_least32_t>(-1); - case 64: return static_cast<uint_least64_t>(-1); + case 8: return static_cast<std::uint_least8_t>(-1); + case 16: return static_cast<std::uint_least16_t>(-1); + case 32: return static_cast<std::uint_least32_t>(-1); + case 64: return static_cast<std::uint_least64_t>(-1); default: return 0; //should never happen } @@ -139,71 +331,88 @@ namespace netlist size_t m_size; }; - struct truthtable_parser + struct truth_table_parser { - truthtable_parser(unsigned NO, unsigned NI, bool *initialized, + truth_table_parser(unsigned NO, unsigned NI, packed_int outs, uint_least8_t *timing, netlist_time *timing_nt) - : m_NO(NO), m_NI(NI), m_initialized(initialized), - m_out_state(outs), m_timing(timing), m_timing_nt(timing_nt), - m_num_bits(m_NI), - m_size(1 << (m_num_bits)) + : m_NO(NO) + , m_NI(NI) + , m_out_state(outs) + , m_timing(timing) + , m_timing_nt(timing_nt) + , m_num_bits(m_NI) + , m_size(1 << (m_num_bits)) { } - void parse(const std::vector<pstring> &desc); + void parse(const std::vector<pstring> &truth_table); private: - void parseline(unsigned cur, std::vector<pstring> list, - tt_bitset state, uint_least64_t val, std::vector<uint_least8_t> &timing_index); + void parse_line(unsigned cur, std::vector<pstring> list, + tt_bitset state, std::uint_least64_t val, std::vector<uint_least8_t> &timing_index); - tt_bitset calculate_ignored_inputs(tt_bitset i); + tt_bitset calculate_ignored_inputs(tt_bitset state) const; unsigned m_NO; unsigned m_NI; - bool *m_initialized; packed_int m_out_state; uint_least8_t *m_timing; netlist_time *m_timing_nt; - /* additional values */ - const std::size_t m_num_bits; const std::size_t m_size; }; // ---------------------------------------------------------------------------------------- - // Truthtable class .... + // Truth table class .... // ---------------------------------------------------------------------------------------- template<std::size_t m_NI, std::size_t m_NO> - void NETLIB_NAME(truthtable_t)<m_NI, m_NO>::init(const std::vector<pstring> &desc) + void NETLIB_NAME(truth_table_t)<m_NI, m_NO>::init(const std::vector<pstring> &desc) { - set_hint_deactivate(true); - pstring header = desc[0]; - std::vector<pstring> io(plib::psplit(header,"|")); + std::vector<pstring> io(plib::psplit(header,'|')); // checks nl_assert_always(io.size() == 2, "too many '|'"); - std::vector<pstring> inout(plib::psplit(io[0], ",")); - nl_assert_always(inout.size() == m_num_bits, "bitcount wrong"); - std::vector<pstring> outputs(plib::psplit(io[1], ",")); + std::vector<pstring> inout(plib::psplit(io[0], ',')); + nl_assert_always(inout.size() == m_num_bits, "bit count wrong"); + std::vector<pstring> outputs(plib::psplit(io[1], ',')); nl_assert_always(outputs.size() == m_NO, "output count wrong"); +#if !NL_USE_TT_ALTERNATIVE + for (std::size_t i=0; i < m_NI; i++) + { + inout[i] = plib::trim(inout[i]); + m_I.emplace_back(*this, inout[i], nl_delegate(&NETLIB_NAME(truth_table_t)<m_NI, m_NO> :: inputs, this)); + } +#else for (std::size_t i=0; i < m_NI; i++) { inout[i] = plib::trim(inout[i]); - m_I.emplace(i, *this, inout[i]); } + if (0 < m_NI) m_I.emplace_back(*this, inout[0], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<0>, this)); + if (1 < m_NI) m_I.emplace_back(*this, inout[1], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<1>, this)); + if (2 < m_NI) m_I.emplace_back(*this, inout[2], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<2>, this)); + if (3 < m_NI) m_I.emplace_back(*this, inout[3], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<3>, this)); + if (4 < m_NI) m_I.emplace_back(*this, inout[4], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<4>, this)); + if (5 < m_NI) m_I.emplace_back(*this, inout[5], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<5>, this)); + if (6 < m_NI) m_I.emplace_back(*this, inout[6], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<6>, this)); + if (7 < m_NI) m_I.emplace_back(*this, inout[7], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<7>, this)); + if (8 < m_NI) m_I.emplace_back(*this, inout[8], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<8>, this)); + if (9 < m_NI) m_I.emplace_back(*this, inout[9], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<9>, this)); + if (10 < m_NI) m_I.emplace_back(*this, inout[10], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<10>, this)); + if (11 < m_NI) m_I.emplace_back(*this, inout[11], nl_delegate(&nld_truth_table_t<m_NI, m_NO>::update_N<11>, this)); +#endif for (std::size_t i=0; i < m_NO; i++) { outputs[i] = plib::trim(outputs[i]); - m_Q.emplace(i, *this, outputs[i]); + m_Q.emplace_back(*this, outputs[i]); // Connect output "Q" to input "_Q" if this exists // This enables timed state without having explicit state .... pstring tmp = "_" + outputs[i]; - const std::size_t idx = plib::container::indexof(inout, tmp); + const std::size_t idx = plib::container::index_of(inout, tmp); if (idx != plib::container::npos) connect(m_Q[i], m_I[idx]); } @@ -211,74 +420,71 @@ namespace netlist } // ---------------------------------------------------------------------------------------- - // Truthtable factory .... + // Truth table factory .... // ---------------------------------------------------------------------------------------- template<unsigned m_NI, unsigned m_NO> - class netlist_factory_truthtable_t : public netlist_base_factory_truthtable_t + class factory_truth_table_t : public factory::truth_table_base_element_t { public: - netlist_factory_truthtable_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &sourcefile) - : netlist_base_factory_truthtable_t(name, classname, def_param, sourcefile) + factory_truth_table_t(const pstring &name, + factory::properties &&props) + : truth_table_base_element_t(name, std::move(props)) { } - pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override + device_arena::unique_ptr<core_device_t> make_device(device_arena &pool, netlist_state_t &anetlist, const pstring &name) override { - using tt_type = nld_truthtable_t<m_NI, m_NO>; - truthtable_parser desc_s(m_NO, m_NI, &m_ttbl.m_initialized, - packed_int(m_ttbl.m_out_state.data(), sizeof(m_ttbl.m_out_state[0]) * 8), - m_ttbl.m_timing_index.data(), m_ttbl.m_timing_nt.data()); + using tt_type = nld_truth_table_t<m_NI, m_NO>; - desc_s.parse(m_desc); - - /* update truthtable family definitions */ - if (m_family_name != "") - m_family_desc = anetlist.setup().family_from_model(m_family_name); + if (!m_table) + { + m_table = plib::make_unique<typename nld_truth_table_t<m_NI, m_NO>::truth_table_t>(pool); + truth_table_parser desc_s(m_NO, m_NI, + packed_int(m_table->m_out_state.data(), sizeof(m_table->m_out_state[0]) * 8), + m_table->m_timing_index.data(), m_table->m_timing_nt.data()); - if (m_family_desc == nullptr) - throw nl_exception("family description not found for {1}", m_family_name); + desc_s.parse(m_desc); + } - return pool().make_poolptr<tt_type>(anetlist, name, m_family_desc, m_ttbl, m_desc); + return plib::make_unique<tt_type>(pool, device_data_t{anetlist, name}, m_family_name, *m_table, m_desc); } private: - typename nld_truthtable_t<m_NI, m_NO>::truthtable_t m_ttbl; + device_arena::unique_ptr<typename nld_truth_table_t<m_NI, m_NO>::truth_table_t> m_table; }; - tt_bitset truthtable_parser::calculate_ignored_inputs(tt_bitset state) + tt_bitset truth_table_parser::calculate_ignored_inputs(tt_bitset state) const { // Determine all inputs which may be ignored ... tt_bitset ignore = 0; for (std::size_t j=0; j<m_NI; j++) { // if changing the input directly doesn't change outputs we can ignore - if (m_out_state[state] == m_out_state[tt_bitset(state).set(j)]) + if (m_out_state[state] == m_out_state[tt_bitset(state).flip(j)]) ignore.set(j); } - /* Check all permutations of ign - * We have to remove those where the ignored inputs - * may change the output - */ - + // Check all permutations of ign + // We have to remove those where the ignored inputs + // may change the output + // tt_bitset bits = tt_bitset().set(ignore.count()); std::vector<bool> t(bits); // loop over all combinations of bits set in ignore - for (uint_least64_t j=1; j < bits; j++) + for (std::uint_least64_t j = 1; j < bits; j++) { tt_bitset tign = ignore.expand_and(j); t[j] = false; - tt_bitset bitsk = tt_bitset().set(tign.count()); + tt_bitset bitsk(tt_bitset().set(tign.count())); // now loop over all combinations of the bits set currently set - for (uint_least64_t k=0; k < bitsk; k++) + for (std::uint_least64_t k=0; k < bitsk; k++) { tt_bitset b = tign.expand_and(k); // will any of the inputs ignored change the output if changed? - if (m_out_state[state] != m_out_state[(state & tign.invert()) | b]) + if (m_out_state[state] != m_out_state[state ^ b]) { t[j] = true; break; @@ -286,16 +492,16 @@ namespace netlist } } - /* find the ignore mask without potential for change with the most bits */ + // find the ignore mask without potential for change with the most bits - size_t jb=0; - tt_bitset jm=0; + size_t jb(0); + tt_bitset jm(0); - for (uint_least64_t j=1; j<bits; j++) + for (std::uint_least64_t j=1; j<bits; j++) { tt_bitset bj(j); - size_t nb = bj.count(); - if ((t[j] == false) && (nb>jb)) + size_t nb(bj.count()); + if (!t[j] && (nb > jb)) { jb = nb; jm = bj; @@ -304,195 +510,197 @@ namespace netlist return ignore.expand_and(jm); } -// ---------------------------------------------------------------------------------------- -// parseline -// ---------------------------------------------------------------------------------------- - -void truthtable_parser::parseline(unsigned cur, std::vector<pstring> list, - tt_bitset state, uint_least64_t val, std::vector<uint_least8_t> &timing_index) -{ - pstring elem = plib::trim(list[cur]); - uint_least64_t start = 0; - uint_least64_t end = 0; + // ---------------------------------------------------------------------------------------- + // parse line + // ---------------------------------------------------------------------------------------- - if (elem == "0") - { - start = 0; - end = 0; - } - else if (elem == "1") - { - start = 1; - end = 1; - } - else if (elem == "X") - { - start = 0; - end = 1; - } - else - nl_assert_always(false, "unknown input value (not 0, 1, or X)"); - for (uint_least64_t i = start; i <= end; i++) + void truth_table_parser::parse_line(unsigned cur, std::vector<pstring> list, + tt_bitset state, std::uint_least64_t val, std::vector<uint_least8_t> &timing_index) { - tt_bitset nstate = state; - if (i==1) - nstate.set(cur); + pstring elem = plib::trim(list[cur]); + std::uint_least64_t start = 0; + std::uint_least64_t end = 0; - if (cur < m_num_bits - 1) + if (elem == "0") + { + start = 0; + end = 0; + } + else if (elem == "1") + { + start = 1; + end = 1; + } + else if (elem == "X") { - parseline(cur + 1, list, nstate, val, timing_index); + start = 0; + end = 1; } else + nl_assert_always(false, "unknown input value (not 0, 1, or X)"); + for (std::uint_least64_t i = start; i <= end; i++) { - // cutoff previous inputs and outputs for ignore - if (m_out_state[nstate] != m_out_state.mask() && m_out_state[nstate] != val) - throw nl_exception(plib::pfmt("Error in truthtable: State {1:04} already set, {2} != {3}\n") - .x(nstate.as_uint())(m_out_state[nstate])(val) ); - m_out_state.set(nstate, val); - for (std::size_t j=0; j<m_NO; j++) - m_timing[nstate * m_NO + j] = timing_index[j]; + tt_bitset new_state = state; + if (i==1) + new_state.set(cur); + + if (cur < m_num_bits - 1) + { + parse_line(cur + 1, list, new_state, val, timing_index); + } + else + { + // cutoff previous inputs and outputs for ignore + if (m_out_state[new_state] != m_out_state.mask() && m_out_state[new_state] != val) + throw nl_exception(plib::pfmt("Error in truth table: State {1:04} already set, {2} != {3}\n") + .x(new_state.as_uint())(m_out_state[new_state])(val) ); + m_out_state.set(new_state, val); + for (std::size_t j=0; j<m_NO; j++) + m_timing[new_state * m_NO + j] = timing_index[j]; + } } } -} - -void truthtable_parser::parse(const std::vector<pstring> &truthtable) -{ - unsigned line = 0; - if (*m_initialized) - return; + void truth_table_parser::parse(const std::vector<pstring> &truth_table) + { + unsigned line = 0; - pstring ttline(truthtable[line]); - line++; - ttline = truthtable[line]; - line++; + pstring tt_line(truth_table[line]); + line++; + tt_line = truth_table[line]; + line++; - for (unsigned j=0; j < m_size; j++) - m_out_state.set(j, tt_bitset::all_bits()); + for (unsigned j=0; j < m_size; j++) + m_out_state.set(j, tt_bitset::all_bits()); - for (int j=0; j < 16; j++) - m_timing_nt[j] = netlist_time::zero(); + for (int j=0; j < 16; j++) + m_timing_nt[j] = netlist_time::zero(); - while (!(ttline == "")) - { - std::vector<pstring> io(plib::psplit(ttline,"|")); - // checks - nl_assert_always(io.size() == 3, "io.count mismatch"); - std::vector<pstring> inout(plib::psplit(io[0], ",")); - nl_assert_always(inout.size() == m_num_bits, "number of bits not matching"); - std::vector<pstring> out(plib::psplit(io[1], ",")); - nl_assert_always(out.size() == m_NO, "output count not matching"); - std::vector<pstring> times(plib::psplit(io[2], ",")); - nl_assert_always(times.size() == m_NO, "timing count not matching"); - - tt_bitset val = 0; - std::vector<uint_least8_t> tindex; - - /* - * FIXME: evaluation of outputs should be done in parseline to - * enable the use of inputs for output values, i.e. "I1" or "~I1" - * in addition to "0" and "1". - */ - for (unsigned j=0; j<m_NO; j++) + while (!tt_line.empty()) { - pstring outs = plib::trim(out[j]); - if (outs == "1") - val.set(j); + std::vector<pstring> io(plib::psplit(tt_line,'|')); + // checks + nl_assert_always(io.size() == 3, "io.count mismatch"); + std::vector<pstring> inout(plib::psplit(io[0], ',')); + nl_assert_always(inout.size() == m_num_bits, "number of bits not matching"); + std::vector<pstring> out(plib::psplit(io[1], ',')); + nl_assert_always(out.size() == m_NO, "output count not matching"); + std::vector<pstring> times(plib::psplit(io[2], ',')); + nl_assert_always(times.size() == m_NO, "timing count not matching"); + + tt_bitset val = 0; + std::vector<uint_least8_t> indexes; + + // + // FIXME: evaluation of outputs should be done in parse_line to + // enable the use of inputs for output values, i.e. "I1" or "~I1" + // in addition to "0" and "1". + + for (unsigned j=0; j<m_NO; j++) + { + pstring outs = plib::trim(out[j]); + if (outs == "1") + val.set(j); + else + nl_assert_always(outs == "0", "Unknown value (not 0 or 1"); + // FIXME: error handling + netlist_time t = netlist_time::from_nsec(plib::pstonum<std::int64_t>(plib::trim(times[j]))); + uint_least8_t k=0; + while (m_timing_nt[k] != netlist_time::zero() && m_timing_nt[k] != t) + k++; + m_timing_nt[k] = t; + indexes.push_back(k); //[j] = k; + } + + parse_line(0, inout, 0 , val, indexes); + if (line < truth_table.size()) + tt_line = truth_table[line]; else - nl_assert_always(outs == "0", "Unknown value (not 0 or 1"); - // FIXME: error handling - netlist_time t = netlist_time::from_nsec(plib::pstonum<std::int64_t>(plib::trim(times[j]))); - uint_least8_t k=0; - while (m_timing_nt[k] != netlist_time::zero() && m_timing_nt[k] != t) - k++; - m_timing_nt[k] = t; - tindex.push_back(k); //[j] = k; + tt_line = ""; + line++; } - parseline(0, inout, 0 , val, tindex); - if (line < truthtable.size()) - ttline = truthtable[line]; - else - ttline = ""; - line++; - } - - // determine ignore mask by looping over all input combinations - std::vector<tt_bitset> ign(m_size); - for (tt_bitset &x : ign) - x.set(); + // determine ignore mask by looping over all input combinations + std::vector<tt_bitset> ign(m_size); + for (tt_bitset &x : ign) + x.set(); - for (uint_least64_t i=0; i < m_size; i++) - { - if (ign[i].all()) // not yet visited + for (std::uint_least64_t i=0; i < m_size; i++) { - tt_bitset tign = calculate_ignored_inputs(i); - - ign[i] = tign; + if (ign[i].all()) // not yet visited + { + tt_bitset tign = calculate_ignored_inputs(i); - /* don't need to recalculate similar ones */ + ign[i] = tign; - tt_bitset bitsk; - bitsk.set(tign.count()); + // don't need to recalculate similar ones + tt_bitset bitsk; + bitsk.set(tign.count()); - for (uint_least64_t k=0; k < bitsk; k++) - { - tt_bitset b = tign.expand_and(k); - ign[(i & tign.invert()) | b] = tign; + for (std::uint_least64_t k=0; k < bitsk; k++) + { + tt_bitset b = tign.expand_and(k); + ign[(i & tign.flip()) | b] = tign; + } } } + + for (size_t i=0; i<m_size; i++) + { + if (m_out_state[i] == m_out_state.mask()) + throw nl_exception(plib::pfmt("truth table: found element not set {1}\n").x(i) ); + m_out_state.set(i, m_out_state[i] | (ign[i] << m_NO)); + } } - for (size_t i=0; i<m_size; i++) - { - if (m_out_state[i] == m_out_state.mask()) - throw nl_exception(plib::pfmt("truthtable: found element not set {1}\n").x(i) ); - m_out_state.set(i, m_out_state[i] | (ign[i] << m_NO)); - } - *m_initialized = true; -} +} // namespace netlist::devices -netlist_base_factory_truthtable_t::netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &sourcefile) -: factory::element_t(name, classname, def_param, sourcefile), m_family_desc(family_TTL()) -{ -} +namespace netlist::factory { -#define ENTRYY(n, m, s) case (n * 100 + m): \ - { using xtype = netlist_factory_truthtable_t<n, m>; \ - ret = plib::make_unique<xtype>(desc.name, desc.classname, desc.def_param, s); } break + truth_table_base_element_t::truth_table_base_element_t(const pstring &name, + properties &&props) + : factory::element_t(name, std::move(props)) + , m_family_name(config::DEFAULT_LOGIC_FAMILY()) + { + } -#define ENTRY(n, s) ENTRYY(n, 1, s); ENTRYY(n, 2, s); ENTRYY(n, 3, s); \ - ENTRYY(n, 4, s); ENTRYY(n, 5, s); ENTRYY(n, 6, s); \ - ENTRYY(n, 7, s); ENTRYY(n, 8, s) + #define ENTRYY(n, m, s) case (n * 100 + m): \ + { using dev_type = devices::factory_truth_table_t<n, m>; \ + auto cs=s; \ + ret = plib::make_unique<dev_type, host_arena>(desc.name, std::move(cs)); } \ + break -plib::unique_ptr<netlist_base_factory_truthtable_t> tt_factory_create(tt_desc &desc, const pstring &sourcefile) -{ - plib::unique_ptr<netlist_base_factory_truthtable_t> ret; + #define ENTRY(n, s) ENTRYY(n, 1, s); ENTRYY(n, 2, s); ENTRYY(n, 3, s); \ + ENTRYY(n, 4, s); ENTRYY(n, 5, s); ENTRYY(n, 6, s); \ + ENTRYY(n, 7, s); ENTRYY(n, 8, s); ENTRYY(n, 9, s); \ + ENTRYY(n, 10, s) - switch (desc.ni * 100 + desc.no) + host_arena::unique_ptr<truth_table_base_element_t> truth_table_create(tt_desc &desc, properties &&props) { - ENTRY(1, sourcefile); - ENTRY(2, sourcefile); - ENTRY(3, sourcefile); - ENTRY(4, sourcefile); - ENTRY(5, sourcefile); - ENTRY(6, sourcefile); - ENTRY(7, sourcefile); - ENTRY(8, sourcefile); - ENTRY(9, sourcefile); - ENTRY(10, sourcefile); - ENTRY(11, sourcefile); - ENTRY(12, sourcefile); - default: - pstring msg = plib::pfmt("unable to create truthtable<{1},{2}>")(desc.ni)(desc.no); - nl_assert_always(false, msg); - } - ret->m_desc = desc.desc; - ret->m_family_name = desc.family; + host_arena::unique_ptr<truth_table_base_element_t> ret; - return ret; -} + switch (desc.ni * 100 + desc.no) + { + ENTRY(1, props); + ENTRY(2, props); + ENTRY(3, props); + ENTRY(4, props); + ENTRY(5, props); + ENTRY(6, props); + ENTRY(7, props); + ENTRY(8, props); + ENTRY(9, props); + ENTRY(10, props); + ENTRY(11, props); + ENTRY(12, props); + default: + pstring msg = plib::pfmt("unable to create truth table<{1},{2}>")(desc.ni)(desc.no); + nl_assert_always(false, putf8string(msg).c_str()); + } + ret->m_desc = desc.desc; + ret->m_family_name = (!desc.family.empty() ? desc.family : pstring(config::DEFAULT_LOGIC_FAMILY())); + + return ret; + } - } //namespace devices -} // namespace netlist +} // namespace netlist::factory diff --git a/src/lib/netlist/devices/nlid_truthtable.h b/src/lib/netlist/devices/nlid_truthtable.h index 564bb16451b..83f9679e70b 100644 --- a/src/lib/netlist/devices/nlid_truthtable.h +++ b/src/lib/netlist/devices/nlid_truthtable.h @@ -1,227 +1,31 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_truthtable.h - * - * Created on: 19 Jun 2014 - * Author: andre - */ + +/// +/// \file nld_truthtable.h +/// +/// #ifndef NLID_TRUTHTABLE_H_ #define NLID_TRUTHTABLE_H_ -#include "netlist/devices/nlid_system.h" -#include "netlist/nl_base.h" -#include "netlist/nl_setup.h" -#include "plib/putil.h" - -namespace netlist -{ -namespace devices -{ - - template<unsigned bits> - struct need_bytes_for_bits - { - enum { value = - bits <= 8 ? 1 : - bits <= 16 ? 2 : - bits <= 32 ? 4 : - 8 - }; - }; - - template<unsigned bits> struct uint_for_size; - template<> struct uint_for_size<1> { using type = uint_least8_t; }; - template<> struct uint_for_size<2> { using type = uint_least16_t; }; - template<> struct uint_for_size<4> { using type = uint_least32_t; }; - template<> struct uint_for_size<8> { using type = uint_least64_t; }; - - template<std::size_t NUM, typename R> - struct aa - { - template<typename T> - R f(T &arr, const R ign) - { - R r = aa<NUM-1, R>().f(arr, ign); - if (ign & (1 << (NUM-1))) - arr[NUM-1].activate(); - return r | (arr[NUM-1]() << (NUM-1)); - } - }; - - template<typename R> - struct aa<1, R> - { - template<typename T> - R f(T &arr, const R ign) - { - if ((ign & 1)) - arr[0].activate(); - return arr[0](); - } - }; - - template<std::size_t m_NI, std::size_t m_NO> - NETLIB_OBJECT(truthtable_t) - { - private: - detail::family_setter_t m_fam; - public: - - using type_t = typename uint_for_size<need_bytes_for_bits<m_NO + m_NI>::value>::type; - - static constexpr const std::size_t m_num_bits = m_NI; - static constexpr const std::size_t m_size = (1 << (m_num_bits)); - static constexpr const type_t m_outmask = ((1 << m_NO) - 1); - - struct truthtable_t - { - truthtable_t() - : m_timing_index{0} - , m_initialized(false) - {} - - std::array<type_t, m_size> m_out_state; - std::array<uint_least8_t, m_size * m_NO> m_timing_index; - std::array<netlist_time, 16> m_timing_nt; - bool m_initialized; - }; +#include "../nl_setup.h" +#include "nl_factory.h" - template <class C> - nld_truthtable_t(C &owner, const pstring &name, - const logic_family_desc_t *fam, - truthtable_t &ttp, const std::vector<pstring> &desc) - : device_t(owner, name) - , m_fam(*this, fam) - , m_ign(*this, "m_ign", 0) - , m_ttp(ttp) - /* FIXME: the family should provide the names of the power-terminals! */ - , m_power_pins(*this) - { - init(desc); - } +namespace netlist::factory { - void init(const std::vector<pstring> &desc); - - NETLIB_RESETI() - { - int active_outputs = 0; - m_ign = 0; - for (auto &i : m_I) - i.activate(); - for (auto &q : m_Q) - if (q.has_net() && q.net().num_cons() > 0) - active_outputs++; - set_active_outputs(active_outputs); - } - - NETLIB_UPDATEI() - { - process<true>(); - } - - void inc_active() NL_NOEXCEPT override - { - process<false>(); - } - - void dec_active() NL_NOEXCEPT override - { - for (std::size_t i = 0; i< m_NI; i++) - m_I[i].inactivate(); - m_ign = (1<<m_NI)-1; - } - - plib::uninitialised_array_t<logic_input_t, m_NI> m_I; - plib::uninitialised_array_t<logic_output_t, m_NO> m_Q; - - protected: - - private: - - template<bool doOUT> - void process() - { - netlist_time mt(netlist_time::zero()); - - type_t nstate(0); - type_t ign(m_ign); -#if 1 - if (!doOUT) - for (std::size_t i = 0; i < m_NI; i++) - { - m_I[i].activate(); - //nstate |= (m_I[i]() ? (1 << i) : 0); - nstate |= (m_I[i]() << i); - mt = std::max(this->m_I[i].net().next_scheduled_time(), mt); - } - else - for (std::size_t i = 0; i < m_NI; i++) - { - if ((ign & 1)) - m_I[i].activate(); - //nstate |= (m_I[i]() ? (1 << i) : 0); - nstate |= (m_I[i]() << i); - ign >>= 1; - } -#else - if (!doOUT) - { - nstate = aa<m_NI, type_t>().f(m_I, ~0); - for (std::size_t i = 0; i < m_NI; i++) - mt = std::max(this->m_I[i].net().time(), mt); - } - else - nstate = aa<m_NI, type_t>().f(m_I, ign); -#endif - - const type_t outstate(m_ttp.m_out_state[nstate]); - type_t out(outstate & m_outmask); - - m_ign = outstate >> m_NO; - - const std::size_t timebase(nstate * m_NO); - const auto *t(&m_ttp.m_timing_index[timebase]); - const auto *tim = m_ttp.m_timing_nt.data(); - - if (doOUT) - for (std::size_t i = 0; i < m_NO; out >>= 1, ++i) - m_Q[i].push(out & 1, tim[t[i]]); - else - for (std::size_t i = 0; i < m_NO; out >>= 1, ++i) - m_Q[i].set_Q_time(out & 1, mt + tim[t[i]]); - - ign = m_ign; - for (auto I = m_I.begin(); ign != 0; ign >>= 1, ++I) - if (ign & 1) - I->inactivate(); - } - - /* FIXME: check width */ - state_var<type_t> m_ign; - const truthtable_t &m_ttp; - /* FIXME: the family should provide the names of the power-terminals! */ - nld_power_pins m_power_pins; - }; - - class netlist_base_factory_truthtable_t : public factory::element_t + class truth_table_base_element_t : public factory::element_t { public: - netlist_base_factory_truthtable_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &sourcefile); + truth_table_base_element_t(const pstring &name,properties &&props); std::vector<pstring> m_desc; pstring m_family_name; - const logic_family_desc_t *m_family_desc; }; - /* the returned element is still missing a pointer to the family ... */ - plib::unique_ptr<netlist_base_factory_truthtable_t> tt_factory_create(tt_desc &desc, const pstring &sourcefile); - -} //namespace devices -} // namespace netlist - + host_arena::unique_ptr<truth_table_base_element_t> truth_table_create(tt_desc &desc, + properties &&props); +} // namespace netlist::factory -#endif /* NLID_TRUTHTABLE_H_ */ +#endif // NLID_TRUTHTABLE_H_ diff --git a/src/lib/netlist/documentation/mainpage.dox.h b/src/lib/netlist/documentation/mainpage.dox.h index cfe098845ed..817a3a9fda4 100644 --- a/src/lib/netlist/documentation/mainpage.dox.h +++ b/src/lib/netlist/documentation/mainpage.dox.h @@ -1,16 +1,14 @@ -/* - * Documentation settings - */ +// +// Documentation settings +// /*! * * \mainpage Netlist +## Netlist - -##Netlist - -###A mixed signal circuit simulation. +### A mixed signal circuit simulation. - D: Device - O: Rail output (output) @@ -146,7 +144,7 @@ conductance on the diagonal elements, V the net voltage vector and I the current vector. By using solely two terminal devices, we can simplify the whole calculation -significantly. A BJT now is a four terminal device with two terminals being +significantly. A BJT now is a three terminal device with two terminals being connected internally. The system is solved using an iterative approach: diff --git a/src/lib/netlist/documentation/primer_1.dox.h b/src/lib/netlist/documentation/primer_1.dox.h index 8df612e242d..6c2642fbcde 100644 --- a/src/lib/netlist/documentation/primer_1.dox.h +++ b/src/lib/netlist/documentation/primer_1.dox.h @@ -1,6 +1,6 @@ /*! \page primer_1 nltool primer -## First example +# First example Let's start with a simple charge/discharge circuit. I denotes the input, O denotes the output. @@ -16,7 +16,13 @@ O denotes the output. Now in netlist syntax this looks like: ~~~{.cpp} +#include "netlist/devices/net_lib.h" + NETLIST_START(charge_discharge) +{ + + ANALOG_INPUT(V5, 5) // Clock needs a 5V power supply + SOLVER(solver, 48000) // Fixed frequency solver CLOCK(I, 200) // 200 Hz clock as input, TTL logic output RES(R, RES_K(1)) @@ -24,10 +30,12 @@ NETLIST_START(charge_discharge) NET_C(I.Q, R.1) NET_C(R.2, C.1) - NET_C(C.2, GND) + + NET_C(GND, C.2, I.GND) + NET_C(V5, I.VCC) ALIAS(O, R.2) // Output O == C.1 == R.2 -NETLIST_END() +} ~~~ Save this example as e.g. test1.cpp. Now that's a c++ extension. The background @@ -37,7 +45,7 @@ That's something we will cover later. Now, to test this, run the following: ~~~ -> nltool --cmd=run -f test1.cpp -t 0.05 -l O -l I +> nltool --cmd=run -t 0.05 -l O -l I test1.cpp ~~~ This will run the circuit for 50 ms and log input "I" to file log_I.log and @@ -46,14 +54,14 @@ output "O" to log_O.log . The log files will be located in the current folder. Next, run ~~~ -> plot_nl I O +> plot_nl O I ~~~  and enjoy the results. -##Recap +# Recap We have created our first netlist fragment. nltool was used to model the periodically forced charge/discharge circuit for 50ms. Finally we plotted both input diff --git a/src/lib/netlist/documentation/structure.dox.h b/src/lib/netlist/documentation/structure.dox.h index 41dd9507717..9d49656e161 100644 --- a/src/lib/netlist/documentation/structure.dox.h +++ b/src/lib/netlist/documentation/structure.dox.h @@ -1,20 +1,47 @@ -/*! The netlist namespace. - * All netlist related code is contained in the netlist namespace - */ +/// +/// \defgroup compiledefine Compilation defines +/// +/// Compilation defines can be specified using -DDEFINE=VALUE during compilation. +/// If this is not done, a default is set, e.g. +/// \code +/// #ifndef DEFINE +/// #define DEFINE (0) +/// #endif +/// \endcode +/// +/// The define statements below thus show the default value. +/// +///\{ +///\} + +/// \brief The netlist namespace. +/// All netlist related code is contained in the netlist namespace namespace netlist { - /*! The netlist::devices namespace. - * All netlist devices are contained in the netlist::devices namespace. - */ + /// \brief The netlist::devices namespace. + /// All netlist devices are contained in the netlist::devices namespace. namespace devices { } - /*! Internal support classes you should not use in code using netlist api. - * This namespace contains all internal support classes not intended - * to be used outside of the core. - */ + /// \brief The netlist::analog namespace. + /// Netlist analog devices and related code are contained in the + /// netlist::analog namespace. + namespace analog + { + } + + /// \brief The netlist::solver namespace. + /// All linear equation solving code and related code is contained in the + /// netlist::solver namespace. + namespace solver + { + } + + /// \brief Internal support classes you should not use in code using netlist api. + /// This namespace contains all internal support classes not intended + /// to be used outside of the core. namespace detail { } diff --git a/src/lib/netlist/documentation/test1-50r.svg b/src/lib/netlist/documentation/test1-50r.svg index ea4f70f6efe..44f7f9f4958 100644 --- a/src/lib/netlist/documentation/test1-50r.svg +++ b/src/lib/netlist/documentation/test1-50r.svg @@ -66,37 +66,37 @@ <text> 4</text> </g> <path stroke='black' d='M53.9,444.0 L53.9,435.0 M53.9,16.7 L53.9,25.7 '/> <g transform="translate(53.9,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>0 </text> + <text>0</text> </g> <path stroke='black' d='M106.0,444.0 L106.0,435.0 M106.0,16.7 L106.0,25.7 '/> <g transform="translate(106.0,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>5m</text> + <text>0.005</text> </g> <path stroke='black' d='M158.1,444.0 L158.1,435.0 M158.1,16.7 L158.1,25.7 '/> <g transform="translate(158.1,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>10m</text> + <text>0.01</text> </g> <path stroke='black' d='M210.2,444.0 L210.2,435.0 M210.2,16.7 L210.2,25.7 '/> <g transform="translate(210.2,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>15m</text> + <text>0.015</text> </g> <path stroke='black' d='M262.3,444.0 L262.3,435.0 M262.3,16.7 L262.3,25.7 '/> <g transform="translate(262.3,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>20m</text> + <text>0.02</text> </g> <path stroke='black' d='M314.5,444.0 L314.5,435.0 M314.5,16.7 L314.5,25.7 '/> <g transform="translate(314.5,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>25m</text> + <text>0.025</text> </g> <path stroke='black' d='M366.6,444.0 L366.6,435.0 M366.6,16.7 L366.6,25.7 '/> <g transform="translate(366.6,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>30m</text> + <text>0.03</text> </g> <path stroke='black' d='M418.7,444.0 L418.7,435.0 M418.7,16.7 L418.7,25.7 '/> <g transform="translate(418.7,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>35m</text> + <text>0.035</text> </g> <path stroke='black' d='M470.8,444.0 L470.8,435.0 M470.8,16.7 L470.8,25.7 '/> <g transform="translate(470.8,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>40m</text> + <text>0.04</text> </g> <path stroke='black' d='M522.9,444.0 L522.9,435.0 M522.9,16.7 L522.9,25.7 '/> <g transform="translate(522.9,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>45m</text> + <text>0.045</text> </g> <path stroke='black' d='M575.0,444.0 L575.0,435.0 M575.0,16.7 L575.0,25.7 '/> <g transform="translate(575.0,466.5)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:middle"> - <text>50m</text> + <text>0.05</text> </g> <path stroke='black' d='M53.9,16.7 L53.9,444.0 L575.0,444.0 L575.0,16.7 L53.9,16.7 Z '/></g> <g id="gnuplot_plot_1" ><title>gnuplot_plot_1</title> @@ -121,7 +121,7 @@ L66.3,436.7 L66.3,436.6 L66.5,436.6 L66.7,436.6 L66.7,436.5 L66.9,436.5 L66.9,436.4 L67.1,436.4 L67.4,436.4 L67.4,436.3 L67.6,436.3 L67.6,436.2 L67.8,436.2 L68.0,436.2 L68.0,436.1 L68.2,436.1 L68.4,436.1 L68.4,436.0 L68.7,436.0 L68.7,435.9 L68.9,435.9 L69.1,435.9 L69.1,435.8 L69.3,435.8 - L69.5,435.8 L69.5,435.7 L69.7,435.7 L70.0,435.7 L70.0,435.6 L70.2,435.6 L70.4,435.6 L70.4,435.5 + L69.5,435.8 L69.5,435.7 L69.8,435.7 L70.0,435.7 L70.0,435.6 L70.2,435.6 L70.4,435.6 L70.4,435.5 L70.6,435.5 L70.8,435.5 L71.1,435.5 L71.1,435.4 L71.3,435.4 L71.5,435.4 L71.5,435.3 L71.7,435.3 L71.9,435.3 L72.1,435.3 L72.1,435.2 L72.4,435.2 L72.6,435.2 L72.6,435.1 L72.8,435.1 L73.0,435.1 L73.2,435.1 L73.2,435.0 L73.4,435.0 L73.7,435.0 L73.9,435.0 L73.9,434.9 L74.1,434.9 L74.3,434.9 @@ -129,17 +129,17 @@ L75.8,434.7 L76.0,434.7 L76.0,434.6 L76.3,434.6 L76.5,434.6 L76.7,434.6 L76.7,434.5 L76.9,434.5 L77.1,434.5 L77.3,434.5 L77.6,434.5 L77.6,434.4 L77.8,434.4 L78.0,434.4 L78.2,434.4 L78.4,434.4 L78.7,434.4 L78.7,434.3 L78.9,434.3 L79.1,434.3 L79.3,434.3 L79.5,434.3 L79.7,434.3 L79.7,434.2 - L80.0,434.2 L80.2,434.2 L80.2,426.7 L80.4,426.7 L80.4,419.3 L80.6,419.3 L80.6,412.0 L80.8,412.0 + L80.0,434.2 L80.2,434.2 L80.2,426.7 L80.4,426.7 L80.4,419.2 L80.6,419.2 L80.6,412.0 L80.8,412.0 L80.8,404.8 L81.0,404.8 L81.0,397.8 L81.3,397.8 L81.3,390.9 L81.5,390.9 L81.5,384.1 L81.7,384.1 - L81.7,377.5 L81.9,377.5 L81.9,370.9 L82.1,370.9 L82.1,364.5 L82.3,364.5 L82.3,358.2 L82.6,358.2 - L82.6,352.0 L82.8,352.0 L82.8,346.0 L83.0,346.0 L83.0,340.0 L83.2,340.0 L83.2,334.2 L83.4,334.2 + L81.7,377.4 L81.9,377.4 L81.9,370.9 L82.1,370.9 L82.1,364.5 L82.3,364.5 L82.3,358.2 L82.6,358.2 + L82.6,352.0 L82.8,352.0 L82.8,346.0 L83.0,346.0 L83.0,340.0 L83.2,340.0 L83.2,334.1 L83.4,334.1 L83.4,328.4 L83.6,328.4 L83.6,322.8 L83.9,322.8 L83.9,317.2 L84.1,317.2 L84.1,311.8 L84.3,311.8 L84.3,306.4 L84.5,306.4 L84.5,301.2 L84.7,301.2 L84.7,296.0 L84.9,296.0 L84.9,291.0 L85.2,291.0 - L85.2,286.0 L85.4,286.0 L85.4,281.2 L85.6,281.2 L85.6,276.4 L85.8,276.4 L85.8,271.7 L86.0,271.7 + L85.2,286.0 L85.4,286.0 L85.4,281.1 L85.6,281.1 L85.6,276.4 L85.8,276.4 L85.8,271.7 L86.0,271.7 L86.0,267.0 L86.3,267.0 L86.3,262.5 L86.5,262.5 L86.5,258.1 L86.7,258.1 L86.7,253.7 L86.9,253.7 - L86.9,249.4 L87.1,249.4 L87.1,245.2 L87.3,245.2 L87.3,241.1 L87.6,241.1 L87.6,237.0 L87.8,237.0 + L86.9,249.4 L87.1,249.4 L87.1,245.2 L87.3,245.2 L87.3,241.0 L87.6,241.0 L87.6,237.0 L87.8,237.0 L87.8,233.0 L88.0,233.0 L88.0,229.1 L88.2,229.1 L88.2,225.2 L88.4,225.2 L88.4,221.5 L88.6,221.5 - L88.6,217.8 L88.9,217.8 L88.9,214.1 L89.1,214.1 L89.1,210.6 L89.3,210.6 L89.3,207.0 L89.5,207.0 + L88.6,217.8 L88.9,217.8 L88.9,214.1 L89.1,214.1 L89.1,210.5 L89.3,210.5 L89.3,207.0 L89.5,207.0 L89.5,203.6 L89.7,203.6 L89.7,200.2 L89.9,200.2 L89.9,196.9 L90.2,196.9 L90.2,193.6 L90.4,193.6 L90.4,190.4 L90.6,190.4 L90.6,187.3 L90.8,187.3 L90.8,184.2 L91.0,184.2 L91.0,181.2 L91.2,181.2 L91.2,178.2 L91.5,178.2 L91.5,175.3 L91.7,175.3 L91.7,172.4 L91.9,172.4 L91.9,169.6 L92.1,169.6 @@ -149,569 +149,1021 @@ L94.7,137.3 L94.9,137.3 L94.9,135.1 L95.2,135.1 L95.2,132.9 L95.4,132.9 L95.4,130.8 L95.6,130.8 L95.6,128.8 L95.8,128.8 L95.8,126.7 L96.0,126.7 L96.0,124.7 L96.2,124.7 L96.2,122.8 L96.5,122.8 L96.5,120.9 L96.7,120.9 L96.7,119.0 L96.9,119.0 L96.9,117.1 L97.1,117.1 L97.1,115.3 L97.3,115.3 - L97.3,113.5 L97.5,113.5 L97.5,111.8 L97.8,111.8 L97.8,110.1 L98.0,110.1 L98.0,108.4 L98.2,108.4 + L97.3,113.5 L97.5,113.5 L97.5,111.8 L97.8,111.8 L97.8,110.0 L98.0,110.0 L98.0,108.4 L98.2,108.4 L98.2,106.7 L98.4,106.7 L98.4,105.1 L98.6,105.1 L98.6,103.5 L98.8,103.5 L98.8,101.9 L99.1,101.9 L99.1,100.4 L99.3,100.4 L99.3,98.8 L99.5,98.8 L99.5,97.4 L99.7,97.4 L99.7,95.9 L99.9,95.9 L99.9,94.5 L100.1,94.5 L100.1,93.1 L100.4,93.1 L100.4,91.7 L100.6,91.7 L100.6,90.3 L100.8,90.3 - L100.8,89.0 L101.0,89.0 L101.0,87.7 L101.2,87.7 L101.2,86.4 L101.4,86.4 L101.4,85.1 L101.7,85.1 + L100.8,89.0 L101.0,89.0 L101.0,87.7 L101.2,87.7 L101.2,86.4 L101.5,86.4 L101.5,85.1 L101.7,85.1 L101.7,83.9 L101.9,83.9 L101.9,82.7 L102.1,82.7 L102.1,81.5 L102.3,81.5 L102.3,80.3 L102.5,80.3 L102.5,79.2 L102.8,79.2 L102.8,78.0 L103.0,78.0 L103.0,76.9 L103.2,76.9 L103.2,75.8 L103.4,75.8 L103.4,74.8 L103.6,74.8 L103.6,73.7 L103.8,73.7 L103.8,72.7 L104.1,72.7 L104.1,71.7 L104.3,71.7 L104.3,70.7 L104.5,70.7 L104.5,69.7 L104.7,69.7 L104.7,68.7 L104.9,68.7 L104.9,67.8 L105.1,67.8 - L105.1,66.9 L105.4,66.9 L105.4,66.0 L105.6,66.0 L105.6,65.1 L105.8,65.1 L105.8,64.2 L106.0,64.2 - L106.0,63.3 L106.2,63.3 L106.2,70.8 L106.4,70.8 L106.4,78.2 L106.7,78.2 L106.7,85.5 L106.9,85.5 + L105.1,66.9 L105.4,66.9 L105.4,65.9 L105.6,65.9 L105.6,65.1 L105.8,65.1 L105.8,64.2 L106.0,64.2 + L106.0,63.3 L106.2,63.3 L106.2,70.9 L106.4,70.9 L106.4,78.2 L106.7,78.2 L106.7,85.5 L106.9,85.5 L106.9,92.6 L107.1,92.6 L107.1,99.5 L107.3,99.5 L107.3,106.3 L107.5,106.3 L107.5,113.0 L107.7,113.0 L107.7,119.5 L108.0,119.5 L108.0,125.9 L108.2,125.9 L108.2,132.2 L108.4,132.2 L108.4,138.3 L108.6,138.3 - L108.6,144.3 L108.8,144.3 L108.8,150.2 L109.0,150.2 L109.0,156.0 L109.3,156.0 L109.3,161.6 L109.5,161.6 + L108.6,144.3 L108.8,144.3 L108.8,150.2 L109.0,150.2 L109.0,156.0 L109.3,156.0 L109.3,161.7 L109.5,161.7 L109.5,167.2 L109.7,167.2 L109.7,172.6 L109.9,172.6 L109.9,177.9 L110.1,177.9 L110.1,183.1 L110.4,183.1 L110.4,188.2 L110.6,188.2 L110.6,193.2 L110.8,193.2 L110.8,198.1 L111.0,198.1 L111.0,202.9 L111.2,202.9 - L111.2,207.6 L111.4,207.6 L111.4,212.2 L111.7,212.2 L111.7,216.7 L111.9,216.7 L111.9,221.1 L112.1,221.1 + L111.2,207.6 L111.4,207.6 L111.4,212.2 L111.7,212.2 L111.7,216.7 L111.9,216.7 L111.9,221.2 L112.1,221.2 L112.1,225.5 L112.3,225.5 L112.3,229.7 L112.5,229.7 L112.5,233.9 L112.7,233.9 L112.7,237.9 L113.0,237.9 L113.0,241.9 L113.2,241.9 L113.2,245.8 L113.4,245.8 L113.4,249.6 L113.6,249.6 L113.6,253.4 L113.8,253.4 - L113.8,257.0 L114.0,257.0 L114.0,260.6 L114.3,260.6 L114.3,264.2 L114.5,264.2 L114.5,267.6 L114.7,267.6 + L113.8,257.1 L114.0,257.1 L114.0,260.7 L114.3,260.7 L114.3,264.2 L114.5,264.2 L114.5,267.6 L114.7,267.6 L114.7,271.0 L114.9,271.0 L114.9,274.3 L115.1,274.3 L115.1,277.5 L115.3,277.5 L115.3,280.7 L115.6,280.7 L115.6,283.8 L115.8,283.8 L115.8,286.9 L116.0,286.9 L116.0,289.9 L116.2,289.9 L116.2,292.8 L116.4,292.8 L116.4,295.7 L116.6,295.7 L116.6,298.5 L116.9,298.5 L116.9,301.2 L117.1,301.2 L117.1,303.9 L117.3,303.9 L117.3,306.5 L117.5,306.5 L117.5,309.1 L117.7,309.1 L117.7,311.7 L118.0,311.7 L118.0,314.1 L118.2,314.1 - L118.2,316.6 L118.4,316.6 L118.4,318.9 L118.6,318.9 L118.6,321.3 L118.8,321.3 L118.8,323.6 L119.0,323.6 + L118.2,316.6 L118.4,316.6 L118.4,319.0 L118.6,319.0 L118.6,321.3 L118.8,321.3 L118.8,323.6 L119.0,323.6 L119.0,325.8 L119.3,325.8 L119.3,328.0 L119.5,328.0 L119.5,330.1 L119.7,330.1 L119.7,332.2 L119.9,332.2 L119.9,334.3 L120.1,334.3 L120.1,336.3 L120.3,336.3 L120.3,338.3 L120.6,338.3 L120.6,340.2 L120.8,340.2 L120.8,342.1 L121.0,342.1 L121.0,344.0 L121.2,344.0 L121.2,345.8 L121.4,345.8 L121.4,347.6 L121.6,347.6 - L121.6,349.3 L121.9,349.3 L121.9,351.1 L122.1,351.1 L122.1,352.7 L122.3,352.7 L122.3,354.4 L122.5,354.4 + L121.6,349.4 L121.9,349.4 L121.9,351.1 L122.1,351.1 L122.1,352.7 L122.3,352.7 L122.3,354.4 L122.5,354.4 L122.5,356.0 L122.7,356.0 L122.7,357.6 L122.9,357.6 L122.9,359.1 L123.2,359.1 L123.2,360.6 L123.4,360.6 L123.4,362.1 L123.6,362.1 L123.6,363.6 L123.8,363.6 L123.8,365.0 L124.0,365.0 L124.0,366.4 L124.2,366.4 L124.2,367.7 L124.5,367.7 L124.5,369.1 L124.7,369.1 L124.7,370.4 L124.9,370.4 L124.9,371.7 L125.1,371.7 L125.1,372.9 L125.3,372.9 L125.3,374.2 L125.6,374.2 L125.6,375.4 L125.8,375.4 L125.8,376.5 L126.0,376.5 L126.0,377.7 L126.2,377.7 L126.2,378.8 L126.4,378.8 L126.4,379.9 L126.6,379.9 L126.6,381.0 L126.9,381.0 L126.9,382.1 L127.1,382.1 L127.1,383.1 L127.3,383.1 L127.3,384.2 L127.5,384.2 L127.5,385.2 L127.7,385.2 - L127.7,386.1 L127.9,386.1 L127.9,387.1 L128.2,387.1 L128.2,388.1 L128.4,388.1 L128.4,389.0 L128.6,389.0 + L127.7,386.2 L127.9,386.2 L127.9,387.1 L128.2,387.1 L128.2,388.1 L128.4,388.1 L128.4,389.0 L128.6,389.0 L128.6,389.9 L128.8,389.9 L128.8,390.8 L129.0,390.8 L129.0,391.6 L129.2,391.6 L129.2,392.5 L129.5,392.5 L129.5,393.3 L129.7,393.3 L129.7,394.1 L129.9,394.1 L129.9,394.9 L130.1,394.9 L130.1,395.7 L130.3,395.7 L130.3,396.5 L130.5,396.5 L130.5,397.2 L130.8,397.2 L130.8,398.0 L131.0,398.0 L131.0,398.7 L131.2,398.7 L131.2,399.4 L131.4,399.4 L131.4,400.1 L131.6,400.1 L131.6,400.8 L131.8,400.8 L131.8,401.4 L132.1,401.4 - L132.1,402.1 L132.3,402.1 L132.3,395.1 L132.5,395.1 L132.5,388.3 L132.7,388.3 L132.7,381.6 L132.9,381.6 - L132.9,375.0 L133.1,375.0 L133.1,368.5 L133.4,368.5 L133.4,362.1 L133.6,362.1 L133.6,355.9 L133.8,355.9 - L133.8,349.7 L134.0,349.7 L134.0,343.7 L134.2,343.7 L134.2,337.8 L134.5,337.8 L134.5,332.0 L134.7,332.0 + L132.1,402.1 L132.3,402.1 L132.3,395.1 L132.5,395.1 L132.5,388.3 L132.7,388.3 L132.7,381.5 L132.9,381.5 + L132.9,374.9 L133.2,374.9 L133.2,368.5 L133.4,368.5 L133.4,362.1 L133.6,362.1 L133.6,355.8 L133.8,355.8 + L133.8,349.7 L134.0,349.7 L134.0,343.7 L134.2,343.7 L134.2,337.7 L134.5,337.7 L134.5,331.9 L134.7,331.9 L134.7,326.2 L134.9,326.2 L134.9,320.6 L135.1,320.6 L135.1,315.1 L135.3,315.1 L135.3,309.7 L135.5,309.7 L135.5,304.4 L135.8,304.4 L135.8,299.2 L136.0,299.2 L136.0,294.1 L136.2,294.1 L136.2,289.1 L136.4,289.1 - L136.4,284.2 L136.6,284.2 L136.6,279.3 L136.8,279.3 L136.8,274.6 L137.1,274.6 L137.1,269.9 L137.3,269.9 - L137.3,265.3 L137.5,265.3 L137.5,260.8 L137.7,260.8 L137.7,256.4 L137.9,256.4 L137.9,252.1 L138.1,252.1 + L136.4,284.1 L136.6,284.1 L136.6,279.3 L136.8,279.3 L136.8,274.5 L137.1,274.5 L137.1,269.9 L137.3,269.9 + L137.3,265.3 L137.5,265.3 L137.5,260.8 L137.7,260.8 L137.7,256.4 L137.9,256.4 L137.9,252.0 L138.1,252.0 L138.1,247.8 L138.4,247.8 L138.4,243.6 L138.6,243.6 L138.6,239.5 L138.8,239.5 L138.8,235.5 L139.0,235.5 - L139.0,231.5 L139.2,231.5 L139.2,227.6 L139.4,227.6 L139.4,223.8 L139.7,223.8 L139.7,220.1 L139.9,220.1 - L139.9,216.4 L140.1,216.4 L140.1,212.8 L140.3,212.8 L140.3,209.2 L140.5,209.2 L140.5,205.7 L140.7,205.7 + L139.0,231.5 L139.2,231.5 L139.2,227.6 L139.4,227.6 L139.4,223.8 L139.7,223.8 L139.7,220.0 L139.9,220.0 + L139.9,216.4 L140.1,216.4 L140.1,212.7 L140.3,212.7 L140.3,209.2 L140.5,209.2 L140.5,205.7 L140.7,205.7 L140.7,202.3 L141.0,202.3 L141.0,198.9 L141.2,198.9 L141.2,195.6 L141.4,195.6 L141.4,192.4 L141.6,192.4 L141.6,189.2 L141.8,189.2 L141.8,186.1 L142.1,186.1 L142.1,183.0 L142.3,183.0 L142.3,180.0 L142.5,180.0 L142.5,177.1 L142.7,177.1 L142.7,174.2 L142.9,174.2 L142.9,171.3 L143.1,171.3 L143.1,168.5 L143.4,168.5 L143.4,165.8 L143.6,165.8 L143.6,163.1 L143.8,163.1 L143.8,160.4 L144.0,160.4 L144.0,157.8 L144.2,157.8 - L144.2,155.3 L144.4,155.3 L144.4,152.8 L144.7,152.8 L144.7,150.3 L144.9,150.3 L144.9,147.9 L145.1,147.9 + L144.2,155.3 L144.4,155.3 L144.4,152.7 L144.7,152.7 L144.7,150.3 L144.9,150.3 L144.9,147.9 L145.1,147.9 L145.1,145.5 L145.3,145.5 L145.3,143.2 L145.5,143.2 L145.5,140.9 L145.7,140.9 L145.7,138.6 L146.0,138.6 - L146.0,136.4 L146.2,136.4 L146.2,134.3 L146.4,134.3 L146.4,132.1 L146.6,132.1 L146.6,130.0 L146.8,130.0 + L146.0,136.4 L146.2,136.4 L146.2,134.2 L146.4,134.2 L146.4,132.1 L146.6,132.1 L146.6,130.0 L146.8,130.0 L146.8,128.0 L147.0,128.0 L147.0,126.0 L147.3,126.0 L147.3,124.0 L147.5,124.0 L147.5,122.0 L147.7,122.0 L147.7,120.1 L147.9,120.1 L147.9,118.3 L148.1,118.3 L148.1,116.4 L148.3,116.4 L148.3,114.6 L148.6,114.6 - L148.6,112.9 L148.8,112.9 L148.8,111.1 L149.0,111.1 L149.0,109.4 L149.2,109.4 L149.2,107.7 L149.4,107.7 + L148.6,112.8 L148.8,112.8 L148.8,111.1 L149.0,111.1 L149.0,109.4 L149.2,109.4 L149.2,107.7 L149.4,107.7 L149.4,106.1 L149.7,106.1 L149.7,104.5 L149.9,104.5 L149.9,102.9 L150.1,102.9 L150.1,101.3 L150.3,101.3 L150.3,99.8 L150.5,99.8 L150.5,98.3 L150.7,98.3 L150.7,96.8 L151.0,96.8 L151.0,95.3 L151.2,95.3 - L151.2,93.9 L151.4,93.9 L151.4,92.5 L151.6,92.5 L151.6,91.2 L151.8,91.2 L151.8,89.8 L152.0,89.8 - L152.0,88.5 L152.3,88.5 L152.3,87.2 L152.5,87.2 L152.5,85.9 L152.7,85.9 L152.7,84.7 L152.9,84.7 + L151.2,93.9 L151.4,93.9 L151.4,92.5 L151.6,92.5 L151.6,91.1 L151.8,91.1 L151.8,89.8 L152.0,89.8 + L152.0,88.5 L152.3,88.5 L152.3,87.2 L152.5,87.2 L152.5,85.9 L152.7,85.9 L152.7,84.6 L152.9,84.6 L152.9,83.4 L153.1,83.4 L153.1,82.2 L153.3,82.2 L153.3,81.0 L153.6,81.0 L153.6,79.9 L153.8,79.9 L153.8,78.7 L154.0,78.7 L154.0,77.6 L154.2,77.6 L154.2,76.5 L154.4,76.5 L154.4,75.4 L154.6,75.4 - L154.6,74.4 L154.9,74.4 L154.9,73.3 L155.1,73.3 L155.1,72.3 L155.3,72.3 L155.3,71.3 L155.5,71.3 + L154.6,74.3 L154.9,74.3 L154.9,73.3 L155.1,73.3 L155.1,72.3 L155.3,72.3 L155.3,71.3 L155.5,71.3 L155.5,70.3 L155.7,70.3 L155.7,69.3 L155.9,69.3 L155.9,68.4 L156.2,68.4 L156.2,67.4 L156.4,67.4 - L156.4,66.5 L156.6,66.5 L156.6,65.6 L156.8,65.6 L156.8,64.7 L157.0,64.7 L157.0,63.9 L157.2,63.9 - L157.2,63.0 L157.5,63.0 L157.5,62.2 L157.7,62.2 L157.7,61.3 L157.9,61.3 L157.9,60.5 L158.1,60.5 + L156.4,66.5 L156.6,66.5 L156.6,65.6 L156.8,65.6 L156.8,64.7 L157.0,64.7 L157.0,63.9 L157.3,63.9 + L157.3,63.0 L157.5,63.0 L157.5,62.2 L157.7,62.2 L157.7,61.3 L157.9,61.3 L157.9,60.5 L158.1,60.5 L158.1,59.7 L158.3,59.7 L158.3,67.3 L158.6,67.3 L158.6,74.8 L158.8,74.8 L158.8,82.1 L159.0,82.1 - L159.0,89.2 L159.2,89.2 L159.2,96.2 L159.4,96.2 L159.4,103.1 L159.6,103.1 L159.6,109.8 L159.9,109.8 - L159.9,116.4 L160.1,116.4 L160.1,122.9 L160.3,122.9 L160.3,129.2 L160.5,129.2 L160.5,135.4 L160.7,135.4 + L159.0,89.3 L159.2,89.3 L159.2,96.3 L159.4,96.3 L159.4,103.1 L159.6,103.1 L159.6,109.9 L159.9,109.9 + L159.9,116.5 L160.1,116.5 L160.1,122.9 L160.3,122.9 L160.3,129.3 L160.5,129.3 L160.5,135.5 L160.7,135.5 L160.7,141.5 L160.9,141.5 L160.9,147.5 L161.2,147.5 L161.2,153.3 L161.4,153.3 L161.4,159.0 L161.6,159.0 - L161.6,164.6 L161.8,164.6 L161.8,170.1 L162.0,170.1 L162.0,175.4 L162.2,175.4 L162.2,180.7 L162.5,180.7 - L162.5,185.8 L162.7,185.8 L162.7,190.9 L162.9,190.9 L162.9,195.8 L163.1,195.8 L163.1,200.7 L163.3,200.7 + L161.6,164.6 L161.8,164.6 L161.8,170.1 L162.0,170.1 L162.0,175.5 L162.2,175.5 L162.2,180.7 L162.5,180.7 + L162.5,185.9 L162.7,185.9 L162.7,190.9 L162.9,190.9 L162.9,195.8 L163.1,195.8 L163.1,200.7 L163.3,200.7 L163.3,205.4 L163.5,205.4 L163.5,210.1 L163.8,210.1 L163.8,214.6 L164.0,214.6 L164.0,219.1 L164.2,219.1 - L164.2,223.4 L164.4,223.4 L164.4,227.7 L164.6,227.7 L164.6,231.9 L164.8,231.9 L164.8,236.0 L165.1,236.0 - L165.1,240.0 L165.3,240.0 L165.3,244.0 L165.5,244.0 L165.5,247.8 L165.7,247.8 L165.7,251.6 L165.9,251.6 + L164.2,223.5 L164.4,223.5 L164.4,227.7 L164.6,227.7 L164.6,231.9 L164.9,231.9 L164.9,236.0 L165.1,236.0 + L165.1,240.1 L165.3,240.1 L165.3,244.0 L165.5,244.0 L165.5,247.9 L165.7,247.9 L165.7,251.6 L165.9,251.6 L165.9,255.3 L166.2,255.3 L166.2,259.0 L166.4,259.0 L166.4,262.5 L166.6,262.5 L166.6,266.0 L166.8,266.0 - L166.8,269.4 L167.0,269.4 L167.0,272.7 L167.2,272.7 L167.2,276.0 L167.5,276.0 L167.5,279.2 L167.7,279.2 - L167.7,282.4 L167.9,282.4 L167.9,285.4 L168.1,285.4 L168.1,288.5 L168.3,288.5 L168.3,291.4 L168.5,291.4 - L168.5,294.3 L168.8,294.3 L168.8,297.1 L169.0,297.1 L169.0,299.9 L169.2,299.9 L169.2,302.6 L169.4,302.6 + L166.8,269.4 L167.0,269.4 L167.0,272.8 L167.2,272.8 L167.2,276.0 L167.5,276.0 L167.5,279.2 L167.7,279.2 + L167.7,282.4 L167.9,282.4 L167.9,285.5 L168.1,285.5 L168.1,288.5 L168.3,288.5 L168.3,291.4 L168.5,291.4 + L168.5,294.3 L168.8,294.3 L168.8,297.2 L169.0,297.2 L169.0,299.9 L169.2,299.9 L169.2,302.6 L169.4,302.6 L169.4,305.3 L169.6,305.3 L169.6,307.9 L169.8,307.9 L169.8,310.5 L170.1,310.5 L170.1,313.0 L170.3,313.0 L170.3,315.4 L170.5,315.4 L170.5,317.8 L170.7,317.8 L170.7,320.2 L170.9,320.2 L170.9,322.5 L171.1,322.5 - L171.1,324.7 L171.4,324.7 L171.4,327.0 L171.6,327.0 L171.6,329.1 L171.8,329.1 L171.8,331.3 L172.0,331.3 - L172.0,333.3 L172.2,333.3 L172.2,335.4 L172.4,335.4 L172.4,337.4 L172.7,337.4 L172.7,339.3 L172.9,339.3 - L172.9,341.2 L173.1,341.2 L173.1,343.1 L173.3,343.1 L173.3,345.0 L173.5,345.0 L173.5,346.8 L173.8,346.8 - L173.8,348.5 L174.0,348.5 L174.0,350.3 L174.2,350.3 L174.2,351.9 L174.4,351.9 L174.4,353.6 L174.6,353.6 + L171.1,324.8 L171.4,324.8 L171.4,327.0 L171.6,327.0 L171.6,329.1 L171.8,329.1 L171.8,331.3 L172.0,331.3 + L172.0,333.3 L172.2,333.3 L172.2,335.4 L172.5,335.4 L172.5,337.4 L172.7,337.4 L172.7,339.3 L172.9,339.3 + L172.9,341.3 L173.1,341.3 L173.1,343.1 L173.3,343.1 L173.3,345.0 L173.5,345.0 L173.5,346.8 L173.8,346.8 + L173.8,348.5 L174.0,348.5 L174.0,350.3 L174.2,350.3 L174.2,352.0 L174.4,352.0 L174.4,353.6 L174.6,353.6 L174.6,355.2 L174.8,355.2 L174.8,356.8 L175.1,356.8 L175.1,358.4 L175.3,358.4 L175.3,359.9 L175.5,359.9 L175.5,361.4 L175.7,361.4 L175.7,362.9 L175.9,362.9 L175.9,364.3 L176.1,364.3 L176.1,365.7 L176.4,365.7 - L176.4,367.1 L176.6,367.1 L176.6,368.4 L176.8,368.4 L176.8,369.8 L177.0,369.8 L177.0,371.1 L177.2,371.1 + L176.4,367.1 L176.6,367.1 L176.6,368.5 L176.8,368.5 L176.8,369.8 L177.0,369.8 L177.0,371.1 L177.2,371.1 L177.2,372.3 L177.4,372.3 L177.4,373.6 L177.7,373.6 L177.7,374.8 L177.9,374.8 L177.9,376.0 L178.1,376.0 L178.1,377.2 L178.3,377.2 L178.3,378.3 L178.5,378.3 L178.5,379.4 L178.7,379.4 L178.7,380.5 L179.0,380.5 L179.0,381.6 L179.2,381.6 L179.2,382.7 L179.4,382.7 L179.4,383.7 L179.6,383.7 L179.6,384.7 L179.8,384.7 L179.8,385.7 L180.0,385.7 L180.0,386.7 L180.3,386.7 L180.3,387.6 L180.5,387.6 L180.5,388.5 L180.7,388.5 - L180.7,389.5 L180.9,389.5 L180.9,390.3 L181.1,390.3 L181.1,391.2 L181.4,391.2 L181.4,392.1 L181.6,392.1 - L181.6,392.9 L181.8,392.9 L181.8,393.7 L182.0,393.7 L182.0,394.6 L182.2,394.6 L182.2,395.3 L182.4,395.3 - L182.4,396.1 L182.7,396.1 L182.7,396.9 L182.9,396.9 L182.9,397.6 L183.1,397.6 L183.1,398.3 L183.3,398.3 + L180.7,389.5 L180.9,389.5 L180.9,390.4 L181.1,390.4 L181.1,391.2 L181.4,391.2 L181.4,392.1 L181.6,392.1 + L181.6,392.9 L181.8,392.9 L181.8,393.8 L182.0,393.8 L182.0,394.6 L182.2,394.6 L182.2,395.3 L182.4,395.3 + L182.4,396.1 L182.7,396.1 L182.7,396.9 L182.9,396.9 L182.9,397.6 L183.1,397.6 L183.1,398.4 L183.3,398.4 L183.3,399.1 L183.5,399.1 L183.5,399.8 L183.7,399.8 L183.7,400.4 L184.0,400.4 L184.0,401.1 L184.2,401.1 - L184.2,401.8 L184.4,401.8 L184.4,394.9 L184.6,394.9 L184.6,388.0 L184.8,388.0 L184.8,381.3 L185.0,381.3 - L185.0,374.7 L185.3,374.7 L185.3,368.2 L185.5,368.2 L185.5,361.9 L185.7,361.9 L185.7,355.6 L185.9,355.6 - L185.9,349.5 L186.1,349.5 L186.1,343.5 L186.3,343.5 L186.3,337.5 L186.6,337.5 L186.6,331.7 L186.8,331.7 + L184.2,401.8 L184.4,401.8 L184.4,394.8 L184.6,394.8 L184.6,388.0 L184.8,388.0 L184.8,381.3 L185.0,381.3 + L185.0,374.7 L185.3,374.7 L185.3,368.2 L185.5,368.2 L185.5,361.8 L185.7,361.8 L185.7,355.6 L185.9,355.6 + L185.9,349.4 L186.1,349.4 L186.1,343.4 L186.3,343.4 L186.3,337.5 L186.6,337.5 L186.6,331.7 L186.8,331.7 L186.8,326.0 L187.0,326.0 L187.0,320.4 L187.2,320.4 L187.2,314.9 L187.4,314.9 L187.4,309.5 L187.6,309.5 L187.6,304.2 L187.9,304.2 L187.9,299.0 L188.1,299.0 L188.1,293.9 L188.3,293.9 L188.3,288.9 L188.5,288.9 - L188.5,284.0 L188.7,284.0 L188.7,279.1 L188.9,279.1 L188.9,274.4 L189.2,274.4 L189.2,269.7 L189.4,269.7 + L188.5,283.9 L188.7,283.9 L188.7,279.1 L189.0,279.1 L189.0,274.4 L189.2,274.4 L189.2,269.7 L189.4,269.7 L189.4,265.1 L189.6,265.1 L189.6,260.6 L189.8,260.6 L189.8,256.2 L190.0,256.2 L190.0,251.9 L190.3,251.9 L190.3,247.6 L190.5,247.6 L190.5,243.4 L190.7,243.4 L190.7,239.3 L190.9,239.3 L190.9,235.3 L191.1,235.3 - L191.1,231.4 L191.3,231.4 L191.3,227.5 L191.6,227.5 L191.6,223.7 L191.8,223.7 L191.8,219.9 L192.0,219.9 + L191.1,231.3 L191.3,231.3 L191.3,227.4 L191.6,227.4 L191.6,223.6 L191.8,223.6 L191.8,219.9 L192.0,219.9 L192.0,216.2 L192.2,216.2 L192.2,212.6 L192.4,212.6 L192.4,209.1 L192.6,209.1 L192.6,205.6 L192.9,205.6 L192.9,202.2 L193.1,202.2 L193.1,198.8 L193.3,198.8 L193.3,195.5 L193.5,195.5 L193.5,192.3 L193.7,192.3 L193.7,189.1 L193.9,189.1 L193.9,186.0 L194.2,186.0 L194.2,182.9 L194.4,182.9 L194.4,179.9 L194.6,179.9 - L194.6,177.0 L194.8,177.0 L194.8,174.0 L195.0,174.0 L195.0,171.2 L195.2,171.2 L195.2,168.4 L195.5,168.4 - L195.5,165.7 L195.7,165.7 L195.7,163.0 L195.9,163.0 L195.9,160.3 L196.1,160.3 L196.1,157.7 L196.3,157.7 - L196.3,155.2 L196.5,155.2 L196.5,152.7 L196.8,152.7 L196.8,150.2 L197.0,150.2 L197.0,147.8 L197.2,147.8 + L194.6,176.9 L194.8,176.9 L194.8,174.0 L195.0,174.0 L195.0,171.2 L195.2,171.2 L195.2,168.4 L195.5,168.4 + L195.5,165.6 L195.7,165.6 L195.7,162.9 L195.9,162.9 L195.9,160.3 L196.1,160.3 L196.1,157.7 L196.3,157.7 + L196.3,155.1 L196.6,155.1 L196.6,152.6 L196.8,152.6 L196.8,150.2 L197.0,150.2 L197.0,147.8 L197.2,147.8 L197.2,145.4 L197.4,145.4 L197.4,143.1 L197.6,143.1 L197.6,140.8 L197.9,140.8 L197.9,138.5 L198.1,138.5 - L198.1,136.3 L198.3,136.3 L198.3,134.2 L198.5,134.2 L198.5,132.0 L198.7,132.0 L198.7,130.0 L198.9,130.0 + L198.1,136.3 L198.3,136.3 L198.3,134.2 L198.5,134.2 L198.5,132.0 L198.7,132.0 L198.7,129.9 L198.9,129.9 L198.9,127.9 L199.2,127.9 L199.2,125.9 L199.4,125.9 L199.4,123.9 L199.6,123.9 L199.6,122.0 L199.8,122.0 - L199.8,120.1 L200.0,120.1 L200.0,118.2 L200.2,118.2 L200.2,116.4 L200.5,116.4 L200.5,114.6 L200.7,114.6 - L200.7,112.8 L200.9,112.8 L200.9,111.0 L201.1,111.0 L201.1,109.3 L201.3,109.3 L201.3,107.7 L201.5,107.7 + L199.8,120.1 L200.0,120.1 L200.0,118.2 L200.2,118.2 L200.2,116.3 L200.5,116.3 L200.5,114.5 L200.7,114.5 + L200.7,112.8 L200.9,112.8 L200.9,111.0 L201.1,111.0 L201.1,109.3 L201.3,109.3 L201.3,107.6 L201.5,107.6 L201.5,106.0 L201.8,106.0 L201.8,104.4 L202.0,104.4 L202.0,102.8 L202.2,102.8 L202.2,101.2 L202.4,101.2 L202.4,99.7 L202.6,99.7 L202.6,98.2 L202.8,98.2 L202.8,96.7 L203.1,96.7 L203.1,95.3 L203.3,95.3 - L203.3,93.9 L203.5,93.9 L203.5,92.5 L203.7,92.5 L203.7,91.1 L203.9,91.1 L203.9,89.8 L204.1,89.8 - L204.1,88.4 L204.4,88.4 L204.4,87.1 L204.6,87.1 L204.6,85.9 L204.8,85.9 L204.8,84.6 L205.0,84.6 + L203.3,93.9 L203.5,93.9 L203.5,92.5 L203.7,92.5 L203.7,91.1 L203.9,91.1 L203.9,89.7 L204.2,89.7 + L204.2,88.4 L204.4,88.4 L204.4,87.1 L204.6,87.1 L204.6,85.9 L204.8,85.9 L204.8,84.6 L205.0,84.6 L205.0,83.4 L205.2,83.4 L205.2,82.2 L205.5,82.2 L205.5,81.0 L205.7,81.0 L205.7,79.8 L205.9,79.8 - L205.9,78.7 L206.1,78.7 L206.1,77.6 L206.3,77.6 L206.3,76.5 L206.5,76.5 L206.5,75.4 L206.8,75.4 + L205.9,78.7 L206.1,78.7 L206.1,77.5 L206.3,77.5 L206.3,76.4 L206.5,76.4 L206.5,75.4 L206.8,75.4 L206.8,74.3 L207.0,74.3 L207.0,73.3 L207.2,73.3 L207.2,72.2 L207.4,72.2 L207.4,71.2 L207.6,71.2 - L207.6,70.3 L207.8,70.3 L207.8,69.3 L208.1,69.3 L208.1,68.3 L208.3,68.3 L208.3,67.4 L208.5,67.4 + L207.6,70.2 L207.8,70.2 L207.8,69.3 L208.1,69.3 L208.1,68.3 L208.3,68.3 L208.3,67.4 L208.5,67.4 L208.5,66.5 L208.7,66.5 L208.7,65.6 L208.9,65.6 L208.9,64.7 L209.1,64.7 L209.1,63.8 L209.4,63.8 L209.4,63.0 L209.6,63.0 L209.6,62.1 L209.8,62.1 L209.8,61.3 L210.0,61.3 L210.0,60.5 L210.2,60.5 - L210.2,59.7 L210.4,59.7 L210.4,67.2 L210.7,67.2 L210.7,74.7 L210.9,74.7 L210.9,82.0 L211.1,82.0 + L210.2,59.7 L210.4,59.7 L210.4,67.3 L210.7,67.3 L210.7,74.7 L210.9,74.7 L210.9,82.0 L211.1,82.0 L211.1,89.2 L211.3,89.2 L211.3,96.2 L211.5,96.2 L211.5,103.1 L211.7,103.1 L211.7,109.8 L212.0,109.8 - L212.0,116.4 L212.2,116.4 L212.2,122.8 L212.4,122.8 L212.4,129.2 L212.6,129.2 L212.6,135.4 L212.8,135.4 - L212.8,141.5 L213.1,141.5 L213.1,147.4 L213.3,147.4 L213.3,153.2 L213.5,153.2 L213.5,158.9 L213.7,158.9 - L213.7,164.5 L213.9,164.5 L213.9,170.0 L214.1,170.0 L214.1,175.4 L214.4,175.4 L214.4,180.6 L214.6,180.6 - L214.6,185.8 L214.8,185.8 L214.8,190.8 L215.0,190.8 L215.0,195.8 L215.2,195.8 L215.2,200.6 L215.4,200.6 - L215.4,205.4 L215.7,205.4 L215.7,210.0 L215.9,210.0 L215.9,214.6 L216.1,214.6 L216.1,219.0 L216.3,219.0 + L212.0,116.4 L212.2,116.4 L212.2,122.9 L212.4,122.9 L212.4,129.2 L212.6,129.2 L212.6,135.4 L212.8,135.4 + L212.8,141.5 L213.1,141.5 L213.1,147.4 L213.3,147.4 L213.3,153.3 L213.5,153.3 L213.5,159.0 L213.7,159.0 + L213.7,164.6 L213.9,164.6 L213.9,170.0 L214.1,170.0 L214.1,175.4 L214.4,175.4 L214.4,180.7 L214.6,180.7 + L214.6,185.8 L214.8,185.8 L214.8,190.9 L215.0,190.9 L215.0,195.8 L215.2,195.8 L215.2,200.7 L215.4,200.7 + L215.4,205.4 L215.7,205.4 L215.7,210.0 L215.9,210.0 L215.9,214.6 L216.1,214.6 L216.1,219.1 L216.3,219.1 L216.3,223.4 L216.5,223.4 L216.5,227.7 L216.7,227.7 L216.7,231.9 L217.0,231.9 L217.0,236.0 L217.2,236.0 - L217.2,240.0 L217.4,240.0 L217.4,243.9 L217.6,243.9 L217.6,247.8 L217.8,247.8 L217.8,251.6 L218.0,251.6 + L217.2,240.0 L217.4,240.0 L217.4,244.0 L217.6,244.0 L217.6,247.8 L217.8,247.8 L217.8,251.6 L218.0,251.6 L218.0,255.3 L218.3,255.3 L218.3,258.9 L218.5,258.9 L218.5,262.5 L218.7,262.5 L218.7,266.0 L218.9,266.0 L218.9,269.4 L219.1,269.4 L219.1,272.7 L219.3,272.7 L219.3,276.0 L219.6,276.0 L219.6,279.2 L219.8,279.2 - L219.8,282.3 L220.0,282.3 L220.0,285.4 L220.2,285.4 L220.2,288.4 L220.4,288.4 L220.4,291.4 L220.6,291.4 - L220.6,294.3 L220.9,294.3 L220.9,297.1 L221.1,297.1 L221.1,299.9 L221.3,299.9 L221.3,302.6 L221.5,302.6 - L221.5,305.3 L221.7,305.3 L221.7,307.9 L222.0,307.9 L222.0,310.4 L222.2,310.4 L222.2,313.0 L222.4,313.0 + L219.8,282.4 L220.0,282.4 L220.0,285.4 L220.2,285.4 L220.2,288.5 L220.4,288.5 L220.4,291.4 L220.7,291.4 + L220.7,294.3 L220.9,294.3 L220.9,297.1 L221.1,297.1 L221.1,299.9 L221.3,299.9 L221.3,302.6 L221.5,302.6 + L221.5,305.3 L221.7,305.3 L221.7,307.9 L222.0,307.9 L222.0,310.5 L222.2,310.5 L222.2,313.0 L222.4,313.0 L222.4,315.4 L222.6,315.4 L222.6,317.8 L222.8,317.8 L222.8,320.2 L223.0,320.2 L223.0,322.5 L223.3,322.5 - L223.3,324.7 L223.5,324.7 L223.5,326.9 L223.7,326.9 L223.7,329.1 L223.9,329.1 L223.9,331.2 L224.1,331.2 + L223.3,324.7 L223.5,324.7 L223.5,327.0 L223.7,327.0 L223.7,329.1 L223.9,329.1 L223.9,331.3 L224.1,331.3 L224.1,333.3 L224.3,333.3 L224.3,335.4 L224.6,335.4 L224.6,337.4 L224.8,337.4 L224.8,339.3 L225.0,339.3 - L225.0,341.2 L225.2,341.2 L225.2,343.1 L225.4,343.1 L225.4,344.9 L225.6,344.9 L225.6,346.7 L225.9,346.7 - L225.9,348.5 L226.1,348.5 L226.1,350.2 L226.3,350.2 L226.3,351.9 L226.5,351.9 L226.5,353.6 L226.7,353.6 + L225.0,341.2 L225.2,341.2 L225.2,343.1 L225.4,343.1 L225.4,345.0 L225.6,345.0 L225.6,346.8 L225.9,346.8 + L225.9,348.5 L226.1,348.5 L226.1,350.3 L226.3,350.3 L226.3,351.9 L226.5,351.9 L226.5,353.6 L226.7,353.6 L226.7,355.2 L226.9,355.2 L226.9,356.8 L227.2,356.8 L227.2,358.4 L227.4,358.4 L227.4,359.9 L227.6,359.9 - L227.6,361.4 L227.8,361.4 L227.8,362.9 L228.0,362.9 L228.0,364.3 L228.2,364.3 L228.2,365.7 L228.5,365.7 + L227.6,361.4 L227.8,361.4 L227.8,362.9 L228.0,362.9 L228.0,364.3 L228.3,364.3 L228.3,365.7 L228.5,365.7 L228.5,367.1 L228.7,367.1 L228.7,368.4 L228.9,368.4 L228.9,369.8 L229.1,369.8 L229.1,371.1 L229.3,371.1 L229.3,372.3 L229.6,372.3 L229.6,373.6 L229.8,373.6 L229.8,374.8 L230.0,374.8 L230.0,376.0 L230.2,376.0 - L230.2,377.1 L230.4,377.1 L230.4,378.3 L230.6,378.3 L230.6,379.4 L230.9,379.4 L230.9,380.5 L231.1,380.5 - L231.1,381.6 L231.3,381.6 L231.3,382.6 L231.5,382.6 L231.5,383.7 L231.7,383.7 L231.7,384.7 L231.9,384.7 + L230.2,377.2 L230.4,377.2 L230.4,378.3 L230.6,378.3 L230.6,379.4 L230.9,379.4 L230.9,380.5 L231.1,380.5 + L231.1,381.6 L231.3,381.6 L231.3,382.7 L231.5,382.7 L231.5,383.7 L231.7,383.7 L231.7,384.7 L231.9,384.7 L231.9,385.7 L232.2,385.7 L232.2,386.7 L232.4,386.7 L232.4,387.6 L232.6,387.6 L232.6,388.5 L232.8,388.5 - L232.8,389.4 L233.0,389.4 L233.0,390.3 L233.2,390.3 L233.2,391.2 L233.5,391.2 L233.5,392.1 L233.7,392.1 - L233.7,392.9 L233.9,392.9 L233.9,393.7 L234.1,393.7 L234.1,394.5 L234.3,394.5 L234.3,395.3 L234.5,395.3 + L232.8,389.5 L233.0,389.5 L233.0,390.3 L233.2,390.3 L233.2,391.2 L233.5,391.2 L233.5,392.1 L233.7,392.1 + L233.7,392.9 L233.9,392.9 L233.9,393.7 L234.1,393.7 L234.1,394.6 L234.3,394.6 L234.3,395.3 L234.5,395.3 L234.5,396.1 L234.8,396.1 L234.8,396.9 L235.0,396.9 L235.0,397.6 L235.2,397.6 L235.2,398.3 L235.4,398.3 - L235.4,399.1 L235.6,399.1 L235.6,399.8 L235.8,399.8 L235.8,400.4 L236.1,400.4 L236.1,401.1 L236.3,401.1 - L236.3,401.8 L236.5,401.8 L236.5,394.9 L236.7,394.9 L236.7,388.1 L236.9,388.1 L236.9,381.3 L237.2,381.3 - L237.2,374.7 L237.4,374.7 L237.4,368.2 L237.6,368.2 L237.6,361.9 L237.8,361.9 L237.8,355.6 L238.0,355.6 - L238.0,349.5 L238.2,349.5 L238.2,343.5 L238.5,343.5 L238.5,337.6 L238.7,337.6 L238.7,331.7 L238.9,331.7 + L235.4,399.1 L235.6,399.1 L235.6,399.8 L235.9,399.8 L235.9,400.4 L236.1,400.4 L236.1,401.1 L236.3,401.1 + L236.3,401.8 L236.5,401.8 L236.5,394.9 L236.7,394.9 L236.7,388.0 L236.9,388.0 L236.9,381.3 L237.2,381.3 + L237.2,374.7 L237.4,374.7 L237.4,368.2 L237.6,368.2 L237.6,361.8 L237.8,361.8 L237.8,355.6 L238.0,355.6 + L238.0,349.5 L238.2,349.5 L238.2,343.4 L238.5,343.4 L238.5,337.5 L238.7,337.5 L238.7,331.7 L238.9,331.7 L238.9,326.0 L239.1,326.0 L239.1,320.4 L239.3,320.4 L239.3,314.9 L239.5,314.9 L239.5,309.5 L239.8,309.5 L239.8,304.2 L240.0,304.2 L240.0,299.0 L240.2,299.0 L240.2,293.9 L240.4,293.9 L240.4,288.9 L240.6,288.9 L240.6,284.0 L240.8,284.0 L240.8,279.1 L241.1,279.1 L241.1,274.4 L241.3,274.4 L241.3,269.7 L241.5,269.7 - L241.5,265.1 L241.7,265.1 L241.7,260.7 L241.9,260.7 L241.9,256.2 L242.1,256.2 L242.1,251.9 L242.4,251.9 - L242.4,247.6 L242.6,247.6 L242.6,243.5 L242.8,243.5 L242.8,239.4 L243.0,239.4 L243.0,235.3 L243.2,235.3 - L243.2,231.4 L243.4,231.4 L243.4,227.5 L243.7,227.5 L243.7,223.7 L243.9,223.7 L243.9,219.9 L244.1,219.9 - L244.1,216.2 L244.3,216.2 L244.3,212.6 L244.5,212.6 L244.5,209.1 L244.7,209.1 L244.7,205.6 L245.0,205.6 + L241.5,265.1 L241.7,265.1 L241.7,260.6 L241.9,260.6 L241.9,256.2 L242.1,256.2 L242.1,251.9 L242.4,251.9 + L242.4,247.6 L242.6,247.6 L242.6,243.4 L242.8,243.4 L242.8,239.3 L243.0,239.3 L243.0,235.3 L243.2,235.3 + L243.2,231.3 L243.4,231.3 L243.4,227.5 L243.7,227.5 L243.7,223.6 L243.9,223.6 L243.9,219.9 L244.1,219.9 + L244.1,216.2 L244.3,216.2 L244.3,212.6 L244.5,212.6 L244.5,209.1 L244.8,209.1 L244.8,205.6 L245.0,205.6 L245.0,202.2 L245.2,202.2 L245.2,198.8 L245.4,198.8 L245.4,195.5 L245.6,195.5 L245.6,192.3 L245.8,192.3 L245.8,189.1 L246.1,189.1 L246.1,186.0 L246.3,186.0 L246.3,182.9 L246.5,182.9 L246.5,179.9 L246.7,179.9 - L246.7,177.0 L246.9,177.0 L246.9,174.1 L247.1,174.1 L247.1,171.2 L247.4,171.2 L247.4,168.4 L247.6,168.4 - L247.6,165.7 L247.8,165.7 L247.8,163.0 L248.0,163.0 L248.0,160.3 L248.2,160.3 L248.2,157.7 L248.4,157.7 - L248.4,155.2 L248.7,155.2 L248.7,152.7 L248.9,152.7 L248.9,150.2 L249.1,150.2 L249.1,147.8 L249.3,147.8 + L246.7,176.9 L246.9,176.9 L246.9,174.0 L247.1,174.0 L247.1,171.2 L247.4,171.2 L247.4,168.4 L247.6,168.4 + L247.6,165.6 L247.8,165.6 L247.8,163.0 L248.0,163.0 L248.0,160.3 L248.2,160.3 L248.2,157.7 L248.4,157.7 + L248.4,155.2 L248.7,155.2 L248.7,152.6 L248.9,152.6 L248.9,150.2 L249.1,150.2 L249.1,147.8 L249.3,147.8 L249.3,145.4 L249.5,145.4 L249.5,143.1 L249.7,143.1 L249.7,140.8 L250.0,140.8 L250.0,138.5 L250.2,138.5 - L250.2,136.3 L250.4,136.3 L250.4,134.2 L250.6,134.2 L250.6,132.0 L250.8,132.0 L250.8,130.0 L251.0,130.0 + L250.2,136.3 L250.4,136.3 L250.4,134.2 L250.6,134.2 L250.6,132.0 L250.8,132.0 L250.8,129.9 L251.0,129.9 L251.0,127.9 L251.3,127.9 L251.3,125.9 L251.5,125.9 L251.5,123.9 L251.7,123.9 L251.7,122.0 L251.9,122.0 - L251.9,120.1 L252.1,120.1 L252.1,118.2 L252.3,118.2 L252.3,116.4 L252.6,116.4 L252.6,114.6 L252.8,114.6 - L252.8,112.8 L253.0,112.8 L253.0,111.1 L253.2,111.1 L253.2,109.3 L253.4,109.3 L253.4,107.7 L253.7,107.7 - L253.7,106.0 L253.9,106.0 L253.9,104.4 L254.1,104.4 L254.1,102.8 L254.3,102.8 L254.3,101.3 L254.5,101.3 + L251.9,120.1 L252.1,120.1 L252.1,118.2 L252.4,118.2 L252.4,116.4 L252.6,116.4 L252.6,114.5 L252.8,114.5 + L252.8,112.8 L253.0,112.8 L253.0,111.0 L253.2,111.0 L253.2,109.3 L253.4,109.3 L253.4,107.7 L253.7,107.7 + L253.7,106.0 L253.9,106.0 L253.9,104.4 L254.1,104.4 L254.1,102.8 L254.3,102.8 L254.3,101.2 L254.5,101.2 L254.5,99.7 L254.7,99.7 L254.7,98.2 L255.0,98.2 L255.0,96.7 L255.2,96.7 L255.2,95.3 L255.4,95.3 - L255.4,93.9 L255.6,93.9 L255.6,92.5 L255.8,92.5 L255.8,91.1 L256.0,91.1 L256.0,89.8 L256.3,89.8 + L255.4,93.9 L255.6,93.9 L255.6,92.5 L255.8,92.5 L255.8,91.1 L256.0,91.1 L256.0,89.7 L256.3,89.7 L256.3,88.4 L256.5,88.4 L256.5,87.1 L256.7,87.1 L256.7,85.9 L256.9,85.9 L256.9,84.6 L257.1,84.6 L257.1,83.4 L257.3,83.4 L257.3,82.2 L257.6,82.2 L257.6,81.0 L257.8,81.0 L257.8,79.8 L258.0,79.8 - L258.0,78.7 L258.2,78.7 L258.2,77.6 L258.4,77.6 L258.4,76.5 L258.6,76.5 L258.6,75.4 L258.9,75.4 + L258.0,78.7 L258.2,78.7 L258.2,77.6 L258.4,77.6 L258.4,76.4 L258.6,76.4 L258.6,75.4 L258.9,75.4 L258.9,74.3 L259.1,74.3 L259.1,73.3 L259.3,73.3 L259.3,72.2 L259.5,72.2 L259.5,71.2 L259.7,71.2 - L259.7,70.3 L259.9,70.3 L259.9,69.3 L260.2,69.3 L260.2,68.3 L260.4,68.3 L260.4,67.4 L260.6,67.4 + L259.7,70.2 L260.0,70.2 L260.0,69.3 L260.2,69.3 L260.2,68.3 L260.4,68.3 L260.4,67.4 L260.6,67.4 L260.6,66.5 L260.8,66.5 L260.8,65.6 L261.0,65.6 L261.0,64.7 L261.3,64.7 L261.3,63.8 L261.5,63.8 L261.5,63.0 L261.7,63.0 L261.7,62.1 L261.9,62.1 L261.9,61.3 L262.1,61.3 L262.1,60.5 L262.3,60.5 - L262.3,59.7 L262.6,59.7 L262.6,67.2 L262.8,67.2 L262.8,74.7 L263.0,74.7 L263.0,82.0 L263.2,82.0 - L263.2,89.1 L263.4,89.1 L263.4,96.2 L263.6,96.2 L263.6,103.0 L263.9,103.0 L263.9,109.8 L264.1,109.8 - L264.1,116.4 L264.3,116.4 L264.3,122.8 L264.5,122.8 L264.5,129.2 L264.7,129.2 L264.7,135.4 L264.9,135.4 - L264.9,141.4 L265.2,141.4 L265.2,147.4 L265.4,147.4 L265.4,153.2 L265.6,153.2 L265.6,158.9 L265.8,158.9 - L265.8,164.5 L266.0,164.5 L266.0,170.0 L266.2,170.0 L266.2,175.4 L266.5,175.4 L266.5,180.6 L266.7,180.6 - L266.7,185.8 L266.9,185.8 L266.9,190.8 L267.1,190.8 L267.1,195.8 L267.3,195.8 L267.3,200.6 L267.5,200.6 - L267.5,205.4 L267.8,205.4 L267.8,210.0 L268.0,210.0 L268.0,214.6 L268.2,214.6 L268.2,219.0 L268.4,219.0 + L262.3,59.7 L262.6,59.7 L262.6,67.3 L262.8,67.3 L262.8,74.7 L263.0,74.7 L263.0,82.0 L263.2,82.0 + L263.2,89.2 L263.4,89.2 L263.4,96.2 L263.6,96.2 L263.6,103.1 L263.9,103.1 L263.9,109.8 L264.1,109.8 + L264.1,116.4 L264.3,116.4 L264.3,122.9 L264.5,122.9 L264.5,129.2 L264.7,129.2 L264.7,135.4 L264.9,135.4 + L264.9,141.5 L265.2,141.5 L265.2,147.4 L265.4,147.4 L265.4,153.3 L265.6,153.3 L265.6,159.0 L265.8,159.0 + L265.8,164.6 L266.0,164.6 L266.0,170.0 L266.2,170.0 L266.2,175.4 L266.5,175.4 L266.5,180.7 L266.7,180.7 + L266.7,185.8 L266.9,185.8 L266.9,190.9 L267.1,190.9 L267.1,195.8 L267.3,195.8 L267.3,200.6 L267.6,200.6 + L267.6,205.4 L267.8,205.4 L267.8,210.0 L268.0,210.0 L268.0,214.6 L268.2,214.6 L268.2,219.0 L268.4,219.0 L268.4,223.4 L268.6,223.4 L268.6,227.7 L268.9,227.7 L268.9,231.9 L269.1,231.9 L269.1,236.0 L269.3,236.0 - L269.3,240.0 L269.5,240.0 L269.5,243.9 L269.7,243.9 L269.7,247.8 L269.9,247.8 L269.9,251.6 L270.2,251.6 - L270.2,255.3 L270.4,255.3 L270.4,258.9 L270.6,258.9 L270.6,262.5 L270.8,262.5 L270.8,265.9 L271.0,265.9 + L269.3,240.0 L269.5,240.0 L269.5,244.0 L269.7,244.0 L269.7,247.8 L269.9,247.8 L269.9,251.6 L270.2,251.6 + L270.2,255.3 L270.4,255.3 L270.4,258.9 L270.6,258.9 L270.6,262.5 L270.8,262.5 L270.8,266.0 L271.0,266.0 L271.0,269.4 L271.2,269.4 L271.2,272.7 L271.5,272.7 L271.5,276.0 L271.7,276.0 L271.7,279.2 L271.9,279.2 - L271.9,282.3 L272.1,282.3 L272.1,285.4 L272.3,285.4 L272.3,288.4 L272.5,288.4 L272.5,291.4 L272.8,291.4 + L271.9,282.4 L272.1,282.4 L272.1,285.4 L272.3,285.4 L272.3,288.4 L272.5,288.4 L272.5,291.4 L272.8,291.4 L272.8,294.3 L273.0,294.3 L273.0,297.1 L273.2,297.1 L273.2,299.9 L273.4,299.9 L273.4,302.6 L273.6,302.6 - L273.6,305.3 L273.8,305.3 L273.8,307.9 L274.1,307.9 L274.1,310.4 L274.3,310.4 L274.3,312.9 L274.5,312.9 - L274.5,315.4 L274.7,315.4 L274.7,317.8 L274.9,317.8 L274.9,320.2 L275.1,320.2 L275.1,322.5 L275.4,322.5 - L275.4,324.7 L275.6,324.7 L275.6,326.9 L275.8,326.9 L275.8,329.1 L276.0,329.1 L276.0,331.2 L276.2,331.2 - L276.2,333.3 L276.4,333.3 L276.4,335.3 L276.7,335.3 L276.7,337.3 L276.9,337.3 L276.9,339.3 L277.1,339.3 - L277.1,341.2 L277.3,341.2 L277.3,343.1 L277.5,343.1 L277.5,344.9 L277.8,344.9 L277.8,346.7 L278.0,346.7 + L273.6,305.3 L273.8,305.3 L273.8,307.9 L274.1,307.9 L274.1,310.5 L274.3,310.5 L274.3,313.0 L274.5,313.0 + L274.5,315.4 L274.7,315.4 L274.7,317.8 L274.9,317.8 L274.9,320.2 L275.2,320.2 L275.2,322.5 L275.4,322.5 + L275.4,324.7 L275.6,324.7 L275.6,327.0 L275.8,327.0 L275.8,329.1 L276.0,329.1 L276.0,331.2 L276.2,331.2 + L276.2,333.3 L276.5,333.3 L276.5,335.4 L276.7,335.4 L276.7,337.4 L276.9,337.4 L276.9,339.3 L277.1,339.3 + L277.1,341.2 L277.3,341.2 L277.3,343.1 L277.5,343.1 L277.5,345.0 L277.8,345.0 L277.8,346.8 L278.0,346.8 L278.0,348.5 L278.2,348.5 L278.2,350.2 L278.4,350.2 L278.4,351.9 L278.6,351.9 L278.6,353.6 L278.8,353.6 L278.8,355.2 L279.1,355.2 L279.1,356.8 L279.3,356.8 L279.3,358.4 L279.5,358.4 L279.5,359.9 L279.7,359.9 L279.7,361.4 L279.9,361.4 L279.9,362.9 L280.1,362.9 L280.1,364.3 L280.4,364.3 L280.4,365.7 L280.6,365.7 - L280.6,367.1 L280.8,367.1 L280.8,368.4 L281.0,368.4 L281.0,369.8 L281.2,369.8 L281.2,371.0 L281.4,371.0 + L280.6,367.1 L280.8,367.1 L280.8,368.4 L281.0,368.4 L281.0,369.8 L281.2,369.8 L281.2,371.1 L281.4,371.1 L281.4,372.3 L281.7,372.3 L281.7,373.6 L281.9,373.6 L281.9,374.8 L282.1,374.8 L282.1,376.0 L282.3,376.0 - L282.3,377.1 L282.5,377.1 L282.5,378.3 L282.7,378.3 L282.7,379.4 L283.0,379.4 L283.0,380.5 L283.2,380.5 - L283.2,381.6 L283.4,381.6 L283.4,382.6 L283.6,382.6 L283.6,383.7 L283.8,383.7 L283.8,384.7 L284.0,384.7 - L284.0,385.7 L284.3,385.7 L284.3,386.6 L284.5,386.6 L284.5,387.6 L284.7,387.6 L284.7,388.5 L284.9,388.5 - L284.9,389.4 L285.1,389.4 L285.1,390.3 L285.4,390.3 L285.4,391.2 L285.6,391.2 L285.6,392.1 L285.8,392.1 - L285.8,392.9 L286.0,392.9 L286.0,393.7 L286.2,393.7 L286.2,394.5 L286.4,394.5 L286.4,395.3 L286.7,395.3 + L282.3,377.2 L282.5,377.2 L282.5,378.3 L282.7,378.3 L282.7,379.4 L283.0,379.4 L283.0,380.5 L283.2,380.5 + L283.2,381.6 L283.4,381.6 L283.4,382.6 L283.6,382.6 L283.6,383.7 L283.8,383.7 L283.8,384.7 L284.1,384.7 + L284.1,385.7 L284.3,385.7 L284.3,386.7 L284.5,386.7 L284.5,387.6 L284.7,387.6 L284.7,388.5 L284.9,388.5 + L284.9,389.5 L285.1,389.5 L285.1,390.3 L285.4,390.3 L285.4,391.2 L285.6,391.2 L285.6,392.1 L285.8,392.1 + L285.8,392.9 L286.0,392.9 L286.0,393.7 L286.2,393.7 L286.2,394.6 L286.4,394.6 L286.4,395.3 L286.7,395.3 L286.7,396.1 L286.9,396.1 L286.9,396.9 L287.1,396.9 L287.1,397.6 L287.3,397.6 L287.3,398.3 L287.5,398.3 L287.5,399.1 L287.7,399.1 L287.7,399.8 L288.0,399.8 L288.0,400.4 L288.2,400.4 L288.2,401.1 L288.4,401.1 - L288.4,401.8 L288.6,401.8 L288.6,394.9 L288.8,394.9 L288.8,388.1 L289.0,388.1 L289.0,381.4 L289.3,381.4 - L289.3,374.8 L289.5,374.8 L289.5,368.3 L289.7,368.3 L289.7,361.9 L289.9,361.9 L289.9,355.7 L290.1,355.7 - L290.1,349.5 L290.3,349.5 L290.3,343.5 L290.6,343.5 L290.6,337.6 L290.8,337.6 L290.8,331.8 L291.0,331.8 - L291.0,326.1 L291.2,326.1 L291.2,320.5 L291.4,320.5 L291.4,315.0 L291.6,315.0 L291.6,309.6 L291.9,309.6 - L291.9,304.3 L292.1,304.3 L292.1,299.1 L292.3,299.1 L292.3,294.0 L292.5,294.0 L292.5,288.9 L292.7,288.9 - L292.7,284.0 L293.0,284.0 L293.0,279.2 L293.2,279.2 L293.2,274.4 L293.4,274.4 L293.4,269.7 L293.6,269.7 - L293.6,265.2 L293.8,265.2 L293.8,260.7 L294.0,260.7 L294.0,256.3 L294.3,256.3 L294.3,251.9 L294.5,251.9 - L294.5,247.7 L294.7,247.7 L294.7,243.5 L294.9,243.5 L294.9,239.4 L295.1,239.4 L295.1,235.3 L295.3,235.3 - L295.3,231.4 L295.6,231.4 L295.6,227.5 L295.8,227.5 L295.8,223.7 L296.0,223.7 L296.0,219.9 L296.2,219.9 - L296.2,216.3 L296.4,216.3 L296.4,212.6 L296.6,212.6 L296.6,209.1 L296.9,209.1 L296.9,205.6 L297.1,205.6 + L288.4,401.8 L288.6,401.8 L288.6,394.9 L288.8,394.9 L288.8,388.0 L289.0,388.0 L289.0,381.3 L289.3,381.3 + L289.3,374.7 L289.5,374.7 L289.5,368.2 L289.7,368.2 L289.7,361.9 L289.9,361.9 L289.9,355.6 L290.1,355.6 + L290.1,349.5 L290.3,349.5 L290.3,343.4 L290.6,343.4 L290.6,337.5 L290.8,337.5 L290.8,331.7 L291.0,331.7 + L291.0,326.0 L291.2,326.0 L291.2,320.4 L291.4,320.4 L291.4,314.9 L291.7,314.9 L291.7,309.5 L291.9,309.5 + L291.9,304.2 L292.1,304.2 L292.1,299.0 L292.3,299.0 L292.3,293.9 L292.5,293.9 L292.5,288.9 L292.7,288.9 + L292.7,284.0 L293.0,284.0 L293.0,279.1 L293.2,279.1 L293.2,274.4 L293.4,274.4 L293.4,269.7 L293.6,269.7 + L293.6,265.1 L293.8,265.1 L293.8,260.6 L294.0,260.6 L294.0,256.2 L294.3,256.2 L294.3,251.9 L294.5,251.9 + L294.5,247.6 L294.7,247.6 L294.7,243.4 L294.9,243.4 L294.9,239.3 L295.1,239.3 L295.1,235.3 L295.3,235.3 + L295.3,231.4 L295.6,231.4 L295.6,227.5 L295.8,227.5 L295.8,223.6 L296.0,223.6 L296.0,219.9 L296.2,219.9 + L296.2,216.2 L296.4,216.2 L296.4,212.6 L296.6,212.6 L296.6,209.1 L296.9,209.1 L296.9,205.6 L297.1,205.6 L297.1,202.2 L297.3,202.2 L297.3,198.8 L297.5,198.8 L297.5,195.5 L297.7,195.5 L297.7,192.3 L297.9,192.3 L297.9,189.1 L298.2,189.1 L298.2,186.0 L298.4,186.0 L298.4,182.9 L298.6,182.9 L298.6,179.9 L298.8,179.9 - L298.8,177.0 L299.0,177.0 L299.0,174.1 L299.2,174.1 L299.2,171.2 L299.5,171.2 L299.5,168.4 L299.7,168.4 + L298.8,176.9 L299.0,176.9 L299.0,174.0 L299.3,174.0 L299.3,171.2 L299.5,171.2 L299.5,168.4 L299.7,168.4 L299.7,165.7 L299.9,165.7 L299.9,163.0 L300.1,163.0 L300.1,160.3 L300.3,160.3 L300.3,157.7 L300.6,157.7 L300.6,155.2 L300.8,155.2 L300.8,152.7 L301.0,152.7 L301.0,150.2 L301.2,150.2 L301.2,147.8 L301.4,147.8 - L301.4,145.4 L301.6,145.4 L301.6,143.1 L301.9,143.1 L301.9,140.8 L302.1,140.8 L302.1,138.6 L302.3,138.6 - L302.3,136.4 L302.5,136.4 L302.5,134.2 L302.7,134.2 L302.7,132.1 L302.9,132.1 L302.9,130.0 L303.2,130.0 + L301.4,145.4 L301.6,145.4 L301.6,143.1 L301.9,143.1 L301.9,140.8 L302.1,140.8 L302.1,138.5 L302.3,138.5 + L302.3,136.3 L302.5,136.3 L302.5,134.2 L302.7,134.2 L302.7,132.0 L302.9,132.0 L302.9,130.0 L303.2,130.0 L303.2,127.9 L303.4,127.9 L303.4,125.9 L303.6,125.9 L303.6,123.9 L303.8,123.9 L303.8,122.0 L304.0,122.0 L304.0,120.1 L304.2,120.1 L304.2,118.2 L304.5,118.2 L304.5,116.4 L304.7,116.4 L304.7,114.6 L304.9,114.6 - L304.9,112.8 L305.1,112.8 L305.1,111.1 L305.3,111.1 L305.3,109.3 L305.5,109.3 L305.5,107.7 L305.8,107.7 - L305.8,106.0 L306.0,106.0 L306.0,104.4 L306.2,104.4 L306.2,102.8 L306.4,102.8 L306.4,101.3 L306.6,101.3 - L306.6,99.7 L306.8,99.7 L306.8,98.2 L307.1,98.2 L307.1,96.8 L307.3,96.8 L307.3,95.3 L307.5,95.3 - L307.5,93.9 L307.7,93.9 L307.7,92.5 L307.9,92.5 L307.9,91.1 L308.1,91.1 L308.1,89.8 L308.4,89.8 + L304.9,112.8 L305.1,112.8 L305.1,111.0 L305.3,111.0 L305.3,109.3 L305.5,109.3 L305.5,107.7 L305.8,107.7 + L305.8,106.0 L306.0,106.0 L306.0,104.4 L306.2,104.4 L306.2,102.8 L306.4,102.8 L306.4,101.2 L306.6,101.2 + L306.6,99.7 L306.9,99.7 L306.9,98.2 L307.1,98.2 L307.1,96.7 L307.3,96.7 L307.3,95.3 L307.5,95.3 + L307.5,93.9 L307.7,93.9 L307.7,92.5 L307.9,92.5 L307.9,91.1 L308.2,91.1 L308.2,89.8 L308.4,89.8 L308.4,88.4 L308.6,88.4 L308.6,87.1 L308.8,87.1 L308.8,85.9 L309.0,85.9 L309.0,84.6 L309.2,84.6 L309.2,83.4 L309.5,83.4 L309.5,82.2 L309.7,82.2 L309.7,81.0 L309.9,81.0 L309.9,79.8 L310.1,79.8 L310.1,78.7 L310.3,78.7 L310.3,77.6 L310.5,77.6 L310.5,76.5 L310.8,76.5 L310.8,75.4 L311.0,75.4 - L311.0,74.3 L311.2,74.3 L311.2,73.3 L311.4,73.3 L311.4,72.3 L311.6,72.3 L311.6,71.2 L311.8,71.2 - L311.8,70.3 L312.1,70.3 L312.1,69.3 L312.3,69.3 L312.3,68.3 L312.5,68.3 L312.5,67.4 L312.7,67.4 + L311.0,74.3 L311.2,74.3 L311.2,73.3 L311.4,73.3 L311.4,72.2 L311.6,72.2 L311.6,71.2 L311.8,71.2 + L311.8,70.2 L312.1,70.2 L312.1,69.3 L312.3,69.3 L312.3,68.3 L312.5,68.3 L312.5,67.4 L312.7,67.4 L312.7,66.5 L312.9,66.5 L312.9,65.6 L313.1,65.6 L313.1,64.7 L313.4,64.7 L313.4,63.8 L313.6,63.8 L313.6,63.0 L313.8,63.0 L313.8,62.1 L314.0,62.1 L314.0,61.3 L314.2,61.3 L314.2,60.5 L314.4,60.5 - L314.4,59.7 L314.7,59.7 L314.7,67.2 L314.9,67.2 L314.9,74.6 L315.1,74.6 L315.1,81.9 L315.3,81.9 - L315.3,89.1 L315.5,89.1 L315.5,96.1 L315.7,96.1 L315.7,103.0 L316.0,103.0 L316.0,109.7 L316.2,109.7 - L316.2,116.3 L316.4,116.3 L316.4,122.8 L316.6,122.8 L316.6,129.1 L316.8,129.1 L316.8,135.3 L317.1,135.3 - L317.1,141.4 L317.3,141.4 L317.3,147.4 L317.5,147.4 L317.5,153.2 L317.7,153.2 L317.7,158.9 L317.9,158.9 - L317.9,164.5 L318.1,164.5 L318.1,170.0 L318.4,170.0 L318.4,175.3 L318.6,175.3 L318.6,180.6 L318.8,180.6 - L318.8,185.8 L319.0,185.8 L319.0,190.8 L319.2,190.8 L319.2,195.7 L319.4,195.7 L319.4,200.6 L319.7,200.6 - L319.7,205.3 L319.9,205.3 L319.9,210.0 L320.1,210.0 L320.1,214.5 L320.3,214.5 L320.3,219.0 L320.5,219.0 - L320.5,223.4 L320.7,223.4 L320.7,227.6 L321.0,227.6 L321.0,231.8 L321.2,231.8 L321.2,235.9 L321.4,235.9 - L321.4,240.0 L321.6,240.0 L321.6,243.9 L321.8,243.9 L321.8,247.8 L322.0,247.8 L322.0,251.6 L322.3,251.6 - L322.3,255.3 L322.5,255.3 L322.5,258.9 L322.7,258.9 L322.7,262.5 L322.9,262.5 L322.9,265.9 L323.1,265.9 - L323.1,269.3 L323.3,269.3 L323.3,272.7 L323.6,272.7 L323.6,276.0 L323.8,276.0 L323.8,279.2 L324.0,279.2 - L324.0,282.3 L324.2,282.3 L324.2,285.4 L324.4,285.4 L324.4,288.4 L324.7,288.4 L324.7,291.4 L324.9,291.4 - L324.9,294.3 L325.1,294.3 L325.1,297.1 L325.3,297.1 L325.3,299.9 L325.5,299.9 L325.5,302.6 L325.7,302.6 - L325.7,305.3 L326.0,305.3 L326.0,307.9 L326.2,307.9 L326.2,310.4 L326.4,310.4 L326.4,312.9 L326.6,312.9 - L326.6,315.4 L326.8,315.4 L326.8,317.8 L327.0,317.8 L327.0,320.1 L327.3,320.1 L327.3,322.5 L327.5,322.5 - L327.5,324.7 L327.7,324.7 L327.7,326.9 L327.9,326.9 L327.9,329.1 L328.1,329.1 L328.1,331.2 L328.3,331.2 - L328.3,333.3 L328.6,333.3 L328.6,335.3 L328.8,335.3 L328.8,337.3 L329.0,337.3 L329.0,339.3 L329.2,339.3 - L329.2,341.2 L329.4,341.2 L329.4,343.1 L329.6,343.1 L329.6,344.9 L329.9,344.9 L329.9,346.7 L330.1,346.7 - L330.1,348.5 L330.3,348.5 L330.3,350.2 L330.5,350.2 L330.5,351.9 L330.7,351.9 L330.7,353.6 L330.9,353.6 - L330.9,355.2 L331.2,355.2 L331.2,356.8 L331.4,356.8 L331.4,358.4 L331.6,358.4 L331.6,359.9 L331.8,359.9 - L331.8,361.4 L332.0,361.4 L332.0,362.9 L332.2,362.9 L332.2,364.3 L332.5,364.3 L332.5,365.7 L332.7,365.7 - L332.7,367.1 L332.9,367.1 L332.9,368.4 L333.1,368.4 L333.1,369.7 L333.3,369.7 L333.3,371.0 L333.6,371.0 - L333.6,372.3 L333.8,372.3 L333.8,373.6 L334.0,373.6 L334.0,374.8 L334.2,374.8 L334.2,376.0 L334.4,376.0 - L334.4,377.1 L334.6,377.1 L334.6,378.3 L334.9,378.3 L334.9,379.4 L335.1,379.4 L335.1,380.5 L335.3,380.5 - L335.3,381.6 L335.5,381.6 L335.5,382.6 L335.7,382.6 L335.7,383.7 L335.9,383.7 L335.9,384.7 L336.2,384.7 - L336.2,385.7 L336.4,385.7 L336.4,386.6 L336.6,386.6 L336.6,387.6 L336.8,387.6 L336.8,388.5 L337.0,388.5 - L337.0,389.4 L337.2,389.4 L337.2,390.3 L337.5,390.3 L337.5,391.2 L337.7,391.2 L337.7,392.1 L337.9,392.1 - L337.9,392.9 L338.1,392.9 L338.1,393.7 L338.3,393.7 L338.3,394.5 L338.5,394.5 L338.5,395.3 L338.8,395.3 - L338.8,396.1 L339.0,396.1 L339.0,396.9 L339.2,396.9 L339.2,397.6 L339.4,397.6 L339.4,398.3 L339.6,398.3 - L339.6,399.1 L339.8,399.1 L339.8,399.7 L340.1,399.7 L340.1,400.4 L340.3,400.4 L340.3,401.1 L340.5,401.1 - L340.5,401.8 L340.7,401.8 L340.7,394.9 L340.9,394.9 L340.9,388.1 L341.2,388.1 L341.2,381.4 L341.4,381.4 - L341.4,374.8 L341.6,374.8 L341.6,368.3 L341.8,368.3 L341.8,361.9 L342.0,361.9 L342.0,355.7 L342.2,355.7 - L342.2,349.5 L342.5,349.5 L342.5,343.5 L342.7,343.5 L342.7,337.6 L342.9,337.6 L342.9,331.8 L343.1,331.8 - L343.1,326.1 L343.3,326.1 L343.3,320.5 L343.5,320.5 L343.5,315.0 L343.8,315.0 L343.8,309.6 L344.0,309.6 - L344.0,304.3 L344.2,304.3 L344.2,299.1 L344.4,299.1 L344.4,294.0 L344.6,294.0 L344.6,289.0 L344.8,289.0 - L344.8,284.0 L345.1,284.0 L345.1,279.2 L345.3,279.2 L345.3,274.4 L345.5,274.4 L345.5,269.8 L345.7,269.8 - L345.7,265.2 L345.9,265.2 L345.9,260.7 L346.1,260.7 L346.1,256.3 L346.4,256.3 L346.4,251.9 L346.6,251.9 - L346.6,247.7 L346.8,247.7 L346.8,243.5 L347.0,243.5 L347.0,239.4 L347.2,239.4 L347.2,235.4 L347.4,235.4 - L347.4,231.4 L347.7,231.4 L347.7,227.5 L347.9,227.5 L347.9,223.7 L348.1,223.7 L348.1,219.9 L348.3,219.9 - L348.3,216.3 L348.5,216.3 L348.5,212.7 L348.8,212.7 L348.8,209.1 L349.0,209.1 L349.0,205.6 L349.2,205.6 - L349.2,202.2 L349.4,202.2 L349.4,198.8 L349.6,198.8 L349.6,195.6 L349.8,195.6 L349.8,192.3 L350.1,192.3 - L350.1,189.1 L350.3,189.1 L350.3,186.0 L350.5,186.0 L350.5,182.9 L350.7,182.9 L350.7,179.9 L350.9,179.9 - L350.9,177.0 L351.1,177.0 L351.1,174.1 L351.4,174.1 L351.4,171.2 L351.6,171.2 L351.6,168.4 L351.8,168.4 - L351.8,165.7 L352.0,165.7 L352.0,163.0 L352.2,163.0 L352.2,160.3 L352.4,160.3 L352.4,157.7 L352.7,157.7 - L352.7,155.2 L352.9,155.2 L352.9,152.7 L353.1,152.7 L353.1,150.2 L353.3,150.2 L353.3,147.8 L353.5,147.8 - L353.5,145.4 L353.7,145.4 L353.7,143.1 L354.0,143.1 L354.0,140.8 L354.2,140.8 L354.2,138.6 L354.4,138.6 - L354.4,136.4 L354.6,136.4 L354.6,134.2 L354.8,134.2 L354.8,132.1 L355.0,132.1 L355.0,130.0 L355.3,130.0 - L355.3,127.9 L355.5,127.9 L355.5,125.9 L355.7,125.9 L355.7,123.9 L355.9,123.9 L355.9,122.0 L356.1,122.0 - L356.1,120.1 L356.4,120.1 L356.4,118.2 L356.6,118.2 L356.6,116.4 L356.8,116.4 L356.8,114.6 L357.0,114.6 - L357.0,112.8 L357.2,112.8 L357.2,111.1 L357.4,111.1 L357.4,109.4 L357.7,109.4 L357.7,107.7 L357.9,107.7 - L357.9,106.0 L358.1,106.0 L358.1,104.4 L358.3,104.4 L358.3,102.8 L358.5,102.8 L358.5,101.3 L358.7,101.3 - L358.7,99.7 L359.0,99.7 L359.0,98.2 L359.2,98.2 L359.2,96.8 L359.4,96.8 L359.4,95.3 L359.6,95.3 - L359.6,93.9 L359.8,93.9 L359.8,92.5 L360.0,92.5 L360.0,91.1 L360.3,91.1 L360.3,89.8 L360.5,89.8 - L360.5,88.4 L360.7,88.4 L360.7,87.1 L360.9,87.1 L360.9,85.9 L361.1,85.9 L361.1,84.6 L361.3,84.6 - L361.3,83.4 L361.6,83.4 L361.6,82.2 L361.8,82.2 L361.8,81.0 L362.0,81.0 L362.0,79.8 L362.2,79.8 - L362.2,78.7 L362.4,78.7 L362.4,77.6 L362.6,77.6 L362.6,76.5 L362.9,76.5 L362.9,75.4 L363.1,75.4 - L363.1,74.3 L363.3,74.3 L363.3,73.3 L363.5,73.3 L363.5,72.3 L363.7,72.3 L363.7,71.2 L363.9,71.2 - L363.9,70.3 L364.2,70.3 L364.2,69.3 L364.4,69.3 L364.4,68.3 L364.6,68.3 L364.6,67.4 L364.8,67.4 - L364.8,66.5 L365.0,66.5 L365.0,65.6 L365.3,65.6 L365.3,64.7 L365.5,64.7 L365.5,63.8 L365.7,63.8 - L365.7,63.0 L365.9,63.0 L365.9,62.1 L366.1,62.1 L366.1,61.3 L366.3,61.3 L366.3,60.5 L366.6,60.5 - L366.6,59.7 L366.8,59.7 L366.8,67.1 L367.0,67.1 L367.0,74.6 L367.2,74.6 L367.2,81.9 L367.4,81.9 - L367.4,89.1 L367.6,89.1 L367.6,96.1 L367.9,96.1 L367.9,103.0 L368.1,103.0 L368.1,109.7 L368.3,109.7 - L368.3,116.3 L368.5,116.3 L368.5,122.8 L368.7,122.8 L368.7,129.1 L368.9,129.1 L368.9,135.3 L369.2,135.3 - L369.2,141.4 L369.4,141.4 L369.4,147.3 L369.6,147.3 L369.6,153.2 L369.8,153.2 L369.8,158.9 L370.0,158.9 - L370.0,164.5 L370.2,164.5 L370.2,170.0 L370.5,170.0 L370.5,175.3 L370.7,175.3 L370.7,180.6 L370.9,180.6 - L370.9,185.7 L371.1,185.7 L371.1,190.8 L371.3,190.8 L371.3,195.7 L371.5,195.7 L371.5,200.6 L371.8,200.6 - L371.8,205.3 L372.0,205.3 L372.0,210.0 L372.2,210.0 L372.2,214.5 L372.4,214.5 L372.4,219.0 L372.6,219.0 - L372.6,223.4 L372.9,223.4 L372.9,227.6 L373.1,227.6 L373.1,231.8 L373.3,231.8 L373.3,235.9 L373.5,235.9 - L373.5,240.0 L373.7,240.0 L373.7,243.9 L373.9,243.9 L373.9,247.8 L374.2,247.8 L374.2,251.5 L374.4,251.5 - L374.4,255.3 L374.6,255.3 L374.6,258.9 L374.8,258.9 L374.8,262.4 L375.0,262.4 L375.0,265.9 L375.2,265.9 - L375.2,269.3 L375.5,269.3 L375.5,272.7 L375.7,272.7 L375.7,276.0 L375.9,276.0 L375.9,279.2 L376.1,279.2 - L376.1,282.3 L376.3,282.3 L376.3,285.4 L376.5,285.4 L376.5,288.4 L376.8,288.4 L376.8,291.4 L377.0,291.4 - L377.0,294.2 L377.2,294.2 L377.2,297.1 L377.4,297.1 L377.4,299.9 L377.6,299.9 L377.6,302.6 L377.8,302.6 - L377.8,305.2 L378.1,305.2 L378.1,307.9 L378.3,307.9 L378.3,310.4 L378.5,310.4 L378.5,312.9 L378.7,312.9 - L378.7,315.4 L378.9,315.4 L378.9,317.8 L379.1,317.8 L379.1,320.1 L379.4,320.1 L379.4,322.4 L379.6,322.4 - L379.6,324.7 L379.8,324.7 L379.8,326.9 L380.0,326.9 L380.0,329.1 L380.2,329.1 L380.2,331.2 L380.5,331.2 - L380.5,333.3 L380.7,333.3 L380.7,335.3 L380.9,335.3 L380.9,337.3 L381.1,337.3 L381.1,339.3 L381.3,339.3 - L381.3,341.2 L381.5,341.2 L381.5,343.1 L381.8,343.1 L381.8,344.9 L382.0,344.9 L382.0,346.7 L382.2,346.7 - L382.2,348.5 L382.4,348.5 L382.4,350.2 L382.6,350.2 L382.6,351.9 L382.8,351.9 L382.8,353.6 L383.1,353.6 - L383.1,355.2 L383.3,355.2 L383.3,356.8 L383.5,356.8 L383.5,358.4 L383.7,358.4 L383.7,359.9 L383.9,359.9 - L383.9,361.4 L384.1,361.4 L384.1,362.8 L384.4,362.8 L384.4,364.3 L384.6,364.3 L384.6,365.7 L384.8,365.7 - L384.8,367.1 L385.0,367.1 L385.0,368.4 L385.2,368.4 L385.2,369.7 L385.4,369.7 L385.4,371.0 L385.7,371.0 - L385.7,372.3 L385.9,372.3 L385.9,373.6 L386.1,373.6 L386.1,374.8 L386.3,374.8 L386.3,376.0 L386.5,376.0 - L386.5,377.1 L386.7,377.1 L386.7,378.3 L387.0,378.3 L387.0,379.4 L387.2,379.4 L387.2,380.5 L387.4,380.5 - L387.4,381.6 L387.6,381.6 L387.6,382.6 L387.8,382.6 L387.8,383.7 L388.1,383.7 L388.1,384.7 L388.3,384.7 - L388.3,385.7 L388.5,385.7 L388.5,386.6 L388.7,386.6 L388.7,387.6 L388.9,387.6 L388.9,388.5 L389.1,388.5 - L389.1,389.4 L389.4,389.4 L389.4,390.3 L389.6,390.3 L389.6,391.2 L389.8,391.2 L389.8,392.1 L390.0,392.1 - L390.0,392.9 L390.2,392.9 L390.2,393.7 L390.4,393.7 L390.4,394.5 L390.7,394.5 L390.7,395.3 L390.9,395.3 - L390.9,396.1 L391.1,396.1 L391.1,396.9 L391.3,396.9 L391.3,397.6 L391.5,397.6 L391.5,398.3 L391.7,398.3 - L391.7,399.0 L392.0,399.0 L392.0,399.7 L392.2,399.7 L392.2,400.4 L392.4,400.4 L392.4,401.1 L392.6,401.1 - L392.6,401.8 L392.8,401.8 L392.8,395.0 L393.0,395.0 L393.0,388.1 L393.3,388.1 L393.3,381.4 L393.5,381.4 - L393.5,374.8 L393.7,374.8 L393.7,368.3 L393.9,368.3 L393.9,362.0 L394.1,362.0 L394.1,355.7 L394.3,355.7 - L394.3,349.6 L394.6,349.6 L394.6,343.5 L394.8,343.5 L394.8,337.6 L395.0,337.6 L395.0,331.8 L395.2,331.8 - L395.2,326.1 L395.4,326.1 L395.4,320.5 L395.6,320.5 L395.6,315.0 L395.9,315.0 L395.9,309.6 L396.1,309.6 - L396.1,304.3 L396.3,304.3 L396.3,299.1 L396.5,299.1 L396.5,294.0 L396.7,294.0 L396.7,289.0 L397.0,289.0 - L397.0,284.0 L397.2,284.0 L397.2,279.2 L397.4,279.2 L397.4,274.4 L397.6,274.4 L397.6,269.8 L397.8,269.8 - L397.8,265.2 L398.0,265.2 L398.0,260.7 L398.3,260.7 L398.3,256.3 L398.5,256.3 L398.5,251.9 L398.7,251.9 - L398.7,247.7 L398.9,247.7 L398.9,243.5 L399.1,243.5 L399.1,239.4 L399.3,239.4 L399.3,235.4 L399.6,235.4 - L399.6,231.4 L399.8,231.4 L399.8,227.5 L400.0,227.5 L400.0,223.7 L400.2,223.7 L400.2,220.0 L400.4,220.0 - L400.4,216.3 L400.6,216.3 L400.6,212.7 L400.9,212.7 L400.9,209.1 L401.1,209.1 L401.1,205.6 L401.3,205.6 - L401.3,202.2 L401.5,202.2 L401.5,198.9 L401.7,198.9 L401.7,195.6 L401.9,195.6 L401.9,192.3 L402.2,192.3 - L402.2,189.1 L402.4,189.1 L402.4,186.0 L402.6,186.0 L402.6,183.0 L402.8,183.0 L402.8,179.9 L403.0,179.9 - L403.0,177.0 L403.2,177.0 L403.2,174.1 L403.5,174.1 L403.5,171.2 L403.7,171.2 L403.7,168.4 L403.9,168.4 - L403.9,165.7 L404.1,165.7 L404.1,163.0 L404.3,163.0 L404.3,160.4 L404.6,160.4 L404.6,157.8 L404.8,157.8 - L404.8,155.2 L405.0,155.2 L405.0,152.7 L405.2,152.7 L405.2,150.2 L405.4,150.2 L405.4,147.8 L405.6,147.8 - L405.6,145.4 L405.9,145.4 L405.9,143.1 L406.1,143.1 L406.1,140.8 L406.3,140.8 L406.3,138.6 L406.5,138.6 - L406.5,136.4 L406.7,136.4 L406.7,134.2 L406.9,134.2 L406.9,132.1 L407.2,132.1 L407.2,130.0 L407.4,130.0 - L407.4,127.9 L407.6,127.9 L407.6,125.9 L407.8,125.9 L407.8,123.9 L408.0,123.9 L408.0,122.0 L408.2,122.0 - L408.2,120.1 L408.5,120.1 L408.5,118.2 L408.7,118.2 L408.7,116.4 L408.9,116.4 L408.9,114.6 L409.1,114.6 - L409.1,112.8 L409.3,112.8 L409.3,111.1 L409.5,111.1 L409.5,109.4 L409.8,109.4 L409.8,107.7 L410.0,107.7 - L410.0,106.0 L410.2,106.0 L410.2,104.4 L410.4,104.4 L410.4,102.8 L410.6,102.8 L410.6,101.3 L410.8,101.3 - L410.8,99.7 L411.1,99.7 L411.1,98.2 L411.3,98.2 L411.3,96.8 L411.5,96.8 L411.5,95.3 L411.7,95.3 - L411.7,93.9 L411.9,93.9 L411.9,92.5 L412.2,92.5 L412.2,91.1 L412.4,91.1 L412.4,89.8 L412.6,89.8 - L412.6,88.5 L412.8,88.5 L412.8,87.2 L413.0,87.2 L413.0,85.9 L413.2,85.9 L413.2,84.6 L413.5,84.6 - L413.5,83.4 L413.7,83.4 L413.7,82.2 L413.9,82.2 L413.9,81.0 L414.1,81.0 L414.1,79.8 L414.3,79.8 - L414.3,78.7 L414.5,78.7 L414.5,77.6 L414.8,77.6 L414.8,76.5 L415.0,76.5 L415.0,75.4 L415.2,75.4 - L415.2,74.3 L415.4,74.3 L415.4,73.3 L415.6,73.3 L415.6,72.3 L415.8,72.3 L415.8,71.3 L416.1,71.3 - L416.1,70.3 L416.3,70.3 L416.3,69.3 L416.5,69.3 L416.5,68.3 L416.7,68.3 L416.7,67.4 L416.9,67.4 - L416.9,66.5 L417.1,66.5 L417.1,65.6 L417.4,65.6 L417.4,64.7 L417.6,64.7 L417.6,63.8 L417.8,63.8 - L417.8,63.0 L418.0,63.0 L418.0,62.1 L418.2,62.1 L418.2,61.3 L418.4,61.3 L418.4,60.5 L418.7,60.5 - L418.7,59.7 L418.9,59.7 L418.9,67.1 L419.1,67.1 L419.1,74.6 L419.3,74.6 L419.3,81.9 L419.5,81.9 - L419.5,89.1 L419.7,89.1 L419.7,96.1 L420.0,96.1 L420.0,103.0 L420.2,103.0 L420.2,109.7 L420.4,109.7 - L420.4,116.3 L420.6,116.3 L420.6,122.8 L420.8,122.8 L420.8,129.1 L421.1,129.1 L421.1,135.3 L421.3,135.3 - L421.3,141.4 L421.5,141.4 L421.5,147.3 L421.7,147.3 L421.7,153.1 L421.9,153.1 L421.9,158.9 L422.1,158.9 - L422.1,164.5 L422.4,164.5 L422.4,169.9 L422.6,169.9 L422.6,175.3 L422.8,175.3 L422.8,180.6 L423.0,180.6 - L423.0,185.7 L423.2,185.7 L423.2,190.8 L423.4,190.8 L423.4,195.7 L423.7,195.7 L423.7,200.6 L423.9,200.6 - L423.9,205.3 L424.1,205.3 L424.1,209.9 L424.3,209.9 L424.3,214.5 L424.5,214.5 L424.5,219.0 L424.7,219.0 - L424.7,223.3 L425.0,223.3 L425.0,227.6 L425.2,227.6 L425.2,231.8 L425.4,231.8 L425.4,235.9 L425.6,235.9 - L425.6,239.9 L425.8,239.9 L425.8,243.9 L426.0,243.9 L426.0,247.7 L426.3,247.7 L426.3,251.5 L426.5,251.5 - L426.5,255.2 L426.7,255.2 L426.7,258.9 L426.9,258.9 L426.9,262.4 L427.1,262.4 L427.1,265.9 L427.3,265.9 - L427.3,269.3 L427.6,269.3 L427.6,272.7 L427.8,272.7 L427.8,275.9 L428.0,275.9 L428.0,279.1 L428.2,279.1 - L428.2,282.3 L428.4,282.3 L428.4,285.4 L428.7,285.4 L428.7,288.4 L428.9,288.4 L428.9,291.3 L429.1,291.3 - L429.1,294.2 L429.3,294.2 L429.3,297.1 L429.5,297.1 L429.5,299.9 L429.7,299.9 L429.7,302.6 L430.0,302.6 - L430.0,305.2 L430.2,305.2 L430.2,307.8 L430.4,307.8 L430.4,310.4 L430.6,310.4 L430.6,312.9 L430.8,312.9 - L430.8,315.4 L431.0,315.4 L431.0,317.8 L431.3,317.8 L431.3,320.1 L431.5,320.1 L431.5,322.4 L431.7,322.4 - L431.7,324.7 L431.9,324.7 L431.9,326.9 L432.1,326.9 L432.1,329.1 L432.3,329.1 L432.3,331.2 L432.6,331.2 - L432.6,333.3 L432.8,333.3 L432.8,335.3 L433.0,335.3 L433.0,337.3 L433.2,337.3 L433.2,339.3 L433.4,339.3 - L433.4,341.2 L433.6,341.2 L433.6,343.1 L433.9,343.1 L433.9,344.9 L434.1,344.9 L434.1,346.7 L434.3,346.7 - L434.3,348.5 L434.5,348.5 L434.5,350.2 L434.7,350.2 L434.7,351.9 L434.9,351.9 L434.9,353.6 L435.2,353.6 - L435.2,355.2 L435.4,355.2 L435.4,356.8 L435.6,356.8 L435.6,358.3 L435.8,358.3 L435.8,359.9 L436.0,359.9 - L436.0,361.4 L436.3,361.4 L436.3,362.8 L436.5,362.8 L436.5,364.3 L436.7,364.3 L436.7,365.7 L436.9,365.7 - L436.9,367.1 L437.1,367.1 L437.1,368.4 L437.3,368.4 L437.3,369.7 L437.6,369.7 L437.6,371.0 L437.8,371.0 - L437.8,372.3 L438.0,372.3 L438.0,373.5 L438.2,373.5 L438.2,374.8 L438.4,374.8 L438.4,376.0 L438.6,376.0 - L438.6,377.1 L438.9,377.1 L438.9,378.3 L439.1,378.3 L439.1,379.4 L439.3,379.4 L439.3,380.5 L439.5,380.5 - L439.5,381.6 L439.7,381.6 L439.7,382.6 L439.9,382.6 L439.9,383.7 L440.2,383.7 L440.2,384.7 L440.4,384.7 - L440.4,385.7 L440.6,385.7 L440.6,386.6 L440.8,386.6 L440.8,387.6 L441.0,387.6 L441.0,388.5 L441.2,388.5 - L441.2,389.4 L441.5,389.4 L441.5,390.3 L441.7,390.3 L441.7,391.2 L441.9,391.2 L441.9,392.1 L442.1,392.1 - L442.1,392.9 L442.3,392.9 L442.3,393.7 L442.5,393.7 L442.5,394.5 L442.8,394.5 L442.8,395.3 L443.0,395.3 - L443.0,396.1 L443.2,396.1 L443.2,396.9 L443.4,396.9 L443.4,397.6 L443.6,397.6 L443.6,398.3 L443.9,398.3 - L443.9,399.0 L444.1,399.0 L444.1,399.7 L444.3,399.7 L444.3,400.4 L444.5,400.4 L444.5,401.1 L444.7,401.1 - L444.7,401.8 L444.9,401.8 L444.9,395.0 L445.2,395.0 L445.2,388.2 L445.4,388.2 L445.4,381.4 L445.6,381.4 - L445.6,374.8 L445.8,374.8 L445.8,368.3 L446.0,368.3 L446.0,362.0 L446.2,362.0 L446.2,355.7 L446.5,355.7 - L446.5,349.6 L446.7,349.6 L446.7,343.6 L446.9,343.6 L446.9,337.6 L447.1,337.6 L447.1,331.8 L447.3,331.8 - L447.3,326.1 L447.5,326.1 L447.5,320.5 L447.8,320.5 L447.8,315.0 L448.0,315.0 L448.0,309.6 L448.2,309.6 - L448.2,304.3 L448.4,304.3 L448.4,299.1 L448.6,299.1 L448.6,294.0 L448.8,294.0 L448.8,289.0 L449.1,289.0 - L449.1,284.1 L449.3,284.1 L449.3,279.2 L449.5,279.2 L449.5,274.5 L449.7,274.5 L449.7,269.8 L449.9,269.8 - L449.9,265.2 L450.1,265.2 L450.1,260.7 L450.4,260.7 L450.4,256.3 L450.6,256.3 L450.6,252.0 L450.8,252.0 - L450.8,247.7 L451.0,247.7 L451.0,243.5 L451.2,243.5 L451.2,239.4 L451.4,239.4 L451.4,235.4 L451.7,235.4 - L451.7,231.4 L451.9,231.4 L451.9,227.5 L452.1,227.5 L452.1,223.7 L452.3,223.7 L452.3,220.0 L452.5,220.0 - L452.5,216.3 L452.8,216.3 L452.8,212.7 L453.0,212.7 L453.0,209.1 L453.2,209.1 L453.2,205.7 L453.4,205.7 - L453.4,202.2 L453.6,202.2 L453.6,198.9 L453.8,198.9 L453.8,195.6 L454.1,195.6 L454.1,192.3 L454.3,192.3 - L454.3,189.2 L454.5,189.2 L454.5,186.0 L454.7,186.0 L454.7,183.0 L454.9,183.0 L454.9,180.0 L455.1,180.0 - L455.1,177.0 L455.4,177.0 L455.4,174.1 L455.6,174.1 L455.6,171.3 L455.8,171.3 L455.8,168.5 L456.0,168.5 - L456.0,165.7 L456.2,165.7 L456.2,163.0 L456.4,163.0 L456.4,160.4 L456.7,160.4 L456.7,157.8 L456.9,157.8 - L456.9,155.2 L457.1,155.2 L457.1,152.7 L457.3,152.7 L457.3,150.2 L457.5,150.2 L457.5,147.8 L457.7,147.8 - L457.7,145.4 L458.0,145.4 L458.0,143.1 L458.2,143.1 L458.2,140.8 L458.4,140.8 L458.4,138.6 L458.6,138.6 - L458.6,136.4 L458.8,136.4 L458.8,134.2 L459.0,134.2 L459.0,132.1 L459.3,132.1 L459.3,130.0 L459.5,130.0 - L459.5,127.9 L459.7,127.9 L459.7,125.9 L459.9,125.9 L459.9,124.0 L460.1,124.0 L460.1,122.0 L460.4,122.0 - L460.4,120.1 L460.6,120.1 L460.6,118.2 L460.8,118.2 L460.8,116.4 L461.0,116.4 L461.0,114.6 L461.2,114.6 - L461.2,112.8 L461.4,112.8 L461.4,111.1 L461.7,111.1 L461.7,109.4 L461.9,109.4 L461.9,107.7 L462.1,107.7 - L462.1,106.0 L462.3,106.0 L462.3,104.4 L462.5,104.4 L462.5,102.8 L462.7,102.8 L462.7,101.3 L463.0,101.3 - L463.0,99.7 L463.2,99.7 L463.2,98.2 L463.4,98.2 L463.4,96.8 L463.6,96.8 L463.6,95.3 L463.8,95.3 - L463.8,93.9 L464.0,93.9 L464.0,92.5 L464.3,92.5 L464.3,91.1 L464.5,91.1 L464.5,89.8 L464.7,89.8 - L464.7,88.5 L464.9,88.5 L464.9,87.2 L465.1,87.2 L465.1,85.9 L465.3,85.9 L465.3,84.6 L465.6,84.6 - L465.6,83.4 L465.8,83.4 L465.8,82.2 L466.0,82.2 L466.0,81.0 L466.2,81.0 L466.2,79.8 L466.4,79.8 - L466.4,78.7 L466.6,78.7 L466.6,77.6 L466.9,77.6 L466.9,76.5 L467.1,76.5 L467.1,75.4 L467.3,75.4 - L467.3,74.3 L467.5,74.3 L467.5,73.3 L467.7,73.3 L467.7,72.3 L468.0,72.3 L468.0,71.3 L468.2,71.3 - L468.2,70.3 L468.4,70.3 L468.4,69.3 L468.6,69.3 L468.6,68.3 L468.8,68.3 L468.8,67.4 L469.0,67.4 - L469.0,66.5 L469.3,66.5 L469.3,65.6 L469.5,65.6 L469.5,64.7 L469.7,64.7 L469.7,63.8 L469.9,63.8 - L469.9,63.0 L470.1,63.0 L470.1,62.1 L470.3,62.1 L470.3,61.3 L470.6,61.3 L470.6,60.5 L470.8,60.5 - L470.8,59.7 L471.0,59.7 L471.0,67.1 L471.2,67.1 L471.2,74.6 L471.4,74.6 L471.4,81.9 L471.6,81.9 - L471.6,89.0 L471.9,89.0 L471.9,96.1 L472.1,96.1 L472.1,102.9 L472.3,102.9 L472.3,109.7 L472.5,109.7 - L472.5,116.3 L472.7,116.3 L472.7,122.7 L472.9,122.7 L472.9,129.1 L473.2,129.1 L473.2,135.3 L473.4,135.3 - L473.4,141.3 L473.6,141.3 L473.6,147.3 L473.8,147.3 L473.8,153.1 L474.0,153.1 L474.0,158.8 L474.2,158.8 - L474.2,164.4 L474.5,164.4 L474.5,169.9 L474.7,169.9 L474.7,175.3 L474.9,175.3 L474.9,180.5 L475.1,180.5 - L475.1,185.7 L475.3,185.7 L475.3,190.7 L475.6,190.7 L475.6,195.7 L475.8,195.7 L475.8,200.5 L476.0,200.5 - L476.0,205.3 L476.2,205.3 L476.2,209.9 L476.4,209.9 L476.4,214.5 L476.6,214.5 L476.6,218.9 L476.9,218.9 - L476.9,223.3 L477.1,223.3 L477.1,227.6 L477.3,227.6 L477.3,231.8 L477.5,231.8 L477.5,235.9 L477.7,235.9 - L477.7,239.9 L477.9,239.9 L477.9,243.9 L478.2,243.9 L478.2,247.7 L478.4,247.7 L478.4,251.5 L478.6,251.5 - L478.6,255.2 L478.8,255.2 L478.8,258.9 L479.0,258.9 L479.0,262.4 L479.2,262.4 L479.2,265.9 L479.5,265.9 - L479.5,269.3 L479.7,269.3 L479.7,272.7 L479.9,272.7 L479.9,275.9 L480.1,275.9 L480.1,279.1 L480.3,279.1 - L480.3,282.3 L480.5,282.3 L480.5,285.4 L480.8,285.4 L480.8,288.4 L481.0,288.4 L481.0,291.3 L481.2,291.3 - L481.2,294.2 L481.4,294.2 L481.4,297.1 L481.6,297.1 L481.6,299.8 L481.8,299.8 L481.8,302.6 L482.1,302.6 - L482.1,305.2 L482.3,305.2 L482.3,307.8 L482.5,307.8 L482.5,310.4 L482.7,310.4 L482.7,312.9 L482.9,312.9 - L482.9,315.4 L483.1,315.4 L483.1,317.8 L483.4,317.8 L483.4,320.1 L483.6,320.1 L483.6,322.4 L483.8,322.4 - L483.8,324.7 L484.0,324.7 L484.0,326.9 L484.2,326.9 L484.2,329.1 L484.5,329.1 L484.5,331.2 L484.7,331.2 - L484.7,333.3 L484.9,333.3 L484.9,335.3 L485.1,335.3 L485.1,337.3 L485.3,337.3 L485.3,339.3 L485.5,339.3 - L485.5,341.2 L485.8,341.2 L485.8,343.1 L486.0,343.1 L486.0,344.9 L486.2,344.9 L486.2,346.7 L486.4,346.7 - L486.4,348.5 L486.6,348.5 L486.6,350.2 L486.8,350.2 L486.8,351.9 L487.1,351.9 L487.1,353.6 L487.3,353.6 - L487.3,355.2 L487.5,355.2 L487.5,356.8 L487.7,356.8 L487.7,358.3 L487.9,358.3 L487.9,359.9 L488.1,359.9 - L488.1,361.4 L488.4,361.4 L488.4,362.8 L488.6,362.8 L488.6,364.3 L488.8,364.3 L488.8,365.7 L489.0,365.7 - L489.0,367.1 L489.2,367.1 L489.2,368.4 L489.4,368.4 L489.4,369.7 L489.7,369.7 L489.7,371.0 L489.9,371.0 - L489.9,372.3 L490.1,372.3 L490.1,373.5 L490.3,373.5 L490.3,374.8 L490.5,374.8 L490.5,376.0 L490.7,376.0 - L490.7,377.1 L491.0,377.1 L491.0,378.3 L491.2,378.3 L491.2,379.4 L491.4,379.4 L491.4,380.5 L491.6,380.5 - L491.6,381.6 L491.8,381.6 L491.8,382.6 L492.1,382.6 L492.1,383.7 L492.3,383.7 L492.3,384.7 L492.5,384.7 - L492.5,385.7 L492.7,385.7 L492.7,386.6 L492.9,386.6 L492.9,387.6 L493.1,387.6 L493.1,388.5 L493.4,388.5 - L493.4,389.4 L493.6,389.4 L493.6,390.3 L493.8,390.3 L493.8,391.2 L494.0,391.2 L494.0,392.1 L494.2,392.1 - L494.2,392.9 L494.4,392.9 L494.4,393.7 L494.7,393.7 L494.7,394.5 L494.9,394.5 L494.9,395.3 L495.1,395.3 - L495.1,396.1 L495.3,396.1 L495.3,396.9 L495.5,396.9 L495.5,397.6 L495.7,397.6 L495.7,398.3 L496.0,398.3 - L496.0,399.0 L496.2,399.0 L496.2,399.7 L496.4,399.7 L496.4,400.4 L496.6,400.4 L496.6,401.1 L496.8,401.1 - L496.8,401.8 L497.0,401.8 L497.0,395.0 L497.3,395.0 L497.3,388.2 L497.5,388.2 L497.5,381.5 L497.7,381.5 - L497.7,374.9 L497.9,374.9 L497.9,368.4 L498.1,368.4 L498.1,362.0 L498.3,362.0 L498.3,355.8 L498.6,355.8 - L498.6,349.6 L498.8,349.6 L498.8,343.6 L499.0,343.6 L499.0,337.7 L499.2,337.7 L499.2,331.9 L499.4,331.9 - L499.4,326.2 L499.7,326.2 L499.7,320.6 L499.9,320.6 L499.9,315.1 L500.1,315.1 L500.1,309.7 L500.3,309.7 - L500.3,304.3 L500.5,304.3 L500.5,299.1 L500.7,299.1 L500.7,294.0 L501.0,294.0 L501.0,289.0 L501.2,289.0 - L501.2,284.1 L501.4,284.1 L501.4,279.2 L501.6,279.2 L501.6,274.5 L501.8,274.5 L501.8,269.8 L502.0,269.8 - L502.0,265.2 L502.3,265.2 L502.3,260.7 L502.5,260.7 L502.5,256.3 L502.7,256.3 L502.7,252.0 L502.9,252.0 - L502.9,247.7 L503.1,247.7 L503.1,243.5 L503.3,243.5 L503.3,239.4 L503.6,239.4 L503.6,235.4 L503.8,235.4 - L503.8,231.4 L504.0,231.4 L504.0,227.6 L504.2,227.6 L504.2,223.7 L504.4,223.7 L504.4,220.0 L504.6,220.0 - L504.6,216.3 L504.9,216.3 L504.9,212.7 L505.1,212.7 L505.1,209.1 L505.3,209.1 L505.3,205.7 L505.5,205.7 - L505.5,202.2 L505.7,202.2 L505.7,198.9 L505.9,198.9 L505.9,195.6 L506.2,195.6 L506.2,192.3 L506.4,192.3 - L506.4,189.2 L506.6,189.2 L506.6,186.0 L506.8,186.0 L506.8,183.0 L507.0,183.0 L507.0,180.0 L507.2,180.0 - L507.2,177.0 L507.5,177.0 L507.5,174.1 L507.7,174.1 L507.7,171.3 L507.9,171.3 L507.9,168.5 L508.1,168.5 - L508.1,165.7 L508.3,165.7 L508.3,163.0 L508.6,163.0 L508.6,160.4 L508.8,160.4 L508.8,157.8 L509.0,157.8 - L509.0,155.2 L509.2,155.2 L509.2,152.7 L509.4,152.7 L509.4,150.2 L509.6,150.2 L509.6,147.8 L509.9,147.8 - L509.9,145.5 L510.1,145.5 L510.1,143.1 L510.3,143.1 L510.3,140.8 L510.5,140.8 L510.5,138.6 L510.7,138.6 - L510.7,136.4 L510.9,136.4 L510.9,134.2 L511.2,134.2 L511.2,132.1 L511.4,132.1 L511.4,130.0 L511.6,130.0 - L511.6,127.9 L511.8,127.9 L511.8,125.9 L512.0,125.9 L512.0,124.0 L512.2,124.0 L512.2,122.0 L512.5,122.0 - L512.5,120.1 L512.7,120.1 L512.7,118.2 L512.9,118.2 L512.9,116.4 L513.1,116.4 L513.1,114.6 L513.3,114.6 - L513.3,112.8 L513.5,112.8 L513.5,111.1 L513.8,111.1 L513.8,109.4 L514.0,109.4 L514.0,107.7 L514.2,107.7 - L514.2,106.0 L514.4,106.0 L514.4,104.4 L514.6,104.4 L514.6,102.8 L514.8,102.8 L514.8,101.3 L515.1,101.3 - L515.1,99.8 L515.3,99.8 L515.3,98.2 L515.5,98.2 L515.5,96.8 L515.7,96.8 L515.7,95.3 L515.9,95.3 - L515.9,93.9 L516.2,93.9 L516.2,92.5 L516.4,92.5 L516.4,91.1 L516.6,91.1 L516.6,89.8 L516.8,89.8 - L516.8,88.5 L517.0,88.5 L517.0,87.2 L517.2,87.2 L517.2,85.9 L517.5,85.9 L517.5,84.6 L517.7,84.6 - L517.7,83.4 L517.9,83.4 L517.9,82.2 L518.1,82.2 L518.1,81.0 L518.3,81.0 L518.3,79.8 L518.5,79.8 - L518.5,78.7 L518.8,78.7 L518.8,77.6 L519.0,77.6 L519.0,76.5 L519.2,76.5 L519.2,75.4 L519.4,75.4 - L519.4,74.3 L519.6,74.3 L519.6,73.3 L519.8,73.3 L519.8,72.3 L520.1,72.3 L520.1,71.3 L520.3,71.3 - L520.3,70.3 L520.5,70.3 L520.5,69.3 L520.7,69.3 L520.7,68.4 L520.9,68.4 L520.9,67.4 L521.1,67.4 - L521.1,66.5 L521.4,66.5 L521.4,65.6 L521.6,65.6 L521.6,64.7 L521.8,64.7 L521.8,63.8 L522.0,63.8 - L522.0,63.0 L522.2,63.0 L522.2,62.2 L522.4,62.2 L522.4,61.3 L522.7,61.3 L522.7,60.5 L522.9,60.5 - L522.9,59.7 L523.1,59.7 L523.1,67.1 L523.3,67.1 L523.3,74.5 L523.5,74.5 L523.5,81.8 L523.8,81.8 - L523.8,89.0 L524.0,89.0 L524.0,96.0 L524.2,96.0 L524.2,102.9 L524.4,102.9 L524.4,109.6 L524.6,109.6 - L524.6,116.2 L524.8,116.2 L524.8,122.7 L525.1,122.7 L525.1,129.0 L525.3,129.0 L525.3,135.2 L525.5,135.2 - L525.5,141.3 L525.7,141.3 L525.7,147.3 L525.9,147.3 L525.9,153.1 L526.1,153.1 L526.1,158.8 L526.4,158.8 - L526.4,164.4 L526.6,164.4 L526.6,169.9 L526.8,169.9 L526.8,175.3 L527.0,175.3 L527.0,180.5 L527.2,180.5 - L527.2,185.7 L527.4,185.7 L527.4,190.7 L527.7,190.7 L527.7,195.7 L527.9,195.7 L527.9,200.5 L528.1,200.5 - L528.1,205.3 L528.3,205.3 L528.3,209.9 L528.5,209.9 L528.5,214.5 L528.7,214.5 L528.7,218.9 L529.0,218.9 - L529.0,223.3 L529.2,223.3 L529.2,227.6 L529.4,227.6 L529.4,231.8 L529.6,231.8 L529.6,235.9 L529.8,235.9 - L529.8,239.9 L530.0,239.9 L530.0,243.9 L530.3,243.9 L530.3,247.7 L530.5,247.7 L530.5,251.5 L530.7,251.5 - L530.7,255.2 L530.9,255.2 L530.9,258.8 L531.1,258.8 L531.1,262.4 L531.4,262.4 L531.4,265.9 L531.6,265.9 - L531.6,269.3 L531.8,269.3 L531.8,272.6 L532.0,272.6 L532.0,275.9 L532.2,275.9 L532.2,279.1 L532.4,279.1 - L532.4,282.3 L532.7,282.3 L532.7,285.3 L532.9,285.3 L532.9,288.4 L533.1,288.4 L533.1,291.3 L533.3,291.3 - L533.3,294.2 L533.5,294.2 L533.5,297.1 L533.7,297.1 L533.7,299.8 L534.0,299.8 L534.0,302.6 L534.2,302.6 - L534.2,305.2 L534.4,305.2 L534.4,307.8 L534.6,307.8 L534.6,310.4 L534.8,310.4 L534.8,312.9 L535.0,312.9 - L535.0,315.3 L535.3,315.3 L535.3,317.8 L535.5,317.8 L535.5,320.1 L535.7,320.1 L535.7,322.4 L535.9,322.4 - L535.9,324.7 L536.1,324.7 L536.1,326.9 L536.3,326.9 L536.3,329.1 L536.6,329.1 L536.6,331.2 L536.8,331.2 - L536.8,333.3 L537.0,333.3 L537.0,335.3 L537.2,335.3 L537.2,337.3 L537.4,337.3 L537.4,339.3 L537.6,339.3 - L537.6,341.2 L537.9,341.2 L537.9,343.1 L538.1,343.1 L538.1,344.9 L538.3,344.9 L538.3,346.7 L538.5,346.7 - L538.5,348.5 L538.7,348.5 L538.7,350.2 L538.9,350.2 L538.9,351.9 L539.2,351.9 L539.2,353.6 L539.4,353.6 - L539.4,355.2 L539.6,355.2 L539.6,356.8 L539.8,356.8 L539.8,358.3 L540.0,358.3 L540.0,359.9 L540.3,359.9 - L540.3,361.4 L540.5,361.4 L540.5,362.8 L540.7,362.8 L540.7,364.3 L540.9,364.3 L540.9,365.7 L541.1,365.7 - L541.1,367.1 L541.3,367.1 L541.3,368.4 L541.6,368.4 L541.6,369.7 L541.8,369.7 L541.8,371.0 L542.0,371.0 - L542.0,372.3 L542.2,372.3 L542.2,373.5 L542.4,373.5 L542.4,374.8 L542.6,374.8 L542.6,376.0 L542.9,376.0 - L542.9,377.1 L543.1,377.1 L543.1,378.3 L543.3,378.3 L543.3,379.4 L543.5,379.4 L543.5,380.5 L543.7,380.5 - L543.7,381.6 L543.9,381.6 L543.9,382.6 L544.2,382.6 L544.2,383.7 L544.4,383.7 L544.4,384.7 L544.6,384.7 - L544.6,385.7 L544.8,385.7 L544.8,386.6 L545.0,386.6 L545.0,387.6 L545.2,387.6 L545.2,388.5 L545.5,388.5 - L545.5,389.4 L545.7,389.4 L545.7,390.3 L545.9,390.3 L545.9,391.2 L546.1,391.2 L546.1,392.1 L546.3,392.1 - L546.3,392.9 L546.5,392.9 L546.5,393.7 L546.8,393.7 L546.8,394.5 L547.0,394.5 L547.0,395.3 L547.2,395.3 - L547.2,396.1 L547.4,396.1 L547.4,396.9 L547.6,396.9 L547.6,397.6 L547.9,397.6 L547.9,398.3 L548.1,398.3 - L548.1,399.0 L548.3,399.0 L548.3,399.7 L548.5,399.7 L548.5,400.4 L548.7,400.4 L548.7,401.1 L548.9,401.1 - L548.9,401.8 L549.2,401.8 L549.2,395.1 L549.4,395.1 L549.4,388.2 L549.6,388.2 L549.6,381.5 L549.8,381.5 - L549.8,374.9 L550.0,374.9 L550.0,368.4 L550.2,368.4 L550.2,362.0 L550.5,362.0 L550.5,355.8 L550.7,355.8 - L550.7,349.6 L550.9,349.6 L550.9,343.6 L551.1,343.6 L551.1,337.7 L551.3,337.7 L551.3,331.9 L551.5,331.9 - L551.5,326.2 L551.8,326.2 L551.8,320.6 L552.0,320.6 L552.0,315.1 L552.2,315.1 L552.2,309.7 L552.4,309.7 - L552.4,304.4 L552.6,304.4 L552.6,299.2 L552.8,299.2 L552.8,294.0 L553.1,294.0 L553.1,289.0 L553.3,289.0 - L553.3,284.1 L553.5,284.1 L553.5,279.3 L553.7,279.3 L553.7,274.5 L553.9,274.5 L553.9,269.8 L554.1,269.8 - L554.1,265.3 L554.4,265.3 L554.4,260.8 L554.6,260.8 L554.6,256.3 L554.8,256.3 L554.8,252.0 L555.0,252.0 - L555.0,247.7 L555.2,247.7 L555.2,243.6 L555.5,243.6 L555.5,239.4 L555.7,239.4 L555.7,235.4 L555.9,235.4 - L555.9,231.5 L556.1,231.5 L556.1,227.6 L556.3,227.6 L556.3,223.8 L556.5,223.8 L556.5,220.0 L556.8,220.0 - L556.8,216.3 L557.0,216.3 L557.0,212.7 L557.2,212.7 L557.2,209.2 L557.4,209.2 L557.4,205.7 L557.6,205.7 - L557.6,202.3 L557.8,202.3 L557.8,198.9 L558.1,198.9 L558.1,195.6 L558.3,195.6 L558.3,192.4 L558.5,192.4 - L558.5,189.2 L558.7,189.2 L558.7,186.1 L558.9,186.1 L558.9,183.0 L559.1,183.0 L559.1,180.0 L559.4,180.0 - L559.4,177.0 L559.6,177.0 L559.6,174.1 L559.8,174.1 L559.8,171.3 L560.0,171.3 L560.0,168.5 L560.2,168.5 - L560.2,165.7 L560.4,165.7 L560.4,163.0 L560.7,163.0 L560.7,160.4 L560.9,160.4 L560.9,157.8 L561.1,157.8 - L561.1,155.2 L561.3,155.2 L561.3,152.7 L561.5,152.7 L561.5,150.3 L561.7,150.3 L561.7,147.8 L562.0,147.8 - L562.0,145.5 L562.2,145.5 L562.2,143.1 L562.4,143.1 L562.4,140.8 L562.6,140.8 L562.6,138.6 L562.8,138.6 - L562.8,136.4 L563.1,136.4 L563.1,134.2 L563.3,134.2 L563.3,132.1 L563.5,132.1 L563.5,130.0 L563.7,130.0 - L563.7,128.0 L563.9,128.0 L563.9,125.9 L564.1,125.9 L564.1,124.0 L564.4,124.0 L564.4,122.0 L564.6,122.0 - L564.6,120.1 L564.8,120.1 L564.8,118.2 L565.0,118.2 L565.0,116.4 L565.2,116.4 L565.2,114.6 L565.4,114.6 - L565.4,112.8 L565.7,112.8 L565.7,111.1 L565.9,111.1 L565.9,109.4 L566.1,109.4 L566.1,107.7 L566.3,107.7 - L566.3,106.1 L566.5,106.1 L566.5,104.4 L566.7,104.4 L566.7,102.9 L567.0,102.9 L567.0,101.3 L567.2,101.3 - L567.2,99.8 L567.4,99.8 L567.4,98.3 L567.6,98.3 L567.6,96.8 L567.8,96.8 L567.8,95.3 L568.0,95.3 - L568.0,93.9 L568.3,93.9 L568.3,92.5 L568.5,92.5 L568.5,91.1 L568.7,91.1 L568.7,89.8 L568.9,89.8 - L568.9,88.5 L569.1,88.5 L569.1,87.2 L569.3,87.2 L569.3,85.9 L569.6,85.9 L569.6,84.6 L569.8,84.6 - L569.8,83.4 L570.0,83.4 L570.0,82.2 L570.2,82.2 L570.2,81.0 L570.4,81.0 L570.4,79.9 L570.6,79.9 - L570.6,78.7 L570.9,78.7 L570.9,77.6 L571.1,77.6 L571.1,76.5 L571.3,76.5 L571.3,75.4 L571.5,75.4 - L571.5,74.3 L571.7,74.3 L571.7,73.3 L572.0,73.3 L572.0,72.3 L572.2,72.3 L572.2,71.3 L572.4,71.3 - L572.4,70.3 L572.6,70.3 L572.6,69.3 L572.8,69.3 L572.8,68.4 L573.0,68.4 L573.0,67.4 L573.3,67.4 - L573.3,66.5 L573.5,66.5 L573.5,65.6 L573.7,65.6 L573.7,64.7 L573.9,64.7 L573.9,63.8 L574.1,63.8 - L574.1,63.0 L574.3,63.0 L574.3,62.2 L574.6,62.2 L574.6,61.3 L574.8,61.3 L574.8,60.5 L575.0,60.5 - L575.0,59.7 '/></g> + L314.4,59.7 L314.5,59.7 L314.7,59.7 L314.7,67.2 L314.9,67.2 L314.9,74.7 L315.1,74.7 L315.1,82.0 + L315.3,82.0 L315.3,89.2 L315.5,89.2 L315.5,96.2 L315.8,96.2 L315.8,103.1 L316.0,103.1 L316.0,109.8 + L316.2,109.8 L316.2,116.4 L316.4,116.4 L316.4,122.9 L316.6,122.9 L316.6,129.2 L316.8,129.2 L316.8,135.4 + L317.1,135.4 L317.1,141.5 L317.3,141.5 L317.3,147.4 L317.5,147.4 L317.5,153.2 L317.7,153.2 L317.7,158.9 + L317.9,158.9 L317.9,164.5 L318.1,164.5 L318.1,170.0 L318.4,170.0 L318.4,175.4 L318.6,175.4 L318.6,180.7 + L318.8,180.7 L318.8,185.8 L319.0,185.8 L319.0,190.8 L319.2,190.8 L319.2,195.8 L319.4,195.8 L319.4,200.6 + L319.7,200.6 L319.7,205.4 L319.9,205.4 L319.9,210.0 L320.1,210.0 L320.1,214.6 L320.3,214.6 L320.3,219.0 + L320.5,219.0 L320.5,223.4 L320.7,223.4 L320.7,227.7 L321.0,227.7 L321.0,231.9 L321.2,231.9 L321.2,236.0 + L321.4,236.0 L321.4,240.0 L321.6,240.0 L321.6,243.9 L321.8,243.9 L321.8,247.8 L322.0,247.8 L322.0,251.6 + L322.3,251.6 L322.3,255.3 L322.5,255.3 L322.5,258.9 L322.7,258.9 L322.7,262.5 L322.9,262.5 L322.9,266.0 + L323.1,266.0 L323.1,269.4 L323.4,269.4 L323.4,272.7 L323.6,272.7 L323.6,276.0 L323.8,276.0 L323.8,279.2 + L324.0,279.2 L324.0,282.3 L324.2,282.3 L324.2,285.4 L324.4,285.4 L324.4,288.4 L324.7,288.4 L324.7,291.4 + L324.9,291.4 L324.9,294.3 L325.1,294.3 L325.1,297.1 L325.3,297.1 L325.3,299.9 L325.5,299.9 L325.5,302.6 + L325.7,302.6 L325.7,305.3 L326.0,305.3 L326.0,307.9 L326.2,307.9 L326.2,310.4 L326.4,310.4 L326.4,313.0 + L326.6,313.0 L326.6,315.4 L326.8,315.4 L326.8,317.8 L327.0,317.8 L327.0,320.2 L327.3,320.2 L327.3,322.5 + L327.5,322.5 L327.5,324.7 L327.7,324.7 L327.7,326.9 L327.9,326.9 L327.9,329.1 L328.1,329.1 L328.1,331.2 + L328.3,331.2 L328.3,333.3 L328.6,333.3 L328.6,335.4 L328.8,335.4 L328.8,337.4 L329.0,337.4 L329.0,339.3 + L329.2,339.3 L329.2,341.2 L329.4,341.2 L329.4,343.1 L329.6,343.1 L329.6,344.9 L329.9,344.9 L329.9,346.7 + L330.1,346.7 L330.1,348.5 L330.3,348.5 L330.3,350.2 L330.5,350.2 L330.5,351.9 L330.7,351.9 L330.7,353.6 + L331.0,353.6 L331.0,355.2 L331.2,355.2 L331.2,356.8 L331.4,356.8 L331.4,358.4 L331.6,358.4 L331.6,359.9 + L331.8,359.9 L331.8,361.4 L332.0,361.4 L332.0,362.9 L332.3,362.9 L332.3,364.3 L332.5,364.3 L332.5,365.7 + L332.7,365.7 L332.7,367.1 L332.9,367.1 L332.9,368.4 L333.1,368.4 L333.1,369.8 L333.3,369.8 L333.3,371.1 + L333.6,371.1 L333.6,372.3 L333.8,372.3 L333.8,373.6 L334.0,373.6 L334.0,374.8 L334.2,374.8 L334.2,376.0 + L334.4,376.0 L334.4,377.1 L334.6,377.1 L334.6,378.3 L334.9,378.3 L334.9,379.4 L335.1,379.4 L335.1,380.5 + L335.3,380.5 L335.3,381.6 L335.5,381.6 L335.5,382.6 L335.7,382.6 L335.7,383.7 L335.9,383.7 L335.9,384.7 + L336.2,384.7 L336.2,385.7 L336.4,385.7 L336.4,386.7 L336.6,386.7 L336.6,387.6 L336.8,387.6 L336.8,388.5 + L337.0,388.5 L337.0,389.5 L337.2,389.5 L337.2,390.3 L337.5,390.3 L337.5,391.2 L337.7,391.2 L337.7,392.1 + L337.9,392.1 L337.9,392.9 L338.1,392.9 L338.1,393.7 L338.3,393.7 L338.3,394.6 L338.6,394.6 L338.6,395.3 + L338.8,395.3 L338.8,396.1 L339.0,396.1 L339.0,396.9 L339.2,396.9 L339.2,397.6 L339.4,397.6 L339.4,398.3 + L339.6,398.3 L339.6,399.1 L339.9,399.1 L339.9,399.8 L340.1,399.8 L340.1,400.4 L340.3,400.4 L340.3,401.1 + L340.5,401.1 L340.5,401.8 L340.7,401.8 L340.7,394.9 L340.9,394.9 L340.9,388.0 L341.2,388.0 L341.2,381.3 + L341.4,381.3 L341.4,374.7 L341.6,374.7 L341.6,368.2 L341.8,368.2 L341.8,361.9 L342.0,361.9 L342.0,355.6 + L342.2,355.6 L342.2,349.5 L342.5,349.5 L342.5,343.5 L342.7,343.5 L342.7,337.5 L342.9,337.5 L342.9,331.7 + L343.1,331.7 L343.1,326.0 L343.3,326.0 L343.3,320.4 L343.5,320.4 L343.5,314.9 L343.8,314.9 L343.8,309.5 + L344.0,309.5 L344.0,304.2 L344.2,304.2 L344.2,299.0 L344.4,299.0 L344.4,293.9 L344.6,293.9 L344.6,288.9 + L344.8,288.9 L344.8,284.0 L345.1,284.0 L345.1,279.1 L345.3,279.1 L345.3,274.4 L345.5,274.4 L345.5,269.7 + L345.7,269.7 L345.7,265.1 L345.9,265.1 L345.9,260.6 L346.1,260.6 L346.1,256.2 L346.4,256.2 L346.4,251.9 + L346.6,251.9 L346.6,247.6 L346.8,247.6 L346.8,243.5 L347.0,243.5 L347.0,239.3 L347.2,239.3 L347.2,235.3 + L347.5,235.3 L347.5,231.4 L347.7,231.4 L347.7,227.5 L347.9,227.5 L347.9,223.7 L348.1,223.7 L348.1,219.9 + L348.3,219.9 L348.3,216.2 L348.5,216.2 L348.5,212.6 L348.8,212.6 L348.8,209.1 L349.0,209.1 L349.0,205.6 + L349.2,205.6 L349.2,202.2 L349.4,202.2 L349.4,198.8 L349.6,198.8 L349.6,195.5 L349.8,195.5 L349.8,192.3 + L350.1,192.3 L350.1,189.1 L350.3,189.1 L350.3,186.0 L350.5,186.0 L350.5,182.9 L350.7,182.9 L350.7,179.9 + L350.9,179.9 L350.9,177.0 L351.1,177.0 L351.1,174.1 L351.4,174.1 L351.4,171.2 L351.6,171.2 L351.6,168.4 + L351.8,168.4 L351.8,165.7 L352.0,165.7 L352.0,163.0 L352.2,163.0 L352.2,160.3 L352.4,160.3 L352.4,157.7 + L352.7,157.7 L352.7,155.2 L352.9,155.2 L352.9,152.7 L353.1,152.7 L353.1,150.2 L353.3,150.2 L353.3,147.8 + L353.5,147.8 L353.5,145.4 L353.7,145.4 L353.7,143.1 L354.0,143.1 L354.0,140.8 L354.2,140.8 L354.2,138.5 + L354.4,138.5 L354.4,136.3 L354.6,136.3 L354.6,134.2 L354.8,134.2 L354.8,132.0 L355.1,132.0 L355.1,130.0 + L355.3,130.0 L355.3,127.9 L355.5,127.9 L355.5,125.9 L355.7,125.9 L355.7,123.9 L355.9,123.9 L355.9,122.0 + L356.1,122.0 L356.1,120.1 L356.4,120.1 L356.4,118.2 L356.6,118.2 L356.6,116.4 L356.8,116.4 L356.8,114.6 + L357.0,114.6 L357.0,112.8 L357.2,112.8 L357.2,111.0 L357.4,111.0 L357.4,109.3 L357.7,109.3 L357.7,107.7 + L357.9,107.7 L357.9,106.0 L358.1,106.0 L358.1,104.4 L358.3,104.4 L358.3,102.8 L358.5,102.8 L358.5,101.3 + L358.7,101.3 L358.7,99.7 L359.0,99.7 L359.0,98.2 L359.2,98.2 L359.2,96.7 L359.4,96.7 L359.4,95.3 + L359.6,95.3 L359.6,93.9 L359.8,93.9 L359.8,92.5 L360.0,92.5 L360.0,91.1 L360.3,91.1 L360.3,89.8 + L360.5,89.8 L360.5,88.4 L360.7,88.4 L360.7,87.1 L360.9,87.1 L360.9,85.9 L361.1,85.9 L361.1,84.6 + L361.3,84.6 L361.3,83.4 L361.6,83.4 L361.6,82.2 L361.8,82.2 L361.8,81.0 L362.0,81.0 L362.0,79.8 + L362.2,79.8 L362.2,78.7 L362.4,78.7 L362.4,77.6 L362.7,77.6 L362.7,76.5 L362.9,76.5 L362.9,75.4 + L363.1,75.4 L363.1,74.3 L363.3,74.3 L363.3,73.3 L363.5,73.3 L363.5,72.2 L363.7,72.2 L363.7,71.2 + L364.0,71.2 L364.0,70.3 L364.2,70.3 L364.2,69.3 L364.4,69.3 L364.4,68.3 L364.6,68.3 L364.6,67.4 + L364.8,67.4 L364.8,66.5 L365.0,66.5 L365.0,65.6 L365.3,65.6 L365.3,64.7 L365.5,64.7 L365.5,63.8 + L365.7,63.8 L365.7,63.0 L365.9,63.0 L365.9,62.1 L366.1,62.1 L366.1,61.3 L366.3,61.3 L366.3,60.5 + L366.6,60.5 L366.6,59.7 L366.8,59.7 L366.8,67.2 L367.0,67.2 L367.0,74.7 L367.2,74.7 L367.2,82.0 + L367.4,82.0 L367.4,89.2 L367.6,89.2 L367.6,96.2 L367.9,96.2 L367.9,103.0 L368.1,103.0 L368.1,109.8 + L368.3,109.8 L368.3,116.4 L368.5,116.4 L368.5,122.8 L368.7,122.8 L368.7,129.2 L368.9,129.2 L368.9,135.4 + L369.2,135.4 L369.2,141.4 L369.4,141.4 L369.4,147.4 L369.6,147.4 L369.6,153.2 L369.8,153.2 L369.8,158.9 + L370.0,158.9 L370.0,164.5 L370.3,164.5 L370.3,170.0 L370.5,170.0 L370.5,175.4 L370.7,175.4 L370.7,180.6 + L370.9,180.6 L370.9,185.8 L371.1,185.8 L371.1,190.8 L371.3,190.8 L371.3,195.8 L371.6,195.8 L371.6,200.6 + L371.8,200.6 L371.8,205.4 L372.0,205.4 L372.0,210.0 L372.2,210.0 L372.2,214.6 L372.4,214.6 L372.4,219.0 + L372.6,219.0 L372.6,223.4 L372.9,223.4 L372.9,227.7 L373.1,227.7 L373.1,231.9 L373.3,231.9 L373.3,236.0 + L373.5,236.0 L373.5,240.0 L373.7,240.0 L373.7,243.9 L373.9,243.9 L373.9,247.8 L374.2,247.8 L374.2,251.6 + L374.4,251.6 L374.4,255.3 L374.6,255.3 L374.6,258.9 L374.8,258.9 L374.8,262.5 L375.0,262.5 L375.0,266.0 + L375.2,266.0 L375.2,269.4 L375.5,269.4 L375.5,272.7 L375.7,272.7 L375.7,276.0 L375.9,276.0 L375.9,279.2 + L376.1,279.2 L376.1,282.3 L376.3,282.3 L376.3,285.4 L376.5,285.4 L376.5,288.4 L376.8,288.4 L376.8,291.4 + L377.0,291.4 L377.0,294.3 L377.2,294.3 L377.2,297.1 L377.4,297.1 L377.4,299.9 L377.6,299.9 L377.6,302.6 + L377.8,302.6 L377.8,305.3 L378.1,305.3 L378.1,307.9 L378.3,307.9 L378.3,310.4 L378.5,310.4 L378.5,312.9 + L378.7,312.9 L378.7,315.4 L378.9,315.4 L378.9,317.8 L379.2,317.8 L379.2,320.2 L379.4,320.2 L379.4,322.5 + L379.6,322.5 L379.6,324.7 L379.8,324.7 L379.8,326.9 L380.0,326.9 L380.0,329.1 L380.2,329.1 L380.2,331.2 + L380.5,331.2 L380.5,333.3 L380.7,333.3 L380.7,335.4 L380.9,335.4 L380.9,337.4 L381.1,337.4 L381.1,339.3 + L381.3,339.3 L381.3,341.2 L381.5,341.2 L381.5,343.1 L381.8,343.1 L381.8,344.9 L382.0,344.9 L382.0,346.7 + L382.2,346.7 L382.2,348.5 L382.4,348.5 L382.4,350.2 L382.6,350.2 L382.6,351.9 L382.8,351.9 L382.8,353.6 + L383.1,353.6 L383.1,355.2 L383.3,355.2 L383.3,356.8 L383.5,356.8 L383.5,358.4 L383.7,358.4 L383.7,359.9 + L383.9,359.9 L383.9,361.4 L384.1,361.4 L384.1,362.9 L384.4,362.9 L384.4,364.3 L384.6,364.3 L384.6,365.7 + L384.8,365.7 L384.8,367.1 L385.0,367.1 L385.0,368.4 L385.2,368.4 L385.2,369.8 L385.4,369.8 L385.4,371.1 + L385.7,371.1 L385.7,372.3 L385.9,372.3 L385.9,373.6 L386.1,373.6 L386.1,374.8 L386.3,374.8 L386.3,376.0 + L386.5,376.0 L386.5,377.1 L386.8,377.1 L386.8,378.3 L387.0,378.3 L387.0,379.4 L387.2,379.4 L387.2,380.5 + L387.4,380.5 L387.4,381.6 L387.6,381.6 L387.6,382.6 L387.8,382.6 L387.8,383.7 L388.1,383.7 L388.1,384.7 + L388.3,384.7 L388.3,385.7 L388.5,385.7 L388.5,386.7 L388.7,386.7 L388.7,387.6 L388.9,387.6 L388.9,388.5 + L389.1,388.5 L389.1,389.4 L389.4,389.4 L389.4,390.3 L389.6,390.3 L389.6,391.2 L389.8,391.2 L389.8,392.1 + L390.0,392.1 L390.0,392.9 L390.2,392.9 L390.2,393.7 L390.4,393.7 L390.4,394.5 L390.7,394.5 L390.7,395.3 + L390.9,395.3 L390.9,396.1 L391.1,396.1 L391.1,396.9 L391.3,396.9 L391.3,397.6 L391.5,397.6 L391.5,398.3 + L391.7,398.3 L391.7,399.1 L392.0,399.1 L392.0,399.8 L392.2,399.8 L392.2,400.4 L392.4,400.4 L392.4,401.1 + L392.6,401.1 L392.6,401.8 L392.8,401.8 L392.8,394.9 L393.0,394.9 L393.0,388.1 L393.3,388.1 L393.3,381.3 + L393.5,381.3 L393.5,374.7 L393.7,374.7 L393.7,368.2 L393.9,368.2 L393.9,361.9 L394.1,361.9 L394.1,355.6 + L394.4,355.6 L394.4,349.5 L394.6,349.5 L394.6,343.5 L394.8,343.5 L394.8,337.6 L395.0,337.6 L395.0,331.8 + L395.2,331.8 L395.2,326.0 L395.4,326.0 L395.4,320.4 L395.7,320.4 L395.7,314.9 L395.9,314.9 L395.9,309.6 + L396.1,309.6 L396.1,304.2 L396.3,304.2 L396.3,299.0 L396.5,299.0 L396.5,293.9 L396.7,293.9 L396.7,288.9 + L397.0,288.9 L397.0,284.0 L397.2,284.0 L397.2,279.1 L397.4,279.1 L397.4,274.4 L397.6,274.4 L397.6,269.7 + L397.8,269.7 L397.8,265.2 L398.0,265.2 L398.0,260.7 L398.3,260.7 L398.3,256.2 L398.5,256.2 L398.5,251.9 + L398.7,251.9 L398.7,247.6 L398.9,247.6 L398.9,243.5 L399.1,243.5 L399.1,239.4 L399.3,239.4 L399.3,235.3 + L399.6,235.3 L399.6,231.4 L399.8,231.4 L399.8,227.5 L400.0,227.5 L400.0,223.7 L400.2,223.7 L400.2,219.9 + L400.4,219.9 L400.4,216.2 L400.6,216.2 L400.6,212.6 L400.9,212.6 L400.9,209.1 L401.1,209.1 L401.1,205.6 + L401.3,205.6 L401.3,202.2 L401.5,202.2 L401.5,198.8 L401.7,198.8 L401.7,195.5 L402.0,195.5 L402.0,192.3 + L402.2,192.3 L402.2,189.1 L402.4,189.1 L402.4,186.0 L402.6,186.0 L402.6,182.9 L402.8,182.9 L402.8,179.9 + L403.0,179.9 L403.0,177.0 L403.3,177.0 L403.3,174.1 L403.5,174.1 L403.5,171.2 L403.7,171.2 L403.7,168.4 + L403.9,168.4 L403.9,165.7 L404.1,165.7 L404.1,163.0 L404.3,163.0 L404.3,160.3 L404.6,160.3 L404.6,157.7 + L404.8,157.7 L404.8,155.2 L405.0,155.2 L405.0,152.7 L405.2,152.7 L405.2,150.2 L405.4,150.2 L405.4,147.8 + L405.6,147.8 L405.6,145.4 L405.9,145.4 L405.9,143.1 L406.1,143.1 L406.1,140.8 L406.3,140.8 L406.3,138.5 + L406.5,138.5 L406.5,136.3 L406.7,136.3 L406.7,134.2 L406.9,134.2 L406.9,132.0 L407.2,132.0 L407.2,130.0 + L407.4,130.0 L407.4,127.9 L407.6,127.9 L407.6,125.9 L407.8,125.9 L407.8,123.9 L408.0,123.9 L408.0,122.0 + L408.2,122.0 L408.2,120.1 L408.5,120.1 L408.5,118.2 L408.7,118.2 L408.7,116.4 L408.9,116.4 L408.9,114.6 + L409.1,114.6 L409.1,112.8 L409.3,112.8 L409.3,111.0 L409.6,111.0 L409.6,109.3 L409.8,109.3 L409.8,107.7 + L410.0,107.7 L410.0,106.0 L410.2,106.0 L410.2,104.4 L410.4,104.4 L410.4,102.8 L410.6,102.8 L410.6,101.3 + L410.9,101.3 L410.9,99.7 L411.1,99.7 L411.1,98.2 L411.3,98.2 L411.3,96.7 L411.5,96.7 L411.5,95.3 + L411.7,95.3 L411.7,93.9 L411.9,93.9 L411.9,92.5 L412.2,92.5 L412.2,91.1 L412.4,91.1 L412.4,89.8 + L412.6,89.8 L412.6,88.4 L412.8,88.4 L412.8,87.1 L413.0,87.1 L413.0,85.9 L413.2,85.9 L413.2,84.6 + L413.5,84.6 L413.5,83.4 L413.7,83.4 L413.7,82.2 L413.9,82.2 L413.9,81.0 L414.1,81.0 L414.1,79.8 + L414.3,79.8 L414.3,78.7 L414.5,78.7 L414.5,77.6 L414.8,77.6 L414.8,76.5 L415.0,76.5 L415.0,75.4 + L415.2,75.4 L415.2,74.3 L415.4,74.3 L415.4,73.3 L415.6,73.3 L415.6,72.2 L415.8,72.2 L415.8,71.2 + L416.1,71.2 L416.1,70.3 L416.3,70.3 L416.3,69.3 L416.5,69.3 L416.5,68.3 L416.7,68.3 L416.7,67.4 + L416.9,67.4 L416.9,66.5 L417.1,66.5 L417.1,65.6 L417.4,65.6 L417.4,64.7 L417.6,64.7 L417.6,63.8 + L417.8,63.8 L417.8,63.0 L418.0,63.0 L418.0,62.1 L418.2,62.1 L418.2,61.3 L418.5,61.3 L418.5,60.5 + L418.7,60.5 L418.7,59.7 L418.9,59.7 L418.9,67.2 L419.1,67.2 L419.1,74.7 L419.3,74.7 L419.3,82.0 + L419.5,82.0 L419.5,89.1 L419.8,89.1 L419.8,96.2 L420.0,96.2 L420.0,103.0 L420.2,103.0 L420.2,109.8 + L420.4,109.8 L420.4,116.4 L420.6,116.4 L420.6,122.8 L420.8,122.8 L420.8,129.2 L421.1,129.2 L421.1,135.4 + L421.3,135.4 L421.3,141.4 L421.5,141.4 L421.5,147.4 L421.7,147.4 L421.7,153.2 L421.9,153.2 L421.9,158.9 + L422.1,158.9 L422.1,164.5 L422.4,164.5 L422.4,170.0 L422.6,170.0 L422.6,175.4 L422.8,175.4 L422.8,180.6 + L423.0,180.6 L423.0,185.8 L423.2,185.8 L423.2,190.8 L423.4,190.8 L423.4,195.8 L423.7,195.8 L423.7,200.6 + L423.9,200.6 L423.9,205.4 L424.1,205.4 L424.1,210.0 L424.3,210.0 L424.3,214.6 L424.5,214.6 L424.5,219.0 + L424.7,219.0 L424.7,223.4 L425.0,223.4 L425.0,227.7 L425.2,227.7 L425.2,231.9 L425.4,231.9 L425.4,236.0 + L425.6,236.0 L425.6,240.0 L425.8,240.0 L425.8,243.9 L426.1,243.9 L426.1,247.8 L426.3,247.8 L426.3,251.6 + L426.5,251.6 L426.5,255.3 L426.7,255.3 L426.7,258.9 L426.9,258.9 L426.9,262.5 L427.1,262.5 L427.1,266.0 + L427.4,266.0 L427.4,269.4 L427.6,269.4 L427.6,272.7 L427.8,272.7 L427.8,276.0 L428.0,276.0 L428.0,279.2 + L428.2,279.2 L428.2,282.3 L428.4,282.3 L428.4,285.4 L428.7,285.4 L428.7,288.4 L428.9,288.4 L428.9,291.4 + L429.1,291.4 L429.1,294.3 L429.3,294.3 L429.3,297.1 L429.5,297.1 L429.5,299.9 L429.7,299.9 L429.7,302.6 + L430.0,302.6 L430.0,305.3 L430.2,305.3 L430.2,307.9 L430.4,307.9 L430.4,310.4 L430.6,310.4 L430.6,312.9 + L430.8,312.9 L430.8,315.4 L431.0,315.4 L431.0,317.8 L431.3,317.8 L431.3,320.2 L431.5,320.2 L431.5,322.5 + L431.7,322.5 L431.7,324.7 L431.9,324.7 L431.9,326.9 L432.1,326.9 L432.1,329.1 L432.3,329.1 L432.3,331.2 + L432.6,331.2 L432.6,333.3 L432.8,333.3 L432.8,335.4 L433.0,335.4 L433.0,337.3 L433.2,337.3 L433.2,339.3 + L433.4,339.3 L433.4,341.2 L433.7,341.2 L433.7,343.1 L433.9,343.1 L433.9,344.9 L434.1,344.9 L434.1,346.7 + L434.3,346.7 L434.3,348.5 L434.5,348.5 L434.5,350.2 L434.7,350.2 L434.7,351.9 L435.0,351.9 L435.0,353.6 + L435.2,353.6 L435.2,355.2 L435.4,355.2 L435.4,356.8 L435.6,356.8 L435.6,358.4 L435.8,358.4 L435.8,359.9 + L436.0,359.9 L436.0,361.4 L436.3,361.4 L436.3,362.9 L436.5,362.9 L436.5,364.3 L436.7,364.3 L436.7,365.7 + L436.9,365.7 L436.9,367.1 L437.1,367.1 L437.1,368.4 L437.3,368.4 L437.3,369.8 L437.6,369.8 L437.6,371.0 + L437.8,371.0 L437.8,372.3 L438.0,372.3 L438.0,373.6 L438.2,373.6 L438.2,374.8 L438.4,374.8 L438.4,376.0 + L438.6,376.0 L438.6,377.1 L438.9,377.1 L438.9,378.3 L439.1,378.3 L439.1,379.4 L439.3,379.4 L439.3,380.5 + L439.5,380.5 L439.5,381.6 L439.7,381.6 L439.7,382.6 L439.9,382.6 L439.9,383.7 L440.2,383.7 L440.2,384.7 + L440.4,384.7 L440.4,385.7 L440.6,385.7 L440.6,386.6 L440.8,386.6 L440.8,387.6 L441.0,387.6 L441.0,388.5 + L441.3,388.5 L441.3,389.4 L441.5,389.4 L441.5,390.3 L441.7,390.3 L441.7,391.2 L441.9,391.2 L441.9,392.1 + L442.1,392.1 L442.1,392.9 L442.3,392.9 L442.3,393.7 L442.6,393.7 L442.6,394.5 L442.8,394.5 L442.8,395.3 + L443.0,395.3 L443.0,396.1 L443.2,396.1 L443.2,396.9 L443.4,396.9 L443.4,397.6 L443.6,397.6 L443.6,398.3 + L443.9,398.3 L443.9,399.1 L444.1,399.1 L444.1,399.8 L444.3,399.8 L444.3,400.4 L444.5,400.4 L444.5,401.1 + L444.7,401.1 L444.7,401.8 L444.9,401.8 L444.9,394.9 L445.2,394.9 L445.2,388.1 L445.4,388.1 L445.4,381.3 + L445.6,381.3 L445.6,374.7 L445.8,374.7 L445.8,368.3 L446.0,368.3 L446.0,361.9 L446.2,361.9 L446.2,355.7 + L446.5,355.7 L446.5,349.5 L446.7,349.5 L446.7,343.5 L446.9,343.5 L446.9,337.6 L447.1,337.6 L447.1,331.8 + L447.3,331.8 L447.3,326.1 L447.5,326.1 L447.5,320.5 L447.8,320.5 L447.8,315.0 L448.0,315.0 L448.0,309.6 + L448.2,309.6 L448.2,304.3 L448.4,304.3 L448.4,299.1 L448.6,299.1 L448.6,293.9 L448.8,293.9 L448.8,288.9 + L449.1,288.9 L449.1,284.0 L449.3,284.0 L449.3,279.2 L449.5,279.2 L449.5,274.4 L449.7,274.4 L449.7,269.7 + L449.9,269.7 L449.9,265.2 L450.2,265.2 L450.2,260.7 L450.4,260.7 L450.4,256.2 L450.6,256.2 L450.6,251.9 + L450.8,251.9 L450.8,247.7 L451.0,247.7 L451.0,243.5 L451.2,243.5 L451.2,239.4 L451.5,239.4 L451.5,235.3 + L451.7,235.3 L451.7,231.4 L451.9,231.4 L451.9,227.5 L452.1,227.5 L452.1,223.7 L452.3,223.7 L452.3,219.9 + L452.5,219.9 L452.5,216.2 L452.8,216.2 L452.8,212.6 L453.0,212.6 L453.0,209.1 L453.2,209.1 L453.2,205.6 + L453.4,205.6 L453.4,202.2 L453.6,202.2 L453.6,198.8 L453.8,198.8 L453.8,195.5 L454.1,195.5 L454.1,192.3 + L454.3,192.3 L454.3,189.1 L454.5,189.1 L454.5,186.0 L454.7,186.0 L454.7,182.9 L454.9,182.9 L454.9,179.9 + L455.1,179.9 L455.1,177.0 L455.4,177.0 L455.4,174.1 L455.6,174.1 L455.6,171.2 L455.8,171.2 L455.8,168.4 + L456.0,168.4 L456.0,165.7 L456.2,165.7 L456.2,163.0 L456.4,163.0 L456.4,160.3 L456.7,160.3 L456.7,157.7 + L456.9,157.7 L456.9,155.2 L457.1,155.2 L457.1,152.7 L457.3,152.7 L457.3,150.2 L457.5,150.2 L457.5,147.8 + L457.8,147.8 L457.8,145.4 L458.0,145.4 L458.0,143.1 L458.2,143.1 L458.2,140.8 L458.4,140.8 L458.4,138.6 + L458.6,138.6 L458.6,136.3 L458.8,136.3 L458.8,134.2 L459.1,134.2 L459.1,132.1 L459.3,132.1 L459.3,130.0 + L459.5,130.0 L459.5,127.9 L459.7,127.9 L459.7,125.9 L459.9,125.9 L459.9,123.9 L460.1,123.9 L460.1,122.0 + L460.4,122.0 L460.4,120.1 L460.6,120.1 L460.6,118.2 L460.8,118.2 L460.8,116.4 L461.0,116.4 L461.0,114.6 + L461.2,114.6 L461.2,112.8 L461.4,112.8 L461.4,111.1 L461.7,111.1 L461.7,109.3 L461.9,109.3 L461.9,107.7 + L462.1,107.7 L462.1,106.0 L462.3,106.0 L462.3,104.4 L462.5,104.4 L462.5,102.8 L462.7,102.8 L462.7,101.3 + L463.0,101.3 L463.0,99.7 L463.2,99.7 L463.2,98.2 L463.4,98.2 L463.4,96.7 L463.6,96.7 L463.6,95.3 + L463.8,95.3 L463.8,93.9 L464.0,93.9 L464.0,92.5 L464.3,92.5 L464.3,91.1 L464.5,91.1 L464.5,89.8 + L464.7,89.8 L464.7,88.4 L464.9,88.4 L464.9,87.1 L465.1,87.1 L465.1,85.9 L465.4,85.9 L465.4,84.6 + L465.6,84.6 L465.6,83.4 L465.8,83.4 L465.8,82.2 L466.0,82.2 L466.0,81.0 L466.2,81.0 L466.2,79.8 + L466.4,79.8 L466.4,78.7 L466.7,78.7 L466.7,77.6 L466.9,77.6 L466.9,76.5 L467.1,76.5 L467.1,75.4 + L467.3,75.4 L467.3,74.3 L467.5,74.3 L467.5,73.3 L467.7,73.3 L467.7,72.2 L468.0,72.2 L468.0,71.2 + L468.2,71.2 L468.2,70.3 L468.4,70.3 L468.4,69.3 L468.6,69.3 L468.6,68.3 L468.8,68.3 L468.8,67.4 + L469.0,67.4 L469.0,66.5 L469.3,66.5 L469.3,65.6 L469.5,65.6 L469.5,64.7 L469.7,64.7 L469.7,63.8 + L469.9,63.8 L469.9,63.0 L470.1,63.0 L470.1,62.1 L470.3,62.1 L470.3,61.3 L470.6,61.3 L470.6,60.5 + L470.8,60.5 L470.8,59.7 L471.0,59.7 L471.0,67.2 L471.2,67.2 L471.2,74.6 L471.4,74.6 L471.4,82.0 + L471.6,82.0 L471.6,89.1 L471.9,89.1 L471.9,96.1 L472.1,96.1 L472.1,103.0 L472.3,103.0 L472.3,109.8 + L472.5,109.8 L472.5,116.3 L472.7,116.3 L472.7,122.8 L473.0,122.8 L473.0,129.1 L473.2,129.1 L473.2,135.3 + L473.4,135.3 L473.4,141.4 L473.6,141.4 L473.6,147.4 L473.8,147.4 L473.8,153.2 L474.0,153.2 L474.0,158.9 + L474.3,158.9 L474.3,164.5 L474.5,164.5 L474.5,170.0 L474.7,170.0 L474.7,175.4 L474.9,175.4 L474.9,180.6 + L475.1,180.6 L475.1,185.8 L475.3,185.8 L475.3,190.8 L475.6,190.8 L475.6,195.8 L475.8,195.8 L475.8,200.6 + L476.0,200.6 L476.0,205.3 L476.2,205.3 L476.2,210.0 L476.4,210.0 L476.4,214.5 L476.6,214.5 L476.6,219.0 + L476.9,219.0 L476.9,223.4 L477.1,223.4 L477.1,227.7 L477.3,227.7 L477.3,231.8 L477.5,231.8 L477.5,236.0 + L477.7,236.0 L477.7,240.0 L477.9,240.0 L477.9,243.9 L478.2,243.9 L478.2,247.8 L478.4,247.8 L478.4,251.6 + L478.6,251.6 L478.6,255.3 L478.8,255.3 L478.8,258.9 L479.0,258.9 L479.0,262.5 L479.2,262.5 L479.2,265.9 + L479.5,265.9 L479.5,269.4 L479.7,269.4 L479.7,272.7 L479.9,272.7 L479.9,276.0 L480.1,276.0 L480.1,279.2 + L480.3,279.2 L480.3,282.3 L480.5,282.3 L480.5,285.4 L480.8,285.4 L480.8,288.4 L481.0,288.4 L481.0,291.4 + L481.2,291.4 L481.2,294.3 L481.4,294.3 L481.4,297.1 L481.6,297.1 L481.6,299.9 L481.9,299.9 L481.9,302.6 + L482.1,302.6 L482.1,305.3 L482.3,305.3 L482.3,307.9 L482.5,307.9 L482.5,310.4 L482.7,310.4 L482.7,312.9 + L482.9,312.9 L482.9,315.4 L483.2,315.4 L483.2,317.8 L483.4,317.8 L483.4,320.2 L483.6,320.2 L483.6,322.5 + L483.8,322.5 L483.8,324.7 L484.0,324.7 L484.0,326.9 L484.2,326.9 L484.2,329.1 L484.5,329.1 L484.5,331.2 + L484.7,331.2 L484.7,333.3 L484.9,333.3 L484.9,335.3 L485.1,335.3 L485.1,337.3 L485.3,337.3 L485.3,339.3 + L485.5,339.3 L485.5,341.2 L485.8,341.2 L485.8,343.1 L486.0,343.1 L486.0,344.9 L486.2,344.9 L486.2,346.7 + L486.4,346.7 L486.4,348.5 L486.6,348.5 L486.6,350.2 L486.8,350.2 L486.8,351.9 L487.1,351.9 L487.1,353.6 + L487.3,353.6 L487.3,355.2 L487.5,355.2 L487.5,356.8 L487.7,356.8 L487.7,358.4 L487.9,358.4 L487.9,359.9 + L488.1,359.9 L488.1,361.4 L488.4,361.4 L488.4,362.9 L488.6,362.9 L488.6,364.3 L488.8,364.3 L488.8,365.7 + L489.0,365.7 L489.0,367.1 L489.2,367.1 L489.2,368.4 L489.5,368.4 L489.5,369.8 L489.7,369.8 L489.7,371.0 + L489.9,371.0 L489.9,372.3 L490.1,372.3 L490.1,373.6 L490.3,373.6 L490.3,374.8 L490.5,374.8 L490.5,376.0 + L490.8,376.0 L490.8,377.1 L491.0,377.1 L491.0,378.3 L491.2,378.3 L491.2,379.4 L491.4,379.4 L491.4,380.5 + L491.6,380.5 L491.6,381.6 L491.8,381.6 L491.8,382.6 L492.1,382.6 L492.1,383.7 L492.3,383.7 L492.3,384.7 + L492.5,384.7 L492.5,385.7 L492.7,385.7 L492.7,386.6 L492.9,386.6 L492.9,387.6 L493.1,387.6 L493.1,388.5 + L493.4,388.5 L493.4,389.4 L493.6,389.4 L493.6,390.3 L493.8,390.3 L493.8,391.2 L494.0,391.2 L494.0,392.1 + L494.2,392.1 L494.2,392.9 L494.4,392.9 L494.4,393.7 L494.7,393.7 L494.7,394.5 L494.9,394.5 L494.9,395.3 + L495.1,395.3 L495.1,396.1 L495.3,396.1 L495.3,396.9 L495.5,396.9 L495.5,397.6 L495.7,397.6 L495.7,398.3 + L496.0,398.3 L496.0,399.1 L496.2,399.1 L496.2,399.8 L496.4,399.8 L496.4,400.4 L496.6,400.4 L496.6,401.1 + L496.8,401.1 L496.8,401.8 L497.1,401.8 L497.1,394.9 L497.3,394.9 L497.3,388.1 L497.5,388.1 L497.5,381.4 + L497.7,381.4 L497.7,374.8 L497.9,374.8 L497.9,368.3 L498.1,368.3 L498.1,361.9 L498.4,361.9 L498.4,355.7 + L498.6,355.7 L498.6,349.5 L498.8,349.5 L498.8,343.5 L499.0,343.5 L499.0,337.6 L499.2,337.6 L499.2,331.8 + L499.4,331.8 L499.4,326.1 L499.7,326.1 L499.7,320.5 L499.9,320.5 L499.9,315.0 L500.1,315.0 L500.1,309.6 + L500.3,309.6 L500.3,304.3 L500.5,304.3 L500.5,299.1 L500.7,299.1 L500.7,294.0 L501.0,294.0 L501.0,288.9 + L501.2,288.9 L501.2,284.0 L501.4,284.0 L501.4,279.2 L501.6,279.2 L501.6,274.4 L501.8,274.4 L501.8,269.8 + L502.0,269.8 L502.0,265.2 L502.3,265.2 L502.3,260.7 L502.5,260.7 L502.5,256.3 L502.7,256.3 L502.7,251.9 + L502.9,251.9 L502.9,247.7 L503.1,247.7 L503.1,243.5 L503.3,243.5 L503.3,239.4 L503.6,239.4 L503.6,235.3 + L503.8,235.3 L503.8,231.4 L504.0,231.4 L504.0,227.5 L504.2,227.5 L504.2,223.7 L504.4,223.7 L504.4,219.9 + L504.7,219.9 L504.7,216.3 L504.9,216.3 L504.9,212.6 L505.1,212.6 L505.1,209.1 L505.3,209.1 L505.3,205.6 + L505.5,205.6 L505.5,202.2 L505.7,202.2 L505.7,198.8 L506.0,198.8 L506.0,195.5 L506.2,195.5 L506.2,192.3 + L506.4,192.3 L506.4,189.1 L506.6,189.1 L506.6,186.0 L506.8,186.0 L506.8,182.9 L507.0,182.9 L507.0,179.9 + L507.3,179.9 L507.3,177.0 L507.5,177.0 L507.5,174.1 L507.7,174.1 L507.7,171.2 L507.9,171.2 L507.9,168.4 + L508.1,168.4 L508.1,165.7 L508.3,165.7 L508.3,163.0 L508.6,163.0 L508.6,160.3 L508.8,160.3 L508.8,157.7 + L509.0,157.7 L509.0,155.2 L509.2,155.2 L509.2,152.7 L509.4,152.7 L509.4,150.2 L509.6,150.2 L509.6,147.8 + L509.9,147.8 L509.9,145.4 L510.1,145.4 L510.1,143.1 L510.3,143.1 L510.3,140.8 L510.5,140.8 L510.5,138.6 + L510.7,138.6 L510.7,136.4 L510.9,136.4 L510.9,134.2 L511.2,134.2 L511.2,132.1 L511.4,132.1 L511.4,130.0 + L511.6,130.0 L511.6,127.9 L511.8,127.9 L511.8,125.9 L512.0,125.9 L512.0,123.9 L512.3,123.9 L512.3,122.0 + L512.5,122.0 L512.5,120.1 L512.7,120.1 L512.7,118.2 L512.9,118.2 L512.9,116.4 L513.1,116.4 L513.1,114.6 + L513.3,114.6 L513.3,112.8 L513.6,112.8 L513.6,111.1 L513.8,111.1 L513.8,109.3 L514.0,109.3 L514.0,107.7 + L514.2,107.7 L514.2,106.0 L514.4,106.0 L514.4,104.4 L514.6,104.4 L514.6,102.8 L514.9,102.8 L514.9,101.3 + L515.1,101.3 L515.1,99.7 L515.3,99.7 L515.3,98.2 L515.5,98.2 L515.5,96.8 L515.7,96.8 L515.7,95.3 + L515.9,95.3 L515.9,93.9 L516.2,93.9 L516.2,92.5 L516.4,92.5 L516.4,91.1 L516.6,91.1 L516.6,89.8 + L516.8,89.8 L516.8,88.4 L517.0,88.4 L517.0,87.1 L517.2,87.1 L517.2,85.9 L517.5,85.9 L517.5,84.6 + L517.7,84.6 L517.7,83.4 L517.9,83.4 L517.9,82.2 L518.1,82.2 L518.1,81.0 L518.3,81.0 L518.3,79.8 + L518.5,79.8 L518.5,78.7 L518.8,78.7 L518.8,77.6 L519.0,77.6 L519.0,76.5 L519.2,76.5 L519.2,75.4 + L519.4,75.4 L519.4,74.3 L519.6,74.3 L519.6,73.3 L519.8,73.3 L519.8,72.3 L520.1,72.3 L520.1,71.2 + L520.3,71.2 L520.3,70.3 L520.5,70.3 L520.5,69.3 L520.7,69.3 L520.7,68.3 L520.9,68.3 L520.9,67.4 + L521.2,67.4 L521.2,66.5 L521.4,66.5 L521.4,65.6 L521.6,65.6 L521.6,64.7 L521.8,64.7 L521.8,63.8 + L522.0,63.8 L522.0,63.0 L522.2,63.0 L522.2,62.1 L522.5,62.1 L522.5,61.3 L522.7,61.3 L522.7,60.5 + L522.9,60.5 L522.9,59.7 L523.1,59.7 L523.1,67.2 L523.3,67.2 L523.3,74.6 L523.5,74.6 L523.5,81.9 + L523.8,81.9 L523.8,89.1 L524.0,89.1 L524.0,96.1 L524.2,96.1 L524.2,103.0 L524.4,103.0 L524.4,109.7 + L524.6,109.7 L524.6,116.3 L524.8,116.3 L524.8,122.8 L525.1,122.8 L525.1,129.1 L525.3,129.1 L525.3,135.3 + L525.5,135.3 L525.5,141.4 L525.7,141.4 L525.7,147.4 L525.9,147.4 L525.9,153.2 L526.1,153.2 L526.1,158.9 + L526.4,158.9 L526.4,164.5 L526.6,164.5 L526.6,170.0 L526.8,170.0 L526.8,175.3 L527.0,175.3 L527.0,180.6 + L527.2,180.6 L527.2,185.8 L527.4,185.8 L527.4,190.8 L527.7,190.8 L527.7,195.7 L527.9,195.7 L527.9,200.6 + L528.1,200.6 L528.1,205.3 L528.3,205.3 L528.3,210.0 L528.5,210.0 L528.5,214.5 L528.8,214.5 L528.8,219.0 + L529.0,219.0 L529.0,223.4 L529.2,223.4 L529.2,227.6 L529.4,227.6 L529.4,231.8 L529.6,231.8 L529.6,235.9 + L529.8,235.9 L529.8,240.0 L530.1,240.0 L530.1,243.9 L530.3,243.9 L530.3,247.8 L530.5,247.8 L530.5,251.6 + L530.7,251.6 L530.7,255.3 L530.9,255.3 L530.9,258.9 L531.1,258.9 L531.1,262.5 L531.4,262.5 L531.4,265.9 + L531.6,265.9 L531.6,269.3 L531.8,269.3 L531.8,272.7 L532.0,272.7 L532.0,276.0 L532.2,276.0 L532.2,279.2 + L532.4,279.2 L532.4,282.3 L532.7,282.3 L532.7,285.4 L532.9,285.4 L532.9,288.4 L533.1,288.4 L533.1,291.4 + L533.3,291.4 L533.3,294.3 L533.5,294.3 L533.5,297.1 L533.7,297.1 L533.7,299.9 L534.0,299.9 L534.0,302.6 + L534.2,302.6 L534.2,305.3 L534.4,305.3 L534.4,307.9 L534.6,307.9 L534.6,310.4 L534.8,310.4 L534.8,312.9 + L535.0,312.9 L535.0,315.4 L535.3,315.4 L535.3,317.8 L535.5,317.8 L535.5,320.1 L535.7,320.1 L535.7,322.5 + L535.9,322.5 L535.9,324.7 L536.1,324.7 L536.1,326.9 L536.4,326.9 L536.4,329.1 L536.6,329.1 L536.6,331.2 + L536.8,331.2 L536.8,333.3 L537.0,333.3 L537.0,335.3 L537.2,335.3 L537.2,337.3 L537.4,337.3 L537.4,339.3 + L537.7,339.3 L537.7,341.2 L537.9,341.2 L537.9,343.1 L538.1,343.1 L538.1,344.9 L538.3,344.9 L538.3,346.7 + L538.5,346.7 L538.5,348.5 L538.7,348.5 L538.7,350.2 L539.0,350.2 L539.0,351.9 L539.2,351.9 L539.2,353.6 + L539.4,353.6 L539.4,355.2 L539.6,355.2 L539.6,356.8 L539.8,356.8 L539.8,358.4 L540.0,358.4 L540.0,359.9 + L540.3,359.9 L540.3,361.4 L540.5,361.4 L540.5,362.9 L540.7,362.9 L540.7,364.3 L540.9,364.3 L540.9,365.7 + L541.1,365.7 L541.1,367.1 L541.3,367.1 L541.3,368.4 L541.6,368.4 L541.6,369.7 L541.8,369.7 L541.8,371.0 + L542.0,371.0 L542.0,372.3 L542.2,372.3 L542.2,373.6 L542.4,373.6 L542.4,374.8 L542.6,374.8 L542.6,376.0 + L542.9,376.0 L542.9,377.1 L543.1,377.1 L543.1,378.3 L543.3,378.3 L543.3,379.4 L543.5,379.4 L543.5,380.5 + L543.7,380.5 L543.7,381.6 L544.0,381.6 L544.0,382.6 L544.2,382.6 L544.2,383.7 L544.4,383.7 L544.4,384.7 + L544.6,384.7 L544.6,385.7 L544.8,385.7 L544.8,386.6 L545.0,386.6 L545.0,387.6 L545.3,387.6 L545.3,388.5 + L545.5,388.5 L545.5,389.4 L545.7,389.4 L545.7,390.3 L545.9,390.3 L545.9,391.2 L546.1,391.2 L546.1,392.1 + L546.3,392.1 L546.3,392.9 L546.6,392.9 L546.6,393.7 L546.8,393.7 L546.8,394.5 L547.0,394.5 L547.0,395.3 + L547.2,395.3 L547.2,396.1 L547.4,396.1 L547.4,396.9 L547.6,396.9 L547.6,397.6 L547.9,397.6 L547.9,398.3 + L548.1,398.3 L548.1,399.1 L548.3,399.1 L548.3,399.7 L548.5,399.7 L548.5,400.4 L548.7,400.4 L548.7,401.1 + L548.9,401.1 L548.9,401.8 L549.2,401.8 L549.2,394.9 L549.4,394.9 L549.4,388.1 L549.6,388.1 L549.6,381.4 + L549.8,381.4 L549.8,374.8 L550.0,374.8 L550.0,368.3 L550.2,368.3 L550.2,361.9 L550.5,361.9 L550.5,355.7 + L550.7,355.7 L550.7,349.5 L550.9,349.5 L550.9,343.5 L551.1,343.5 L551.1,337.6 L551.3,337.6 L551.3,331.8 + L551.5,331.8 L551.5,326.1 L551.8,326.1 L551.8,320.5 L552.0,320.5 L552.0,315.0 L552.2,315.0 L552.2,309.6 + L552.4,309.6 L552.4,304.3 L552.6,304.3 L552.6,299.1 L552.9,299.1 L552.9,294.0 L553.1,294.0 L553.1,288.9 + L553.3,288.9 L553.3,284.0 L553.5,284.0 L553.5,279.2 L553.7,279.2 L553.7,274.4 L553.9,274.4 L553.9,269.8 + L554.2,269.8 L554.2,265.2 L554.4,265.2 L554.4,260.7 L554.6,260.7 L554.6,256.3 L554.8,256.3 L554.8,251.9 + L555.0,251.9 L555.0,247.7 L555.2,247.7 L555.2,243.5 L555.5,243.5 L555.5,239.4 L555.7,239.4 L555.7,235.4 + L555.9,235.4 L555.9,231.4 L556.1,231.4 L556.1,227.5 L556.3,227.5 L556.3,223.7 L556.5,223.7 L556.5,219.9 + L556.8,219.9 L556.8,216.3 L557.0,216.3 L557.0,212.7 L557.2,212.7 L557.2,209.1 L557.4,209.1 L557.4,205.6 + L557.6,205.6 L557.6,202.2 L557.8,202.2 L557.8,198.8 L558.1,198.8 L558.1,195.5 L558.3,195.5 L558.3,192.3 + L558.5,192.3 L558.5,189.1 L558.7,189.1 L558.7,186.0 L558.9,186.0 L558.9,182.9 L559.1,182.9 L559.1,179.9 + L559.4,179.9 L559.4,177.0 L559.6,177.0 L559.6,174.1 L559.8,174.1 L559.8,171.2 L560.0,171.2 L560.0,168.4 + L560.2,168.4 L560.2,165.7 L560.5,165.7 L560.5,163.0 L560.7,163.0 L560.7,160.3 L560.9,160.3 L560.9,157.7 + L561.1,157.7 L561.1,155.2 L561.3,155.2 L561.3,152.7 L561.5,152.7 L561.5,150.2 L561.8,150.2 L561.8,147.8 + L562.0,147.8 L562.0,145.4 L562.2,145.4 L562.2,143.1 L562.4,143.1 L562.4,140.8 L562.6,140.8 L562.6,138.6 + L562.8,138.6 L562.8,136.4 L563.1,136.4 L563.1,134.2 L563.3,134.2 L563.3,132.1 L563.5,132.1 L563.5,130.0 + L563.7,130.0 L563.7,127.9 L563.9,127.9 L563.9,125.9 L564.1,125.9 L564.1,123.9 L564.4,123.9 L564.4,122.0 + L564.6,122.0 L564.6,120.1 L564.8,120.1 L564.8,118.2 L565.0,118.2 L565.0,116.4 L565.2,116.4 L565.2,114.6 + L565.4,114.6 L565.4,112.8 L565.7,112.8 L565.7,111.1 L565.9,111.1 L565.9,109.4 L566.1,109.4 L566.1,107.7 + L566.3,107.7 L566.3,106.0 L566.5,106.0 L566.5,104.4 L566.7,104.4 L566.7,102.8 L567.0,102.8 L567.0,101.3 + L567.2,101.3 L567.2,99.7 L567.4,99.7 L567.4,98.2 L567.6,98.2 L567.6,96.8 L567.8,96.8 L567.8,95.3 + L568.1,95.3 L568.1,93.9 L568.3,93.9 L568.3,92.5 L568.5,92.5 L568.5,91.1 L568.7,91.1 L568.7,89.8 + L568.9,89.8 L568.9,88.4 L569.1,88.4 L569.1,87.1 L569.4,87.1 L569.4,85.9 L569.6,85.9 L569.6,84.6 + L569.8,84.6 L569.8,83.4 L570.0,83.4 L570.0,82.2 L570.2,82.2 L570.2,81.0 L570.4,81.0 L570.4,79.8 + L570.7,79.8 L570.7,78.7 L570.9,78.7 L570.9,77.6 L571.1,77.6 L571.1,76.5 L571.3,76.5 L571.3,75.4 + L571.5,75.4 L571.5,74.3 L571.7,74.3 L571.7,73.3 L572.0,73.3 L572.0,72.3 L572.2,72.3 L572.2,71.2 + L572.4,71.2 L572.4,70.3 L572.6,70.3 L572.6,69.3 L572.8,69.3 L572.8,68.3 L573.0,68.3 L573.0,67.4 + L573.3,67.4 L573.3,66.5 L573.5,66.5 L573.5,65.6 L573.7,65.6 L573.7,64.7 L573.9,64.7 L573.9,63.8 + L574.1,63.8 L574.1,63.0 L574.3,63.0 L574.3,62.1 L574.6,62.1 L574.6,61.3 L574.8,61.3 L574.8,60.5 + L575.0,60.5 L575.0,59.7 '/></g> </g> <g id="gnuplot_plot_2" ><title>gnuplot_plot_2</title> <g style="fill:none; color:green; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter"> <g transform="translate(507.9,57.2)" style="stroke:none; fill:black; font-family:Arial; font-size:12.00pt; text-anchor:end"> <text>I</text> </g> - <path d='M516.2,52.7 L558.4,52.7 M53.9,444.0 L53.9,433.3 L80.0,433.3 L80.0,16.7 L106.0,16.7 L106.0,433.3 - L132.1,433.3 L132.1,16.7 L158.1,16.7 L158.1,433.3 L184.2,433.3 L184.2,16.7 L210.2,16.7 L210.2,433.3 - L236.3,433.3 L236.3,16.7 L262.3,16.7 L262.3,433.3 L288.4,433.3 L288.4,16.7 L314.5,16.7 L314.5,433.3 - L340.5,433.3 L340.5,16.7 L366.6,16.7 L366.6,433.3 L392.6,433.3 L392.6,16.7 L418.7,16.7 L418.7,433.3 - L444.7,433.3 L444.7,16.7 L470.8,16.7 L470.8,433.3 L496.8,433.3 L496.8,16.7 L522.9,16.7 L522.9,433.3 - L548.9,433.3 L548.9,16.7 '/></g> + <path d='M516.2,52.7 L558.4,52.7 M53.9,444.0 L53.9,433.3 L54.1,433.3 L54.3,433.3 L54.6,433.3 L54.8,433.3 + L55.0,433.3 L55.2,433.3 L55.4,433.3 L55.6,433.3 L55.9,433.3 L56.1,433.3 L56.3,433.3 L56.5,433.3 + L56.7,433.3 L56.9,433.3 L57.2,433.3 L57.4,433.3 L57.6,433.3 L57.8,433.3 L58.0,433.3 L58.2,433.3 + L58.5,433.3 L58.7,433.3 L58.9,433.3 L59.1,433.3 L59.3,433.3 L59.5,433.3 L59.8,433.3 L60.0,433.3 + L60.2,433.3 L60.4,433.3 L60.6,433.3 L60.8,433.3 L61.1,433.3 L61.3,433.3 L61.5,433.3 L61.7,433.3 + L61.9,433.3 L62.2,433.3 L62.4,433.3 L62.6,433.3 L62.8,433.3 L63.0,433.3 L63.2,433.3 L63.5,433.3 + L63.7,433.3 L63.9,433.3 L64.1,433.3 L64.3,433.3 L64.5,433.3 L64.8,433.3 L65.0,433.3 L65.2,433.3 + L65.4,433.3 L65.6,433.3 L65.8,433.3 L66.1,433.3 L66.3,433.3 L66.5,433.3 L66.7,433.3 L66.9,433.3 + L67.1,433.3 L67.4,433.3 L67.6,433.3 L67.8,433.3 L68.0,433.3 L68.2,433.3 L68.4,433.3 L68.7,433.3 + L68.9,433.3 L69.1,433.3 L69.3,433.3 L69.5,433.3 L69.8,433.3 L70.0,433.3 L70.2,433.3 L70.4,433.3 + L70.6,433.3 L70.8,433.3 L71.1,433.3 L71.3,433.3 L71.5,433.3 L71.7,433.3 L71.9,433.3 L72.1,433.3 + L72.4,433.3 L72.6,433.3 L72.8,433.3 L73.0,433.3 L73.2,433.3 L73.4,433.3 L73.7,433.3 L73.9,433.3 + L74.1,433.3 L74.3,433.3 L74.5,433.3 L74.7,433.3 L75.0,433.3 L75.2,433.3 L75.4,433.3 L75.6,433.3 + L75.8,433.3 L76.0,433.3 L76.3,433.3 L76.5,433.3 L76.7,433.3 L76.9,433.3 L77.1,433.3 L77.3,433.3 + L77.6,433.3 L77.8,433.3 L78.0,433.3 L78.2,433.3 L78.4,433.3 L78.7,433.3 L78.9,433.3 L79.1,433.3 + L79.3,433.3 L79.5,433.3 L79.7,433.3 L80.0,433.3 L80.0,64.7 L80.2,64.7 L80.2,63.9 L80.4,63.9 + L80.4,63.0 L80.6,63.0 L80.6,62.2 L80.8,62.2 L80.8,61.3 L81.0,61.3 L81.0,60.5 L81.3,60.5 + L81.3,59.7 L81.5,59.7 L81.5,59.0 L81.7,59.0 L81.7,58.2 L81.9,58.2 L81.9,57.5 L82.1,57.5 + L82.1,56.7 L82.3,56.7 L82.3,56.0 L82.6,56.0 L82.6,55.3 L82.8,55.3 L82.8,54.6 L83.0,54.6 + L83.0,53.9 L83.2,53.9 L83.2,53.2 L83.4,53.2 L83.4,52.6 L83.6,52.6 L83.6,51.9 L83.9,51.9 + L83.9,51.3 L84.1,51.3 L84.1,50.6 L84.3,50.6 L84.3,50.0 L84.5,50.0 L84.5,49.4 L84.7,49.4 + L84.7,48.8 L84.9,48.8 L84.9,48.3 L85.2,48.3 L85.2,47.7 L85.4,47.7 L85.4,47.1 L85.6,47.1 + L85.6,46.6 L85.8,46.6 L85.8,46.0 L86.0,46.0 L86.0,45.5 L86.3,45.5 L86.3,45.0 L86.5,45.0 + L86.5,44.5 L86.7,44.5 L86.7,44.0 L86.9,44.0 L86.9,43.5 L87.1,43.5 L87.1,43.0 L87.3,43.0 + L87.3,42.5 L87.6,42.5 L87.6,42.0 L87.8,42.0 L87.8,41.6 L88.0,41.6 L88.0,41.1 L88.2,41.1 + L88.2,40.7 L88.4,40.7 L88.4,40.3 L88.6,40.3 L88.6,39.8 L88.9,39.8 L88.9,39.4 L89.1,39.4 + L89.1,39.0 L89.3,39.0 L89.3,38.6 L89.5,38.6 L89.5,38.2 L89.7,38.2 L89.7,37.8 L89.9,37.8 + L89.9,37.4 L90.2,37.4 L90.2,37.1 L90.4,37.1 L90.4,36.7 L90.6,36.7 L90.6,36.3 L90.8,36.3 + L90.8,36.0 L91.0,36.0 L91.0,35.6 L91.2,35.6 L91.2,35.3 L91.5,35.3 L91.5,34.9 L91.7,34.9 + L91.7,34.6 L91.9,34.6 L91.9,34.3 L92.1,34.3 L92.1,34.0 L92.3,34.0 L92.3,33.7 L92.5,33.7 + L92.5,33.3 L92.8,33.3 L92.8,33.0 L93.0,33.0 L93.0,32.8 L93.2,32.8 L93.2,32.5 L93.4,32.5 + L93.4,32.2 L93.6,32.2 L93.6,31.9 L93.9,31.9 L93.9,31.6 L94.1,31.6 L94.1,31.3 L94.3,31.3 + L94.3,31.1 L94.5,31.1 L94.5,30.8 L94.7,30.8 L94.7,30.6 L94.9,30.6 L94.9,30.3 L95.2,30.3 + L95.2,30.1 L95.4,30.1 L95.4,29.8 L95.6,29.8 L95.6,29.6 L95.8,29.6 L95.8,29.4 L96.0,29.4 + L96.0,29.1 L96.2,29.1 L96.2,28.9 L96.5,28.9 L96.5,28.7 L96.7,28.7 L96.7,28.5 L96.9,28.5 + L96.9,28.3 L97.1,28.3 L97.1,28.0 L97.3,28.0 L97.3,27.8 L97.5,27.8 L97.5,27.6 L97.8,27.6 + L97.8,27.4 L98.0,27.4 L98.0,27.2 L98.2,27.2 L98.2,27.1 L98.4,27.1 L98.4,26.9 L98.6,26.9 + L98.6,26.7 L98.8,26.7 L98.8,26.5 L99.1,26.5 L99.1,26.3 L99.3,26.3 L99.3,26.1 L99.5,26.1 + L99.5,26.0 L99.7,26.0 L99.7,25.8 L99.9,25.8 L99.9,25.6 L100.1,25.6 L100.1,25.5 L100.4,25.5 + L100.4,25.3 L100.6,25.3 L100.6,25.2 L100.8,25.2 L100.8,25.0 L101.0,25.0 L101.0,24.9 L101.2,24.9 + L101.2,24.7 L101.5,24.7 L101.5,24.6 L101.7,24.6 L101.7,24.4 L101.9,24.4 L101.9,24.3 L102.1,24.3 + L102.1,24.2 L102.3,24.2 L102.3,24.0 L102.5,24.0 L102.5,23.9 L102.8,23.9 L102.8,23.8 L103.0,23.8 + L103.0,23.6 L103.2,23.6 L103.2,23.5 L103.4,23.5 L103.4,23.4 L103.6,23.4 L103.6,23.3 L103.8,23.3 + L103.8,23.1 L104.1,23.1 L104.1,23.0 L104.3,23.0 L104.3,22.9 L104.5,22.9 L104.5,22.8 L104.7,22.8 + L104.7,22.7 L104.9,22.7 L104.9,22.6 L105.1,22.6 L105.1,22.5 L105.4,22.5 L105.4,22.4 L105.6,22.4 + L105.6,22.3 L105.8,22.3 L105.8,22.2 L106.0,22.2 L106.0,22.1 L106.0,432.9 L106.2,432.9 L106.2,433.0 + L106.4,433.0 L106.7,433.0 L106.9,433.0 L107.1,433.0 L107.3,433.0 L107.5,433.0 L107.7,433.0 L108.0,433.0 + L108.2,433.0 L108.4,433.0 L108.6,433.0 L108.8,433.0 L109.0,433.0 L109.3,433.0 L109.5,433.0 L109.5,433.1 + L109.7,433.1 L109.9,433.1 L110.1,433.1 L110.4,433.1 L110.6,433.1 L110.8,433.1 L111.0,433.1 L111.2,433.1 + L111.4,433.1 L111.7,433.1 L111.9,433.1 L112.1,433.1 L112.3,433.1 L112.5,433.1 L112.7,433.1 L113.0,433.1 + L113.2,433.1 L113.4,433.1 L113.6,433.1 L113.8,433.1 L114.0,433.1 L114.3,433.1 L114.5,433.1 L114.5,433.2 + L114.7,433.2 L114.9,433.2 L115.1,433.2 L115.3,433.2 L115.6,433.2 L115.8,433.2 L116.0,433.2 L116.2,433.2 + L116.4,433.2 L116.6,433.2 L116.9,433.2 L117.1,433.2 L117.3,433.2 L117.5,433.2 L117.7,433.2 L118.0,433.2 + L118.2,433.2 L118.4,433.2 L118.6,433.2 L118.8,433.2 L119.0,433.2 L119.3,433.2 L119.5,433.2 L119.7,433.2 + L119.9,433.2 L120.1,433.2 L120.3,433.2 L120.6,433.2 L120.8,433.2 L121.0,433.2 L121.2,433.2 L121.4,433.2 + L121.6,433.2 L121.9,433.2 L122.1,433.2 L122.3,433.2 L122.5,433.2 L122.7,433.2 L122.9,433.2 L123.2,433.2 + L123.4,433.2 L123.6,433.2 L123.8,433.2 L124.0,433.2 L124.0,433.3 L124.2,433.3 L124.5,433.3 L124.7,433.3 + L124.9,433.3 L125.1,433.3 L125.3,433.3 L125.6,433.3 L125.8,433.3 L126.0,433.3 L126.2,433.3 L126.4,433.3 + L126.6,433.3 L126.9,433.3 L127.1,433.3 L127.3,433.3 L127.5,433.3 L127.7,433.3 L127.9,433.3 L128.2,433.3 + L128.4,433.3 L128.6,433.3 L128.8,433.3 L129.0,433.3 L129.2,433.3 L129.5,433.3 L129.7,433.3 L129.9,433.3 + L130.1,433.3 L130.3,433.3 L130.5,433.3 L130.8,433.3 L131.0,433.3 L131.2,433.3 L131.4,433.3 L131.6,433.3 + L131.8,433.3 L132.1,433.3 L132.1,61.0 L132.3,61.0 L132.3,60.2 L132.5,60.2 L132.5,59.4 L132.7,59.4 + L132.7,58.7 L132.9,58.7 L132.9,57.9 L133.2,57.9 L133.2,57.2 L133.4,57.2 L133.4,56.4 L133.6,56.4 + L133.6,55.7 L133.8,55.7 L133.8,55.0 L134.0,55.0 L134.0,54.3 L134.2,54.3 L134.2,53.6 L134.5,53.6 + L134.5,53.0 L134.7,53.0 L134.7,52.3 L134.9,52.3 L134.9,51.7 L135.1,51.7 L135.1,51.0 L135.3,51.0 + L135.3,50.4 L135.5,50.4 L135.5,49.8 L135.8,49.8 L135.8,49.2 L136.0,49.2 L136.0,48.6 L136.2,48.6 + L136.2,48.0 L136.4,48.0 L136.4,47.5 L136.6,47.5 L136.6,46.9 L136.8,46.9 L136.8,46.4 L137.1,46.4 + L137.1,45.8 L137.3,45.8 L137.3,45.3 L137.5,45.3 L137.5,44.8 L137.7,44.8 L137.7,44.3 L137.9,44.3 + L137.9,43.8 L138.1,43.8 L138.1,43.3 L138.4,43.3 L138.4,42.8 L138.6,42.8 L138.6,42.3 L138.8,42.3 + L138.8,41.9 L139.0,41.9 L139.0,41.4 L139.2,41.4 L139.2,41.0 L139.4,41.0 L139.4,40.5 L139.7,40.5 + L139.7,40.1 L139.9,40.1 L139.9,39.7 L140.1,39.7 L140.1,39.3 L140.3,39.3 L140.3,38.8 L140.5,38.8 + L140.5,38.4 L140.7,38.4 L140.7,38.1 L141.0,38.1 L141.0,37.7 L141.2,37.7 L141.2,37.3 L141.4,37.3 + L141.4,36.9 L141.6,36.9 L141.6,36.5 L141.8,36.5 L141.8,36.2 L142.1,36.2 L142.1,35.8 L142.3,35.8 + L142.3,35.5 L142.5,35.5 L142.5,35.1 L142.7,35.1 L142.7,34.8 L142.9,34.8 L142.9,34.5 L143.1,34.5 + L143.1,34.2 L143.4,34.2 L143.4,33.8 L143.6,33.8 L143.6,33.5 L143.8,33.5 L143.8,33.2 L144.0,33.2 + L144.0,32.9 L144.2,32.9 L144.2,32.6 L144.4,32.6 L144.4,32.4 L144.7,32.4 L144.7,32.1 L144.9,32.1 + L144.9,31.8 L145.1,31.8 L145.1,31.5 L145.3,31.5 L145.3,31.2 L145.5,31.2 L145.5,31.0 L145.7,31.0 + L145.7,30.7 L146.0,30.7 L146.0,30.5 L146.2,30.5 L146.2,30.2 L146.4,30.2 L146.4,30.0 L146.6,30.0 + L146.6,29.7 L146.8,29.7 L146.8,29.5 L147.0,29.5 L147.0,29.3 L147.3,29.3 L147.3,29.0 L147.5,29.0 + L147.5,28.8 L147.7,28.8 L147.7,28.6 L147.9,28.6 L147.9,28.4 L148.1,28.4 L148.1,28.2 L148.3,28.2 + L148.3,28.0 L148.6,28.0 L148.6,27.8 L148.8,27.8 L148.8,27.6 L149.0,27.6 L149.0,27.4 L149.2,27.4 + L149.2,27.2 L149.4,27.2 L149.4,27.0 L149.7,27.0 L149.7,26.8 L149.9,26.8 L149.9,26.6 L150.1,26.6 + L150.1,26.4 L150.3,26.4 L150.3,26.3 L150.5,26.3 L150.5,26.1 L150.7,26.1 L150.7,25.9 L151.0,25.9 + L151.0,25.7 L151.2,25.7 L151.2,25.6 L151.4,25.6 L151.4,25.4 L151.6,25.4 L151.6,25.3 L151.8,25.3 + L151.8,25.1 L152.0,25.1 L152.0,25.0 L152.3,25.0 L152.3,24.8 L152.5,24.8 L152.5,24.7 L152.7,24.7 + L152.7,24.5 L152.9,24.5 L152.9,24.4 L153.1,24.4 L153.1,24.2 L153.3,24.2 L153.3,24.1 L153.6,24.1 + L153.6,24.0 L153.8,24.0 L153.8,23.8 L154.0,23.8 L154.0,23.7 L154.2,23.7 L154.2,23.6 L154.4,23.6 + L154.4,23.5 L154.6,23.5 L154.6,23.3 L154.9,23.3 L154.9,23.2 L155.1,23.2 L155.1,23.1 L155.3,23.1 + L155.3,23.0 L155.5,23.0 L155.5,22.9 L155.7,22.9 L155.7,22.8 L155.9,22.8 L155.9,22.6 L156.2,22.6 + L156.2,22.5 L156.4,22.5 L156.4,22.4 L156.6,22.4 L156.6,22.3 L156.8,22.3 L156.8,22.2 L157.0,22.2 + L157.0,22.1 L157.3,22.1 L157.3,22.0 L157.5,22.0 L157.5,21.9 L157.7,21.9 L157.7,21.8 L157.9,21.8 + L157.9,21.7 L158.1,21.7 L158.1,432.9 L158.3,432.9 L158.3,433.0 L158.6,433.0 L158.8,433.0 L159.0,433.0 + L159.2,433.0 L159.4,433.0 L159.6,433.0 L159.9,433.0 L160.1,433.0 L160.3,433.0 L160.5,433.0 L160.7,433.0 + L160.9,433.0 L161.2,433.0 L161.4,433.0 L161.6,433.0 L161.8,433.0 L161.8,433.1 L162.0,433.1 L162.2,433.1 + L162.5,433.1 L162.7,433.1 L162.9,433.1 L163.1,433.1 L163.3,433.1 L163.5,433.1 L163.8,433.1 L164.0,433.1 + L164.2,433.1 L164.4,433.1 L164.6,433.1 L164.9,433.1 L165.1,433.1 L165.3,433.1 L165.5,433.1 L165.7,433.1 + L165.9,433.1 L166.2,433.1 L166.4,433.1 L166.6,433.1 L166.6,433.2 L166.8,433.2 L167.0,433.2 L167.2,433.2 + L167.5,433.2 L167.7,433.2 L167.9,433.2 L168.1,433.2 L168.3,433.2 L168.5,433.2 L168.8,433.2 L169.0,433.2 + L169.2,433.2 L169.4,433.2 L169.6,433.2 L169.8,433.2 L170.1,433.2 L170.3,433.2 L170.5,433.2 L170.7,433.2 + L170.9,433.2 L171.1,433.2 L171.4,433.2 L171.6,433.2 L171.8,433.2 L172.0,433.2 L172.2,433.2 L172.5,433.2 + L172.7,433.2 L172.9,433.2 L173.1,433.2 L173.3,433.2 L173.5,433.2 L173.8,433.2 L174.0,433.2 L174.2,433.2 + L174.4,433.2 L174.6,433.2 L174.8,433.2 L175.1,433.2 L175.3,433.2 L175.5,433.2 L175.7,433.2 L175.9,433.2 + L176.1,433.2 L176.4,433.2 L176.4,433.3 L176.6,433.3 L176.8,433.3 L177.0,433.3 L177.2,433.3 L177.4,433.3 + L177.7,433.3 L177.9,433.3 L178.1,433.3 L178.3,433.3 L178.5,433.3 L178.7,433.3 L179.0,433.3 L179.2,433.3 + L179.4,433.3 L179.6,433.3 L179.8,433.3 L180.0,433.3 L180.3,433.3 L180.5,433.3 L180.7,433.3 L180.9,433.3 + L181.1,433.3 L181.4,433.3 L181.6,433.3 L181.8,433.3 L182.0,433.3 L182.2,433.3 L182.4,433.3 L182.7,433.3 + L182.9,433.3 L183.1,433.3 L183.3,433.3 L183.5,433.3 L183.7,433.3 L184.0,433.3 L184.2,433.3 L184.2,61.0 + L184.4,61.0 L184.4,60.2 L184.6,60.2 L184.6,59.4 L184.8,59.4 L184.8,58.6 L185.0,58.6 L185.0,57.9 + L185.3,57.9 L185.3,57.1 L185.5,57.1 L185.5,56.4 L185.7,56.4 L185.7,55.7 L185.9,55.7 L185.9,55.0 + L186.1,55.0 L186.1,54.3 L186.3,54.3 L186.3,53.6 L186.6,53.6 L186.6,52.9 L186.8,52.9 L186.8,52.3 + L187.0,52.3 L187.0,51.6 L187.2,51.6 L187.2,51.0 L187.4,51.0 L187.4,50.4 L187.6,50.4 L187.6,49.8 + L187.9,49.8 L187.9,49.2 L188.1,49.2 L188.1,48.6 L188.3,48.6 L188.3,48.0 L188.5,48.0 L188.5,47.4 + L188.7,47.4 L188.7,46.9 L189.0,46.9 L189.0,46.3 L189.2,46.3 L189.2,45.8 L189.4,45.8 L189.4,45.3 + L189.6,45.3 L189.6,44.8 L189.8,44.8 L189.8,44.3 L190.0,44.3 L190.0,43.8 L190.3,43.8 L190.3,43.3 + L190.5,43.3 L190.5,42.8 L190.7,42.8 L190.7,42.3 L190.9,42.3 L190.9,41.8 L191.1,41.8 L191.1,41.4 + L191.3,41.4 L191.3,40.9 L191.6,40.9 L191.6,40.5 L191.8,40.5 L191.8,40.1 L192.0,40.1 L192.0,39.7 + L192.2,39.7 L192.2,39.2 L192.4,39.2 L192.4,38.8 L192.6,38.8 L192.6,38.4 L192.9,38.4 L192.9,38.0 + L193.1,38.0 L193.1,37.6 L193.3,37.6 L193.3,37.3 L193.5,37.3 L193.5,36.9 L193.7,36.9 L193.7,36.5 + L193.9,36.5 L193.9,36.2 L194.2,36.2 L194.2,35.8 L194.4,35.8 L194.4,35.5 L194.6,35.5 L194.6,35.1 + L194.8,35.1 L194.8,34.8 L195.0,34.8 L195.0,34.5 L195.2,34.5 L195.2,34.2 L195.5,34.2 L195.5,33.8 + L195.7,33.8 L195.7,33.5 L195.9,33.5 L195.9,33.2 L196.1,33.2 L196.1,32.9 L196.3,32.9 L196.3,32.6 + L196.6,32.6 L196.6,32.3 L196.8,32.3 L196.8,32.1 L197.0,32.1 L197.0,31.8 L197.2,31.8 L197.2,31.5 + L197.4,31.5 L197.4,31.2 L197.6,31.2 L197.6,31.0 L197.9,31.0 L197.9,30.7 L198.1,30.7 L198.1,30.5 + L198.3,30.5 L198.3,30.2 L198.5,30.2 L198.5,30.0 L198.7,30.0 L198.7,29.7 L198.9,29.7 L198.9,29.5 + L199.2,29.5 L199.2,29.3 L199.4,29.3 L199.4,29.0 L199.6,29.0 L199.6,28.8 L199.8,28.8 L199.8,28.6 + L200.0,28.6 L200.0,28.4 L200.2,28.4 L200.2,28.2 L200.5,28.2 L200.5,28.0 L200.7,28.0 L200.7,27.8 + L200.9,27.8 L200.9,27.6 L201.1,27.6 L201.1,27.4 L201.3,27.4 L201.3,27.2 L201.5,27.2 L201.5,27.0 + L201.8,27.0 L201.8,26.8 L202.0,26.8 L202.0,26.6 L202.2,26.6 L202.2,26.4 L202.4,26.4 L202.4,26.2 + L202.6,26.2 L202.6,26.1 L202.8,26.1 L202.8,25.9 L203.1,25.9 L203.1,25.7 L203.3,25.7 L203.3,25.6 + L203.5,25.6 L203.5,25.4 L203.7,25.4 L203.7,25.3 L203.9,25.3 L203.9,25.1 L204.2,25.1 L204.2,25.0 + L204.4,25.0 L204.4,24.8 L204.6,24.8 L204.6,24.7 L204.8,24.7 L204.8,24.5 L205.0,24.5 L205.0,24.4 + L205.2,24.4 L205.2,24.2 L205.5,24.2 L205.5,24.1 L205.7,24.1 L205.7,24.0 L205.9,24.0 L205.9,23.8 + L206.1,23.8 L206.1,23.7 L206.3,23.7 L206.3,23.6 L206.5,23.6 L206.5,23.4 L206.8,23.4 L206.8,23.3 + L207.0,23.3 L207.0,23.2 L207.2,23.2 L207.2,23.1 L207.4,23.1 L207.4,23.0 L207.6,23.0 L207.6,22.9 + L207.8,22.9 L207.8,22.7 L208.1,22.7 L208.1,22.6 L208.3,22.6 L208.3,22.5 L208.5,22.5 L208.5,22.4 + L208.7,22.4 L208.7,22.3 L208.9,22.3 L208.9,22.2 L209.1,22.2 L209.1,22.1 L209.4,22.1 L209.4,22.0 + L209.6,22.0 L209.6,21.9 L209.8,21.9 L209.8,21.8 L210.0,21.8 L210.0,21.7 L210.2,21.7 L210.2,21.6 + L210.2,432.9 L210.4,432.9 L210.4,433.0 L210.7,433.0 L210.9,433.0 L211.1,433.0 L211.3,433.0 L211.5,433.0 + L211.7,433.0 L212.0,433.0 L212.2,433.0 L212.4,433.0 L212.6,433.0 L212.8,433.0 L213.1,433.0 L213.3,433.0 + L213.5,433.0 L213.7,433.0 L213.9,433.0 L213.9,433.1 L214.1,433.1 L214.4,433.1 L214.6,433.1 L214.8,433.1 + L215.0,433.1 L215.2,433.1 L215.4,433.1 L215.7,433.1 L215.9,433.1 L216.1,433.1 L216.3,433.1 L216.5,433.1 + L216.7,433.1 L217.0,433.1 L217.2,433.1 L217.4,433.1 L217.6,433.1 L217.8,433.1 L218.0,433.1 L218.3,433.1 + L218.5,433.1 L218.7,433.1 L218.7,433.2 L218.9,433.2 L219.1,433.2 L219.3,433.2 L219.6,433.2 L219.8,433.2 + L220.0,433.2 L220.2,433.2 L220.4,433.2 L220.7,433.2 L220.9,433.2 L221.1,433.2 L221.3,433.2 L221.5,433.2 + L221.7,433.2 L222.0,433.2 L222.2,433.2 L222.4,433.2 L222.6,433.2 L222.8,433.2 L223.0,433.2 L223.3,433.2 + L223.5,433.2 L223.7,433.2 L223.9,433.2 L224.1,433.2 L224.3,433.2 L224.6,433.2 L224.8,433.2 L225.0,433.2 + L225.2,433.2 L225.4,433.2 L225.6,433.2 L225.9,433.2 L226.1,433.2 L226.3,433.2 L226.5,433.2 L226.7,433.2 + L226.9,433.2 L227.2,433.2 L227.4,433.2 L227.6,433.2 L227.8,433.2 L228.0,433.2 L228.3,433.2 L228.5,433.2 + L228.5,433.3 L228.7,433.3 L228.9,433.3 L229.1,433.3 L229.3,433.3 L229.6,433.3 L229.8,433.3 L230.0,433.3 + L230.2,433.3 L230.4,433.3 L230.6,433.3 L230.9,433.3 L231.1,433.3 L231.3,433.3 L231.5,433.3 L231.7,433.3 + L231.9,433.3 L232.2,433.3 L232.4,433.3 L232.6,433.3 L232.8,433.3 L233.0,433.3 L233.2,433.3 L233.5,433.3 + L233.7,433.3 L233.9,433.3 L234.1,433.3 L234.3,433.3 L234.5,433.3 L234.8,433.3 L235.0,433.3 L235.2,433.3 + L235.4,433.3 L235.6,433.3 L235.9,433.3 L236.1,433.3 L236.3,433.3 L236.3,61.0 L236.5,61.0 L236.5,60.2 + L236.7,60.2 L236.7,59.4 L236.9,59.4 L236.9,58.6 L237.2,58.6 L237.2,57.9 L237.4,57.9 L237.4,57.1 + L237.6,57.1 L237.6,56.4 L237.8,56.4 L237.8,55.7 L238.0,55.7 L238.0,55.0 L238.2,55.0 L238.2,54.3 + L238.5,54.3 L238.5,53.6 L238.7,53.6 L238.7,52.9 L238.9,52.9 L238.9,52.3 L239.1,52.3 L239.1,51.6 + L239.3,51.6 L239.3,51.0 L239.5,51.0 L239.5,50.4 L239.8,50.4 L239.8,49.8 L240.0,49.8 L240.0,49.2 + L240.2,49.2 L240.2,48.6 L240.4,48.6 L240.4,48.0 L240.6,48.0 L240.6,47.4 L240.8,47.4 L240.8,46.9 + L241.1,46.9 L241.1,46.3 L241.3,46.3 L241.3,45.8 L241.5,45.8 L241.5,45.3 L241.7,45.3 L241.7,44.8 + L241.9,44.8 L241.9,44.3 L242.1,44.3 L242.1,43.8 L242.4,43.8 L242.4,43.3 L242.6,43.3 L242.6,42.8 + L242.8,42.8 L242.8,42.3 L243.0,42.3 L243.0,41.8 L243.2,41.8 L243.2,41.4 L243.4,41.4 L243.4,40.9 + L243.7,40.9 L243.7,40.5 L243.9,40.5 L243.9,40.1 L244.1,40.1 L244.1,39.7 L244.3,39.7 L244.3,39.2 + L244.5,39.2 L244.5,38.8 L244.8,38.8 L244.8,38.4 L245.0,38.4 L245.0,38.0 L245.2,38.0 L245.2,37.6 + L245.4,37.6 L245.4,37.3 L245.6,37.3 L245.6,36.9 L245.8,36.9 L245.8,36.5 L246.1,36.5 L246.1,36.2 + L246.3,36.2 L246.3,35.8 L246.5,35.8 L246.5,35.5 L246.7,35.5 L246.7,35.1 L246.9,35.1 L246.9,34.8 + L247.1,34.8 L247.1,34.5 L247.4,34.5 L247.4,34.2 L247.6,34.2 L247.6,33.8 L247.8,33.8 L247.8,33.5 + L248.0,33.5 L248.0,33.2 L248.2,33.2 L248.2,32.9 L248.4,32.9 L248.4,32.6 L248.7,32.6 L248.7,32.3 + L248.9,32.3 L248.9,32.1 L249.1,32.1 L249.1,31.8 L249.3,31.8 L249.3,31.5 L249.5,31.5 L249.5,31.2 + L249.7,31.2 L249.7,31.0 L250.0,31.0 L250.0,30.7 L250.2,30.7 L250.2,30.5 L250.4,30.5 L250.4,30.2 + L250.6,30.2 L250.6,30.0 L250.8,30.0 L250.8,29.7 L251.0,29.7 L251.0,29.5 L251.3,29.5 L251.3,29.3 + L251.5,29.3 L251.5,29.0 L251.7,29.0 L251.7,28.8 L251.9,28.8 L251.9,28.6 L252.1,28.6 L252.1,28.4 + L252.4,28.4 L252.4,28.2 L252.6,28.2 L252.6,28.0 L252.8,28.0 L252.8,27.8 L253.0,27.8 L253.0,27.6 + L253.2,27.6 L253.2,27.4 L253.4,27.4 L253.4,27.2 L253.7,27.2 L253.7,27.0 L253.9,27.0 L253.9,26.8 + L254.1,26.8 L254.1,26.6 L254.3,26.6 L254.3,26.4 L254.5,26.4 L254.5,26.3 L254.7,26.3 L254.7,26.1 + L255.0,26.1 L255.0,25.9 L255.2,25.9 L255.2,25.7 L255.4,25.7 L255.4,25.6 L255.6,25.6 L255.6,25.4 + L255.8,25.4 L255.8,25.3 L256.0,25.3 L256.0,25.1 L256.3,25.1 L256.3,25.0 L256.5,25.0 L256.5,24.8 + L256.7,24.8 L256.7,24.7 L256.9,24.7 L256.9,24.5 L257.1,24.5 L257.1,24.4 L257.3,24.4 L257.3,24.2 + L257.6,24.2 L257.6,24.1 L257.8,24.1 L257.8,24.0 L258.0,24.0 L258.0,23.8 L258.2,23.8 L258.2,23.7 + L258.4,23.7 L258.4,23.6 L258.6,23.6 L258.6,23.4 L258.9,23.4 L258.9,23.3 L259.1,23.3 L259.1,23.2 + L259.3,23.2 L259.3,23.1 L259.5,23.1 L259.5,23.0 L259.7,23.0 L259.7,22.9 L260.0,22.9 L260.0,22.7 + L260.2,22.7 L260.2,22.6 L260.4,22.6 L260.4,22.5 L260.6,22.5 L260.6,22.4 L260.8,22.4 L260.8,22.3 + L261.0,22.3 L261.0,22.2 L261.3,22.2 L261.3,22.1 L261.5,22.1 L261.5,22.0 L261.7,22.0 L261.7,21.9 + L261.9,21.9 L261.9,21.8 L262.1,21.8 L262.1,21.7 L262.3,21.7 L262.3,21.6 L262.3,432.9 L262.6,432.9 + L262.6,433.0 L262.8,433.0 L263.0,433.0 L263.2,433.0 L263.4,433.0 L263.6,433.0 L263.9,433.0 L264.1,433.0 + L264.3,433.0 L264.5,433.0 L264.7,433.0 L264.9,433.0 L265.2,433.0 L265.4,433.0 L265.6,433.0 L265.8,433.0 + L266.0,433.0 L266.0,433.1 L266.2,433.1 L266.5,433.1 L266.7,433.1 L266.9,433.1 L267.1,433.1 L267.3,433.1 + L267.6,433.1 L267.8,433.1 L268.0,433.1 L268.2,433.1 L268.4,433.1 L268.6,433.1 L268.9,433.1 L269.1,433.1 + L269.3,433.1 L269.5,433.1 L269.7,433.1 L269.9,433.1 L270.2,433.1 L270.4,433.1 L270.6,433.1 L270.8,433.1 + L270.8,433.2 L271.0,433.2 L271.2,433.2 L271.5,433.2 L271.7,433.2 L271.9,433.2 L272.1,433.2 L272.3,433.2 + L272.5,433.2 L272.8,433.2 L273.0,433.2 L273.2,433.2 L273.4,433.2 L273.6,433.2 L273.8,433.2 L274.1,433.2 + L274.3,433.2 L274.5,433.2 L274.7,433.2 L274.9,433.2 L275.2,433.2 L275.4,433.2 L275.6,433.2 L275.8,433.2 + L276.0,433.2 L276.2,433.2 L276.5,433.2 L276.7,433.2 L276.9,433.2 L277.1,433.2 L277.3,433.2 L277.5,433.2 + L277.8,433.2 L278.0,433.2 L278.2,433.2 L278.4,433.2 L278.6,433.2 L278.8,433.2 L279.1,433.2 L279.3,433.2 + L279.5,433.2 L279.7,433.2 L279.9,433.2 L280.1,433.2 L280.4,433.2 L280.6,433.2 L280.6,433.3 L280.8,433.3 + L281.0,433.3 L281.2,433.3 L281.4,433.3 L281.7,433.3 L281.9,433.3 L282.1,433.3 L282.3,433.3 L282.5,433.3 + L282.7,433.3 L283.0,433.3 L283.2,433.3 L283.4,433.3 L283.6,433.3 L283.8,433.3 L284.1,433.3 L284.3,433.3 + L284.5,433.3 L284.7,433.3 L284.9,433.3 L285.1,433.3 L285.4,433.3 L285.6,433.3 L285.8,433.3 L286.0,433.3 + L286.2,433.3 L286.4,433.3 L286.7,433.3 L286.9,433.3 L287.1,433.3 L287.3,433.3 L287.5,433.3 L287.7,433.3 + L288.0,433.3 L288.2,433.3 L288.4,433.3 L288.4,61.0 L288.6,61.0 L288.6,60.2 L288.8,60.2 L288.8,59.4 + L289.0,59.4 L289.0,58.6 L289.3,58.6 L289.3,57.9 L289.5,57.9 L289.5,57.1 L289.7,57.1 L289.7,56.4 + L289.9,56.4 L289.9,55.7 L290.1,55.7 L290.1,55.0 L290.3,55.0 L290.3,54.3 L290.6,54.3 L290.6,53.6 + L290.8,53.6 L290.8,52.9 L291.0,52.9 L291.0,52.3 L291.2,52.3 L291.2,51.6 L291.4,51.6 L291.4,51.0 + L291.7,51.0 L291.7,50.4 L291.9,50.4 L291.9,49.8 L292.1,49.8 L292.1,49.2 L292.3,49.2 L292.3,48.6 + L292.5,48.6 L292.5,48.0 L292.7,48.0 L292.7,47.4 L293.0,47.4 L293.0,46.9 L293.2,46.9 L293.2,46.3 + L293.4,46.3 L293.4,45.8 L293.6,45.8 L293.6,45.3 L293.8,45.3 L293.8,44.8 L294.0,44.8 L294.0,44.3 + L294.3,44.3 L294.3,43.8 L294.5,43.8 L294.5,43.3 L294.7,43.3 L294.7,42.8 L294.9,42.8 L294.9,42.3 + L295.1,42.3 L295.1,41.8 L295.3,41.8 L295.3,41.4 L295.6,41.4 L295.6,40.9 L295.8,40.9 L295.8,40.5 + L296.0,40.5 L296.0,40.1 L296.2,40.1 L296.2,39.7 L296.4,39.7 L296.4,39.2 L296.6,39.2 L296.6,38.8 + L296.9,38.8 L296.9,38.4 L297.1,38.4 L297.1,38.0 L297.3,38.0 L297.3,37.7 L297.5,37.7 L297.5,37.3 + L297.7,37.3 L297.7,36.9 L297.9,36.9 L297.9,36.5 L298.2,36.5 L298.2,36.2 L298.4,36.2 L298.4,35.8 + L298.6,35.8 L298.6,35.5 L298.8,35.5 L298.8,35.1 L299.0,35.1 L299.0,34.8 L299.3,34.8 L299.3,34.5 + L299.5,34.5 L299.5,34.2 L299.7,34.2 L299.7,33.8 L299.9,33.8 L299.9,33.5 L300.1,33.5 L300.1,33.2 + L300.3,33.2 L300.3,32.9 L300.6,32.9 L300.6,32.6 L300.8,32.6 L300.8,32.3 L301.0,32.3 L301.0,32.1 + L301.2,32.1 L301.2,31.8 L301.4,31.8 L301.4,31.5 L301.6,31.5 L301.6,31.2 L301.9,31.2 L301.9,31.0 + L302.1,31.0 L302.1,30.7 L302.3,30.7 L302.3,30.5 L302.5,30.5 L302.5,30.2 L302.7,30.2 L302.7,30.0 + L302.9,30.0 L302.9,29.7 L303.2,29.7 L303.2,29.5 L303.4,29.5 L303.4,29.3 L303.6,29.3 L303.6,29.0 + L303.8,29.0 L303.8,28.8 L304.0,28.8 L304.0,28.6 L304.2,28.6 L304.2,28.4 L304.5,28.4 L304.5,28.2 + L304.7,28.2 L304.7,28.0 L304.9,28.0 L304.9,27.8 L305.1,27.8 L305.1,27.6 L305.3,27.6 L305.3,27.4 + L305.5,27.4 L305.5,27.2 L305.8,27.2 L305.8,27.0 L306.0,27.0 L306.0,26.8 L306.2,26.8 L306.2,26.6 + L306.4,26.6 L306.4,26.4 L306.6,26.4 L306.6,26.3 L306.9,26.3 L306.9,26.1 L307.1,26.1 L307.1,25.9 + L307.3,25.9 L307.3,25.7 L307.5,25.7 L307.5,25.6 L307.7,25.6 L307.7,25.4 L307.9,25.4 L307.9,25.3 + L308.2,25.3 L308.2,25.1 L308.4,25.1 L308.4,25.0 L308.6,25.0 L308.6,24.8 L308.8,24.8 L308.8,24.7 + L309.0,24.7 L309.0,24.5 L309.2,24.5 L309.2,24.4 L309.5,24.4 L309.5,24.2 L309.7,24.2 L309.7,24.1 + L309.9,24.1 L309.9,24.0 L310.1,24.0 L310.1,23.8 L310.3,23.8 L310.3,23.7 L310.5,23.7 L310.5,23.6 + L310.8,23.6 L310.8,23.4 L311.0,23.4 L311.0,23.3 L311.2,23.3 L311.2,23.2 L311.4,23.2 L311.4,23.1 + L311.6,23.1 L311.6,23.0 L311.8,23.0 L311.8,22.9 L312.1,22.9 L312.1,22.7 L312.3,22.7 L312.3,22.6 + L312.5,22.6 L312.5,22.5 L312.7,22.5 L312.7,22.4 L312.9,22.4 L312.9,22.3 L313.1,22.3 L313.1,22.2 + L313.4,22.2 L313.4,22.1 L313.6,22.1 L313.6,22.0 L313.8,22.0 L313.8,21.9 L314.0,21.9 L314.0,21.8 + L314.2,21.8 L314.2,21.7 L314.4,21.7 L314.4,21.6 L314.5,21.6 L314.5,432.9 L314.7,432.9 L314.7,433.0 + L314.9,433.0 L315.1,433.0 L315.3,433.0 L315.5,433.0 L315.8,433.0 L316.0,433.0 L316.2,433.0 L316.4,433.0 + L316.6,433.0 L316.8,433.0 L317.1,433.0 L317.3,433.0 L317.5,433.0 L317.7,433.0 L317.9,433.0 L318.1,433.0 + L318.1,433.1 L318.4,433.1 L318.6,433.1 L318.8,433.1 L319.0,433.1 L319.2,433.1 L319.4,433.1 L319.7,433.1 + L319.9,433.1 L320.1,433.1 L320.3,433.1 L320.5,433.1 L320.7,433.1 L321.0,433.1 L321.2,433.1 L321.4,433.1 + L321.6,433.1 L321.8,433.1 L322.0,433.1 L322.3,433.1 L322.5,433.1 L322.7,433.1 L322.9,433.1 L322.9,433.2 + L323.1,433.2 L323.4,433.2 L323.6,433.2 L323.8,433.2 L324.0,433.2 L324.2,433.2 L324.4,433.2 L324.7,433.2 + L324.9,433.2 L325.1,433.2 L325.3,433.2 L325.5,433.2 L325.7,433.2 L326.0,433.2 L326.2,433.2 L326.4,433.2 + L326.6,433.2 L326.8,433.2 L327.0,433.2 L327.3,433.2 L327.5,433.2 L327.7,433.2 L327.9,433.2 L328.1,433.2 + L328.3,433.2 L328.6,433.2 L328.8,433.2 L329.0,433.2 L329.2,433.2 L329.4,433.2 L329.6,433.2 L329.9,433.2 + L330.1,433.2 L330.3,433.2 L330.5,433.2 L330.7,433.2 L331.0,433.2 L331.2,433.2 L331.4,433.2 L331.6,433.2 + L331.8,433.2 L332.0,433.2 L332.3,433.2 L332.5,433.2 L332.7,433.2 L332.7,433.3 L332.9,433.3 L333.1,433.3 + L333.3,433.3 L333.6,433.3 L333.8,433.3 L334.0,433.3 L334.2,433.3 L334.4,433.3 L334.6,433.3 L334.9,433.3 + L335.1,433.3 L335.3,433.3 L335.5,433.3 L335.7,433.3 L335.9,433.3 L336.2,433.3 L336.4,433.3 L336.6,433.3 + L336.8,433.3 L337.0,433.3 L337.2,433.3 L337.5,433.3 L337.7,433.3 L337.9,433.3 L338.1,433.3 L338.3,433.3 + L338.6,433.3 L338.8,433.3 L339.0,433.3 L339.2,433.3 L339.4,433.3 L339.6,433.3 L339.9,433.3 L340.1,433.3 + L340.3,433.3 L340.5,433.3 L340.5,61.0 L340.7,61.0 L340.7,60.2 L340.9,60.2 L340.9,59.4 L341.2,59.4 + L341.2,58.6 L341.4,58.6 L341.4,57.9 L341.6,57.9 L341.6,57.1 L341.8,57.1 L341.8,56.4 L342.0,56.4 + L342.0,55.7 L342.2,55.7 L342.2,55.0 L342.5,55.0 L342.5,54.3 L342.7,54.3 L342.7,53.6 L342.9,53.6 + L342.9,52.9 L343.1,52.9 L343.1,52.3 L343.3,52.3 L343.3,51.6 L343.5,51.6 L343.5,51.0 L343.8,51.0 + L343.8,50.4 L344.0,50.4 L344.0,49.8 L344.2,49.8 L344.2,49.2 L344.4,49.2 L344.4,48.6 L344.6,48.6 + L344.6,48.0 L344.8,48.0 L344.8,47.4 L345.1,47.4 L345.1,46.9 L345.3,46.9 L345.3,46.3 L345.5,46.3 + L345.5,45.8 L345.7,45.8 L345.7,45.3 L345.9,45.3 L345.9,44.8 L346.1,44.8 L346.1,44.3 L346.4,44.3 + L346.4,43.8 L346.6,43.8 L346.6,43.3 L346.8,43.3 L346.8,42.8 L347.0,42.8 L347.0,42.3 L347.2,42.3 + L347.2,41.9 L347.5,41.9 L347.5,41.4 L347.7,41.4 L347.7,40.9 L347.9,40.9 L347.9,40.5 L348.1,40.5 + L348.1,40.1 L348.3,40.1 L348.3,39.7 L348.5,39.7 L348.5,39.2 L348.8,39.2 L348.8,38.8 L349.0,38.8 + L349.0,38.4 L349.2,38.4 L349.2,38.0 L349.4,38.0 L349.4,37.7 L349.6,37.7 L349.6,37.3 L349.8,37.3 + L349.8,36.9 L350.1,36.9 L350.1,36.5 L350.3,36.5 L350.3,36.2 L350.5,36.2 L350.5,35.8 L350.7,35.8 + L350.7,35.5 L350.9,35.5 L350.9,35.1 L351.1,35.1 L351.1,34.8 L351.4,34.8 L351.4,34.5 L351.6,34.5 + L351.6,34.2 L351.8,34.2 L351.8,33.8 L352.0,33.8 L352.0,33.5 L352.2,33.5 L352.2,33.2 L352.4,33.2 + L352.4,32.9 L352.7,32.9 L352.7,32.6 L352.9,32.6 L352.9,32.3 L353.1,32.3 L353.1,32.1 L353.3,32.1 + L353.3,31.8 L353.5,31.8 L353.5,31.5 L353.7,31.5 L353.7,31.2 L354.0,31.2 L354.0,31.0 L354.2,31.0 + L354.2,30.7 L354.4,30.7 L354.4,30.5 L354.6,30.5 L354.6,30.2 L354.8,30.2 L354.8,30.0 L355.1,30.0 + L355.1,29.7 L355.3,29.7 L355.3,29.5 L355.5,29.5 L355.5,29.3 L355.7,29.3 L355.7,29.0 L355.9,29.0 + L355.9,28.8 L356.1,28.8 L356.1,28.6 L356.4,28.6 L356.4,28.4 L356.6,28.4 L356.6,28.2 L356.8,28.2 + L356.8,28.0 L357.0,28.0 L357.0,27.8 L357.2,27.8 L357.2,27.6 L357.4,27.6 L357.4,27.4 L357.7,27.4 + L357.7,27.2 L357.9,27.2 L357.9,27.0 L358.1,27.0 L358.1,26.8 L358.3,26.8 L358.3,26.6 L358.5,26.6 + L358.5,26.4 L358.7,26.4 L358.7,26.3 L359.0,26.3 L359.0,26.1 L359.2,26.1 L359.2,25.9 L359.4,25.9 + L359.4,25.7 L359.6,25.7 L359.6,25.6 L359.8,25.6 L359.8,25.4 L360.0,25.4 L360.0,25.3 L360.3,25.3 + L360.3,25.1 L360.5,25.1 L360.5,25.0 L360.7,25.0 L360.7,24.8 L360.9,24.8 L360.9,24.7 L361.1,24.7 + L361.1,24.5 L361.3,24.5 L361.3,24.4 L361.6,24.4 L361.6,24.2 L361.8,24.2 L361.8,24.1 L362.0,24.1 + L362.0,24.0 L362.2,24.0 L362.2,23.8 L362.4,23.8 L362.4,23.7 L362.7,23.7 L362.7,23.6 L362.9,23.6 + L362.9,23.5 L363.1,23.5 L363.1,23.3 L363.3,23.3 L363.3,23.2 L363.5,23.2 L363.5,23.1 L363.7,23.1 + L363.7,23.0 L364.0,23.0 L364.0,22.9 L364.2,22.9 L364.2,22.7 L364.4,22.7 L364.4,22.6 L364.6,22.6 + L364.6,22.5 L364.8,22.5 L364.8,22.4 L365.0,22.4 L365.0,22.3 L365.3,22.3 L365.3,22.2 L365.5,22.2 + L365.5,22.1 L365.7,22.1 L365.7,22.0 L365.9,22.0 L365.9,21.9 L366.1,21.9 L366.1,21.8 L366.3,21.8 + L366.3,21.7 L366.6,21.7 L366.6,21.6 L366.6,432.9 L366.8,432.9 L366.8,433.0 L367.0,433.0 L367.2,433.0 + L367.4,433.0 L367.6,433.0 L367.9,433.0 L368.1,433.0 L368.3,433.0 L368.5,433.0 L368.7,433.0 L368.9,433.0 + L369.2,433.0 L369.4,433.0 L369.6,433.0 L369.8,433.0 L370.0,433.0 L370.3,433.0 L370.3,433.1 L370.5,433.1 + L370.7,433.1 L370.9,433.1 L371.1,433.1 L371.3,433.1 L371.6,433.1 L371.8,433.1 L372.0,433.1 L372.2,433.1 + L372.4,433.1 L372.6,433.1 L372.9,433.1 L373.1,433.1 L373.3,433.1 L373.5,433.1 L373.7,433.1 L373.9,433.1 + L374.2,433.1 L374.4,433.1 L374.6,433.1 L374.8,433.1 L375.0,433.1 L375.0,433.2 L375.2,433.2 L375.5,433.2 + L375.7,433.2 L375.9,433.2 L376.1,433.2 L376.3,433.2 L376.5,433.2 L376.8,433.2 L377.0,433.2 L377.2,433.2 + L377.4,433.2 L377.6,433.2 L377.8,433.2 L378.1,433.2 L378.3,433.2 L378.5,433.2 L378.7,433.2 L378.9,433.2 + L379.2,433.2 L379.4,433.2 L379.6,433.2 L379.8,433.2 L380.0,433.2 L380.2,433.2 L380.5,433.2 L380.7,433.2 + L380.9,433.2 L381.1,433.2 L381.3,433.2 L381.5,433.2 L381.8,433.2 L382.0,433.2 L382.2,433.2 L382.4,433.2 + L382.6,433.2 L382.8,433.2 L383.1,433.2 L383.3,433.2 L383.5,433.2 L383.7,433.2 L383.9,433.2 L384.1,433.2 + L384.4,433.2 L384.6,433.2 L384.8,433.2 L384.8,433.3 L385.0,433.3 L385.2,433.3 L385.4,433.3 L385.7,433.3 + L385.9,433.3 L386.1,433.3 L386.3,433.3 L386.5,433.3 L386.8,433.3 L387.0,433.3 L387.2,433.3 L387.4,433.3 + L387.6,433.3 L387.8,433.3 L388.1,433.3 L388.3,433.3 L388.5,433.3 L388.7,433.3 L388.9,433.3 L389.1,433.3 + L389.4,433.3 L389.6,433.3 L389.8,433.3 L390.0,433.3 L390.2,433.3 L390.4,433.3 L390.7,433.3 L390.9,433.3 + L391.1,433.3 L391.3,433.3 L391.5,433.3 L391.7,433.3 L392.0,433.3 L392.2,433.3 L392.4,433.3 L392.6,433.3 + L392.6,61.0 L392.8,61.0 L392.8,60.2 L393.0,60.2 L393.0,59.4 L393.3,59.4 L393.3,58.6 L393.5,58.6 + L393.5,57.9 L393.7,57.9 L393.7,57.1 L393.9,57.1 L393.9,56.4 L394.1,56.4 L394.1,55.7 L394.4,55.7 + L394.4,55.0 L394.6,55.0 L394.6,54.3 L394.8,54.3 L394.8,53.6 L395.0,53.6 L395.0,52.9 L395.2,52.9 + L395.2,52.3 L395.4,52.3 L395.4,51.6 L395.7,51.6 L395.7,51.0 L395.9,51.0 L395.9,50.4 L396.1,50.4 + L396.1,49.8 L396.3,49.8 L396.3,49.2 L396.5,49.2 L396.5,48.6 L396.7,48.6 L396.7,48.0 L397.0,48.0 + L397.0,47.4 L397.2,47.4 L397.2,46.9 L397.4,46.9 L397.4,46.3 L397.6,46.3 L397.6,45.8 L397.8,45.8 + L397.8,45.3 L398.0,45.3 L398.0,44.8 L398.3,44.8 L398.3,44.3 L398.5,44.3 L398.5,43.8 L398.7,43.8 + L398.7,43.3 L398.9,43.3 L398.9,42.8 L399.1,42.8 L399.1,42.3 L399.3,42.3 L399.3,41.9 L399.6,41.9 + L399.6,41.4 L399.8,41.4 L399.8,40.9 L400.0,40.9 L400.0,40.5 L400.2,40.5 L400.2,40.1 L400.4,40.1 + L400.4,39.7 L400.6,39.7 L400.6,39.2 L400.9,39.2 L400.9,38.8 L401.1,38.8 L401.1,38.4 L401.3,38.4 + L401.3,38.0 L401.5,38.0 L401.5,37.7 L401.7,37.7 L401.7,37.3 L402.0,37.3 L402.0,36.9 L402.2,36.9 + L402.2,36.5 L402.4,36.5 L402.4,36.2 L402.6,36.2 L402.6,35.8 L402.8,35.8 L402.8,35.5 L403.0,35.5 + L403.0,35.1 L403.3,35.1 L403.3,34.8 L403.5,34.8 L403.5,34.5 L403.7,34.5 L403.7,34.2 L403.9,34.2 + L403.9,33.8 L404.1,33.8 L404.1,33.5 L404.3,33.5 L404.3,33.2 L404.6,33.2 L404.6,32.9 L404.8,32.9 + L404.8,32.6 L405.0,32.6 L405.0,32.3 L405.2,32.3 L405.2,32.1 L405.4,32.1 L405.4,31.8 L405.6,31.8 + L405.6,31.5 L405.9,31.5 L405.9,31.2 L406.1,31.2 L406.1,31.0 L406.3,31.0 L406.3,30.7 L406.5,30.7 + L406.5,30.5 L406.7,30.5 L406.7,30.2 L406.9,30.2 L406.9,30.0 L407.2,30.0 L407.2,29.7 L407.4,29.7 + L407.4,29.5 L407.6,29.5 L407.6,29.3 L407.8,29.3 L407.8,29.0 L408.0,29.0 L408.0,28.8 L408.2,28.8 + L408.2,28.6 L408.5,28.6 L408.5,28.4 L408.7,28.4 L408.7,28.2 L408.9,28.2 L408.9,28.0 L409.1,28.0 + L409.1,27.8 L409.3,27.8 L409.3,27.6 L409.6,27.6 L409.6,27.4 L409.8,27.4 L409.8,27.2 L410.0,27.2 + L410.0,27.0 L410.2,27.0 L410.2,26.8 L410.4,26.8 L410.4,26.6 L410.6,26.6 L410.6,26.4 L410.9,26.4 + L410.9,26.3 L411.1,26.3 L411.1,26.1 L411.3,26.1 L411.3,25.9 L411.5,25.9 L411.5,25.7 L411.7,25.7 + L411.7,25.6 L411.9,25.6 L411.9,25.4 L412.2,25.4 L412.2,25.3 L412.4,25.3 L412.4,25.1 L412.6,25.1 + L412.6,25.0 L412.8,25.0 L412.8,24.8 L413.0,24.8 L413.0,24.7 L413.2,24.7 L413.2,24.5 L413.5,24.5 + L413.5,24.4 L413.7,24.4 L413.7,24.2 L413.9,24.2 L413.9,24.1 L414.1,24.1 L414.1,24.0 L414.3,24.0 + L414.3,23.8 L414.5,23.8 L414.5,23.7 L414.8,23.7 L414.8,23.6 L415.0,23.6 L415.0,23.5 L415.2,23.5 + L415.2,23.3 L415.4,23.3 L415.4,23.2 L415.6,23.2 L415.6,23.1 L415.8,23.1 L415.8,23.0 L416.1,23.0 + L416.1,22.9 L416.3,22.9 L416.3,22.7 L416.5,22.7 L416.5,22.6 L416.7,22.6 L416.7,22.5 L416.9,22.5 + L416.9,22.4 L417.1,22.4 L417.1,22.3 L417.4,22.3 L417.4,22.2 L417.6,22.2 L417.6,22.1 L417.8,22.1 + L417.8,22.0 L418.0,22.0 L418.0,21.9 L418.2,21.9 L418.2,21.8 L418.5,21.8 L418.5,21.7 L418.7,21.7 + L418.7,21.6 L418.7,432.9 L418.9,432.9 L418.9,433.0 L419.1,433.0 L419.3,433.0 L419.5,433.0 L419.8,433.0 + L420.0,433.0 L420.2,433.0 L420.4,433.0 L420.6,433.0 L420.8,433.0 L421.1,433.0 L421.3,433.0 L421.5,433.0 + L421.7,433.0 L421.9,433.0 L422.1,433.0 L422.4,433.0 L422.4,433.1 L422.6,433.1 L422.8,433.1 L423.0,433.1 + L423.2,433.1 L423.4,433.1 L423.7,433.1 L423.9,433.1 L424.1,433.1 L424.3,433.1 L424.5,433.1 L424.7,433.1 + L425.0,433.1 L425.2,433.1 L425.4,433.1 L425.6,433.1 L425.8,433.1 L426.1,433.1 L426.3,433.1 L426.5,433.1 + L426.7,433.1 L426.9,433.1 L427.1,433.1 L427.1,433.2 L427.4,433.2 L427.6,433.2 L427.8,433.2 L428.0,433.2 + L428.2,433.2 L428.4,433.2 L428.7,433.2 L428.9,433.2 L429.1,433.2 L429.3,433.2 L429.5,433.2 L429.7,433.2 + L430.0,433.2 L430.2,433.2 L430.4,433.2 L430.6,433.2 L430.8,433.2 L431.0,433.2 L431.3,433.2 L431.5,433.2 + L431.7,433.2 L431.9,433.2 L432.1,433.2 L432.3,433.2 L432.6,433.2 L432.8,433.2 L433.0,433.2 L433.2,433.2 + L433.4,433.2 L433.7,433.2 L433.9,433.2 L434.1,433.2 L434.3,433.2 L434.5,433.2 L434.7,433.2 L435.0,433.2 + L435.2,433.2 L435.4,433.2 L435.6,433.2 L435.8,433.2 L436.0,433.2 L436.3,433.2 L436.5,433.2 L436.7,433.2 + L436.9,433.2 L436.9,433.3 L437.1,433.3 L437.3,433.3 L437.6,433.3 L437.8,433.3 L438.0,433.3 L438.2,433.3 + L438.4,433.3 L438.6,433.3 L438.9,433.3 L439.1,433.3 L439.3,433.3 L439.5,433.3 L439.7,433.3 L439.9,433.3 + L440.2,433.3 L440.4,433.3 L440.6,433.3 L440.8,433.3 L441.0,433.3 L441.3,433.3 L441.5,433.3 L441.7,433.3 + L441.9,433.3 L442.1,433.3 L442.3,433.3 L442.6,433.3 L442.8,433.3 L443.0,433.3 L443.2,433.3 L443.4,433.3 + L443.6,433.3 L443.9,433.3 L444.1,433.3 L444.3,433.3 L444.5,433.3 L444.7,433.3 L444.7,61.0 L444.9,61.0 + L444.9,60.2 L445.2,60.2 L445.2,59.4 L445.4,59.4 L445.4,58.7 L445.6,58.7 L445.6,57.9 L445.8,57.9 + L445.8,57.1 L446.0,57.1 L446.0,56.4 L446.2,56.4 L446.2,55.7 L446.5,55.7 L446.5,55.0 L446.7,55.0 + L446.7,54.3 L446.9,54.3 L446.9,53.6 L447.1,53.6 L447.1,52.9 L447.3,52.9 L447.3,52.3 L447.5,52.3 + L447.5,51.6 L447.8,51.6 L447.8,51.0 L448.0,51.0 L448.0,50.4 L448.2,50.4 L448.2,49.8 L448.4,49.8 + L448.4,49.2 L448.6,49.2 L448.6,48.6 L448.8,48.6 L448.8,48.0 L449.1,48.0 L449.1,47.5 L449.3,47.5 + L449.3,46.9 L449.5,46.9 L449.5,46.3 L449.7,46.3 L449.7,45.8 L449.9,45.8 L449.9,45.3 L450.2,45.3 + L450.2,44.8 L450.4,44.8 L450.4,44.3 L450.6,44.3 L450.6,43.8 L450.8,43.8 L450.8,43.3 L451.0,43.3 + L451.0,42.8 L451.2,42.8 L451.2,42.3 L451.5,42.3 L451.5,41.9 L451.7,41.9 L451.7,41.4 L451.9,41.4 + L451.9,41.0 L452.1,41.0 L452.1,40.5 L452.3,40.5 L452.3,40.1 L452.5,40.1 L452.5,39.7 L452.8,39.7 + L452.8,39.2 L453.0,39.2 L453.0,38.8 L453.2,38.8 L453.2,38.4 L453.4,38.4 L453.4,38.0 L453.6,38.0 + L453.6,37.7 L453.8,37.7 L453.8,37.3 L454.1,37.3 L454.1,36.9 L454.3,36.9 L454.3,36.5 L454.5,36.5 + L454.5,36.2 L454.7,36.2 L454.7,35.8 L454.9,35.8 L454.9,35.5 L455.1,35.5 L455.1,35.1 L455.4,35.1 + L455.4,34.8 L455.6,34.8 L455.6,34.5 L455.8,34.5 L455.8,34.2 L456.0,34.2 L456.0,33.8 L456.2,33.8 + L456.2,33.5 L456.4,33.5 L456.4,33.2 L456.7,33.2 L456.7,32.9 L456.9,32.9 L456.9,32.6 L457.1,32.6 + L457.1,32.3 L457.3,32.3 L457.3,32.1 L457.5,32.1 L457.5,31.8 L457.8,31.8 L457.8,31.5 L458.0,31.5 + L458.0,31.2 L458.2,31.2 L458.2,31.0 L458.4,31.0 L458.4,30.7 L458.6,30.7 L458.6,30.5 L458.8,30.5 + L458.8,30.2 L459.1,30.2 L459.1,30.0 L459.3,30.0 L459.3,29.7 L459.5,29.7 L459.5,29.5 L459.7,29.5 + L459.7,29.3 L459.9,29.3 L459.9,29.0 L460.1,29.0 L460.1,28.8 L460.4,28.8 L460.4,28.6 L460.6,28.6 + L460.6,28.4 L460.8,28.4 L460.8,28.2 L461.0,28.2 L461.0,28.0 L461.2,28.0 L461.2,27.8 L461.4,27.8 + L461.4,27.6 L461.7,27.6 L461.7,27.4 L461.9,27.4 L461.9,27.2 L462.1,27.2 L462.1,27.0 L462.3,27.0 + L462.3,26.8 L462.5,26.8 L462.5,26.6 L462.7,26.6 L462.7,26.4 L463.0,26.4 L463.0,26.3 L463.2,26.3 + L463.2,26.1 L463.4,26.1 L463.4,25.9 L463.6,25.9 L463.6,25.7 L463.8,25.7 L463.8,25.6 L464.0,25.6 + L464.0,25.4 L464.3,25.4 L464.3,25.3 L464.5,25.3 L464.5,25.1 L464.7,25.1 L464.7,25.0 L464.9,25.0 + L464.9,24.8 L465.1,24.8 L465.1,24.7 L465.4,24.7 L465.4,24.5 L465.6,24.5 L465.6,24.4 L465.8,24.4 + L465.8,24.2 L466.0,24.2 L466.0,24.1 L466.2,24.1 L466.2,24.0 L466.4,24.0 L466.4,23.8 L466.7,23.8 + L466.7,23.7 L466.9,23.7 L466.9,23.6 L467.1,23.6 L467.1,23.5 L467.3,23.5 L467.3,23.3 L467.5,23.3 + L467.5,23.2 L467.7,23.2 L467.7,23.1 L468.0,23.1 L468.0,23.0 L468.2,23.0 L468.2,22.9 L468.4,22.9 + L468.4,22.7 L468.6,22.7 L468.6,22.6 L468.8,22.6 L468.8,22.5 L469.0,22.5 L469.0,22.4 L469.3,22.4 + L469.3,22.3 L469.5,22.3 L469.5,22.2 L469.7,22.2 L469.7,22.1 L469.9,22.1 L469.9,22.0 L470.1,22.0 + L470.1,21.9 L470.3,21.9 L470.3,21.8 L470.6,21.8 L470.6,21.7 L470.8,21.7 L470.8,21.6 L470.8,432.9 + L471.0,432.9 L471.0,433.0 L471.2,433.0 L471.4,433.0 L471.6,433.0 L471.9,433.0 L472.1,433.0 L472.3,433.0 + L472.5,433.0 L472.7,433.0 L473.0,433.0 L473.2,433.0 L473.4,433.0 L473.6,433.0 L473.8,433.0 L474.0,433.0 + L474.3,433.0 L474.5,433.0 L474.5,433.1 L474.7,433.1 L474.9,433.1 L475.1,433.1 L475.3,433.1 L475.6,433.1 + L475.8,433.1 L476.0,433.1 L476.2,433.1 L476.4,433.1 L476.6,433.1 L476.9,433.1 L477.1,433.1 L477.3,433.1 + L477.5,433.1 L477.7,433.1 L477.9,433.1 L478.2,433.1 L478.4,433.1 L478.6,433.1 L478.8,433.1 L479.0,433.1 + L479.2,433.1 L479.2,433.2 L479.5,433.2 L479.7,433.2 L479.9,433.2 L480.1,433.2 L480.3,433.2 L480.5,433.2 + L480.8,433.2 L481.0,433.2 L481.2,433.2 L481.4,433.2 L481.6,433.2 L481.9,433.2 L482.1,433.2 L482.3,433.2 + L482.5,433.2 L482.7,433.2 L482.9,433.2 L483.2,433.2 L483.4,433.2 L483.6,433.2 L483.8,433.2 L484.0,433.2 + L484.2,433.2 L484.5,433.2 L484.7,433.2 L484.9,433.2 L485.1,433.2 L485.3,433.2 L485.5,433.2 L485.8,433.2 + L486.0,433.2 L486.2,433.2 L486.4,433.2 L486.6,433.2 L486.8,433.2 L487.1,433.2 L487.3,433.2 L487.5,433.2 + L487.7,433.2 L487.9,433.2 L488.1,433.2 L488.4,433.2 L488.6,433.2 L488.8,433.2 L489.0,433.2 L489.0,433.3 + L489.2,433.3 L489.5,433.3 L489.7,433.3 L489.9,433.3 L490.1,433.3 L490.3,433.3 L490.5,433.3 L490.8,433.3 + L491.0,433.3 L491.2,433.3 L491.4,433.3 L491.6,433.3 L491.8,433.3 L492.1,433.3 L492.3,433.3 L492.5,433.3 + L492.7,433.3 L492.9,433.3 L493.1,433.3 L493.4,433.3 L493.6,433.3 L493.8,433.3 L494.0,433.3 L494.2,433.3 + L494.4,433.3 L494.7,433.3 L494.9,433.3 L495.1,433.3 L495.3,433.3 L495.5,433.3 L495.7,433.3 L496.0,433.3 + L496.2,433.3 L496.4,433.3 L496.6,433.3 L496.8,433.3 L496.8,61.0 L497.1,61.0 L497.1,60.2 L497.3,60.2 + L497.3,59.4 L497.5,59.4 L497.5,58.7 L497.7,58.7 L497.7,57.9 L497.9,57.9 L497.9,57.1 L498.1,57.1 + L498.1,56.4 L498.4,56.4 L498.4,55.7 L498.6,55.7 L498.6,55.0 L498.8,55.0 L498.8,54.3 L499.0,54.3 + L499.0,53.6 L499.2,53.6 L499.2,52.9 L499.4,52.9 L499.4,52.3 L499.7,52.3 L499.7,51.6 L499.9,51.6 + L499.9,51.0 L500.1,51.0 L500.1,50.4 L500.3,50.4 L500.3,49.8 L500.5,49.8 L500.5,49.2 L500.7,49.2 + L500.7,48.6 L501.0,48.6 L501.0,48.0 L501.2,48.0 L501.2,47.5 L501.4,47.5 L501.4,46.9 L501.6,46.9 + L501.6,46.3 L501.8,46.3 L501.8,45.8 L502.0,45.8 L502.0,45.3 L502.3,45.3 L502.3,44.8 L502.5,44.8 + L502.5,44.3 L502.7,44.3 L502.7,43.8 L502.9,43.8 L502.9,43.3 L503.1,43.3 L503.1,42.8 L503.3,42.8 + L503.3,42.3 L503.6,42.3 L503.6,41.9 L503.8,41.9 L503.8,41.4 L504.0,41.4 L504.0,41.0 L504.2,41.0 + L504.2,40.5 L504.4,40.5 L504.4,40.1 L504.7,40.1 L504.7,39.7 L504.9,39.7 L504.9,39.2 L505.1,39.2 + L505.1,38.8 L505.3,38.8 L505.3,38.4 L505.5,38.4 L505.5,38.0 L505.7,38.0 L505.7,37.7 L506.0,37.7 + L506.0,37.3 L506.2,37.3 L506.2,36.9 L506.4,36.9 L506.4,36.5 L506.6,36.5 L506.6,36.2 L506.8,36.2 + L506.8,35.8 L507.0,35.8 L507.0,35.5 L507.3,35.5 L507.3,35.1 L507.5,35.1 L507.5,34.8 L507.7,34.8 + L507.7,34.5 L507.9,34.5 L507.9,34.2 L508.1,34.2 L508.1,33.8 L508.3,33.8 L508.3,33.5 L508.6,33.5 + L508.6,33.2 L508.8,33.2 L508.8,32.9 L509.0,32.9 L509.0,32.6 L509.2,32.6 L509.2,32.3 L509.4,32.3 + L509.4,32.1 L509.6,32.1 L509.6,31.8 L509.9,31.8 L509.9,31.5 L510.1,31.5 L510.1,31.2 L510.3,31.2 + L510.3,31.0 L510.5,31.0 L510.5,30.7 L510.7,30.7 L510.7,30.5 L510.9,30.5 L510.9,30.2 L511.2,30.2 + L511.2,30.0 L511.4,30.0 L511.4,29.7 L511.6,29.7 L511.6,29.5 L511.8,29.5 L511.8,29.3 L512.0,29.3 + L512.0,29.0 L512.3,29.0 L512.3,28.8 L512.5,28.8 L512.5,28.6 L512.7,28.6 L512.7,28.4 L512.9,28.4 + L512.9,28.2 L513.1,28.2 L513.1,28.0 L513.3,28.0 L513.3,27.8 L513.6,27.8 L513.6,27.6 L513.8,27.6 + L513.8,27.4 L514.0,27.4 L514.0,27.2 L514.2,27.2 L514.2,27.0 L514.4,27.0 L514.4,26.8 L514.6,26.8 + L514.6,26.6 L514.9,26.6 L514.9,26.4 L515.1,26.4 L515.1,26.3 L515.3,26.3 L515.3,26.1 L515.5,26.1 + L515.5,25.9 L515.7,25.9 L515.7,25.7 L515.9,25.7 L515.9,25.6 L516.2,25.6 L516.2,25.4 L516.4,25.4 + L516.4,25.3 L516.6,25.3 L516.6,25.1 L516.8,25.1 L516.8,25.0 L517.0,25.0 L517.0,24.8 L517.2,24.8 + L517.2,24.7 L517.5,24.7 L517.5,24.5 L517.7,24.5 L517.7,24.4 L517.9,24.4 L517.9,24.2 L518.1,24.2 + L518.1,24.1 L518.3,24.1 L518.3,24.0 L518.5,24.0 L518.5,23.8 L518.8,23.8 L518.8,23.7 L519.0,23.7 + L519.0,23.6 L519.2,23.6 L519.2,23.5 L519.4,23.5 L519.4,23.3 L519.6,23.3 L519.6,23.2 L519.8,23.2 + L519.8,23.1 L520.1,23.1 L520.1,23.0 L520.3,23.0 L520.3,22.9 L520.5,22.9 L520.5,22.8 L520.7,22.8 + L520.7,22.6 L520.9,22.6 L520.9,22.5 L521.2,22.5 L521.2,22.4 L521.4,22.4 L521.4,22.3 L521.6,22.3 + L521.6,22.2 L521.8,22.2 L521.8,22.1 L522.0,22.1 L522.0,22.0 L522.2,22.0 L522.2,21.9 L522.5,21.9 + L522.5,21.8 L522.7,21.8 L522.7,21.7 L522.9,21.7 L522.9,21.6 L522.9,432.9 L523.1,432.9 L523.1,433.0 + L523.3,433.0 L523.5,433.0 L523.8,433.0 L524.0,433.0 L524.2,433.0 L524.4,433.0 L524.6,433.0 L524.8,433.0 + L525.1,433.0 L525.3,433.0 L525.5,433.0 L525.7,433.0 L525.9,433.0 L526.1,433.0 L526.4,433.0 L526.6,433.0 + L526.6,433.1 L526.8,433.1 L527.0,433.1 L527.2,433.1 L527.4,433.1 L527.7,433.1 L527.9,433.1 L528.1,433.1 + L528.3,433.1 L528.5,433.1 L528.8,433.1 L529.0,433.1 L529.2,433.1 L529.4,433.1 L529.6,433.1 L529.8,433.1 + L530.1,433.1 L530.3,433.1 L530.5,433.1 L530.7,433.1 L530.9,433.1 L531.1,433.1 L531.4,433.1 L531.4,433.2 + L531.6,433.2 L531.8,433.2 L532.0,433.2 L532.2,433.2 L532.4,433.2 L532.7,433.2 L532.9,433.2 L533.1,433.2 + L533.3,433.2 L533.5,433.2 L533.7,433.2 L534.0,433.2 L534.2,433.2 L534.4,433.2 L534.6,433.2 L534.8,433.2 + L535.0,433.2 L535.3,433.2 L535.5,433.2 L535.7,433.2 L535.9,433.2 L536.1,433.2 L536.4,433.2 L536.6,433.2 + L536.8,433.2 L537.0,433.2 L537.2,433.2 L537.4,433.2 L537.7,433.2 L537.9,433.2 L538.1,433.2 L538.3,433.2 + L538.5,433.2 L538.7,433.2 L539.0,433.2 L539.2,433.2 L539.4,433.2 L539.6,433.2 L539.8,433.2 L540.0,433.2 + L540.3,433.2 L540.5,433.2 L540.7,433.2 L540.9,433.2 L541.1,433.2 L541.1,433.3 L541.3,433.3 L541.6,433.3 + L541.8,433.3 L542.0,433.3 L542.2,433.3 L542.4,433.3 L542.6,433.3 L542.9,433.3 L543.1,433.3 L543.3,433.3 + L543.5,433.3 L543.7,433.3 L544.0,433.3 L544.2,433.3 L544.4,433.3 L544.6,433.3 L544.8,433.3 L545.0,433.3 + L545.3,433.3 L545.5,433.3 L545.7,433.3 L545.9,433.3 L546.1,433.3 L546.3,433.3 L546.6,433.3 L546.8,433.3 + L547.0,433.3 L547.2,433.3 L547.4,433.3 L547.6,433.3 L547.9,433.3 L548.1,433.3 L548.3,433.3 L548.5,433.3 + L548.7,433.3 L548.9,433.3 L548.9,61.0 L549.2,61.0 L549.2,60.2 L549.4,60.2 L549.4,59.4 L549.6,59.4 + L549.6,58.7 L549.8,58.7 L549.8,57.9 L550.0,57.9 L550.0,57.1 L550.2,57.1 L550.2,56.4 L550.5,56.4 + L550.5,55.7 L550.7,55.7 L550.7,55.0 L550.9,55.0 L550.9,54.3 L551.1,54.3 L551.1,53.6 L551.3,53.6 + L551.3,52.9 L551.5,52.9 L551.5,52.3 L551.8,52.3 L551.8,51.6 L552.0,51.6 L552.0,51.0 L552.2,51.0 + L552.2,50.4 L552.4,50.4 L552.4,49.8 L552.6,49.8 L552.6,49.2 L552.9,49.2 L552.9,48.6 L553.1,48.6 + L553.1,48.0 L553.3,48.0 L553.3,47.5 L553.5,47.5 L553.5,46.9 L553.7,46.9 L553.7,46.4 L553.9,46.4 + L553.9,45.8 L554.2,45.8 L554.2,45.3 L554.4,45.3 L554.4,44.8 L554.6,44.8 L554.6,44.3 L554.8,44.3 + L554.8,43.8 L555.0,43.8 L555.0,43.3 L555.2,43.3 L555.2,42.8 L555.5,42.8 L555.5,42.3 L555.7,42.3 + L555.7,41.9 L555.9,41.9 L555.9,41.4 L556.1,41.4 L556.1,41.0 L556.3,41.0 L556.3,40.5 L556.5,40.5 + L556.5,40.1 L556.8,40.1 L556.8,39.7 L557.0,39.7 L557.0,39.2 L557.2,39.2 L557.2,38.8 L557.4,38.8 + L557.4,38.4 L557.6,38.4 L557.6,38.0 L557.8,38.0 L557.8,37.7 L558.1,37.7 L558.1,37.3 L558.3,37.3 + L558.3,36.9 L558.5,36.9 L558.5,36.5 L558.7,36.5 L558.7,36.2 L558.9,36.2 L558.9,35.8 L559.1,35.8 + L559.1,35.5 L559.4,35.5 L559.4,35.1 L559.6,35.1 L559.6,34.8 L559.8,34.8 L559.8,34.5 L560.0,34.5 + L560.0,34.2 L560.2,34.2 L560.2,33.8 L560.5,33.8 L560.5,33.5 L560.7,33.5 L560.7,33.2 L560.9,33.2 + L560.9,32.9 L561.1,32.9 L561.1,32.6 L561.3,32.6 L561.3,32.3 L561.5,32.3 L561.5,32.1 L561.8,32.1 + L561.8,31.8 L562.0,31.8 L562.0,31.5 L562.2,31.5 L562.2,31.2 L562.4,31.2 L562.4,31.0 L562.6,31.0 + L562.6,30.7 L562.8,30.7 L562.8,30.5 L563.1,30.5 L563.1,30.2 L563.3,30.2 L563.3,30.0 L563.5,30.0 + L563.5,29.7 L563.7,29.7 L563.7,29.5 L563.9,29.5 L563.9,29.3 L564.1,29.3 L564.1,29.0 L564.4,29.0 + L564.4,28.8 L564.6,28.8 L564.6,28.6 L564.8,28.6 L564.8,28.4 L565.0,28.4 L565.0,28.2 L565.2,28.2 + L565.2,28.0 L565.4,28.0 L565.4,27.8 L565.7,27.8 L565.7,27.6 L565.9,27.6 L565.9,27.4 L566.1,27.4 + L566.1,27.2 L566.3,27.2 L566.3,27.0 L566.5,27.0 L566.5,26.8 L566.7,26.8 L566.7,26.6 L567.0,26.6 + L567.0,26.4 L567.2,26.4 L567.2,26.3 L567.4,26.3 L567.4,26.1 L567.6,26.1 L567.6,25.9 L567.8,25.9 + L567.8,25.7 L568.1,25.7 L568.1,25.6 L568.3,25.6 L568.3,25.4 L568.5,25.4 L568.5,25.3 L568.7,25.3 + L568.7,25.1 L568.9,25.1 L568.9,25.0 L569.1,25.0 L569.1,24.8 L569.4,24.8 L569.4,24.7 L569.6,24.7 + L569.6,24.5 L569.8,24.5 L569.8,24.4 L570.0,24.4 L570.0,24.2 L570.2,24.2 L570.2,24.1 L570.4,24.1 + L570.4,24.0 L570.7,24.0 L570.7,23.8 L570.9,23.8 L570.9,23.7 L571.1,23.7 L571.1,23.6 L571.3,23.6 + L571.3,23.5 L571.5,23.5 L571.5,23.3 L571.7,23.3 L571.7,23.2 L572.0,23.2 L572.0,23.1 L572.2,23.1 + L572.2,23.0 L572.4,23.0 L572.4,22.9 L572.6,22.9 L572.6,22.8 L572.8,22.8 L572.8,22.6 L573.0,22.6 + L573.0,22.5 L573.3,22.5 L573.3,22.4 L573.5,22.4 L573.5,22.3 L573.7,22.3 L573.7,22.2 L573.9,22.2 + L573.9,22.1 L574.1,22.1 L574.1,22.0 L574.3,22.0 L574.3,21.9 L574.6,21.9 L574.6,21.8 L574.8,21.8 + L574.8,21.7 L575.0,21.7 L575.0,21.6 '/></g> </g> <g style="fill:none; color:black; stroke:currentColor; stroke-width:1.00; stroke-linecap:butt; stroke-linejoin:miter"> <path stroke='black' d='M53.9,16.7 L53.9,444.0 L575.0,444.0 L575.0,16.7 L53.9,16.7 Z '/></g> diff --git a/src/lib/netlist/examples/2n6027.cpp b/src/lib/netlist/examples/2n6027.cpp new file mode 100644 index 00000000000..8585ace3ae6 --- /dev/null +++ b/src/lib/netlist/examples/2n6027.cpp @@ -0,0 +1,99 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +#include "netlist/devices/net_lib.h" + +/* + * Run with + * ./nltool -t 1 -f nl_examples/2N6027.cpp -l PUT.A -l PUT.K -l PUT.G -v + */ + +/* ---------------------------------------------------------------------------- + * Library section header START + * ---------------------------------------------------------------------------*/ + +#ifndef __PLIB_PREPROCESSOR__ + +#define PUT_2N6027(_name) \ + NET_REGISTER_DEV(G501534_DIP, _name) + +//NETLIST_EXTERNAL(ex2N6027) +NETLIST_EXTERNAL(loc_lib) + +#endif + +/* ---------------------------------------------------------------------------- + * Library section header END + * ---------------------------------------------------------------------------*/ + +NETLIST_START(ex2N6027) +{ + + SOLVER(Solver, 48000) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-9) + PARAM(Solver.METHOD, "MAT_CR") + + LOCAL_SOURCE(loc_lib) + INCLUDE(loc_lib) + + ANALOG_INPUT(VB, 10) + + PUT_2N6027(PUT) + + // Figure 3 from datasheet + RES(R1, RES_K(510)) + RES(R2, RES_K(16)) + RES(R3, RES_K(27)) + RES(R4, 20) + CAP(C, CAP_U(0.1)) + + NET_C(VB, R1.1, R2.1) + NET_C(R1.2, C.1, PUT.A) + NET_C(PUT.K, R4.1) + NET_C(PUT.G, R2.2, R3.1) + + NET_C(GND, C.2, R4.2, R3.2) + +} + + +NETLIST_START(PUT_2N6027) +{ + + NET_MODEL("2N6027_NPN NPN(IS=5E-15 VAF=100 IKF=0.3 ISE=1.85E-12 NE=1.45 RE=0.15 RC=0.15 CJE=7E-10 TF=0.6E-8 CJC=2.2E-10 TR=4.76E-8 XTB=3)") + NET_MODEL("2N6027_PNP PNP(IS=2E-15 VAF=100 IKF=0.3 ISE=1.90E-12 NE=1.5 RE=0.15 RC=0.15 CJE=7E-10 TF=1.6E-8 CJC=2.2E-10 TR=5.1E-8 XTB=3)") + + QBJT_EB(Q1, "2N6027_NPN") + QBJT_EB(Q2, "2N6027_PNP") + + /* The netlist transistor model currently doesn't support + * BE and BC capacitances. + * Adding those here significantly reduces NR loops. + * FIXME: Needs to be removed when added to the + * transistor EB model. + */ +#if 0 + CAP(CJE1, CAP_N(1)) + CAP(CJE2, CAP_N(1)) + + NET_C(CJE1.1, Q1.B) + NET_C(CJE1.2, Q1.E) + NET_C(CJE2.1, Q2.B) + NET_C(CJE2.2, Q2.E) +#endif + NET_C(Q1.C, Q2.B) + NET_C(Q1.B, Q2.C) + + ALIAS(G, Q2.B) + ALIAS(A, Q2.E) + ALIAS(K, Q1.E) + +} + +NETLIST_START(loc_lib) +{ + + LOCAL_LIB_ENTRY(PUT_2N6027) + +} diff --git a/src/lib/netlist/examples/7400_astable.c b/src/lib/netlist/examples/7400_astable.c new file mode 100644 index 00000000000..207444568ea --- /dev/null +++ b/src/lib/netlist/examples/7400_astable.c @@ -0,0 +1,36 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * 7400_astable.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(7400_astable) +{ + + /* + * Astable multivibrator using two 7400 gates (or inverters) + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-5) + + // astable NAND Multivibrator ==> f ~ 1.0 / (3 * R * C) + RES(R1, 4700) + CAP(C1, 0.22e-6) + TTL_7400_NAND(n1,R1.1,R1.1) + TTL_7400_NAND(n2,R1.2,R1.2) + NET_C(n1.Q, R1.2) + NET_C(n2.Q, C1.1) + NET_C(C1.2, R1.1) + + LOG(logC12, C1.2) + LOG(logn1Q, n1.Q) + LOG(logn2Q, n2.Q) + +} diff --git a/src/lib/netlist/examples/74123_mstable.c b/src/lib/netlist/examples/74123_mstable.c new file mode 100644 index 00000000000..a6572920537 --- /dev/null +++ b/src/lib/netlist/examples/74123_mstable.c @@ -0,0 +1,48 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * 74123_mstable.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(74123_mstable) +{ + + /* + * Monoflog + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + + ANALOG_INPUT(V5, 5) // 5V + + /* Wiring up the 74123 */ + + CLOCK(clk, 50) + TTL_74123(mf) + + RES(R, 10000) + CAP(C, 1e-6) + + NET_C(GND, mf.GND) + NET_C(V5, mf.VCC) + + NET_C(C.1, mf.C) + NET_C(mf.C, GND) + NET_C(C.2, mf.RC, R.2) + NET_C(R.1, V5) + + NET_C(mf.CLRQ, V5) + NET_C(mf.B, V5) + NET_C(mf.A, clk.Q) + + LOG(log_C, C.2) + LOG(log_Q, mf.Q) + LOG(log_X, clk.Q) + +} diff --git a/src/lib/netlist/examples/74125.cpp b/src/lib/netlist/examples/74125.cpp new file mode 100644 index 00000000000..48e443ccab0 --- /dev/null +++ b/src/lib/netlist/examples/74125.cpp @@ -0,0 +1,43 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +/* + * 74125.cpp + * + */ + +//! [74125_example] +#include "netlist/devices/net_lib.h" + +// ./nltool -c run -l RL.1 src/lib/netlist/examples/74125.cpp +// RL.1 : Output + +NETLIST_START(main) +{ + + SOLVER(Solver, 48000) // could be 1 in this example + + ANALOG_INPUT(VCC, 5.0) + + TTL_74125_GATE(X1) + TTL_74126_GATE(X2) + PARAM(X2.FORCE_TRISTATE_LOGIC, 0) + + CLOCK(C1, 100) + CLOCK(C2, 300) + CLOCK(C3, 5) + + RES(RL, 1000) + + NET_C(C1.Q, X1.A) + NET_C(C2.Q, X2.A) + NET_C(C3.Q, X1.GQ, X2.G) + + NET_C(X1.Y, X2.Y, RL.1) + //NET_C(X1.Y, RL.1) + + NET_C(GND, RL.2, C1.GND, C2.GND, C3.GND, X1.GND, X2.GND) + NET_C(VCC, C1.VCC, C2.VCC, C3.VCC, X1.VCC, X2.VCC) + +} +//! [74125_example] diff --git a/src/lib/netlist/examples/7414.cpp b/src/lib/netlist/examples/7414.cpp new file mode 100644 index 00000000000..1efc836fcd5 --- /dev/null +++ b/src/lib/netlist/examples/7414.cpp @@ -0,0 +1,34 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * 7414.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(7414_astable) +{ + + /* + * Simple oscillator with 74LS14 + * + * ./nltool -f nl_examples/7414.cpp -l C37.1 -l U4A1.Q + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-8) + + TTL_74LS14_GATE(U4A1) + //TTL_7404_GATE(U4A1) + RES(R39, 2200) + CAP(C37, CAP_U(1)) + NET_C(U4A1.A, R39.2, C37.1) + NET_C(GND, C37.2) + NET_C(GND, U4A1.GND) + NET_C(R39.1, U4A1.Q) + +} diff --git a/src/lib/netlist/examples/9602_mstable.c b/src/lib/netlist/examples/9602_mstable.c new file mode 100644 index 00000000000..46388dca3bc --- /dev/null +++ b/src/lib/netlist/examples/9602_mstable.c @@ -0,0 +1,54 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * 9602_mstable.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(74123_mstable) +{ + + /* + * Monoflog + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + + ANALOG_INPUT(V5, 5) // 5V + + /* Wiring up the 74123 */ + + CLOCK(clk, 50) + TTL_9602_DIP(mf) + + RES(R, 10000) + CAP(C, 1e-6) + + NET_C(GND, mf.8) // + NET_C(V5, mf.16) // + + NET_C(C.1, mf.1) + NET_C(mf.1, GND) // Test - can be removed + NET_C(C.2, mf.2, R.2) + NET_C(R.1, V5) + + NET_C(mf.3, V5) // CLR + NET_C(mf.4, GND) // B + NET_C(mf.5, clk.Q) // A + + LOG(logC, C.2) + LOG(logQ, mf.6) //Q + LOG(logX, clk.Q) + + // avoid non connected inputs + + NET_C(mf.11, V5) + NET_C(mf.12, V5) + NET_C(mf.13, V5) + +} diff --git a/src/lib/netlist/examples/bjt.c b/src/lib/netlist/examples/bjt.c new file mode 100644 index 00000000000..082049640a8 --- /dev/null +++ b/src/lib/netlist/examples/bjt.c @@ -0,0 +1,47 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(bjt) +{ + /* Standard stuff */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) + + /* NPN - example */ + + QBJT_SW(Q, "BC237B") + RES(RB, 1000) + RES(RC, 1000) + + NET_C(RC.1, V5) + NET_C(RC.2, Q.C) + NET_C(RB.1, clk) + NET_C(RB.2, Q.B) + NET_C(Q.E, GND) + + /* PNP - example */ + + QBJT_SW(Q1, "BC556B") + RES(RB1, 1000) + RES(RC1, 1000) + + NET_C(RC1.1, GND) + NET_C(RC1.2, Q1.C) + NET_C(RB1.1, clk) + NET_C(RB1.2, Q1.B) + NET_C(Q1.E, V3) + + LOG(logB, Q.B) + LOG(logC, Q.C) + +} diff --git a/src/lib/netlist/examples/bjt_eb.c b/src/lib/netlist/examples/bjt_eb.c new file mode 100644 index 00000000000..dd681e5ac1a --- /dev/null +++ b/src/lib/netlist/examples/bjt_eb.c @@ -0,0 +1,45 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + + +#include "netlist/devices/net_lib.h" +#include "netlist/devices/net_lib.h" + +NETLIST_START(bjt) +{ + /* Standard stuff */ + + CLOCK(clk, 10000) // 10000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + PARAM(Solver.RESCHED_LOOPS, 30) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) + + /* NPN - example */ + + QBJT_EB(Q, "BC237B") + RES(RB, 1000) + RES(RC, 1000) + + NET_C(RC.1, V5) + NET_C(RC.2, Q.C) + NET_C(RB.1, clk) + //NET_C(RB.1, V3) + NET_C(RB.2, Q.B) + NET_C(Q.E, GND) + + // put some load on Q.C + + RES(RCE, 150000) + NET_C(RCE.1, Q.C) + NET_C(RCE.2, GND) + + //LOG(logB, Q.B) + //LOG(logC, Q.C) + +} diff --git a/src/lib/netlist/examples/bjt_eb_pnp.c b/src/lib/netlist/examples/bjt_eb_pnp.c new file mode 100644 index 00000000000..875f47623ab --- /dev/null +++ b/src/lib/netlist/examples/bjt_eb_pnp.c @@ -0,0 +1,36 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(bjt) +{ + /* Standard stuff */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) + + /* PNP - example */ + + QBJT_EB(Q1, "BC556B") + RES(RB1, 1000) + RES(RC1, 1000) + + NET_C(RC1.1, GND) + NET_C(RC1.2, Q1.C) + NET_C(RB1.1, clk) + NET_C(RB1.2, Q1.B) + NET_C(Q1.E, V3) + + LOG(logA, clk) + LOG(logB, Q1.B) + LOG(logC, Q1.C) + +} diff --git a/src/lib/netlist/examples/cccs.cpp b/src/lib/netlist/examples/cccs.cpp new file mode 100644 index 00000000000..709493c619e --- /dev/null +++ b/src/lib/netlist/examples/cccs.cpp @@ -0,0 +1,40 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * cccs.cpp + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(cccs) +{ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.METHOD, "MAT_CR") + + ANALOG_INPUT(V5,5) + CCCS(VV, 0.9) + PARAM(VV.RI, 1e-3) + + RES(R2, 1000) + RES(R1, 1000) + + NET_C(V5, clk.VCC) + NET_C(clk, VV.IP) + NET_C(VV.IN, R1.1) + NET_C(GND, R1.2, R2.2, VV.OP, clk.GND) + + NET_C(R2.1, VV.ON) + + /* Simple current source */ + + CS(CS1, 1) + RES(R3, 1) + NET_C(R3.1, CS1.P) + NET_C(GND, CS1.N, R3.2) + +} diff --git a/src/lib/netlist/examples/cd4066.c b/src/lib/netlist/examples/cd4066.c new file mode 100644 index 00000000000..bba0a5c298e --- /dev/null +++ b/src/lib/netlist/examples/cd4066.c @@ -0,0 +1,47 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(cd4066) +{ + /* Standard stuff */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + + ANALOG_INPUT(V5, 5) + + CD_4066_DIP(SW) + RES(R1, 1000) + + NET_C(SW.7, GND) + NET_C(SW.14, V5) + + NET_C(SW.13, clk) + NET_C(SW.1, V5) + + NET_C(SW.2, R1.1) + NET_C(R1.2, GND) + + // ground anything else + + NET_C(SW.3, GND) + NET_C(SW.4, GND) + NET_C(SW.5, GND) + NET_C(SW.6, GND) + NET_C(SW.8, GND) + NET_C(SW.9, GND) + NET_C(SW.10, GND) + NET_C(SW.11, GND) + NET_C(SW.12, GND) + + LOG(logB, clk) + LOG(logC, R1.1) + +} diff --git a/src/lib/netlist/examples/cdelay.c b/src/lib/netlist/examples/cdelay.c new file mode 100644 index 00000000000..87bf184aa16 --- /dev/null +++ b/src/lib/netlist/examples/cdelay.c @@ -0,0 +1,55 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * cdelay.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(perf) +{ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-20) + MAINCLOCK(clk, 50000000) + + TTL_7400_NAND(n1,clk,clk) + +} + +#ifndef P_FREQ +#define P_FREQ 4800 +#endif + +#ifndef P_DTS +#define P_DTS 1 +#endif + +NETLIST_START(cap_delay) +{ + + /* + * delay circuit + * + */ + + /* Standard stuff */ + + SOLVER(Solver, P_FREQ) + PARAM(Solver.ACCURACY, 1e-20) + PARAM(Solver.DYNAMIC_TS, P_DTS) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-6) + CLOCK(clk, 5000) + + TTL_7400_NAND(n1,clk,clk) + CAP(C, 1e-6) + NET_C(n1.Q, C.2) + NET_C(GND, C.1) + TTL_7400_NAND(n2,n1.Q, n1.Q) + + LOG(logclk, clk) + LOG(logn1Q, C.2) + LOG(logn2Q, n1.Q) + +} diff --git a/src/lib/netlist/examples/cmos_inverter.cpp b/src/lib/netlist/examples/cmos_inverter.cpp new file mode 100644 index 00000000000..3db470744b7 --- /dev/null +++ b/src/lib/netlist/examples/cmos_inverter.cpp @@ -0,0 +1,50 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(cmos_inverter) +{ + /* Standard stuff */ + + //EXTERNAL_SOURCE(modules_lib) + + //INCLUDE(modules_lib) + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-7) + PARAM(Solver.NR_LOOPS, 50) + PARAM(Solver.METHOD, "MAT_CR") + ANALOG_INPUT(V5, 5) + + RTEST(X) + NET_C(X.1, V5) + NET_C(X.2, GND) + + VS(IN, 5) + PARAM(IN.FUNC, "T * 5") + + MOSFET(P, "PMOS(VTO=-1.0 KP=2e-3 LAMBDA=2E-2)") + MOSFET(M, "NMOS(VTO=1.0 KP=2e-3 LAMBDA=2E-2)") + + NET_C(P.S, V5) + NET_C(P.D, M.D) + NET_C(GND, M.S, IN.N) + + NET_C(IN.P, M.G, P.G) + + // capacitance over D - S +#if 0 + CAP(C, CAP_N(1)) + NET_C(M.D, C.1) + NET_C(M.S, C.2) +#endif + LOG(log_G, M.G) + LOG(log_D, M.D) + +} diff --git a/src/lib/netlist/examples/cmos_inverter_clk.cpp b/src/lib/netlist/examples/cmos_inverter_clk.cpp new file mode 100644 index 00000000000..d913e8f6d6b --- /dev/null +++ b/src/lib/netlist/examples/cmos_inverter_clk.cpp @@ -0,0 +1,64 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * cmos_inverter_clk + * + */ + + +#include "netlist/devices/net_lib.h" + +#define USE_CLOCK (1) + +NETLIST_START(cmos_inverter_clk) +{ + /* Standard stuff */ + + //SOLVER(Solver, 480000) + SOLVER(Solver, 1e5) + //SOLVER(Solver, 100000000000) + PARAM(Solver.ACCURACY, 1e-6 ) + PARAM(Solver.NR_LOOPS, 50) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.DYNAMIC_LTE, 1e-5) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 2e-6) + ANALOG_INPUT(V5, 5) + +// CLOCK(clk, 0.5e6) + +#if (USE_CLOCK) + CLOCK(V, 5000) + PARAM(NETLIST.DEFAULT_MOS_CAPMODEL, 2) // Disable capacitance modeling + //CLOCK(V, 500000) +#else + VS(V, 5) + PARAM(V.FUNC, "T * 5e6") +#endif + + MOSFET(P, "PMOS(VTO=-0.5 GAMMA=0.5 TOX=20n)") + MOSFET(M, "NMOS(VTO=0.5 GAMMA=0.5 TOX=20n)") + RES(RG, 1) + + NET_C(P.S, V5) + NET_C(P.D, M.D) +#if (USE_CLOCK) + NET_C(GND, M.S) + NET_C(V.Q, RG.1) +#else + NET_C(GND, M.S, V.N) + NET_C(V.P, RG.1) +#endif + NET_C(RG.2, M.G, P.G) + + // capacitance over D - S +#if 0 + CAP(C, CAP_N(1)) + NET_C(M.D, C.1) + NET_C(M.S, C.2) +#endif +#if 1 + LOG(log_G, M.G) + LOG(log_D, M.D) + LOGD(log_X, RG.1, RG.2) +#endif +} diff --git a/src/lib/netlist/examples/cmos_inverter_rs.cpp b/src/lib/netlist/examples/cmos_inverter_rs.cpp new file mode 100644 index 00000000000..86a84e2e8fa --- /dev/null +++ b/src/lib/netlist/examples/cmos_inverter_rs.cpp @@ -0,0 +1,136 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + +#include "netlist/devices/net_lib.h" + +// Run this with ... ./nltool -c run -t 1 -n cmos_inverter ../examples/cmos_inverter_dk.cpp + +static NETLIST_START(CD4069_ANALOG_GATE) +{ + + //MOSFET(P, "PMOS(VTO=-1.0 KP=2e-3 LAMBDA=2E-2)") + //MOSFET(M, "NMOS(VTO=1.0 KP=2e-3 LAMBDA=2E-2)") + // https://www.youtube.com/watch?v=jayFN7XqPJw + MOSFET(P, "PMOS(VTO=-1.22 KP=0.044 LAMBDA=0.05 GAMMA=0.25 L=4.22e-6 W=30e-6)") + MOSFET(M, "NMOS(VTO=1.22 KP=0.044 LAMBDA=0.05 GAMMA=0.25 L=4.22e-6 W=30e-6)") + + ALIAS(VDD, P.S) + ALIAS(VSS, M.S) + ALIAS(Q, M.D) + ALIAS(A, M.G) + +#if 0 + // No real difference + DIODE(D1, "1N4148") + NET_C(D1.K, A) + NET_C(D1.A, VSS) + + DIODE(D2, "1N4148") + NET_C(D2.A, A) + NET_C(D2.K, VDD) +#endif + NET_C(P.D, M.D) + NET_C(M.G, P.G) + +} + +//- Identifier: CD4069_ANALOG_DIP +//- Title: CD4069UBM/CD4069UBC Inverter Circuits +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,VSS,Y4,A4,Y5,A5,Y6,A6,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/150/206783_DS.pdf +//- +//- This uses two NMOS/PMOS transistors to model +// the input to output voltage transfer function. +// +static NETLIST_START(CD4069_ANALOG_DIP) +{ + CD4069_ANALOG_GATE(A) + CD4069_ANALOG_GATE(B) + CD4069_ANALOG_GATE(C) + CD4069_ANALOG_GATE(D) + CD4069_ANALOG_GATE(E) + CD4069_ANALOG_GATE(F) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD, E.VDD, F.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS, E.VSS, F.VSS) + + DIPPINS( /* +--------------+ */ + A.A, /* A1 |1 ++ 14| VDD */ A.VDD, + A.Q, /* Y1 |2 13| A6 */ F.A, + B.A, /* A2 |3 12| Y6 */ F.Q, + B.Q, /* Y2 |4 4069 11| A5 */ E.A, + C.A, /* A3 |5 10| Y5 */ E.Q, + C.Q, /* Y3 |6 9| A4 */ D.A, + A.VSS, /* VSS |7 8| Y4 */ D.Q + /* +--------------+ */ + ) +} + +NETLIST_START(cmos_inverter) +{ + /* Standard stuff */ + + //EXTERNAL_SOURCE(modules_lib) + + //INCLUDE(modules_lib) + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-7) + PARAM(Solver.NR_LOOPS, 50) + PARAM(Solver.METHOD, "MAT_CR") + ANALOG_INPUT(V5, 5) + + RTEST(X) + NET_C(X.1, V5) + NET_C(X.2, GND) + + LOCAL_LIB_ENTRY(CD4069_ANALOG_GATE) + //SUBMODEL(CD4069_ANALOG_GATE, GATE) + CD4069_ANALOG_GATE(G1) + CD4069_ANALOG_GATE(G2) + CD4069_ANALOG_GATE(G3) + + NET_C(V5, G1.VDD, G2.VDD, G3.VDD) + NET_C(GND, G1.VSS, G2.VSS, G3.VSS) + + RES(R1, 18000) + RES(R2, 3300000) + CAP(C, CAP_U(10)) // is 20! + NET_C(G1.Q, G2.A) + NET_C(G2.Q, G3.A, C.1) + NET_C(G3.Q, R1.1) + NET_C(C.2, R1.2, R2.1) + NET_C(R2.2, G1.A) + + RES(R47,10000) + RES(R46,1000) + RES(R48,2000) // is 1000!, but assume 50:50 on modulated signal + CAP(C45, CAP_U(22)) + QBJT_EB(Q,"2SC1815") + NET_C(G1.Q, R47.1) + NET_C(R47.2, Q.B) + NET_C(V5, Q.C) + NET_C(R46.1, Q.E) + NET_C(R46.2, C45.1) + NET_C(R48.1, C45.1) + NET_C(GND, C45.2, R48.2) + + + // capacitance over D - S +#if 0 + CAP(C, CAP_N(1)) + NET_C(M.D, C.1) + NET_C(M.S, C.2) +#endif + //LOG(log_G, IN.P) + //LOG(log_D, G1.Q) + LOG(log_D, C45.1) + +} diff --git a/src/lib/netlist/examples/congo_bongo.cpp b/src/lib/netlist/examples/congo_bongo.cpp new file mode 100644 index 00000000000..50f265601b0 --- /dev/null +++ b/src/lib/netlist/examples/congo_bongo.cpp @@ -0,0 +1,511 @@ +// license:CC0-1.0 +// copyright-holders:Andrew Gardner,Couriersud + +#include "netlist/devices/net_lib.h" + +/* ---------------------------------------------------------------------------- + * Define + * ---------------------------------------------------------------------------*/ + +/* set to 1 to use optimizations increasing performance significantly */ + +#ifndef USE_OPTIMOPTIMIZATIONS +#define USE_OPTIMIZATIONS 1 +#endif + +#ifndef USE_FRONTIERS +#define USE_FRONTIERS 1 +#endif + +/* ---------------------------------------------------------------------------- + * Library section header START + * ---------------------------------------------------------------------------*/ + +#ifndef __PLIB_PREPROCESSOR__ + +#define G501534_DIP(_name) \ + NET_REGISTER_DEV_X(G501534_DIP, _name) + +NETLIST_EXTERNAL(congob_lib) + +#endif + +/* ---------------------------------------------------------------------------- + * Library section header END + * ---------------------------------------------------------------------------*/ + + +NETLIST_START(congo_bongo) +{ +// EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: WED 01 JUL 2015 11:09:25 PM CEST +// TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N +// TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0 +// SHEET NAME:/ +// IGNORED O_AUDIO0: O_AUDIO0 64 0 +// .END + + PARAM(Solver.RELTOL, 1e-2) + PARAM(Solver.VNTOL, 1e-6) + PARAM(Solver.NR_LOOPS, 30) + PARAM(Solver.GS_LOOPS, 99) + PARAM(Solver.METHOD, "MAT_CR") + + //PARAM(Solver.METHOD, "GMRES") + //PARAM(Solver.ACCURACY, 1e-5) + //PARAM(Solver.METHOD, "SOR") + +#if USE_OPTIMIZATIONS + SOLVER(Solver, 48000) +#else + SOLVER(Solver, 48000) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.PARALLEL, 0) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 2e-7) + PARAM(Solver.DYNAMIC_LTE, 1e-4) +#endif + + LOCAL_SOURCE(congob_lib) + INCLUDE(congob_lib) + + // The following TTL_INPUTs need to be hooked up in MAME + // I_BASS_DRUM0, I_CONGA_H0, I_CONGA_L0, I_GORILLA0, I_RIM0 + // + // 76489 outputs to ANALOG_INPUTS + // + // I_DSG4, I_DSG5 + + // Found here: https://hamesspam.sakura.ne.jp/hes2016/160521.html + NET_MODEL("1S2075 D(IS=1.387E-9 N=1.702 RS=1.53 CJO=1.92pf VJ=0.4996 M=0.0605 TT=5ns BV=75 IBV=100E-15)") + + NET_MODEL("2SC1941 NPN(IS=46.416f BF=210 NF=1.0022 VAF=600 IKF=500m ISE=60f NE=1.5 BR=2.0122 NR=1.0022 VAR=10G IKR=10G ISC=300p NC=2 RB=13.22 IRB=10G RBM=13.22 RE=100m RC=790m CJE=26.52p VJE=900m MJE=518m TF=1.25n XTF=10 VTF=10 ITF=500m PTF=0 CJC=4.89p VJC=750m MJC=237m XCJC=500m TR=100n CJS=0 VJS=750m MJS=500m XTB=1.5 EG=1.11 XTI=3 KF=0 AF=1 FC=500m)") + + INCLUDE(CongoBongo_schematics) + SUBMODEL(CongoBongo_amp, amp) + INCLUDE(CongoBongo_dsg) + + NET_C(R94.1, SJ1) + NET_C(SOU1, amp.AMPIN1) + NET_C(GND, amp.GND) + +#if USE_OPTIMIZATIONS + /* The opamp has an UGF of about 1000k. This doesn't work here and causes oscillations. + * UGF here therefore about half the Solver clock. + */ + PARAM(U16.B.MODEL, "MB3614(TYPE=3 UGF=22k)") + PARAM(U17.C.MODEL, "MB3614(TYPE=3 UGF=44k)") +#endif +#if USE_FRONTIERS + //OPTIMIZE_FRONTIER(C51.2, RES_K(47), 50) + //OPTIMIZE_FRONTIER(R78.2, RES_K(20), RES_K(47)) + OPTIMIZE_FRONTIER(R77.2, RES_K(20), 50) + + OPTIMIZE_FRONTIER(C25.2, RES_K(240), 50) + OPTIMIZE_FRONTIER(C29.2, RES_K(390), 50) + OPTIMIZE_FRONTIER(C37.2, RES_K(390), 50) + OPTIMIZE_FRONTIER(C44.2, RES_K(200), 50) + + OPTIMIZE_FRONTIER(R90.2, RES_K(100), 50) + OPTIMIZE_FRONTIER(R92.2, RES_K(15), 50) + + OPTIMIZE_FRONTIER(R19.2, RES_K(51), 50) +#endif + +} + +NETLIST_START(CongoBongo_schematics) +{ + + CAP(C20, CAP_N(68)) + CAP(C21, CAP_U(1)) + CAP(C22, CAP_U(47)) + CAP(C23, CAP_N(100)) + CAP(C24, CAP_N(100)) + CAP(C25, CAP_U(1)) + CAP(C26, CAP_N(68)) + CAP(C27, CAP_N(33)) + CAP(C28, CAP_U(47)) + CAP(C29, CAP_U(1)) + CAP(C30, CAP_N(33)) + CAP(C31, CAP_N(33)) + CAP(C32, CAP_N(68)) + CAP(C33, CAP_N(33)) + CAP(C34, CAP_U(47)) + CAP(C35, CAP_N(33)) + CAP(C36, CAP_N(33)) + CAP(C37, CAP_U(1)) + CAP(C38, CAP_N(10)) + CAP(C39, CAP_N(3.300000)) + CAP(C40, CAP_U(2.200000)) + CAP(C41, CAP_N(6.800000)) + CAP(C42, CAP_N(6.800000)) + CAP(C43, CAP_N(47)) + CAP(C44, CAP_U(1)) + CAP(C45, CAP_U(33)) + CAP(C46, CAP_N(100)) + CAP(C47, CAP_P(470)) + CAP(C48, CAP_N(1.500000)) + CAP(C49, CAP_P(220)) + CAP(C50, CAP_N(3.900000)) + CAP(C51, CAP_U(1)) + CAP(C52, CAP_U(1)) + CAP(C53, CAP_U(1)) + CAP(C54, CAP_U(1)) + CAP(C55, CAP_U(1)) + CAP(C56, CAP_U(10)) + CAP(C57, CAP_N(47)) + CAP(C58, CAP_N(22)) + CAP(C59, CAP_U(10)) + CAP(C60, CAP_N(22)) + CAP(C61, CAP_U(1)) + CAP(C62, CAP_N(22)) + DIODE(D1, "1S2075") + DIODE(D2, "1S2075") + DIODE(D3, "1S2075") + DIODE(D4, "1S2075") + DIODE(D5, "1S2075") + DIODE(D6, "1S2075") + DIODE(D7, "1S2075") + DIODE(D8, "1S2075") + TTL_INPUT(I_BASS_DRUM0, 0) + TTL_INPUT(I_CONGA_H0, 0) + TTL_INPUT(I_CONGA_L0, 0) + TTL_INPUT(I_GORILLA0, 0) + TTL_INPUT(I_RIM0, 0) + ANALOG_INPUT(I_V12, 12) + ANALOG_INPUT(I_V5, 5) + ANALOG_INPUT(I_V6, 6) + QBJT_EB(Q2, "2SC1941") + RES(R21, RES_K(10)) + RES(R22, RES_K(47)) + RES(R23, RES_K(47)) + RES(R24, RES_K(10)) + RES(R25, RES_K(47)) + RES(R26, RES_K(22)) + RES(R27, RES_K(10)) + RES(R28, RES_K(470)) + RES(R29, RES_K(1)) + RES(R30, RES_K(240)) + RES(R31, RES_K(10)) + RES(R32, RES_K(47)) + RES(R33, RES_K(47)) + RES(R34, RES_K(47)) + RES(R35, RES_K(47)) + RES(R36, RES_K(22)) + RES(R37, RES_K(10)) + RES(R38, RES_M(1)) + RES(R39, 330) + RES(R40, RES_K(390)) + RES(R41, RES_K(10)) + RES(R42, RES_K(47)) + RES(R43, RES_K(47)) + RES(R44, RES_K(47)) + RES(R45, RES_K(47)) + RES(R46, RES_K(22)) + RES(R47, RES_K(10)) + RES(R48, RES_M(1)) + RES(R49, 220) + RES(R50, RES_K(390)) + RES(R51, RES_K(10)) + RES(R52, RES_K(22)) + RES(R53, RES_K(22)) + RES(R54, RES_K(22)) + RES(R55, RES_K(22)) + RES(R56, RES_K(10)) + RES(R57, RES_K(4.700000)) + RES(R58, RES_M(1)) + RES(R59, 470) + RES(R60, RES_M(2.200000)) + RES(R61, RES_M(2.200000)) + RES(R62, RES_K(200)) + RES(R63, RES_K(22)) + RES(R64, RES_K(22)) + RES(R65, RES_K(20)) + RES(R66, RES_K(20)) + RES(R67, RES_K(20)) + + // Sallen-Key filter amplification is 1+R68/69 ~= 2 + + RES(R68, RES_K(20)) + RES(R69, RES_K(20)) + RES(R70, RES_K(100)) + RES(R71, RES_K(150)) + RES(R72, RES_K(330)) + RES(R73, RES_K(1)) + RES(R74, RES_K(1)) + RES(R75, RES_K(470)) + RES(R76, RES_K(10)) + RES(R77, RES_K(20)) + RES(R78, RES_K(47)) + RES(R79, RES_K(22)) + RES(R80, RES_K(20)) + RES(R81, RES_K(10)) + RES(R82, RES_K(100)) + RES(R83, RES_K(51)) + RES(R84, RES_K(51)) + RES(R85, RES_K(51)) + RES(R86, RES_K(51)) + RES(R87, RES_K(100)) + RES(R88, RES_K(2.200000)) + RES(R89, RES_K(10)) + RES(R90, RES_K(100)) + RES(R91, RES_K(10)) + RES(R92, RES_K(15)) + RES(R93, RES_K(15)) + RES(R94, RES_K(51)) + MB3614_DIP(U13) + G501534_DIP(U15) + MB3614_DIP(U16) + MB3614_DIP(U17) + CD4001_DIP(U18) + CD4538_DIP(U19) + MM5837_DIP(U20) + //PARAM(U20.FREQ, 38000) // FIXME: after measurement + PARAM(U20.FREQ, 100000) + TTL_7416_DIP(U6) + NET_C(U15.3, C61.2) + NET_C(R89.2, R88.2, Q2.B) + NET_C(U16.13, U16.14, C57.1, C59.2) + NET_C(U16.8, U16.9, U15.13) + NET_C(U16.3, R86.2, I_V6.Q) + NET_C(U16.2, R90.1, R91.2) + NET_C(R89.1, D8.K) + NET_C(U16.1, R91.1, R92.2) + NET_C(U18.9, U19.6) + NET_C(R71.1, U19.14, C53.2) + NET_C(R76.1, U19.3, U19.13) + NET_C(R72.2, D6.A, U18.10) + NET_C(C51.2, R78.2) + NET_C(I_GORILLA0.Q, U19.5, U19.11) + NET_C(U17.12, C56.1, R81.2, R80.1) + NET_C(U17.6, U17.7, R77.2) + NET_C(U17.5, C55.1, R72.1, R73.1) + NET_C(U17.3, R83.1, R84.2) + NET_C(R73.2, D6.K) + NET_C(U17.2, R82.1, C62.2, R85.2) + NET_C(R92.1, C57.2, R93.2) + NET_C(U16.12, R93.1, C58.1) + NET_C(R68.2, C50.1, U17.8, C51.1) + NET_C(C59.1, U15.1) + NET_C(R68.1, R69.2, U17.9) + NET_C(R67.1, C49.1, U17.10) + NET_C(R70.1, C52.2, U19.2) + NET_C(R65.2, U18.4) + NET_C(U17.13, R78.1, R79.2, R77.1) + NET_C(R63.1, R64.2, C47.1, D5.A, U18.5, U18.6) + NET_C(R60.1, R61.2, C43.1) + NET_C(C40.1, R57.2, R56.1) + NET_C(R30.1, R40.1, R50.1, R62.1, R94.1) + NET_C(D7.K, R74.2) + NET_C(C20.2, R21.2, U6.8) + NET_C(GND, U13.11, C22.2, R29.2, R25.2, R23.2, R22.2, U6.1, U6.3, U6.7, C28.2, R39.2, R35.2, R33.2, R32.2, C34.2, R49.2, R45.2, R43.2, R42.2, C40.2, R59.2, R55.2, R53.2, R52.2, C43.2, R69.1, R64.1, C49.2, C48.2, C47.2, C46.1, C45.1, U17.11, C55.2, C52.1, U18.1, U18.2, U18.7, U18.12, U18.13, C54.2, U16.11, R84.1, R88.1, Q2.E, C58.2, C60.2, U20.1, U20.2, U15.4, I_GORILLA0.GND, U19.1, U19.4, U19.8, U19.12, U19.15, I_BASS_DRUM0.GND, I_CONGA_L0.GND, I_CONGA_H0.GND, I_RIM0.GND, C53.1, C56.2, R81.1) + NET_C(R74.1, R75.1, C54.1, U16.10) + NET_C(D3.K, C32.1, R42.1) + NET_C(U16.5, R86.1, R87.2) + NET_C(C24.2, C23.1, R29.1) + NET_C(U13.14, C25.2, C24.1, R28.1) + NET_C(U16.7, R87.1, D8.A, R90.2) + NET_C(U13.13, C23.2, R28.2) + NET_C(U13.12, R24.1, R26.2, R25.1) + NET_C(C21.1, R24.2) + NET_C(U18.8, U19.9) + NET_C(U13.8, C29.2, C31.1, R38.1) + NET_C(U17.1, U16.6, C62.1) + NET_C(U6.9, I_BASS_DRUM0.Q) + NET_C(U6.12, C32.2, R41.2) + NET_C(U13.10, R34.1, R36.2, R35.1) + NET_C(C39.1, R54.2) + NET_C(U6.10, C38.2, R51.2) + NET_C(R85.1, Q2.C) + NET_C(U13.3, R44.1, R46.2, R45.1) + NET_C(D1.A, C21.2, R23.1) + NET_C(C61.1, R94.2) + NET_C(U13.5, R54.1, R56.2, R55.1) + NET_C(U6.11, I_RIM0.Q) + NET_C(C33.1, R44.2) + NET_C(D7.A, R75.2, U19.10) + NET_C(C25.1, R30.2) + NET_C(C42.2, C41.1, R59.1) + NET_C(U13.6, C41.2, R58.2, R60.2) + NET_C(U13.7, C44.2, C42.1, R58.1, R61.1) + NET_C(C60.1, U15.2) + NET_C(U13.9, C30.2, R38.2) + NET_C(C44.1, R62.2) + NET_C(U6.5, I_CONGA_L0.Q) + NET_C(U6.13, I_CONGA_H0.Q) + NET_C(U6.14, D5.K, R70.2, R76.2, R71.2, U18.14, I_GORILLA0.VCC, U19.16, I_V5.Q, I_BASS_DRUM0.VCC, I_CONGA_L0.VCC, I_CONGA_H0.VCC, I_RIM0.VCC) + NET_C(U6.6, C26.2, R31.2) + NET_C(D2.A, C27.2, R33.1) + NET_C(D1.K, C20.1, R22.1) + NET_C(C29.1, R40.2) + NET_C(D2.K, C26.1, R32.1) + NET_C(C31.2, C30.1, R39.1) + NET_C(R66.1, R67.2, C50.2) +#if 0 + RES(XX, 1) + NET_C(C50.2, XX.1) + NET_C(R66.1, R67.2, XX.2) +#endif + NET_C(R63.2, U20.3) + NET_C(C27.1, R34.2) + NET_C(C22.1, R27.2, R26.1) + NET_C(C28.1, R37.2, R36.1) + NET_C(R65.1, R66.2, C48.1) + NET_C(D3.A, C33.2, R43.1) + NET_C(U13.1, C37.2, C36.1, R48.1) + NET_C(C34.1, R47.2, R46.1) + NET_C(C37.1, R50.2) + NET_C(U17.14, R79.1, R82.2, R83.2) + NET_C(U13.2, C35.2, R48.2) + NET_C(U13.4, R27.1, R21.1, R37.1, R31.1, R47.1, R41.1, R57.1, R51.1, C46.2, C45.2, U17.4, U16.4, U20.4, U15.12, I_V12.Q, R80.2) + NET_C(C36.2, C35.1, R49.1) + NET_C(D4.A, C39.2, R53.1) + NET_C(D4.K, C38.1, R52.1) +} + +NETLIST_START(CongoBongo_amp) +{ + // .INCLUDE "NLSPICE.LIB" + // .TRAN 1E-5 1 + // .END + ALIAS(AMPIN1, R83.1) + ALIAS(AMPOUT1, R77.1) + ANALOG_INPUT(I_V12, 12) + //ANALOG_INPUT(GND, 0) + ALIAS(GND, C66.2) + CAP(C124, CAP_U(470)) + CAP(C51, CAP_U(10)) + CAP(C53, CAP_U(200)) + CAP(C54, CAP_N(3.900000)) + CAP(C55, CAP_P(220)) + CAP(C56, CAP_N(1.500000)) + CAP(C57, CAP_U(10)) + CAP(C58, CAP_U(10)) + CAP(C59, CAP_U(10)) + CAP(C66, CAP_N(100)) + RES(R77, RES_K(100)) + RES(R80, RES_K(20)) + RES(R81, RES_K(10)) + RES(R82, RES_K(10)) + RES(R83, RES_M(1)) + RES(R84, RES_K(47)) + RES(R85, RES_K(47)) + RES(R86, RES_M(1)) + RES(R87, RES_K(100)) + RES(R88, RES_K(20)) + RES(R89, RES_K(10)) + RES(R90, RES_K(10)) + RES(R91, RES_K(10)) + LM324_DIP(U2) + POT(XVR1, 20000) + PARAM(XVR1.DIAL, 0.500000) + NET_C(R82.2, R81.1, C54.2) + NET_C(C51.2, R77.1) + NET_C(R91.2, C56.1, R82.1) + NET_C(R84.2, C57.1) + NET_C(R80.2, XVR1.1) + NET_C(U2.10, C55.1, R81.2) + NET_C(C58.2, XVR1.2) + NET_C(U2.8, U2.9, R80.1, C54.1) + NET_C(R77.2, C53.1) + NET_C(C66.1, U2.4, C124.1, R89.1, I_V12.Q) + NET_C(R83.1, R91.1) + //NET_C(GND, C66.2, U2.11, C124.2, C56.2, C55.2, C57.2, C59.2, R90.2, C53.2, XVR1.3) + NET_C(GND, U2.11, C124.2, C56.2, C55.2, C57.2, C59.2, R90.2, C53.2, XVR1.3) + NET_C(R83.2, U2.13, U2.14, R86.1) + NET_C(U2.1, R88.1, C51.1) + NET_C(U2.7, R85.1, R87.2) + NET_C(U2.3, U2.12, C59.1, R90.1, R89.2) + NET_C(U2.2, R87.1, R88.2) + NET_C(U2.5, R86.2, C58.1) + NET_C(U2.6, R84.1, R85.2) + + RES(IN1, RES_K(50)) + RES(IN2, RES_K(50)) + NET_C(GND, IN1.2, IN2.2) + NET_C(IN1.1, R77.1) + NET_C(IN2.1, R77.2) + +} + +NETLIST_START(CongoBongo_dsg) +{ + // .INCLUDE "NLSPICE.LIB" + // .END + ALIAS(SOU1, U12.14) + ALIAS(SJ1, U12.13) + CAP(C12, CAP_N(100)) + CAP(C13, CAP_N(100)) + CAP(C14, CAP_U(1)) + CAP(C15, CAP_U(1)) + ANALOG_INPUT(I_DSG4, 0) + ANALOG_INPUT(I_DSG5, 0) + //ANALOG_INPUT(I_V12, 12) + //ANALOG_INPUT(I_V6, 6) + RES(R14, 10) + RES(R15, 10) + RES(R16, RES_K(51)) + RES(R17, RES_K(51)) + RES(R18, RES_K(100)) + RES(R19, RES_K(51)) + RES(R20, RES_K(20)) + RES(ROU4, 150) + RES(ROU5, 150) + MB3614_DIP(U12) + NET_C(I_DSG4.Q, ROU4.1) + NET_C(R14.2, C12.1) + NET_C(U12.6, U12.7) + NET_C(R17.2, C15.1) + NET_C(U12.4, I_V12.Q) + NET_C(I_DSG5.Q, ROU5.1) + NET_C(GND, U12.3, U12.5, U12.11, C12.2, C13.2) + NET_C(U12.8, R18.1, R19.2) + NET_C(U12.1, U12.2) + NET_C(U12.14, R20.1) + NET_C(R15.2, C13.1) + NET_C(U12.9, R17.1, R16.1, R18.2) + NET_C(C14.2, R15.1, ROU4.2) + NET_C(R16.2, C14.1) + NET_C(U12.10, U12.12, I_V6.Q) + NET_C(U12.13, R19.1, R20.2) + NET_C(R14.1, C15.2, ROU5.2) +} + +NETLIST_START(G501534_DIP) +{ + //AFUNC(f, 2, "A0 A1 A1 A1 * * 0.01 * *") + //AFUNC(f, 2, "A0") + //AFUNC(f, 2, "A0 6 - A1 3 pow * 0.02 * 6 +") + //AFUNC(f, 2, "A0 * pow(A1,3.0) * 0.02") + //AFUNC(f, 2, "A0 * A1 * 0.2") + //AFUNC(f, 2, "(A0 - 6) * max(0, A1 - 2) * 0.3 + 6") + AFUNC(f, 2, "(A0 - 6) * min(max(0.005, A1 - 2.3),0.3) * 2 + 6") + + /* + * 12: VCC + * 4: GND + * 1: IN + * 3: OUT + * 13: CV + * 2: RDL - connected via Capacitor to ground + */ + + RES(DUMMY, RES_K(1)) + + RES(RO, 1000) + + ALIAS(12, DUMMY.1) // VCC + ALIAS(4, DUMMY.2) // GND + ALIAS(2, DUMMY.2) // RDL + ALIAS(1, f.A0) + ALIAS(13, f.A1) + NET_C(f.Q, RO.1) + ALIAS(3, RO.2) + +} + +NETLIST_START(congob_lib) +{ + + LOCAL_LIB_ENTRY(G501534_DIP) + +} diff --git a/src/lib/netlist/examples/congo_bongo.csv b/src/lib/netlist/examples/congo_bongo.csv new file mode 100644 index 00000000000..db4b9e65357 --- /dev/null +++ b/src/lib/netlist/examples/congo_bongo.csv @@ -0,0 +1,21 @@ +5.000,I_GORILLA0.IN,0 +5.100,I_GORILLA0.IN,1 +5.300,I_GORILLA0.IN,0 +6.000,I_BASS_DRUM0.IN,1 +6.100,I_BASS_DRUM0.IN,0 +7.000,I_CONGA_H0.IN,1 +7.100,I_CONGA_H0.IN,0 +8.000,I_CONGA_L0.IN,1 +8.100,I_CONGA_L0.IN,0 +9.000,I_RIM0.IN,1 +9.100,I_RIM0.IN,0 +10.000,I_GORILLA0.IN,1 +10.010,I_GORILLA0.IN,0 +10.500,I_GORILLA0.IN,1 +10.510,I_GORILLA0.IN,0 +11.000,I_GORILLA0.IN,1 +11.010,I_GORILLA0.IN,0 +11.500,I_GORILLA0.IN,1 +11.510,I_GORILLA0.IN,0 +12.000,I_GORILLA0.IN,1 +12.010,I_GORILLA0.IN,0 diff --git a/src/lib/netlist/examples/cs.cpp b/src/lib/netlist/examples/cs.cpp new file mode 100644 index 00000000000..cb7ef7874d9 --- /dev/null +++ b/src/lib/netlist/examples/cs.cpp @@ -0,0 +1,28 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * cs.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(cs) +{ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.METHOD, "MAT_CR") + + /* Positive current flows into pin 1 of the current source + * Thus we observe a negative voltage on R1.1 ! + */ + CS(CS1, 1e-3) + RES(R1, 1000) + + NET_C(CS1.1, R1.1) + NET_C(GND, CS1.2, R1.2) + + LOG(log_P, R1.1) +} diff --git a/src/lib/netlist/examples/diode.c b/src/lib/netlist/examples/diode.c new file mode 100644 index 00000000000..da45f8fe366 --- /dev/null +++ b/src/lib/netlist/examples/diode.c @@ -0,0 +1,32 @@ +/* + * diode.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(diode) +{ + /* Standard stuff */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48) + ANALOG_INPUT(V5, 5) + + //DIODE(D, "1N914") + DIODE(D, "D(IS=1e-15)") + + RES(R, RES_K(10)) + RES(R1, RES_K(10)) + + NET_C(clk, D.K) + NET_C(D.A, R.1) + NET_C(R.2, V5) + NET_C(R1.2, GND) + NET_C(R.1, R1.1) + + LOG(logB, clk) + LOG(logC, D.A) + +} diff --git a/src/lib/netlist/examples/lm3900_test.cpp b/src/lib/netlist/examples/lm3900_test.cpp new file mode 100644 index 00000000000..425eb36e16a --- /dev/null +++ b/src/lib/netlist/examples/lm3900_test.cpp @@ -0,0 +1,104 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * Script to analyze opamp amplification as a function of frequency. + * + * ./nltool -t 0.5 -f nl_examples/LM9000_test.cpp + * + * t=0.0: 10 Hz + * t=0.1: 100 Hz + * t=0.2: 1000 Hz + * t=0.3: 10000 Hz + * t=0.4: 100000 Hz + * .... + * + * ./plot_nl.sh --db Y Z + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(main) +{ + + /* Standard stuff */ + + //VARCLOCK(clk, "0.5 / pow(10, 1 + T * 4)") + //CLOCK(clk, 1000) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-10) + PARAM(Solver.NR_LOOPS, 300) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-7) + + VS(vs, 0) + /* + * Having f(t)=sin(g(t)*t) the derivative becomes + * + * f'(t) = d/dt(g(t)*t) * cos(g(t)*t) + * + * w(t) = d/dt(g(t)*t) = 2*pi*freq(t) is the angular frequency at time t + * + * choosing freq(t) = pow(10, a+b*t) and integrating we get + * + * g(t)*t = 2 * pi /(b*ln(10)) * (pow(10, a+b*t)-pow(10,a)) + */ + + PARAM(vs.FUNC, "0.001 * sin(0.2728752708 * (pow(10, 1 + 10*T) - 10))") + + /* + * Stepwise ... same as above + */ + //PARAM(vs.FUNC, "0.001 * sin(6.28 * pow(10, trunc((1 + T * 10)*10)/10) * T)") + + /* + * Fixed Frequency: + * PARAM(vs.FUNC, "1.001 * sin(6.28 * 100 * T)") + */ + PARAM(vs.R, 0.1) + ALIAS(clk, vs.1) + NET_C(vs.2, GND) + ANALOG_INPUT(V9, 9) + ANALOG_INPUT(V12, 12) + ANALOG_INPUT(VM12, -12) + + //OPAMP(op, OPAMP_TEST) + LM3900(op) + + NET_C(op.GND, VM12) + NET_C(op.VCC, V12) + + /* Opamp B wired as inverting amplifier connected to output of first opamp */ + + RES(R1, 50) + RES(RP, 500000) // Set to R2 * 2 if VPlus == VCC (see datasheet) + RES(R2, 500000) + + NET_C(op.PLUS, RP.1) + + //NET_C(RP.2, V9) + NET_C(RP.2, GND) + //NET_C(RP.2, V12) + + NET_C(op.MINUS, R2.2) + NET_C(op.MINUS, R1.2) + + CAP(C, 10e-6) + + NET_C(clk, C.1) + NET_C(C.2, R1.1) + NET_C(op.OUT, R2.1) + + CAP(CL, 10.0e-6) + RES(RL, 2000) + NET_C(RL.2, GND) + NET_C(RL.1, CL.2) + NET_C(CL.1, op.OUT) + + AFUNC(f, 1, "A0 * 1000") + NET_C(f.A0, RL.1) +#if 1 + LOG(log_Y, R1.1) + LOG(log_Z, f) +#endif +} diff --git a/src/lib/netlist/examples/lostfound.cpp b/src/lib/netlist/examples/lostfound.cpp new file mode 100644 index 00000000000..da9b1cca780 --- /dev/null +++ b/src/lib/netlist/examples/lostfound.cpp @@ -0,0 +1,218 @@ +/// +/// \file lostfound.cpp +/// +/// This file contains various code removed from the core which may be +/// useful again in the future or serve educational purposes. +/// +/// Don't expect this file to compile + + +/// \brief Use the truthtable implementation of 74107 instead of the coded device +/// +/// FIXME: The truthtable implementation of 74107 (JK-Flipflop) +/// is included for educational purposes to demonstrate how +/// to implement state holding devices as truthtables. +/// It will completely nuke performance for pong. + +#ifndef NL_USE_TRUTHTABLE_74107 +#define NL_USE_TRUTHTABLE_74107 (0) +#endif + +#if (NL_USE_TRUTHTABLE_74107) + /* + * +-----+-----+-----+---++---+-----+ + * | CLRQ| CLK | J | K || Q | QQ | + * +=====+=====+=====+===++===+=====+ + * | 0 | X | X | X || 0 | 1 | + * | 1 | * | 0 | 0 || Q0| Q0Q | + * | 1 | * | 1 | 0 || 1 | 0 | + * | 1 | * | 0 | 1 || 0 | 1 | + * | 1 | * | 1 | 1 || TOGGLE | + * +-----+-----+-----+---++---+-----+ + */ + TRUTH_TABLE(TTL_74107, 6, 4, "+CLK,+J,+K,+CLRQ,@VCC,@GND") +{ + TT_HEAD("CLRQ, CLK, _CO, J, K,_QX | Q, QQ, CO, QX") + TT_LINE(" 0, 0, X, X, X, X | 0, 1, 0, 0 | 16, 25, 1, 1") + TT_LINE(" 0, 1, X, X, X, X | 0, 1, 1, 0 | 16, 25, 1, 1") + + TT_LINE(" 1, 0, X, 0, 0, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 1, X, 0, 0, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 0, X, 0, 0, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") + TT_LINE(" 1, 1, X, 0, 0, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") + + TT_LINE(" 1, 0, 1, 1, 0, X | 1, 0, 0, 1 | 25, 16, 1, 1") + TT_LINE(" 1, 0, 0, 1, 0, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 0, 0, 1, 0, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") + TT_LINE(" 1, 1, X, 1, 0, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 1, X, 1, 0, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") + + TT_LINE(" 1, 0, 1, 0, 1, X | 0, 1, 0, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 0, 0, 0, 1, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 0, 0, 0, 1, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") + TT_LINE(" 1, 1, X, 0, 1, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 1, X, 0, 1, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") + + // Toggle + TT_LINE(" 1, 0, 0, 1, 1, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 0, 0, 1, 1, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") + TT_LINE(" 1, 1, 0, 1, 1, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 1, 0, 1, 1, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") + TT_LINE(" 1, 1, 1, 1, 1, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 1, 1, 1, 1, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") + + TT_LINE(" 1, 0, 1, 1, 1, 1 | 0, 1, 0, 0 | 16, 25, 1, 1") + TT_LINE(" 1, 0, 1, 1, 1, 0 | 1, 0, 0, 1 | 25, 16, 1, 1") + } +#endif + +/// \brief Use the truthtable implementation of 7448 instead of the coded device +/// +/// FIXME: Using truthtable is a lot slower than the explicit device +/// in breakout. Performance drops by 20%. This can be fixed by +/// setting param USE_DEACTIVATE for the device. + +#ifndef NL_USE_TRUTHTABLE_7448 +#define NL_USE_TRUTHTABLE_7448 (0) +#endif + +#if (NL_USE_TRUTHTABLE_7448) + TRUTH_TABLE(TTL_7448, 7, 7, "+A,+B,+C,+D,+LTQ,+BIQ,+RBIQ,@VCC,@GND") +{ + TT_HEAD(" LTQ,BIQ,RBIQ, A , B , C , D | a, b, c, d, e, f, g") + + TT_LINE(" 1, 1, 1, 0, 0, 0, 0 | 1, 1, 1, 1, 1, 1, 0|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 0, 0 | 0, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 0, 0 | 1, 1, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 0, 0 | 1, 1, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 0, 1, 0 | 0, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 1, 0 | 1, 0, 1, 1, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 1, 0 | 0, 0, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 1, 0 | 1, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 0, 0, 1 | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 0, 1 | 1, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 0, 1 | 0, 0, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 0, 1 | 0, 0, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 0, 1, 1 | 0, 1, 0, 0, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 1, 1 | 1, 0, 0, 1, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 1, 1 | 0, 0, 0, 1, 1, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 1, 1 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") + + // BI/RBO is input output. In the next case it is used as an input will go low. + TT_LINE(" 1, 1, 0, 0, 0, 0, 0 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // RBI + + TT_LINE(" 0, 1, X, X, X, X, X | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") // LT + + // This condition has precedence + TT_LINE(" X, 0, X, X, X, X, X | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // BI + TT_FAMILY("74XX") + + } + + // FIXME: We need a more elegant solution than defining twice + TRUTH_TABLE(TTL_7448_TT, 7, 7, "") +{ + TT_HEAD(" LTQ,BIQ,RBIQ, A , B , C , D | a, b, c, d, e, f, g") + + TT_LINE(" 1, 1, 1, 0, 0, 0, 0 | 1, 1, 1, 1, 1, 1, 0|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 0, 0 | 0, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 0, 0 | 1, 1, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 0, 0 | 1, 1, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 0, 1, 0 | 0, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 1, 0 | 1, 0, 1, 1, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 1, 0 | 0, 0, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 1, 0 | 1, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 0, 0, 1 | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 0, 1 | 1, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 0, 1 | 0, 0, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 0, 1 | 0, 0, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 0, 1, 1 | 0, 1, 0, 0, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 0, 1, 1 | 1, 0, 0, 1, 0, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 0, 1, 1, 1 | 0, 0, 0, 1, 1, 1, 1|100,100,100,100,100,100,100") + TT_LINE(" 1, 1, X, 1, 1, 1, 1 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") + + // BI/RBO is input output. In the next case it is used as an input will go low. + TT_LINE(" 1, 1, 0, 0, 0, 0, 0 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // RBI + + TT_LINE(" 0, 1, X, X, X, X, X | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") // LT + + // This condition has precedence + TT_LINE(" X, 0, X, X, X, X, X | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // BI + TT_FAMILY("74XX") + + } + +#endif + +// This is an experimental approach to implement the analog switch. +// This will make the switch a 3 terminal element which is completely +// being dealt with as part as the linear system. +// +// The intention was to improve convergence when the switch is in a feedback +// loop. One example are two-opamp tridiagonal wave generators. +// Unfortunately the approach did not work out and in addition was performing +// far worse than the net-separating original code. +// +// FIXME: The transfer function needs review +// +NETLIB_OBJECT(CD4066_GATE_DYNAMIC) +{ + NETLIB_CONSTRUCTOR_MODEL(CD4066_GATE_DYNAMIC, "CD4XXX") + , m_R(*this, "R", NETLIB_DELEGATE(analog_input_changed)) + , m_DUM1(*this, "_DUM1", NETLIB_DELEGATE(analog_input_changed)) + , m_DUM2(*this, "_DUM2", NETLIB_DELEGATE(analog_input_changed)) + , m_base_r(*this, "BASER", nlconst::magic(270.0)) + , m_last(*this, "m_last", false) + , m_supply(*this) + { + register_sub_alias("CTL", m_DUM1.P()); + + connect(m_DUM1.P(), m_DUM2.P()); + connect(m_DUM1.N(), m_R.P()); + connect(m_DUM2.N(), m_R.N()); + } + + NETLIB_RESETI() + { + // Start in off condition + // FIXME: is ROFF correct? + } + + NETLIB_UPDATE_TERMINALSI() + { + nl_fptype sup = (m_supply.VCC().Q_Analog() - m_supply.GND().Q_Analog()); + nl_fptype in = m_DUM1.P().net().Q_Analog() - m_supply.GND().Q_Analog(); + nl_fptype rON = m_base_r() * nlconst::magic(5.0) / sup; + nl_fptype R = std::exp(-(in / sup - nlconst::magic(0.55)) * nlconst::magic(25.0)) + rON; + nl_fptype G = plib::reciprocal(R); + // dI/dVin = (VR1-VR2)*(1.0/sup*b) * exp((Vin/sup-a) * b) + const auto dfdz = nlconst::magic(25.0)/(R*sup) * m_R.deltaV(); + const auto Ieq = dfdz * in; + const auto zero(nlconst::zero()); + m_R.set_mat( G, -G, zero, + -G, G, zero); + //VIN VR1 + m_DUM1.set_mat( zero, zero, zero, // IIN + dfdz, zero, Ieq); // IR1 + m_DUM2.set_mat( zero, zero, zero, // IIN + -dfdz, zero, -Ieq); // IR2 + } + NETLIB_IS_DYNAMIC(true) + +private: + + NETLIB_HANDLERI(analog_input_changed) + { + m_R.solve_now(); + } + + analog::nld_twoterm m_R; + analog::nld_twoterm m_DUM1; + analog::nld_twoterm m_DUM2; + param_fp_t m_base_r; + state_var<bool> m_last; + nld_power_pins m_supply; +}; + +// NETLIB_DEVICE_IMPL(CD4066_GATE_DYNAMIC, "CD4066_GATE_DYNAMIC", "") + diff --git a/src/lib/netlist/examples/mm5837_noise.c b/src/lib/netlist/examples/mm5837_noise.c new file mode 100644 index 00000000000..86c0b1cd415 --- /dev/null +++ b/src/lib/netlist/examples/mm5837_noise.c @@ -0,0 +1,39 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * mm5837_noise.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(ne555_astable) +{ + + /* + * Astable ne555 + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + + ANALOG_INPUT(V12, 12) // 5V + + /* Wiring up the ne555 */ + + // astable NE555, 1.13 ms period + + MM5837_DIP(NOISE) + + RES(R, 10000) + + NET_C(NOISE.1, NOISE.2, R.2, GND) + NET_C(NOISE.4, V12) + + NET_C(NOISE.3, R.1) + + LOG(log3, NOISE.3) + +} diff --git a/src/lib/netlist/examples/msx_mixer_stage.c b/src/lib/netlist/examples/msx_mixer_stage.c new file mode 100644 index 00000000000..e9ff145fcad --- /dev/null +++ b/src/lib/netlist/examples/msx_mixer_stage.c @@ -0,0 +1,66 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(msx) +{ + /* The BJT is used as an amplifier. RESCHED_LOOPS must be relatively high to + * allow Newton-Raphson to finish. */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-5) + //PARAM(Solver.CONVERG, 0.3) + PARAM(Solver.GS_LOOPS, 50) + + RES(RAY8910, 2345) // Max Voltage + + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V12, 12) + + ANALOG_INPUT(SOUND, 5) + ANALOG_INPUT(SND, 5) + + NET_MODEL("ss9014 NPN(is=2.87599e-14 bf=377.5 vaf=123 ikf=1.1841 ise=4.7863e-15 ne=1.5 br=4.79 var=11.29 ikr=0.275423 isc=1.44544e-14 nc=1.5 rb=200 irb=1e-5 rbm=10 re=0.56 rc=5 cje=1.7205e-11 vje=0.6905907 mje=0.3193434 tf=5.89463e-10 cjc=6.2956p vjc=0.4164212 mjc=0.2559546 xcjc=0.451391 xtb=1.8881 eg=1.2415 xti=3 fc=0.5 Vceo=45 Icrating=0.1 mfg=Fairchild)") + + RES(R24, RES_K(51)) + RES(R23, RES_K(5)) + RES(R21, RES_K(51)) + RES(R20, RES_K(1)) + RES(R9, RES_K(10)) + RES(R8, 330) + + CAP(C55, CAP_U(5)) // Guessed + + //NET_C(RAY8910.1, SND) + NET_C(RAY8910.1, clk) + + //NET_C(C55.1, SOUND) + NET_C(C55.1, V5) + NET_C(C55.2, R24.1) + NET_C(R24.2, R23.2) + NET_C(R23.1, RAY8910.2) + NET_C(R23.1, R20.1) + NET_C(R20.2, GND) + + NET_C(R21.1, V5) + NET_C(R21.2, R23.2) + + QBJT_EB(T2, "ss9014") + + NET_C(R9.1, V12) + NET_C(R9.2, T2.C) + NET_C(R21.2, T2.B) + NET_C(R8.1, T2.E) + NET_C(R8.2, GND) + + //LOG(logB, T2.B) + LOG(logC, T2.C) + +} diff --git a/src/lib/netlist/examples/ne555_astable.c b/src/lib/netlist/examples/ne555_astable.c new file mode 100644 index 00000000000..c4fa454af65 --- /dev/null +++ b/src/lib/netlist/examples/ne555_astable.c @@ -0,0 +1,54 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +/* + * ne555_astable.c + * + */ + +//! [ne555_example] +#include "netlist/devices/net_lib.h" + +NETLIST_START(ne555_astable) +{ + + /* + * Astable ne555 + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + + ANALOG_INPUT(V5, 5) // 5V + + /* Wiring up the ne555 */ + + // astable NE555, 1.13 ms period + + RES(RA, 5000) + RES(RB, 3000) + CAP(C, 0.15e-6) + NE555(555) + + NET_C(GND, 555.GND) + NET_C(V5, 555.VCC) + NET_C(V5, 555.RESET) + + NET_C(RA.1, 555.VCC) + NET_C(RA.2, 555.DISCH) + + NET_C(RB.1, 555.DISCH) + NET_C(RB.2, 555.TRIG) + + NET_C(RB.2, 555.THRESH) + + NET_C(555.TRIG, C.1) + NET_C(C.2, GND) + + LOG(log2, C.1) + LOG(log3, 555.OUT) + +} +//! [ne555_example] diff --git a/src/lib/netlist/examples/ne566.cpp b/src/lib/netlist/examples/ne566.cpp new file mode 100644 index 00000000000..f238308c501 --- /dev/null +++ b/src/lib/netlist/examples/ne566.cpp @@ -0,0 +1,35 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +/* + * ne566.cpp + * + */ + +//! [ne566_example] +#include "netlist/devices/net_lib.h" + +// ./nltool -t 1 -l X.3 -l X.4 -n oscillator src/lib/netlist/examples/ne566.cpp +// X.3 : Square out +// X.4 : Triangle out + +NETLIST_START(oscillator) +{ + + SOLVER(Solver, 48000) + + ANALOG_INPUT(I_V12, 12.0) + + ANALOG_INPUT(I_VC, 11.9 - 0.2) + + NE566_DIP(X) + + RES(R1, 10000) // ~20 Hz. + CAP(C1, 1e-6) + NET_C(I_V12, R1.1, X.8) + NET_C(R1.2, X.6) + NET_C(I_VC, X.5) + NET_C(GND, X.1, C1.2) + NET_C(C1.1, X.7) +} +//! [ne566_example] diff --git a/src/lib/netlist/examples/nld_74393_test.c b/src/lib/netlist/examples/nld_74393_test.c new file mode 100644 index 00000000000..6b954b65ccf --- /dev/null +++ b/src/lib/netlist/examples/nld_74393_test.c @@ -0,0 +1,27 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * cdelay.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(perf) +{ + + SOLVER(Solver, 48000) + + ANALOG_INPUT(V5, 5) + + CLOCK(CLK, 100) // clock for driving the 74393 + CLOCK(CLK2, 3) // off-beat clock for master reset + TTL_74393_DIP(TESTCHIP) + + NET_C(V5, CLK.VCC, CLK2.VCC, TESTCHIP.14) + NET_C(GND, CLK.GND, CLK2.GND, TESTCHIP.7) + + NET_C(CLK, TESTCHIP.1, TESTCHIP.13) + NET_C(CLK2, TESTCHIP.2, TESTCHIP.12) + +} diff --git a/src/lib/netlist/examples/nmos_fet.cpp b/src/lib/netlist/examples/nmos_fet.cpp new file mode 100644 index 00000000000..8ee91c97fc3 --- /dev/null +++ b/src/lib/netlist/examples/nmos_fet.cpp @@ -0,0 +1,55 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * nmos_fet.cpp + * + */ + + +#include "netlist/devices/net_lib.h" +#include "netlist/devices/net_lib.h" + +NETLIST_START(nmos) +{ + /* Standard stuff */ + + CLOCK(clk, 100) // 100 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-9) + PARAM(Solver.NR_LOOPS, 50000) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-9) + ANALOG_INPUT(V5, 5) + ANALOG_INPUT(V3, 3.5) + + /* NMOS - example */ + + NET_MODEL("MM NMOS(VTO=1.0 KP=2e-3 LAMBDA=2E-2)") + MOSFET(M, "MM") + + RES(RB, 1000) + RES(RC, 10000) + + NET_C(RC.1, V5) + NET_C(RC.2, M.D) + NET_C(RB.1, clk) + //NET_C(RB.1, V3) + NET_C(RB.2, M.G) + NET_C(M.S, GND) + + // put some load on M.D + + RES(RCE, 150000) + NET_C(RCE.1, M.D) + NET_C(RCE.2, GND) + + // capacitance over G - S + + CAP(C, CAP_N(1)) + NET_C(M.D, C.1) + NET_C(M.S, C.2) + + LOG(log_G, M.G) + LOG(log_D, M.D) + +} diff --git a/src/lib/netlist/examples/noise.cpp b/src/lib/netlist/examples/noise.cpp new file mode 100644 index 00000000000..282f9bce343 --- /dev/null +++ b/src/lib/netlist/examples/noise.cpp @@ -0,0 +1,37 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +/* + * noise.cpp + * + */ + +//! [noise_example] +#include "netlist/devices/net_lib.h" + +// ./nltool -t 1 -l R1.2 -n noise src/lib/netlist/examples/noise.cpp +// X.3 : Square out +// X.4 : Triangle out + +NETLIST_START(noise) +{ + + SOLVER(Solver, 48000) + + CLOCK(nclk, 2000) + + SYS_NOISE_MT_U(noise, 2.5) + + RES(R1,1000) + RES(R2,1000) + + ANALOG_INPUT(VP, 12.0) + + NET_C(nclk.Q, noise.I) + NET_C(VP, R1.1, nclk.VCC) + NET_C(noise.1, R1.2) + NET_C(noise.2, R2.1) + NET_C(GND, R2.2, nclk.GND) + +} +//! [noise_example] diff --git a/src/lib/netlist/examples/norton_opamp.c b/src/lib/netlist/examples/norton_opamp.c new file mode 100644 index 00000000000..cf9c55622b2 --- /dev/null +++ b/src/lib/netlist/examples/norton_opamp.c @@ -0,0 +1,129 @@ +/* + * opamp.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(main) +{ + + /* Standard stuff */ + + CLOCK(clk, 10000) // 1000 Hz + SOLVER(Solver, 48000) + ANALOG_INPUT(V5, 5) + PARAM(Solver.ACCURACY, 1e-6) + PARAM(Solver.DYNAMIC_TS, 0) + PARAM(Solver.SOR_FACTOR, 1.0) + //PARAM(Solver.CONVERG, 1.0) + PARAM(Solver.GS_LOOPS, 5) + + SUBMODEL(op1, opamp_fast) + /* Wired as non - inverting amplifier like in LM3900 datasheet */ + + RES(R1, 25000) + RES(R2, 100000) + RES(R3, 200000) + CAP(C1, CAP_U(0.05)) + + NET_C(clk, C1.1) + NET_C(C1.2, R1.1) + + NET_C(op1.VM, GND) + NET_C(op1.VP, V5 ) + NET_C(op1.PLUS, R1.2, R3.1) + NET_C(R3.2, V5) + //NET_C(R3.2, GND) + NET_C(op1.MINUS, R2.2) + NET_C(op1.OUT, R2.1) + + RES(RL, 10000) + NET_C(RL.2, GND) + NET_C(RL.1, op1.OUT) + + LOG(logX, op1.OUT) + LOG(logY, clk) +} + +NETLIST_START(opamp) +{ + + /* Opamp model from + * + * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + * + * Bandwidth 10Mhz + * + */ + + /* Terminal definitions for calling netlists */ + + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G2.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... + ALIAS(VM, EBUF.ON) // V- terminal + ALIAS(VP, DUMMY.I) // V+ terminal + + DUMMY_INPUT(DUMMY) + + /* The opamp model */ + + CCCS(G1) + CCCS(G2) + //PARAM(G1.G, 100) // typical OP-AMP amplification 100 * 1000 = 100000 + PARAM(G1.G, 1000000) // typical OP-AMP amplification 100 * 1000 = 100000 + PARAM(G2.G, 1000000) // typical OP-AMP amplification 100 * 1000 = 100000 + RES(RP1, 1000) + CAP(CP1, 1.59e-6) // <== change to 1.59e-3 for 10Khz bandwidth + VCVS(EBUF) + PARAM(EBUF.RO, 50) + PARAM(EBUF.G, 1) + +// NET_C(EBUF.ON, GND) + + NET_C(G1.ON, GND) + NET_C(G2.ON, GND) + NET_C(RP1.2, GND) + NET_C(CP1.2, GND) + NET_C(EBUF.IN, GND) + + NET_C(G1.IN, G2.IP, GND) + + NET_C(RP1.1, G1.OP) + NET_C(RP1.1, G2.OP) + NET_C(CP1.1, RP1.1) + NET_C(EBUF.IP, RP1.1) + +} + +NETLIST_START(opamp_fast) +{ + + /* + * Fast norton opamp model without bandwidth + */ + + /* Terminal definitions for calling netlists */ + + ALIAS(PLUS, R1.1) // Positive input + ALIAS(MINUS, R2.1) // Negative input + ALIAS(OUT, G1.OP) // Opamp output ... + ALIAS(VM, G1.ON) // V- terminal + ALIAS(VP, DUMMY.I) // V+ terminal + + DUMMY_INPUT(DUMMY) + + /* The opamp model */ + + RES(R1, 1) + RES(R2, 1) + NET_C(R1.1, G1.IP) + NET_C(R2.1, G1.IN) + NET_C(R1.2, R2.2, G1.ON) + VCVS(G1) + PARAM(G1.G, 1000000) + PARAM(G1.RO, RES_K(8)) + +} diff --git a/src/lib/netlist/examples/opamp.c b/src/lib/netlist/examples/opamp.c new file mode 100644 index 00000000000..2075aa28531 --- /dev/null +++ b/src/lib/netlist/examples/opamp.c @@ -0,0 +1,190 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * opamp.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(main) +{ + + /* Standard stuff */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 480000) + PARAM(Solver.ACCURACY, 1e-10) + PARAM(Solver.NR_LOOPS, 30000 ) + //PARAM(Solver.CONVERG, 1.0) + PARAM(Solver.GS_LOOPS, 30) + + // Tie up +5 to opamps thought it's not currently needed + // Stay compatible + ANALOG_INPUT(V5, 5) + NET_C(op.VCC, V5) + NET_C(op1.VCC, V5) + + /* Opamp wired as impedance changer */ + SUBMODEL(opamp, op) + + NET_C(op.GND, GND) + NET_C(op.PLUS, clk) + NET_C(op.MINUS, op.OUT) + + SUBMODEL(opamp, op1) + /* Wired as inverting amplifier connected to output of first opamp */ + + RES(R1, 100000) + RES(R2, 200000) + + NET_C(op1.GND, GND) + NET_C(op1.PLUS, GND) + NET_C(op1.MINUS, R2.2) + NET_C(op1.MINUS, R1.2) + + NET_C(op.OUT, R1.1) + NET_C(op1.OUT, R2.1) + + RES(RL, 1000) + NET_C(RL.2, GND) + NET_C(RL.1, op1.OUT) + + LOG(log_X, op1.OUT) + LOG(log_Y, clk) +} + +NETLIST_START(opamp) +{ + + /* Opamp model from + * + * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + * + * Bandwidth 10Mhz + * + */ + + /* Terminal definitions for calling netlists */ + + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G1.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... + + ALIAS(GND, EBUF.ON) // GND terminal + ALIAS(VCC, DUMMY.I) // VCC terminal + DUMMY_INPUT(DUMMY) + + /* The opamp model */ + + LVCCS(G1) + PARAM(G1.G, 0.0021) + PARAM(G1.CURLIM, 0.002) + RES(RP1, 1e7) + CAP(CP1, 0.00333e-6) + VCVS(EBUF) + PARAM(EBUF.RO, 50) + PARAM(EBUF.G, 1) + +// NET_C(EBUF.ON, GND) + + NET_C(G1.ON, GND) + NET_C(RP1.2, GND) + NET_C(CP1.2, GND) + NET_C(EBUF.IN, GND) + + NET_C(RP1.1, G1.OP) + NET_C(CP1.1, RP1.1) + NET_C(EBUF.IP, RP1.1) + +} + +NETLIST_START(opamp_mod) +{ + + /* Opamp model from + * + * http://www.ecircuitcenter.com/Circuits/opmodel1/opmodel1.htm + * + * MB3614 Unit Gain frequency is about 500 kHz and the first pole frequency + * about 5 Hz. We have to keep the Unity Gain Frequency below our sampling + * frequency of 24 Khz. + * + * Simple Opamp Model Calculation + * + * First Pole Frequency 5 Hz + * Unity Gain Frequency 11,000 Hz + * RP 100,000 Ohm + * DC Gain / Aol 2200 + * CP 0.318 uF + * KG 0.022 + * + */ + + /* Terminal definitions for calling netlists */ + + ALIAS(PLUS, G1.IP) // Positive input + ALIAS(MINUS, G1.IN) // Negative input + ALIAS(OUT, EBUF.OP) // Opamp output ... + + AFUNC(fUH, 1, "A0 1.2 -") + AFUNC(fUL, 1, "A0 1.2 +") + + ALIAS(VCC, fUH.A0) // VCC terminal + ALIAS(GND, fUL.A0) // VGND terminal + + AFUNC(fVREF, 2, "A0 A1 + 0.5 *") + NET_C(fUH.A0, fVREF.A0) + NET_C(fUL.A0, fVREF.A1) + + NET_C(EBUF.ON, fVREF) + /* The opamp model */ + + LVCCS(G1) + PARAM(G1.RI, RES_K(1000)) +#if 0 + PARAM(G1.G, 0.0022) + RES(RP1, 1e6) + CAP(CP1, 0.0318e-6) +#else + PARAM(G1.G, 0.002) + PARAM(G1.CURLIM, 0.002) + RES(RP1, 9.5e6) + CAP(CP1, 0.0033e-6) +#endif + VCVS(EBUF) + PARAM(EBUF.RO, 50) + PARAM(EBUF.G, 1) + + NET_C(G1.ON, fVREF) + NET_C(RP1.2, fVREF) + NET_C(CP1.2, fVREF) + NET_C(EBUF.IN, fVREF) + + NET_C(RP1.1, G1.OP) + NET_C(CP1.1, RP1.1) + + DIODE(DP,"D(IS=1e-15 N=1)") + DIODE(DN,"D(IS=1e-15 N=1)") +#if 1 + NET_C(DP.K, fUH.Q) + NET_C(fUL.Q, DN.A) + NET_C(DP.A, DN.K, RP1.1) +#else + /* + * This doesn't add any performance by decreasing iteration loops. + * To the contrary, it significantly decreases iterations + */ + RES(RH1, 0.1) + RES(RL1, 0.1) + NET_C(DP.K, RH1.1) + NET_C(RH1.2, fUH.Q) + NET_C(fUL.Q, RL1.1) + NET_C(RL1.2, DN.A) + NET_C(DP.A, DN.K, RP1.1) + +#endif + NET_C(EBUF.IP, RP1.1) + +} diff --git a/src/lib/netlist/examples/opamp_amplification_curve.cpp b/src/lib/netlist/examples/opamp_amplification_curve.cpp new file mode 100644 index 00000000000..f34581c4977 --- /dev/null +++ b/src/lib/netlist/examples/opamp_amplification_curve.cpp @@ -0,0 +1,95 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * Script to analyze opamp amplification as a function of frequency. + * + * ./nltool -t 0.5 -f nl_examples/opamp_amplification_curve.cpp + * + * t=0.0: 10 Hz + * t=0.1: 100 Hz + * t=0.2: 1000 Hz + * t=0.3: 10000 Hz + * t=0.4: 100000 Hz + * .... + * + * ./plot_nl.sh --log Y Z + */ + + +#include "netlist/devices/net_lib.h" + +#define OPAMP_TEST "MB3614(DAB=0.0015)" + +NETLIST_START(main) +{ + + /* Standard stuff */ + + //VARCLOCK(clk, "0.5 / pow(10, 1 + T * 4)") + //CLOCK(clk, 1000) + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-7) + PARAM(Solver.NR_LOOPS, 300) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 1e-7) + + VS(vs, 0) + /* + * Having f(t)=sin(g(t)*t) the derivative becomes + * + * f'(t) = d/dt(g(t)*t) * cos(g(t)*t) + * + * w(t) = d/dt(g(t)*t) = 2*pi*freq(t) is the angular frequency at time t + * + * choosing freq(t) = pow(10, a+b*t) and integrating we get + * + * g(t)*t = 2 * pi /(b*ln(10)) * (pow(10, a+b*t)-pow(10,a)) + */ + + PARAM(vs.FUNC, "0.001 * sin(0.2728752708 * (pow(10, 1 + 10*T) - 10))") + + /* + * Stepwise ... same as above + */ + //PARAM(vs.FUNC, "0.001 * sin(6.28 * pow(10, trunc((1 + T * 10)*10)/10) * T)") + + /* + * Fixed Frequency: + * PARAM(vs.FUNC, "1.001 * sin(6.28 * 100 * T)") + */ + PARAM(vs.R, 0.001) + ALIAS(clk, vs.1) + NET_C(vs.2, GND) + ANALOG_INPUT(V12, 12) + ANALOG_INPUT(VM12, -12) + + OPAMP(op, OPAMP_TEST) + + NET_C(op.GND, VM12) + NET_C(op.VCC, V12) + + /* Opamp B wired as inverting amplifier connected to output of first opamp */ + + RES(R1, 100) + RES(RP, 100) + RES(R2, 10000000) + + NET_C(op.PLUS, RP.1) + NET_C(RP.2, GND) + NET_C(op.MINUS, R2.2) + NET_C(op.MINUS, R1.2) + + NET_C(clk, R1.1) + NET_C(op.OUT, R2.1) + + RES(RL, 2000) + NET_C(RL.2, GND) + NET_C(RL.1, op.OUT) + + AFUNC(f, 1, "A0 * 1000") + NET_C(f.A0, op.OUT) +#if 1 + LOG(log_Y, R1.1) + LOG(log_Z, f) +#endif +} diff --git a/src/lib/netlist/examples/rc.c b/src/lib/netlist/examples/rc.c new file mode 100644 index 00000000000..b18670292ab --- /dev/null +++ b/src/lib/netlist/examples/rc.c @@ -0,0 +1,32 @@ +/* + * cdelay.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(rc) +{ + + /* + * delay circuit + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + CLOCK(clk, 20000) + + CAP(C1, 0.022e-6) + RES(R1, 10000) + RES(R2, 20000) + + NET_C(clk, R2.1) + NET_C(R2.2, R1.1, C1.1) + NET_C(C1.2, R1.2, GND) + + LOG(tt, C1.1) + +} diff --git a/src/lib/netlist/examples/rl.c b/src/lib/netlist/examples/rl.c new file mode 100644 index 00000000000..3684aa1b701 --- /dev/null +++ b/src/lib/netlist/examples/rl.c @@ -0,0 +1,33 @@ +/* + * lr.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(lr) +{ + + /* + * delay circuit + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + CLOCK(clk, 50) + PARAM(Solver.METHOD, "MAT_CR") + + IND(L1, 10) + RES(R1, 10000) + + NET_C(clk, L1.1) + NET_C(L1.2, R1.1) + NET_C(R1.2, GND) + + //LOG(log_1, R1.1) + //LOG(log_2, clk) + +} diff --git a/src/lib/netlist/examples/sn74ls629_osc.c b/src/lib/netlist/examples/sn74ls629_osc.c new file mode 100644 index 00000000000..518460c90b1 --- /dev/null +++ b/src/lib/netlist/examples/sn74ls629_osc.c @@ -0,0 +1,36 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * ne555_astable.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(ls629) +{ + + /* + * Astable ne555 + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + + ANALOG_INPUT(V5, 5) // 5V + ANALOG_INPUT(VF, 2.5) // 5V + ANALOG_INPUT(VR, 5) // 5V + + SN74LS629(OSC, 0.022e-6) + + NET_C(GND, OSC.GND) + NET_C(V5, OSC.VCC) + NET_C(VR, OSC.RNG) + NET_C(VF, OSC.FC) + NET_C(GND, OSC.ENQ) + + LOG(log2, OSC.Y) + +} diff --git a/src/lib/netlist/examples/test.c b/src/lib/netlist/examples/test.c new file mode 100644 index 00000000000..8ae6de99db1 --- /dev/null +++ b/src/lib/netlist/examples/test.c @@ -0,0 +1,88 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * bjt.c + * + */ + +// CURRENTLY BROKEN + +#include "netlist/devices/net_lib.h" + +NETLIST_START(bjt) +{ + /* Standard stuff */ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + + ANALOG_INPUT(V3, 3) + ANALOG_INPUT(STOPG, 0) + ALIAS(SRSTQ, RYf.2) + ALIAS(SRST, RYc.2) + NET_C(antenna, GND) + ALIAS(runQ, Q1.C) + + TTL_7404_INVERT(e4d, STOPG) + + RES(RYf, 50) // output impedance + RES(RYc, 50) // output impedance + + TTL_7404_INVERT(c9f, RYc.2) + TTL_7404_INVERT(c9c, RYf.2) + NET_C(c9f.Q, RYf.1) + NET_C(c9c.Q, RYc.1) + + SWITCH2(coinsw, RYc.2, RYf.2) + + NET_C(coinsw.Q, GND) + + /* Antenna circuit */ + /* Also has a diode to clamp negative voltages - omitted here */ + NETDEV_QNPN(Q3, BC237B) + ALIAS(antenna, Q3.B) + NET_C(GND, Q3.E) + RES(RX5, 100) + CAP(CX1, 100) + NET_C(RX5.1, CX1.1) + NET_C(RX5.1, Q3.C) + NET_C(RX5.2, GND) + NET_C(CX1.2, GND) + NETDEV_QNPN(Q1, BC237B) + NET_C(Q1.B, RX5.1) + NET_C(Q1.E, GND) + + DIODE(D3, 1N914) + NET_C(D3.A, Q1.C) + NET_C(D3.K, SRSTQ) + + DIODE(D2, 1N914) + RES(RX4, 220) + NET_C(D2.K, e4d.Q) + NET_C(D2.A, RX4.1) + NET_C(RX4.2, Q3.C) + + RES(RX1, 100) + RES(RX2, 100) + RES(RX3, 330) + CAP(CX2, CAP_U(0.1)) + + NET_C(RX3.2, D3.A) + NET_C(RX3.1, RX1.2) + NET_C(RX1.1, V3) + + NET_C(RX1.1, CX2.1) + NET_C(RX1.2, CX2.2) + + NETDEV_QPNP(Q2, BC556B) + NET_C(Q2.E, V3) + NET_C(Q2.B, RX1.2) + NET_C(Q2.C, RX2.2) + + NET_C(RX2.1, D2.A) + + + //LOG(logB, Q1.B) + //LOG(logC, Q1.C) + +} diff --git a/src/lib/netlist/examples/todo.c b/src/lib/netlist/examples/todo.c new file mode 100644 index 00000000000..4426f44b3fa --- /dev/null +++ b/src/lib/netlist/examples/todo.c @@ -0,0 +1,143 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * todo.c + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(7400_TTL) +{ + NET_REGISTER_DEV(7400, s1) + NET_REGISTER_DEV(7400, s2) + NET_REGISTER_DEV(7400, s3) + NET_REGISTER_DEV(7400, s4) + + ALIAS(1, s1.A); + ALIAS(2, s1.B); + ALIAS(3, s1.Q); + + ALIAS(4, s2.A); + ALIAS(5, s2.B); + ALIAS(6, s2.Q); + + ALIAS(9, s3.A); + ALIAS(10, s3.B) + ALIAS(8, s3.Q); + + ALIAS(12, s4.A); + ALIAS(13, s4.B); + ALIAS(11, s4.Q); + +} + +NETLIST_START(lib) +{ + TRUTH_TABLE(7400A, 2, 1, 0, "+A,B") +{ + TT_HEAD(" A , B | Q ") + TT_LINE(" 0 , X | 1 |22") + TT_LINE(" X , 0 | 1 |22") + TT_LINE(" 1 , 1 | 0 |15") + } +} + + + +#if 0 + RES(R1, 10) + RES(R2, 10) + RES(R3, 10) + NET_C(V5,R1.1) + NET_C(R1.2, R2.1) + NET_C(R2.2, R3.1) + NET_C(R3.2, GND) +#endif +#if 0 + RES(R4, 1000) + CAP(C1, 1e-6) + NET_C(V5,R4.1) + NET_C(R4.2, C1.1) + NET_C(C1.2, GND) + //LOG(log1, C1.1) +#endif + +#if 0 + RES(R5, 1000) + NETDEV_1N914(D1) + NET_C(V5, R5.1) + NET_C(R5.2, D1.A) + NET_C(D1.K, GND) + //LOG(log1, D1.A) +#endif + +#if 0 +#endif + +#if 0 + NETDEV_VCVS(VV) + RES(R1, 1000) + RES(R2, 10000) + + NET_C(V5, R1.1) + NET_C(R1.2, VV.IN) + NET_C(R2.1, VV.OP) + NET_C(R2.2, VV.IN) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) + +#endif + +#if 0 +#endif + +#if 0 + NETDEV_VCVS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + PARAM(VV.RO, 50) // typical OP-AMP amplification + RES(R1, 1000) + RES(R3, 10000) // ==> 10x amplification (inverting) + + NET_C(4V, R1.1) + NET_C(R1.2, VV.IN) + NET_C(R3.1, VV.IN) + NET_C(R3.2, VV.OP) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) + LOG(logY, 4V) + +#endif + +#if 0 + // Impedance converter with resistor + NETDEV_VCVS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + PARAM(VV.RO, 50) // typical OP-AMP amplification + RES(R3, 10000) + + NET_C(4V, VV.IP) + NET_C(R3.1, VV.IN) + NET_C(R3.2, VV.OP) + NET_C(VV.ON, GND) + LOG(logX, VV.OP) + LOG(logY, 4V) + +#endif + +#if 0 + // Impedance converter without resistor + NETDEV_VCVS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + PARAM(VV.RO, 50) // typical OP-AMP amplification + + NET_C(4V, VV.IP) + NET_C(VV.IN, VV.OP) + NET_C(VV.ON, GND) + LOG(logX, VV.OP) + LOG(logY, 4V) + +#endif + diff --git a/src/lib/netlist/examples/turkey_shoot.cpp b/src/lib/netlist/examples/turkey_shoot.cpp new file mode 100644 index 00000000000..79c851f6a9e --- /dev/null +++ b/src/lib/netlist/examples/turkey_shoot.cpp @@ -0,0 +1,214 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +/* + * This example illustrates how to use netlist to derive RGB output + * levels from complex output circuits. + * + * Create x.cpp: + + #include <cstdio> + + int main() + { + // Change IC86 output every micro second starting at 1ms + for (std::size_t i=0;i<256;i++) + printf("%.9f,IC86.D.IN,%d\n", (double) i / 1.0e6 + 1.0e-3, (int)i); + } + + * Run these commands: + * + * c++ x.cpp + * ./a.out > src/lib/netlist/examples/turkey_shoot.csv + * ./nltool -c run -t 0.0013 -f src/lib/netlist/examples/turkey_shoot.cpp -i src/lib/netlist/examples/turkey_shoot.csv -l BLUE + * ./nlwav -f tab -o x.tab -s 0.0010005 -i 0.000001 -n 256 log_BLUE.log + * + * x.tab now contains 256 values representing the different output levels: + * low 4 bits: color value + * high 4 bits: attenuation value + * + */ + + +#include "netlist/devices/net_lib.h" + +/* ---------------------------------------------------------------------------- + * Define + * ---------------------------------------------------------------------------*/ + +/* set to 1 to use optimizations increasing performance significantly */ + +#ifndef USE_OPTIMIZATIONS +#define USE_OPTIMIZATIONS 0 +#endif + +/* ---------------------------------------------------------------------------- + * Library section header START + * ---------------------------------------------------------------------------*/ + +#ifndef __PLIB_PREPROCESSOR__ + +#define SHIM74LS374_DIP(_name) \ + NET_REGISTER_DEV_X(SHIM74LS374_DIP, _name) +#endif + +/* ---------------------------------------------------------------------------- + * Library section header END + * ---------------------------------------------------------------------------*/ + + +NETLIST_START(turkey_shoot_vga) +{ +// EESCHEMA NETLIST VERSION 1.1 (SPICE FORMAT) CREATION DATE: WED 01 JUL 2015 11:09:25 PM CEST +// TO EXCLUDE A COMPONENT FROM THE SPICE NETLIST ADD [SPICE_NETLIST_ENABLED] USER FIELD SET TO: N +// TO REORDER THE COMPONENT SPICE NODE SEQUENCE ADD [SPICE_NODE_SEQUENCE] USER FIELD AND DEFINE SEQUENCE: 2,1,0 +// SHEET NAME:/ +// IGNORED O_AUDIO0: O_AUDIO0 64 0 +// .END + + PARAM(Solver.RELTOL, 1e-2) + PARAM(Solver.VNTOL, 1e-6) + PARAM(Solver.NR_LOOPS, 30) + PARAM(Solver.GS_LOOPS, 99) + PARAM(Solver.METHOD, "MAT_CR") + PARAM(Solver.PARALLEL, 0) + + //PARAM(Solver.METHOD, "GMRES") + //PARAM(Solver.ACCURACY, 1e-5) + //PARAM(Solver.METHOD, "SOR") + +#if USE_OPTIMIZATIONS + SOLVER(Solver, 48000) +#else + SOLVER(Solver, 48000) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.PARALLEL, 0) + PARAM(Solver.DYNAMIC_MIN_TIMESTEP, 2e-8) + PARAM(Solver.DYNAMIC_LTE, 1e-4) +#endif + + NET_MODEL("2N3904 NPN(IS=1E-14 VAF=100 Bf=300 IKF=0.4 XTB=1.5 BR=4 CJC=4E-12 CJE=8E-12 RB=20 RC=0.1 RE=0.1 TR=250E-9 TF=350E-12 ITF=1 VTF=2 XTF=3 Vceo=40 Icrating=200m mfg=Philips)") + + LOCAL_SOURCE(SHIM74LS374_DIP) + LOCAL_LIB_ENTRY(SHIM74LS374_DIP) + + INCLUDE(turkey_shoot_schematics) + +} + +NETLIST_START(turkey_shoot_schematics) +{ + + ANALOG_INPUT(I_V12, 12) + ANALOG_INPUT(I_V5, 5) + + TTL_INPUT(BLANK, 0) + + IND(L1, 0.0000047) + + CAP(C60, CAP_U(0.1)) + CAP(C54, CAP_P(47)) + CAP(C57, CAP_P(47)) + + RES(R32, RES_K(1)) + RES(R33, RES_K(1)) + RES(R34, 390) + RES(R6, RES_K(8.2)) + RES(R7, RES_K(3.9)) + RES(R8, RES_K(2)) + RES(R9, RES_K(1)) + RES(R10, RES_K(8.2)) + RES(R11, RES_K(3.9)) + RES(R12, RES_K(2)) + RES(R13, RES_K(1)) + + RES(R35, RES_K(2.2)) + RES(R36, RES_K(2.7)) + RES(R31, 270) + RES(R30, RES_K(2)) + RES(R29, RES_K(2)) + RES(R28, RES_K(2)) + RES(R22, 470) + RES(R23, 47) + + DIODE(D1, "1N4148") + DIODE(D2, "1N4148") + DIODE(D3, "1N4148") + DIODE(D4, "1N4148") + DIODE(D5, "1N4148") + DIODE(D6, "1N4148") + DIODE(D7, "1N4148") + DIODE(D8, "1N4148") + DIODE(D17, "1N4148") + + QBJT_EB(Q3, "2N3904") + QBJT_EB(Q4, "2N3904") + QBJT_EB(Q5, "2N3904") + + SHIM74LS374_DIP(IC86) + + NET_C(D8.K, IC86.19) + NET_C(D7.K, IC86.16) + NET_C(D6.K, IC86.15) + NET_C(D5.K, IC86.12) + NET_C(D4.K, IC86.9) + NET_C(D3.K, IC86.6) + NET_C(D2.K, IC86.5) + NET_C(D1.K, IC86.2) + + NET_C(D8.A, R13.1) + NET_C(D7.A, R12.1) + NET_C(D6.A, R11.1) + NET_C(D5.A, R10.1) + NET_C(D4.A, R9.1) + NET_C(D3.A, R8.1) + NET_C(D2.A, R7.1) + NET_C(D1.A, R6.1) + + NET_C(BLANK, C57.1, R32.1) + NET_C(C57.2, R32.2, R33.1, Q5.B) + NET_C(GND, R33.2, Q5.E, R36.2, C60.2) + NET_C(Q5.C, R34.1) + NET_C(R34.2, R13.2, R12.2, R11.2, R10.2, R35.2, R36.1, Q4.B) + NET_C(R35.1, Q4.C, C60.1, L1.2) + + NET_C(I_V12, L1.1) + + NET_C(Q4.E, R30.1, R29.1, R28.1, R31.1) + + NET_C(GND, R31.2, R29.2, R28.2) + NET_C(R6.2, R7.2, R8.2, R9.2, R30.2, Q3.B) + NET_C(I_V5, Q3.C) + NET_C(GND, C54.2, R22.2) + NET_C(Q3.E, D17.A) + NET_C(D17.K, R22.1, R23.1) + NET_C(R23.2, C54.1) + + NET_C(I_V5, IC86.20, BLANK.VCC) + NET_C(GND, IC86.10, BLANK.GND) + + ALIAS(BLUE, C54.1) + +} + + +NETLIST_START(SHIM74LS374_DIP) +{ + + NET_MODEL("SPECIAL FAMILY(IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e10)") + //LOGIC_INPUT8(D, 0, "74XX") + //LOGIC_INPUT8(D, 0, "74XXOC") + LOGIC_INPUT8(D, 0, "SPECIAL") + ALIAS(20, D.VCC) + ALIAS(10, D.GND) + ALIAS( 2, D.Q0) + ALIAS( 5, D.Q1) + ALIAS( 6, D.Q2) + ALIAS( 9, D.Q3) + ALIAS(12, D.Q4) + ALIAS(15, D.Q5) + ALIAS(16, D.Q6) + ALIAS(19, D.Q7) + +} + diff --git a/src/lib/netlist/examples/turkey_shoot.csv b/src/lib/netlist/examples/turkey_shoot.csv new file mode 100644 index 00000000000..095d3d92e08 --- /dev/null +++ b/src/lib/netlist/examples/turkey_shoot.csv @@ -0,0 +1,256 @@ +0.001000000,IC86.D.IN,0 +0.001001000,IC86.D.IN,1 +0.001002000,IC86.D.IN,2 +0.001003000,IC86.D.IN,3 +0.001004000,IC86.D.IN,4 +0.001005000,IC86.D.IN,5 +0.001006000,IC86.D.IN,6 +0.001007000,IC86.D.IN,7 +0.001008000,IC86.D.IN,8 +0.001009000,IC86.D.IN,9 +0.001010000,IC86.D.IN,10 +0.001011000,IC86.D.IN,11 +0.001012000,IC86.D.IN,12 +0.001013000,IC86.D.IN,13 +0.001014000,IC86.D.IN,14 +0.001015000,IC86.D.IN,15 +0.001016000,IC86.D.IN,16 +0.001017000,IC86.D.IN,17 +0.001018000,IC86.D.IN,18 +0.001019000,IC86.D.IN,19 +0.001020000,IC86.D.IN,20 +0.001021000,IC86.D.IN,21 +0.001022000,IC86.D.IN,22 +0.001023000,IC86.D.IN,23 +0.001024000,IC86.D.IN,24 +0.001025000,IC86.D.IN,25 +0.001026000,IC86.D.IN,26 +0.001027000,IC86.D.IN,27 +0.001028000,IC86.D.IN,28 +0.001029000,IC86.D.IN,29 +0.001030000,IC86.D.IN,30 +0.001031000,IC86.D.IN,31 +0.001032000,IC86.D.IN,32 +0.001033000,IC86.D.IN,33 +0.001034000,IC86.D.IN,34 +0.001035000,IC86.D.IN,35 +0.001036000,IC86.D.IN,36 +0.001037000,IC86.D.IN,37 +0.001038000,IC86.D.IN,38 +0.001039000,IC86.D.IN,39 +0.001040000,IC86.D.IN,40 +0.001041000,IC86.D.IN,41 +0.001042000,IC86.D.IN,42 +0.001043000,IC86.D.IN,43 +0.001044000,IC86.D.IN,44 +0.001045000,IC86.D.IN,45 +0.001046000,IC86.D.IN,46 +0.001047000,IC86.D.IN,47 +0.001048000,IC86.D.IN,48 +0.001049000,IC86.D.IN,49 +0.001050000,IC86.D.IN,50 +0.001051000,IC86.D.IN,51 +0.001052000,IC86.D.IN,52 +0.001053000,IC86.D.IN,53 +0.001054000,IC86.D.IN,54 +0.001055000,IC86.D.IN,55 +0.001056000,IC86.D.IN,56 +0.001057000,IC86.D.IN,57 +0.001058000,IC86.D.IN,58 +0.001059000,IC86.D.IN,59 +0.001060000,IC86.D.IN,60 +0.001061000,IC86.D.IN,61 +0.001062000,IC86.D.IN,62 +0.001063000,IC86.D.IN,63 +0.001064000,IC86.D.IN,64 +0.001065000,IC86.D.IN,65 +0.001066000,IC86.D.IN,66 +0.001067000,IC86.D.IN,67 +0.001068000,IC86.D.IN,68 +0.001069000,IC86.D.IN,69 +0.001070000,IC86.D.IN,70 +0.001071000,IC86.D.IN,71 +0.001072000,IC86.D.IN,72 +0.001073000,IC86.D.IN,73 +0.001074000,IC86.D.IN,74 +0.001075000,IC86.D.IN,75 +0.001076000,IC86.D.IN,76 +0.001077000,IC86.D.IN,77 +0.001078000,IC86.D.IN,78 +0.001079000,IC86.D.IN,79 +0.001080000,IC86.D.IN,80 +0.001081000,IC86.D.IN,81 +0.001082000,IC86.D.IN,82 +0.001083000,IC86.D.IN,83 +0.001084000,IC86.D.IN,84 +0.001085000,IC86.D.IN,85 +0.001086000,IC86.D.IN,86 +0.001087000,IC86.D.IN,87 +0.001088000,IC86.D.IN,88 +0.001089000,IC86.D.IN,89 +0.001090000,IC86.D.IN,90 +0.001091000,IC86.D.IN,91 +0.001092000,IC86.D.IN,92 +0.001093000,IC86.D.IN,93 +0.001094000,IC86.D.IN,94 +0.001095000,IC86.D.IN,95 +0.001096000,IC86.D.IN,96 +0.001097000,IC86.D.IN,97 +0.001098000,IC86.D.IN,98 +0.001099000,IC86.D.IN,99 +0.001100000,IC86.D.IN,100 +0.001101000,IC86.D.IN,101 +0.001102000,IC86.D.IN,102 +0.001103000,IC86.D.IN,103 +0.001104000,IC86.D.IN,104 +0.001105000,IC86.D.IN,105 +0.001106000,IC86.D.IN,106 +0.001107000,IC86.D.IN,107 +0.001108000,IC86.D.IN,108 +0.001109000,IC86.D.IN,109 +0.001110000,IC86.D.IN,110 +0.001111000,IC86.D.IN,111 +0.001112000,IC86.D.IN,112 +0.001113000,IC86.D.IN,113 +0.001114000,IC86.D.IN,114 +0.001115000,IC86.D.IN,115 +0.001116000,IC86.D.IN,116 +0.001117000,IC86.D.IN,117 +0.001118000,IC86.D.IN,118 +0.001119000,IC86.D.IN,119 +0.001120000,IC86.D.IN,120 +0.001121000,IC86.D.IN,121 +0.001122000,IC86.D.IN,122 +0.001123000,IC86.D.IN,123 +0.001124000,IC86.D.IN,124 +0.001125000,IC86.D.IN,125 +0.001126000,IC86.D.IN,126 +0.001127000,IC86.D.IN,127 +0.001128000,IC86.D.IN,128 +0.001129000,IC86.D.IN,129 +0.001130000,IC86.D.IN,130 +0.001131000,IC86.D.IN,131 +0.001132000,IC86.D.IN,132 +0.001133000,IC86.D.IN,133 +0.001134000,IC86.D.IN,134 +0.001135000,IC86.D.IN,135 +0.001136000,IC86.D.IN,136 +0.001137000,IC86.D.IN,137 +0.001138000,IC86.D.IN,138 +0.001139000,IC86.D.IN,139 +0.001140000,IC86.D.IN,140 +0.001141000,IC86.D.IN,141 +0.001142000,IC86.D.IN,142 +0.001143000,IC86.D.IN,143 +0.001144000,IC86.D.IN,144 +0.001145000,IC86.D.IN,145 +0.001146000,IC86.D.IN,146 +0.001147000,IC86.D.IN,147 +0.001148000,IC86.D.IN,148 +0.001149000,IC86.D.IN,149 +0.001150000,IC86.D.IN,150 +0.001151000,IC86.D.IN,151 +0.001152000,IC86.D.IN,152 +0.001153000,IC86.D.IN,153 +0.001154000,IC86.D.IN,154 +0.001155000,IC86.D.IN,155 +0.001156000,IC86.D.IN,156 +0.001157000,IC86.D.IN,157 +0.001158000,IC86.D.IN,158 +0.001159000,IC86.D.IN,159 +0.001160000,IC86.D.IN,160 +0.001161000,IC86.D.IN,161 +0.001162000,IC86.D.IN,162 +0.001163000,IC86.D.IN,163 +0.001164000,IC86.D.IN,164 +0.001165000,IC86.D.IN,165 +0.001166000,IC86.D.IN,166 +0.001167000,IC86.D.IN,167 +0.001168000,IC86.D.IN,168 +0.001169000,IC86.D.IN,169 +0.001170000,IC86.D.IN,170 +0.001171000,IC86.D.IN,171 +0.001172000,IC86.D.IN,172 +0.001173000,IC86.D.IN,173 +0.001174000,IC86.D.IN,174 +0.001175000,IC86.D.IN,175 +0.001176000,IC86.D.IN,176 +0.001177000,IC86.D.IN,177 +0.001178000,IC86.D.IN,178 +0.001179000,IC86.D.IN,179 +0.001180000,IC86.D.IN,180 +0.001181000,IC86.D.IN,181 +0.001182000,IC86.D.IN,182 +0.001183000,IC86.D.IN,183 +0.001184000,IC86.D.IN,184 +0.001185000,IC86.D.IN,185 +0.001186000,IC86.D.IN,186 +0.001187000,IC86.D.IN,187 +0.001188000,IC86.D.IN,188 +0.001189000,IC86.D.IN,189 +0.001190000,IC86.D.IN,190 +0.001191000,IC86.D.IN,191 +0.001192000,IC86.D.IN,192 +0.001193000,IC86.D.IN,193 +0.001194000,IC86.D.IN,194 +0.001195000,IC86.D.IN,195 +0.001196000,IC86.D.IN,196 +0.001197000,IC86.D.IN,197 +0.001198000,IC86.D.IN,198 +0.001199000,IC86.D.IN,199 +0.001200000,IC86.D.IN,200 +0.001201000,IC86.D.IN,201 +0.001202000,IC86.D.IN,202 +0.001203000,IC86.D.IN,203 +0.001204000,IC86.D.IN,204 +0.001205000,IC86.D.IN,205 +0.001206000,IC86.D.IN,206 +0.001207000,IC86.D.IN,207 +0.001208000,IC86.D.IN,208 +0.001209000,IC86.D.IN,209 +0.001210000,IC86.D.IN,210 +0.001211000,IC86.D.IN,211 +0.001212000,IC86.D.IN,212 +0.001213000,IC86.D.IN,213 +0.001214000,IC86.D.IN,214 +0.001215000,IC86.D.IN,215 +0.001216000,IC86.D.IN,216 +0.001217000,IC86.D.IN,217 +0.001218000,IC86.D.IN,218 +0.001219000,IC86.D.IN,219 +0.001220000,IC86.D.IN,220 +0.001221000,IC86.D.IN,221 +0.001222000,IC86.D.IN,222 +0.001223000,IC86.D.IN,223 +0.001224000,IC86.D.IN,224 +0.001225000,IC86.D.IN,225 +0.001226000,IC86.D.IN,226 +0.001227000,IC86.D.IN,227 +0.001228000,IC86.D.IN,228 +0.001229000,IC86.D.IN,229 +0.001230000,IC86.D.IN,230 +0.001231000,IC86.D.IN,231 +0.001232000,IC86.D.IN,232 +0.001233000,IC86.D.IN,233 +0.001234000,IC86.D.IN,234 +0.001235000,IC86.D.IN,235 +0.001236000,IC86.D.IN,236 +0.001237000,IC86.D.IN,237 +0.001238000,IC86.D.IN,238 +0.001239000,IC86.D.IN,239 +0.001240000,IC86.D.IN,240 +0.001241000,IC86.D.IN,241 +0.001242000,IC86.D.IN,242 +0.001243000,IC86.D.IN,243 +0.001244000,IC86.D.IN,244 +0.001245000,IC86.D.IN,245 +0.001246000,IC86.D.IN,246 +0.001247000,IC86.D.IN,247 +0.001248000,IC86.D.IN,248 +0.001249000,IC86.D.IN,249 +0.001250000,IC86.D.IN,250 +0.001251000,IC86.D.IN,251 +0.001252000,IC86.D.IN,252 +0.001253000,IC86.D.IN,253 +0.001254000,IC86.D.IN,254 +0.001255000,IC86.D.IN,255 diff --git a/src/lib/netlist/examples/vccs.c b/src/lib/netlist/examples/vccs.c new file mode 100644 index 00000000000..4468a09c352 --- /dev/null +++ b/src/lib/netlist/examples/vccs.c @@ -0,0 +1,31 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * vccs.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(vccs) +{ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-12) + PARAM(Solver.GS_LOOPS, 10000) + + VCCS(VV) + PARAM(VV.G, 100) // typical OP-AMP amplification + RES(R2, 1) + + NET_C(clk, VV.IN) + NET_C(R2.1, VV.OP) + NET_C(R2.2, GND) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) + LOG(logY, clk) + +} diff --git a/src/lib/netlist/examples/vccs1.c b/src/lib/netlist/examples/vccs1.c new file mode 100644 index 00000000000..c578aad6434 --- /dev/null +++ b/src/lib/netlist/examples/vccs1.c @@ -0,0 +1,36 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * vccs.c + * + */ + + +#include "netlist/devices/net_lib.h" + +NETLIST_START(vccs) +{ + + CLOCK(clk, 1000) // 1000 Hz + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + + + VCCS(VV) + PARAM(VV.G, 100000) // typical OP-AMP amplification + RES(R1, 10000) + RES(R2, 1) + RES(R3, 1000) + + NET_C(clk, R1.1) + NET_C(R1.2, VV.IN) + NET_C(R2.1, VV.OP) + NET_C(R3.1, VV.IN) + NET_C(R3.2, VV.OP) + NET_C(R2.2, GND) + NET_C(VV.ON, GND) + NET_C(VV.IP, GND) + LOG(logX, VV.OP) + LOG(logY, clk) + +} diff --git a/src/lib/netlist/examples/vs_cs.c b/src/lib/netlist/examples/vs_cs.c new file mode 100644 index 00000000000..36a025996cc --- /dev/null +++ b/src/lib/netlist/examples/vs_cs.c @@ -0,0 +1,53 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud +/* + * vs_cs.c + * + * Voltage and current source test + * + */ + +#include "netlist/devices/net_lib.h" + +NETLIST_START(rc) +{ + + /* + * delay circuit + * + */ + + /* Standard stuff */ + + SOLVER(Solver, 48000) + PARAM(Solver.ACCURACY, 1e-6) + CLOCK(clk, 20000) + + /* Voltage source. Inner resistance will make clock visible */ + + RES(R1, 1000) + VS(VS1, 1) + NET_C(R1.1, clk) + NET_C(R1.2, VS1.P) + NET_C(GND, VS1.N) + + /* Current source. Current flows from "+" to "-", thus for a source we + * need negative current + */ + + RES(R2, 1000) + RES(R3, 1000) + CS(CS1, -0.001) + NET_C(CS1.P, R2.1) + NET_C(R2.2, R3.1) + NET_C(GND, CS1.N, R3.2) + + CAP(C1, CAP_U(1)) + NET_C(C1.1, R3.1) + NET_C(C1.2, R3.2) + + + LOG(tt, VS1.P) + LOG(tx, R2.2) + +} diff --git a/src/lib/netlist/examples/zdiode.cpp b/src/lib/netlist/examples/zdiode.cpp new file mode 100644 index 00000000000..a059b09299e --- /dev/null +++ b/src/lib/netlist/examples/zdiode.cpp @@ -0,0 +1,46 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +/* + * zdiode.cpp + * + */ + +//! [zdiode_example] +#include "netlist/devices/net_lib.h" + +// ./nltool -t 1 -l clk.Q -l ZD.K -v --extended src/lib/netlist/examples/zdiode.cpp +// ./plot_nl.sh clk.Q ZD.K +// clk.Q: clock output +// ZD.K: voltage at Zener + +NETLIST_START(zdiode) +{ + + SOLVER(Solver, 48000) + PARAM(Solver.DYNAMIC_TS, 1) + PARAM(Solver.VNTOL, 1e-7) + PARAM(Solver.RELTOL, 1e-4) + + ANALOG_INPUT(V12, 12.0) + ANALOG_INPUT(V4, 4.0) + + CLOCK(clk, 100) + ZDIODE(ZD, "D(BV=7.5 IBV=0.01 NBV=3)") + RES(R, 20) + RES(Rclk, 200) + CAP(C, 1e-6) + + NET_C(V4, clk.GND) // make clock between 4 and 12 V + NET_C(V12, clk.VCC, R.1) + + NET_C(GND, ZD.A, C.2) + NET_C(clk.Q, Rclk.1) + NET_C(Rclk.2, R.2, ZD.K, C.1) + + RES(RL, 1000) + NET_C(RL.1, ZD.K) + NET_C(RL.2, GND) + +} +//! [zdiode_example] diff --git a/src/lib/netlist/generated/lib_entries.hxx b/src/lib/netlist/generated/lib_entries.hxx new file mode 100644 index 00000000000..66407355e33 --- /dev/null +++ b/src/lib/netlist/generated/lib_entries.hxx @@ -0,0 +1,120 @@ +LIB_ENTRY(2102A) +LIB_ENTRY(2716) +LIB_ENTRY(4538) +LIB_ENTRY(74107) +LIB_ENTRY(74107A) +LIB_ENTRY(74113) +LIB_ENTRY(74113A) +LIB_ENTRY(74121) +LIB_ENTRY(74123) +LIB_ENTRY(74125) +LIB_ENTRY(74126) +LIB_ENTRY(74153) +LIB_ENTRY(74161) +LIB_ENTRY(74161_fixme) +LIB_ENTRY(74163) +LIB_ENTRY(74164) +LIB_ENTRY(74165) +LIB_ENTRY(74166) +LIB_ENTRY(74174) +LIB_ENTRY(74175) +LIB_ENTRY(74192) +LIB_ENTRY(74193) +LIB_ENTRY(74194) +LIB_ENTRY(74365) +LIB_ENTRY(74377_GATE) +LIB_ENTRY(74393) +LIB_ENTRY(7448) +LIB_ENTRY(7450) +LIB_ENTRY(7473) +LIB_ENTRY(7473A) +LIB_ENTRY(7474) +LIB_ENTRY(7475_GATE) +LIB_ENTRY(7477_GATE) +LIB_ENTRY(7483) +LIB_ENTRY(7485) +LIB_ENTRY(7490) +LIB_ENTRY(7492) +LIB_ENTRY(7493) +LIB_ENTRY(7497) +LIB_ENTRY(74S287) +LIB_ENTRY(8277) +LIB_ENTRY(82S115) +LIB_ENTRY(82S123) +LIB_ENTRY(82S126) +LIB_ENTRY(82S16) +LIB_ENTRY(9310) +LIB_ENTRY(9314) +LIB_ENTRY(9316) +LIB_ENTRY(9321) +LIB_ENTRY(9322) +LIB_ENTRY(9334) +LIB_ENTRY(9602) +LIB_ENTRY(AM2847) +LIB_ENTRY(C) +LIB_ENTRY(CCCS) +LIB_ENTRY(CCVS) +LIB_ENTRY(CD4006) +LIB_ENTRY(CD4013) +LIB_ENTRY(CD4017) +LIB_ENTRY(CD4020) +LIB_ENTRY(CD4022) +LIB_ENTRY(CD4024) +LIB_ENTRY(CD4029) +LIB_ENTRY(CD4042) +LIB_ENTRY(CD4053_GATE) +LIB_ENTRY(CD4066_GATE) +LIB_ENTRY(CD4076) +LIB_ENTRY(CD4316_GATE) +LIB_ENTRY(CS) +LIB_ENTRY(D) +LIB_ENTRY(L) +LIB_ENTRY(LVCCS) +LIB_ENTRY(MC1455P) +LIB_ENTRY(MCM14524) +LIB_ENTRY(MK28000) +LIB_ENTRY(MM5837) +LIB_ENTRY(MOSFET) +LIB_ENTRY(NE555) +LIB_ENTRY(POT) +LIB_ENTRY(POT2) +LIB_ENTRY(QBJT_EB) +LIB_ENTRY(QBJT_switch) +LIB_ENTRY(R) +LIB_ENTRY(SN74LS629) +LIB_ENTRY(TMS4800) +LIB_ENTRY(VCCS) +LIB_ENTRY(VCVS) +LIB_ENTRY(VS) +LIB_ENTRY(Z) +LIB_ENTRY(analog_input) +LIB_ENTRY(clock) +LIB_ENTRY(extclock) +LIB_ENTRY(frontier) +LIB_ENTRY(function) +LIB_ENTRY(gnd) +LIB_ENTRY(log) +LIB_ENTRY(logD) +LIB_ENTRY(logic_input) +LIB_ENTRY(logic_input8) +LIB_ENTRY(logic_input_ttl) +LIB_ENTRY(mainclock) +LIB_ENTRY(nc_pin) +LIB_ENTRY(netlistparams) +LIB_ENTRY(nicDelay) +LIB_ENTRY(nicRSFF) +LIB_ENTRY(opamp) +LIB_ENTRY(r2r_dac) +LIB_ENTRY(schmitt_trigger) +LIB_ENTRY(solver) +LIB_ENTRY(switch1) +LIB_ENTRY(switch2) +LIB_ENTRY(sys_compd) +LIB_ENTRY(sys_dsw1) +LIB_ENTRY(sys_dsw2) +LIB_ENTRY(sys_noise_mt_n) +LIB_ENTRY(sys_noise_mt_u) +LIB_ENTRY(sys_pulse) +LIB_ENTRY(tristate) +LIB_ENTRY(tristate3) +LIB_ENTRY(varclock) diff --git a/src/lib/netlist/generated/nld_devinc.h b/src/lib/netlist/generated/nld_devinc.h new file mode 100644 index 00000000000..2482ba8da9b --- /dev/null +++ b/src/lib/netlist/generated/nld_devinc.h @@ -0,0 +1,1610 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef NLD_DEVINC_H +#define NLD_DEVINC_H + +#ifndef __PLIB_PREPROCESSOR__ + + +#include "../nl_setup.h" + +// --------------------------------------------------------------------- +// Source: ../analog/nld_bjt.cpp +// --------------------------------------------------------------------- + +// usage : QBJT_EB(name, MODEL) +#define QBJT_EB(...) \ + NET_REGISTER_DEVEXT(QBJT_EB, __VA_ARGS__) + +// usage : QBJT_SW(name, MODEL) +#define QBJT_SW(...) \ + NET_REGISTER_DEVEXT(QBJT_SW, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../analog/nld_mosfet.cpp +// --------------------------------------------------------------------- + +// usage : MOSFET(name, MODEL) +#define MOSFET(...) \ + NET_REGISTER_DEVEXT(MOSFET, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../analog/nld_opamps.cpp +// --------------------------------------------------------------------- + +// usage : OPAMP(name, MODEL) +#define OPAMP(...) \ + NET_REGISTER_DEVEXT(OPAMP, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../analog/nld_switches.cpp +// --------------------------------------------------------------------- + +// usage : SWITCH(name, ) +#define SWITCH(...) \ + NET_REGISTER_DEVEXT(SWITCH, __VA_ARGS__) + +// usage : SWITCH2(name, ) +#define SWITCH2(...) \ + NET_REGISTER_DEVEXT(SWITCH2, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../analog/nlid_fourterm.cpp +// --------------------------------------------------------------------- + +// usage : VCVS(name, G) +#define VCVS(...) \ + NET_REGISTER_DEVEXT(VCVS, __VA_ARGS__) + +// usage : VCCS(name, G) +#define VCCS(...) \ + NET_REGISTER_DEVEXT(VCCS, __VA_ARGS__) + +// usage : CCCS(name, G) +#define CCCS(...) \ + NET_REGISTER_DEVEXT(CCCS, __VA_ARGS__) + +// usage : CCVS(name, G) +#define CCVS(...) \ + NET_REGISTER_DEVEXT(CCVS, __VA_ARGS__) + +// usage : LVCCS(name, ) +#define LVCCS(...) \ + NET_REGISTER_DEVEXT(LVCCS, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../analog/nlid_twoterm.cpp +// --------------------------------------------------------------------- + +// usage : RES(name, R) +#define RES(...) \ + NET_REGISTER_DEVEXT(RES, __VA_ARGS__) + +// usage : POT(name, R) +#define POT(...) \ + NET_REGISTER_DEVEXT(POT, __VA_ARGS__) + +// usage : POT2(name, R) +#define POT2(...) \ + NET_REGISTER_DEVEXT(POT2, __VA_ARGS__) + +// usage : CAP(name, C) +#define CAP(...) \ + NET_REGISTER_DEVEXT(CAP, __VA_ARGS__) + +// usage : IND(name, L) +#define IND(...) \ + NET_REGISTER_DEVEXT(IND, __VA_ARGS__) + +// usage : DIODE(name, MODEL) +#define DIODE(...) \ + NET_REGISTER_DEVEXT(DIODE, __VA_ARGS__) + +// usage : ZDIODE(name, MODEL) +#define ZDIODE(...) \ + NET_REGISTER_DEVEXT(ZDIODE, __VA_ARGS__) + +// usage : VS(name, V) +#define VS(...) \ + NET_REGISTER_DEVEXT(VS, __VA_ARGS__) + +// usage : CS(name, I) +#define CS(...) \ + NET_REGISTER_DEVEXT(CS, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_2102a.cpp +// --------------------------------------------------------------------- + +// usage : RAM_2102A(name, CEQ, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, RWQ, DI) +// auto connect: VCC, GND +#define RAM_2102A(...) \ + NET_REGISTER_DEVEXT(RAM_2102A, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4006.cpp +// --------------------------------------------------------------------- + +// usage : CD4006(name, CLOCK, D1, D2, D3, D4, D1P4, D1P4S, D2P4, D2P5, D3P4, D4P4, D4P5) +// auto connect: VCC, GND +#define CD4006(...) \ + NET_REGISTER_DEVEXT(CD4006, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4013.cpp +// --------------------------------------------------------------------- + +// usage : CD4013(name, CLOCK, DATA, RESET, SET) +// auto connect: VDD, VSS +#define CD4013(...) \ + NET_REGISTER_DEVEXT(CD4013, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4017.cpp +// --------------------------------------------------------------------- + +// usage : CD4017(name, ) +#define CD4017(...) \ + NET_REGISTER_DEVEXT(CD4017, __VA_ARGS__) + +// usage : CD4022(name, ) +#define CD4022(...) \ + NET_REGISTER_DEVEXT(CD4022, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4020.cpp +// --------------------------------------------------------------------- + +// usage : CD4020(name, IP, RESET, VDD, VSS) +#define CD4020(...) \ + NET_REGISTER_DEVEXT(CD4020, __VA_ARGS__) + +// usage : CD4024(name, ) +#define CD4024(...) \ + NET_REGISTER_DEVEXT(CD4024, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4029.cpp +// --------------------------------------------------------------------- + +// usage : CD4029(name, PE, J1, J2, J3, J4, CI, UD, BD, CLK) +// auto connect: VCC, GND +#define CD4029(...) \ + NET_REGISTER_DEVEXT(CD4029, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4042.cpp +// --------------------------------------------------------------------- + +// usage : CD4042(name, D1, D2, D3, D4, POL, CLK) +// auto connect: VCC, GND +#define CD4042(...) \ + NET_REGISTER_DEVEXT(CD4042, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4053.cpp +// --------------------------------------------------------------------- + +// usage : CD4053_GATE(name, ) +#define CD4053_GATE(...) \ + NET_REGISTER_DEVEXT(CD4053_GATE, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4066.cpp +// --------------------------------------------------------------------- + +// usage : CD4066_GATE(name, ) +#define CD4066_GATE(...) \ + NET_REGISTER_DEVEXT(CD4066_GATE, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4076.cpp +// --------------------------------------------------------------------- + +// usage : CD4076(name, I1, I2, I3, I4, ID1, ID2, OD1, OD2) +// auto connect: VCC, GND +#define CD4076(...) \ + NET_REGISTER_DEVEXT(CD4076, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_4316.cpp +// --------------------------------------------------------------------- + +// usage : CD4316_GATE(name, ) +#define CD4316_GATE(...) \ + NET_REGISTER_DEVEXT(CD4316_GATE, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74107.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74107(name, CLK, J, K, CLRQ) +// auto connect: VCC, GND +#define TTL_74107(...) \ + NET_REGISTER_DEVEXT(TTL_74107, __VA_ARGS__) + +// usage : TTL_74107A(name, CLK, J, K, CLRQ) +// auto connect: VCC, GND +#define TTL_74107A(...) \ + NET_REGISTER_DEVEXT(TTL_74107A, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74113.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74113(name, CLK, J, K, CLRQ) +// auto connect: VCC, GND +#define TTL_74113(...) \ + NET_REGISTER_DEVEXT(TTL_74113, __VA_ARGS__) + +// usage : TTL_74113A(name, CLK, J, K, CLRQ) +// auto connect: VCC, GND +#define TTL_74113A(...) \ + NET_REGISTER_DEVEXT(TTL_74113A, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74123.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74123(name, ) +#define TTL_74123(...) \ + NET_REGISTER_DEVEXT(TTL_74123, __VA_ARGS__) + +// usage : TTL_74121(name, ) +#define TTL_74121(...) \ + NET_REGISTER_DEVEXT(TTL_74121, __VA_ARGS__) + +// usage : CD4538(name, ) +#define CD4538(...) \ + NET_REGISTER_DEVEXT(CD4538, __VA_ARGS__) + +// usage : TTL_9602(name, ) +#define TTL_9602(...) \ + NET_REGISTER_DEVEXT(TTL_9602, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74125.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74125_GATE(name, ) +#define TTL_74125_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74125_GATE, __VA_ARGS__) + +// usage : TTL_74126_GATE(name, ) +#define TTL_74126_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74126_GATE, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74153.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74153(name, C0, C1, C2, C3, A, B, G) +// auto connect: VCC, GND +#define TTL_74153(...) \ + NET_REGISTER_DEVEXT(TTL_74153, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74161.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74161(name, CLK, ENP, ENT, CLRQ, LOADQ, A, B, C, D) +// auto connect: VCC, GND +#define TTL_74161(...) \ + NET_REGISTER_DEVEXT(TTL_74161, __VA_ARGS__) + +// usage : TTL_74161_FIXME(name, A, B, C, D, CLRQ, LOADQ, CLK, ENP, ENT) +// auto connect: VCC, GND +#define TTL_74161_FIXME(...) \ + NET_REGISTER_DEVEXT(TTL_74161_FIXME, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74163.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74163(name, CLK, ENP, ENT, CLRQ, LOADQ, A, B, C, D) +// auto connect: VCC, GND +#define TTL_74163(...) \ + NET_REGISTER_DEVEXT(TTL_74163, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74164.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74164(name, A, B, CLRQ, CLK) +// auto connect: VCC, GND +#define TTL_74164(...) \ + NET_REGISTER_DEVEXT(TTL_74164, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74165.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74165(name, CLK, CLKINH, SH_LDQ, SER, A, B, C, D, E, F, G, H) +// auto connect: VCC, GND +#define TTL_74165(...) \ + NET_REGISTER_DEVEXT(TTL_74165, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74166.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74166(name, CLK, CLKINH, SH_LDQ, SER, A, B, C, D, E, F, G, H, CLRQ) +// auto connect: VCC, GND +#define TTL_74166(...) \ + NET_REGISTER_DEVEXT(TTL_74166, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74174.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74174(name, CLK, D1, D2, D3, D4, D5, D6, CLRQ) +// auto connect: VCC, GND +#define TTL_74174(...) \ + NET_REGISTER_DEVEXT(TTL_74174, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74175.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74175(name, CLK, D1, D2, D3, D4, CLRQ) +// auto connect: VCC, GND +#define TTL_74175(...) \ + NET_REGISTER_DEVEXT(TTL_74175, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74192.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74192(name, A, B, C, D, CLEAR, LOADQ, CU, CD) +// auto connect: VCC, GND +#define TTL_74192(...) \ + NET_REGISTER_DEVEXT(TTL_74192, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74193.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74193(name, A, B, C, D, CLEAR, LOADQ, CU, CD) +// auto connect: VCC, GND +#define TTL_74193(...) \ + NET_REGISTER_DEVEXT(TTL_74193, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74194.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74194(name, CLK, S0, S1, SRIN, A, B, C, D, SLIN, CLRQ) +// auto connect: VCC, GND +#define TTL_74194(...) \ + NET_REGISTER_DEVEXT(TTL_74194, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74365.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74365(name, G1Q, G2Q, A1, A2, A3, A4, A5, A6) +// auto connect: VCC, GND +#define TTL_74365(...) \ + NET_REGISTER_DEVEXT(TTL_74365, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74377.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74377_GATE(name, ) +#define TTL_74377_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74377_GATE, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74393.cpp +// --------------------------------------------------------------------- + +// usage : TTL_74393(name, CP, MR) +// auto connect: VCC, GND +#define TTL_74393(...) \ + NET_REGISTER_DEVEXT(TTL_74393, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7448.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7448(name, A, B, C, D, LTQ, BIQ, RBIQ) +// auto connect: VCC, GND +#define TTL_7448(...) \ + NET_REGISTER_DEVEXT(TTL_7448, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7450.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7450_ANDORINVERT(name, A, B, C, D) +// auto connect: VCC, GND +#define TTL_7450_ANDORINVERT(...) \ + NET_REGISTER_DEVEXT(TTL_7450_ANDORINVERT, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7473.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7473(name, CLK, J, K, CLRQ) +// auto connect: VCC, GND +#define TTL_7473(...) \ + NET_REGISTER_DEVEXT(TTL_7473, __VA_ARGS__) + +// usage : TTL_7473A(name, CLK, J, K, CLRQ) +// auto connect: VCC, GND +#define TTL_7473A(...) \ + NET_REGISTER_DEVEXT(TTL_7473A, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7474.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7474(name, CLK, D, CLRQ, PREQ) +// auto connect: VCC, GND +#define TTL_7474(...) \ + NET_REGISTER_DEVEXT(TTL_7474, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7475.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7475_GATE(name, ) +#define TTL_7475_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7475_GATE, __VA_ARGS__) + +// usage : TTL_7477_GATE(name, ) +#define TTL_7477_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7477_GATE, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7483.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7483(name, A1, A2, A3, A4, B1, B2, B3, B4, C0) +// auto connect: VCC, GND +#define TTL_7483(...) \ + NET_REGISTER_DEVEXT(TTL_7483, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7485.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7485(name, A0, A1, A2, A3, B0, B1, B2, B3, LTIN, EQIN, GTIN) +// auto connect: VCC, GND +#define TTL_7485(...) \ + NET_REGISTER_DEVEXT(TTL_7485, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7490.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7490(name, A, B, R1, R2, R91, R92) +// auto connect: VCC, GND +#define TTL_7490(...) \ + NET_REGISTER_DEVEXT(TTL_7490, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7492.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7492(name, A, B, R1, R2) +// auto connect: VCC, GND +#define TTL_7492(...) \ + NET_REGISTER_DEVEXT(TTL_7492, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7493.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7493(name, CLKA, CLKB, R1, R2) +// auto connect: VCC, GND +#define TTL_7493(...) \ + NET_REGISTER_DEVEXT(TTL_7493, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_7497.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7497(name, CLK, STRBQ, ENQ, UNITYQ, CLR, B0, B1, B2, B3, B4, B5) +// auto connect: VCC, GND +#define TTL_7497(...) \ + NET_REGISTER_DEVEXT(TTL_7497, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_74ls629.cpp +// --------------------------------------------------------------------- + +// usage : SN74LS629(name, CAP) +// auto connect: VCC, GND +#define SN74LS629(...) \ + NET_REGISTER_DEVEXT(SN74LS629, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_8277.cpp +// --------------------------------------------------------------------- + +// usage : TTL_8277(name, RESET, CLK, CLKA, D0A, D1A, DSA, CLKB, D0B, D1B, DSB) +// auto connect: VCC, GND +#define TTL_8277(...) \ + NET_REGISTER_DEVEXT(TTL_8277, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_82s115.cpp +// --------------------------------------------------------------------- + +// usage : PROM_82S115(name, CE1Q, CE2, A0, A1, A2, A3, A4, A5, A6, A7, A8, STROBE) +// auto connect: VCC, GND +#define PROM_82S115(...) \ + NET_REGISTER_DEVEXT(PROM_82S115, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_82s16.cpp +// --------------------------------------------------------------------- + +// usage : TTL_82S16(name, ) +#define TTL_82S16(...) \ + NET_REGISTER_DEVEXT(TTL_82S16, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_9310.cpp +// --------------------------------------------------------------------- + +// usage : TTL_9310(name, CLK, ENP, ENT, CLRQ, LOADQ, A, B, C, D) +// auto connect: VCC, GND +#define TTL_9310(...) \ + NET_REGISTER_DEVEXT(TTL_9310, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_9316.cpp +// --------------------------------------------------------------------- + +// usage : TTL_9316(name, CLK, ENP, ENT, CLRQ, LOADQ, A, B, C, D) +// auto connect: VCC, GND +#define TTL_9316(...) \ + NET_REGISTER_DEVEXT(TTL_9316, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_9321.cpp +// --------------------------------------------------------------------- + +// usage : TTL_9321(name, E, A0, A1) +#define TTL_9321(...) \ + NET_REGISTER_DEVEXT(TTL_9321, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_9322.cpp +// --------------------------------------------------------------------- + +// usage : TTL_9322(name, SELECT, A1, B1, A2, B2, A3, B3, A4, B4, STROBE) +// auto connect: VCC, GND +#define TTL_9322(...) \ + NET_REGISTER_DEVEXT(TTL_9322, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_am2847.cpp +// --------------------------------------------------------------------- + +// usage : TTL_AM2847(name, CP, INA, INB, INC, IND, RCA, RCB, RCC, RCD) +// auto connect: VSS, VDD +#define TTL_AM2847(...) \ + NET_REGISTER_DEVEXT(TTL_AM2847, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_dm9314.cpp +// --------------------------------------------------------------------- + +// usage : TTL_9314(name, EQ, MRQ, S0Q, S1Q, S2Q, S3Q, D0, D1, D2, D3) +// auto connect: VCC, GND +#define TTL_9314(...) \ + NET_REGISTER_DEVEXT(TTL_9314, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_dm9334.cpp +// --------------------------------------------------------------------- + +// usage : TTL_9334(name, CQ, EQ, D, A0, A1, A2) +// auto connect: VCC, GND +#define TTL_9334(...) \ + NET_REGISTER_DEVEXT(TTL_9334, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_legacy.cpp +// --------------------------------------------------------------------- + +// usage : NETDEV_RSFF(name, ) +#define NETDEV_RSFF(...) \ + NET_REGISTER_DEVEXT(NETDEV_RSFF, __VA_ARGS__) + +// usage : NETDEV_DELAY(name, ) +#define NETDEV_DELAY(...) \ + NET_REGISTER_DEVEXT(NETDEV_DELAY, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_log.cpp +// --------------------------------------------------------------------- + +// usage : LOG(name, I) +#define LOG(...) \ + NET_REGISTER_DEVEXT(LOG, __VA_ARGS__) + +// usage : LOGD(name, I, I2) +#define LOGD(...) \ + NET_REGISTER_DEVEXT(LOGD, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_mm5837.cpp +// --------------------------------------------------------------------- + +// usage : MM5837(name, ) +#define MM5837(...) \ + NET_REGISTER_DEVEXT(MM5837, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_ne555.cpp +// --------------------------------------------------------------------- + +// usage : NE555(name, ) +#define NE555(...) \ + NET_REGISTER_DEVEXT(NE555, __VA_ARGS__) + +// usage : MC1455P(name, ) +#define MC1455P(...) \ + NET_REGISTER_DEVEXT(MC1455P, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_r2r_dac.cpp +// --------------------------------------------------------------------- + +// usage : R2R_DAC(name, VIN, R, N) +#define R2R_DAC(...) \ + NET_REGISTER_DEVEXT(R2R_DAC, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_roms.cpp +// --------------------------------------------------------------------- + +// usage : PROM_82S126(name, CE1Q, CE2Q, A0, A1, A2, A3, A4, A5, A6, A7) +// auto connect: VCC, GND +#define PROM_82S126(...) \ + NET_REGISTER_DEVEXT(PROM_82S126, __VA_ARGS__) + +// usage : PROM_74S287(name, CE1Q, CE2Q, A0, A1, A2, A3, A4, A5, A6, A7) +// auto connect: VCC, GND +#define PROM_74S287(...) \ + NET_REGISTER_DEVEXT(PROM_74S287, __VA_ARGS__) + +// usage : PROM_82S123(name, CEQ, A0, A1, A2, A3, A4) +// auto connect: VCC, GND +#define PROM_82S123(...) \ + NET_REGISTER_DEVEXT(PROM_82S123, __VA_ARGS__) + +// usage : EPROM_2716(name, CE2Q, CE1Q, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) +// auto connect: VCC, GND +#define EPROM_2716(...) \ + NET_REGISTER_DEVEXT(EPROM_2716, __VA_ARGS__) + +// usage : PROM_MK28000(name, OE1, OE2, ARQ, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10, A11) +// auto connect: VCC, GND +#define PROM_MK28000(...) \ + NET_REGISTER_DEVEXT(PROM_MK28000, __VA_ARGS__) + +// usage : ROM_MCM14524(name, EN, CLK, A0, A1, A2, A3, A4, A5, A6, A7) +// auto connect: VCC, GND +#define ROM_MCM14524(...) \ + NET_REGISTER_DEVEXT(ROM_MCM14524, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_schmitt.cpp +// --------------------------------------------------------------------- + +// usage : SCHMITT_TRIGGER(name, STMODEL) +#define SCHMITT_TRIGGER(...) \ + NET_REGISTER_DEVEXT(SCHMITT_TRIGGER, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_system.cpp +// --------------------------------------------------------------------- + +// usage : PARAMETER(name, ) +#define PARAMETER(...) \ + NET_REGISTER_DEVEXT(PARAMETER, __VA_ARGS__) + +// usage : NC_PIN(name, ) +#define NC_PIN(...) \ + NET_REGISTER_DEVEXT(NC_PIN, __VA_ARGS__) + +// usage : FRONTIER_DEV(name, I, G, Q) +#define FRONTIER_DEV(...) \ + NET_REGISTER_DEVEXT(FRONTIER_DEV, __VA_ARGS__) + +// usage : AFUNC(name, N, FUNC) +#define AFUNC(...) \ + NET_REGISTER_DEVEXT(AFUNC, __VA_ARGS__) + +// usage : ANALOG_INPUT(name, IN) +#define ANALOG_INPUT(...) \ + NET_REGISTER_DEVEXT(ANALOG_INPUT, __VA_ARGS__) + +// usage : CLOCK(name, FREQ) +#define CLOCK(...) \ + NET_REGISTER_DEVEXT(CLOCK, __VA_ARGS__) + +// usage : VARCLOCK(name, N, FUNC) +#define VARCLOCK(...) \ + NET_REGISTER_DEVEXT(VARCLOCK, __VA_ARGS__) + +// usage : EXTCLOCK(name, FREQ, PATTERN) +#define EXTCLOCK(...) \ + NET_REGISTER_DEVEXT(EXTCLOCK, __VA_ARGS__) + +// usage : SYS_DSW(name, I, 1, 2) +#define SYS_DSW(...) \ + NET_REGISTER_DEVEXT(SYS_DSW, __VA_ARGS__) + +// usage : SYS_DSW2(name, ) +#define SYS_DSW2(...) \ + NET_REGISTER_DEVEXT(SYS_DSW2, __VA_ARGS__) + +// usage : SYS_COMPD(name, ) +#define SYS_COMPD(...) \ + NET_REGISTER_DEVEXT(SYS_COMPD, __VA_ARGS__) + +// usage : SYS_PULSE(name, DELAY, DURATION, INVERT_INPUT, INVERT_OUTPUT) +#define SYS_PULSE(...) \ + NET_REGISTER_DEVEXT(SYS_PULSE, __VA_ARGS__) + +// usage : SYS_NOISE_MT_U(name, SIGMA) +#define SYS_NOISE_MT_U(...) \ + NET_REGISTER_DEVEXT(SYS_NOISE_MT_U, __VA_ARGS__) + +// usage : SYS_NOISE_MT_N(name, SIGMA) +#define SYS_NOISE_MT_N(...) \ + NET_REGISTER_DEVEXT(SYS_NOISE_MT_N, __VA_ARGS__) + +// usage : MAINCLOCK(name, FREQ) +#define MAINCLOCK(...) \ + NET_REGISTER_DEVEXT(MAINCLOCK, __VA_ARGS__) + +// usage : GNDA(name, ) +#define GNDA(...) \ + NET_REGISTER_DEVEXT(GNDA, __VA_ARGS__) + +// usage : LOGIC_INPUT8(name, IN, MODEL) +#define LOGIC_INPUT8(...) \ + NET_REGISTER_DEVEXT(LOGIC_INPUT8, __VA_ARGS__) + +// usage : LOGIC_INPUT(name, IN, MODEL) +#define LOGIC_INPUT(...) \ + NET_REGISTER_DEVEXT(LOGIC_INPUT, __VA_ARGS__) + +// usage : TTL_INPUT(name, IN) +#define TTL_INPUT(...) \ + NET_REGISTER_DEVEXT(TTL_INPUT, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_tms4800.cpp +// --------------------------------------------------------------------- + +// usage : ROM_TMS4800(name, AR, OE1, OE2, A0, A1, A2, A3, A4, A5, A6, A7, A8, A9, A10) +// auto connect: VCC, GND +#define ROM_TMS4800(...) \ + NET_REGISTER_DEVEXT(ROM_TMS4800, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../devices/nld_tristate.cpp +// --------------------------------------------------------------------- + +// usage : TTL_TRISTATE(name, CEQ1, D1, CEQ2, D2) +#define TTL_TRISTATE(...) \ + NET_REGISTER_DEVEXT(TTL_TRISTATE, __VA_ARGS__) + +// usage : TTL_TRISTATE3(name, ) +#define TTL_TRISTATE3(...) \ + NET_REGISTER_DEVEXT(TTL_TRISTATE3, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../generated/nlm_modules_lib.cpp +// --------------------------------------------------------------------- + +NETLIST_EXTERNAL(modules_lib) +// --------------------------------------------------------------------- +// Source: ../macro/modules/nlmod_icl8038_dip.cpp +// --------------------------------------------------------------------- + +NETLIST_EXTERNAL(ICL8038_DIP) +// --------------------------------------------------------------------- +// Source: ../macro/modules/nlmod_ne556_dip.cpp +// --------------------------------------------------------------------- + +NETLIST_EXTERNAL(NE556_DIP) +// --------------------------------------------------------------------- +// Source: ../macro/modules/nlmod_rtest.cpp +// --------------------------------------------------------------------- + +NETLIST_EXTERNAL(RTEST) +// --------------------------------------------------------------------- +// Source: ../macro/nlm_base_lib.cpp +// --------------------------------------------------------------------- + +NETLIST_EXTERNAL(base_lib) +// --------------------------------------------------------------------- +// Source: ../macro/nlm_cd4xxx_lib.cpp +// --------------------------------------------------------------------- + +// usage : CD4001_GATE(name, ) +#define CD4001_GATE(...) \ + NET_REGISTER_DEVEXT(CD4001_GATE, __VA_ARGS__) + +// usage : CD4011_GATE(name, ) +#define CD4011_GATE(...) \ + NET_REGISTER_DEVEXT(CD4011_GATE, __VA_ARGS__) + +// usage : CD4030_GATE(name, ) +#define CD4030_GATE(...) \ + NET_REGISTER_DEVEXT(CD4030_GATE, __VA_ARGS__) + +// usage : CD4049_GATE(name, ) +#define CD4049_GATE(...) \ + NET_REGISTER_DEVEXT(CD4049_GATE, __VA_ARGS__) + +// usage : CD4069_GATE(name, ) +#define CD4069_GATE(...) \ + NET_REGISTER_DEVEXT(CD4069_GATE, __VA_ARGS__) + +// usage : CD4070_GATE(name, ) +#define CD4070_GATE(...) \ + NET_REGISTER_DEVEXT(CD4070_GATE, __VA_ARGS__) + +// usage : CD4071_GATE(name, ) +#define CD4071_GATE(...) \ + NET_REGISTER_DEVEXT(CD4071_GATE, __VA_ARGS__) + +// usage : CD4081_GATE(name, ) +#define CD4081_GATE(...) \ + NET_REGISTER_DEVEXT(CD4081_GATE, __VA_ARGS__) + +NETLIST_EXTERNAL(cd4xxx_lib) +// usage : CD4001_DIP(name, ) +#define CD4001_DIP(...) \ + NET_REGISTER_DEVEXT(CD4001_DIP, __VA_ARGS__) + +// usage : CD4011_DIP(name, ) +#define CD4011_DIP(...) \ + NET_REGISTER_DEVEXT(CD4011_DIP, __VA_ARGS__) + +// usage : CD4030_DIP(name, ) +#define CD4030_DIP(...) \ + NET_REGISTER_DEVEXT(CD4030_DIP, __VA_ARGS__) + +// usage : CD4049_DIP(name, ) +#define CD4049_DIP(...) \ + NET_REGISTER_DEVEXT(CD4049_DIP, __VA_ARGS__) + +// usage : CD4069_DIP(name, ) +#define CD4069_DIP(...) \ + NET_REGISTER_DEVEXT(CD4069_DIP, __VA_ARGS__) + +// usage : CD4070_DIP(name, ) +#define CD4070_DIP(...) \ + NET_REGISTER_DEVEXT(CD4070_DIP, __VA_ARGS__) + +// usage : CD4071_DIP(name, ) +#define CD4071_DIP(...) \ + NET_REGISTER_DEVEXT(CD4071_DIP, __VA_ARGS__) + +// usage : CD4081_DIP(name, ) +#define CD4081_DIP(...) \ + NET_REGISTER_DEVEXT(CD4081_DIP, __VA_ARGS__) + +// usage : CD4006_DIP(name, ) +#define CD4006_DIP(...) \ + NET_REGISTER_DEVEXT(CD4006_DIP, __VA_ARGS__) + +// usage : CD4013_DIP(name, ) +#define CD4013_DIP(...) \ + NET_REGISTER_DEVEXT(CD4013_DIP, __VA_ARGS__) + +// usage : CD4017_DIP(name, ) +#define CD4017_DIP(...) \ + NET_REGISTER_DEVEXT(CD4017_DIP, __VA_ARGS__) + +// usage : CD4022_DIP(name, ) +#define CD4022_DIP(...) \ + NET_REGISTER_DEVEXT(CD4022_DIP, __VA_ARGS__) + +// usage : CD4020_DIP(name, ) +#define CD4020_DIP(...) \ + NET_REGISTER_DEVEXT(CD4020_DIP, __VA_ARGS__) + +// usage : CD4024_DIP(name, ) +#define CD4024_DIP(...) \ + NET_REGISTER_DEVEXT(CD4024_DIP, __VA_ARGS__) + +// usage : CD4029_DIP(name, ) +#define CD4029_DIP(...) \ + NET_REGISTER_DEVEXT(CD4029_DIP, __VA_ARGS__) + +// usage : CD4042_DIP(name, ) +#define CD4042_DIP(...) \ + NET_REGISTER_DEVEXT(CD4042_DIP, __VA_ARGS__) + +// usage : CD4053_DIP(name, ) +#define CD4053_DIP(...) \ + NET_REGISTER_DEVEXT(CD4053_DIP, __VA_ARGS__) + +// usage : CD4066_DIP(name, ) +#define CD4066_DIP(...) \ + NET_REGISTER_DEVEXT(CD4066_DIP, __VA_ARGS__) + +// usage : CD4016_DIP(name, ) +#define CD4016_DIP(...) \ + NET_REGISTER_DEVEXT(CD4016_DIP, __VA_ARGS__) + +// usage : CD4076_DIP(name, ) +#define CD4076_DIP(...) \ + NET_REGISTER_DEVEXT(CD4076_DIP, __VA_ARGS__) + +// usage : CD4316_DIP(name, ) +#define CD4316_DIP(...) \ + NET_REGISTER_DEVEXT(CD4316_DIP, __VA_ARGS__) + +// usage : CD4538_DIP(name, ) +#define CD4538_DIP(...) \ + NET_REGISTER_DEVEXT(CD4538_DIP, __VA_ARGS__) + +// usage : MM5837_DIP(name, ) +#define MM5837_DIP(...) \ + NET_REGISTER_DEVEXT(MM5837_DIP, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../macro/nlm_opamp_lib.cpp +// --------------------------------------------------------------------- + +NETLIST_EXTERNAL(opamp_lib) +// usage : opamp_layout_4_4_11(name, ) +#define opamp_layout_4_4_11(...) \ + NET_REGISTER_DEVEXT(opamp_layout_4_4_11, __VA_ARGS__) + +// usage : opamp_layout_2_8_4(name, ) +#define opamp_layout_2_8_4(...) \ + NET_REGISTER_DEVEXT(opamp_layout_2_8_4, __VA_ARGS__) + +// usage : opamp_layout_2_13_9_4(name, ) +#define opamp_layout_2_13_9_4(...) \ + NET_REGISTER_DEVEXT(opamp_layout_2_13_9_4, __VA_ARGS__) + +// usage : opamp_layout_1_7_4(name, ) +#define opamp_layout_1_7_4(...) \ + NET_REGISTER_DEVEXT(opamp_layout_1_7_4, __VA_ARGS__) + +// usage : opamp_layout_1_8_5(name, ) +#define opamp_layout_1_8_5(...) \ + NET_REGISTER_DEVEXT(opamp_layout_1_8_5, __VA_ARGS__) + +// usage : opamp_layout_1_11_6(name, ) +#define opamp_layout_1_11_6(...) \ + NET_REGISTER_DEVEXT(opamp_layout_1_11_6, __VA_ARGS__) + +// usage : MB3614_DIP(name, ) +#define MB3614_DIP(...) \ + NET_REGISTER_DEVEXT(MB3614_DIP, __VA_ARGS__) + +// usage : MC3340_DIP(name, ) +#define MC3340_DIP(...) \ + NET_REGISTER_DEVEXT(MC3340_DIP, __VA_ARGS__) + +// usage : TL081_DIP(name, ) +#define TL081_DIP(...) \ + NET_REGISTER_DEVEXT(TL081_DIP, __VA_ARGS__) + +// usage : TL082_DIP(name, ) +#define TL082_DIP(...) \ + NET_REGISTER_DEVEXT(TL082_DIP, __VA_ARGS__) + +// usage : TL084_DIP(name, ) +#define TL084_DIP(...) \ + NET_REGISTER_DEVEXT(TL084_DIP, __VA_ARGS__) + +// usage : LM324_DIP(name, ) +#define LM324_DIP(...) \ + NET_REGISTER_DEVEXT(LM324_DIP, __VA_ARGS__) + +// usage : LM348_DIP(name, ) +#define LM348_DIP(...) \ + NET_REGISTER_DEVEXT(LM348_DIP, __VA_ARGS__) + +// usage : LM358_DIP(name, ) +#define LM358_DIP(...) \ + NET_REGISTER_DEVEXT(LM358_DIP, __VA_ARGS__) + +// usage : LM2902_DIP(name, ) +#define LM2902_DIP(...) \ + NET_REGISTER_DEVEXT(LM2902_DIP, __VA_ARGS__) + +// usage : UA741_DIP8(name, ) +#define UA741_DIP8(...) \ + NET_REGISTER_DEVEXT(UA741_DIP8, __VA_ARGS__) + +// usage : UA741_DIP10(name, ) +#define UA741_DIP10(...) \ + NET_REGISTER_DEVEXT(UA741_DIP10, __VA_ARGS__) + +// usage : UA741_DIP14(name, ) +#define UA741_DIP14(...) \ + NET_REGISTER_DEVEXT(UA741_DIP14, __VA_ARGS__) + +// usage : MC1558_DIP(name, ) +#define MC1558_DIP(...) \ + NET_REGISTER_DEVEXT(MC1558_DIP, __VA_ARGS__) + +// usage : LM747_DIP(name, ) +#define LM747_DIP(...) \ + NET_REGISTER_DEVEXT(LM747_DIP, __VA_ARGS__) + +// usage : LM747A_DIP(name, ) +#define LM747A_DIP(...) \ + NET_REGISTER_DEVEXT(LM747A_DIP, __VA_ARGS__) + +// usage : LM3900(name, ) +#define LM3900(...) \ + NET_REGISTER_DEVEXT(LM3900, __VA_ARGS__) + +// usage : AN6551_SIL(name, ) +#define AN6551_SIL(...) \ + NET_REGISTER_DEVEXT(AN6551_SIL, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../macro/nlm_otheric_lib.cpp +// --------------------------------------------------------------------- + +// usage : MC14584B_GATE(name, ) +#define MC14584B_GATE(...) \ + NET_REGISTER_DEVEXT(MC14584B_GATE, __VA_ARGS__) + +NETLIST_EXTERNAL(otheric_lib) +// usage : MC14584B_DIP(name, ) +#define MC14584B_DIP(...) \ + NET_REGISTER_DEVEXT(MC14584B_DIP, __VA_ARGS__) + +// usage : NE566_DIP(name, ) +#define NE566_DIP(...) \ + NET_REGISTER_DEVEXT(NE566_DIP, __VA_ARGS__) + +// usage : NE555_DIP(name, ) +#define NE555_DIP(...) \ + NET_REGISTER_DEVEXT(NE555_DIP, __VA_ARGS__) + +// usage : MC1455P_DIP(name, ) +#define MC1455P_DIP(...) \ + NET_REGISTER_DEVEXT(MC1455P_DIP, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../macro/nlm_roms_lib.cpp +// --------------------------------------------------------------------- + +NETLIST_EXTERNAL(roms_lib) +// usage : PROM_82S123_DIP(name, ) +#define PROM_82S123_DIP(...) \ + NET_REGISTER_DEVEXT(PROM_82S123_DIP, __VA_ARGS__) + +// usage : PROM_82S126_DIP(name, ) +#define PROM_82S126_DIP(...) \ + NET_REGISTER_DEVEXT(PROM_82S126_DIP, __VA_ARGS__) + +// usage : PROM_74S287_DIP(name, ) +#define PROM_74S287_DIP(...) \ + NET_REGISTER_DEVEXT(PROM_74S287_DIP, __VA_ARGS__) + +// usage : EPROM_2716_DIP(name, ) +#define EPROM_2716_DIP(...) \ + NET_REGISTER_DEVEXT(EPROM_2716_DIP, __VA_ARGS__) + +// usage : TTL_82S16_DIP(name, ) +#define TTL_82S16_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_82S16_DIP, __VA_ARGS__) + +// usage : PROM_82S115_DIP(name, ) +#define PROM_82S115_DIP(...) \ + NET_REGISTER_DEVEXT(PROM_82S115_DIP, __VA_ARGS__) + +// usage : PROM_MK28000_DIP(name, ) +#define PROM_MK28000_DIP(...) \ + NET_REGISTER_DEVEXT(PROM_MK28000_DIP, __VA_ARGS__) + +// usage : ROM_MCM14524_DIP(name, ) +#define ROM_MCM14524_DIP(...) \ + NET_REGISTER_DEVEXT(ROM_MCM14524_DIP, __VA_ARGS__) + +// usage : RAM_2102A_DIP(name, ) +#define RAM_2102A_DIP(...) \ + NET_REGISTER_DEVEXT(RAM_2102A_DIP, __VA_ARGS__) + +// usage : ROM_TMS4800_DIP(name, ) +#define ROM_TMS4800_DIP(...) \ + NET_REGISTER_DEVEXT(ROM_TMS4800_DIP, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../macro/nlm_ttl74xx_lib.cpp +// --------------------------------------------------------------------- + +// usage : TTL_7400_NAND(name, A, B) +// auto connect: VCC, GND +#define TTL_7400_NAND(...) \ + NET_REGISTER_DEVEXT(TTL_7400_NAND, __VA_ARGS__) + +// usage : TTL_7402_NOR(name, A, B) +// auto connect: VCC, GND +#define TTL_7402_NOR(...) \ + NET_REGISTER_DEVEXT(TTL_7402_NOR, __VA_ARGS__) + +// usage : TTL_7404_INVERT(name, A) +// auto connect: VCC, GND +#define TTL_7404_INVERT(...) \ + NET_REGISTER_DEVEXT(TTL_7404_INVERT, __VA_ARGS__) + +// usage : TTL_7406_GATE(name, ) +#define TTL_7406_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7406_GATE, __VA_ARGS__) + +// usage : TTL_7407_GATE(name, ) +#define TTL_7407_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7407_GATE, __VA_ARGS__) + +// usage : TTL_7408_GATE(name, ) +#define TTL_7408_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7408_GATE, __VA_ARGS__) + +// usage : TTL_7408_AND(name, A, B) +// auto connect: VCC, GND +#define TTL_7408_AND(...) \ + NET_REGISTER_DEVEXT(TTL_7408_AND, __VA_ARGS__) + +// usage : TTL_7410_NAND(name, A, B, C) +// auto connect: VCC, GND +#define TTL_7410_NAND(...) \ + NET_REGISTER_DEVEXT(TTL_7410_NAND, __VA_ARGS__) + +// usage : TTL_7410_GATE(name, ) +#define TTL_7410_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7410_GATE, __VA_ARGS__) + +// usage : TTL_7411_AND(name, A, B, C) +// auto connect: VCC, GND +#define TTL_7411_AND(...) \ + NET_REGISTER_DEVEXT(TTL_7411_AND, __VA_ARGS__) + +// usage : TTL_7411_GATE(name, ) +#define TTL_7411_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7411_GATE, __VA_ARGS__) + +// usage : TTL_7416_GATE(name, ) +#define TTL_7416_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7416_GATE, __VA_ARGS__) + +// usage : TTL_7417_GATE(name, ) +#define TTL_7417_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7417_GATE, __VA_ARGS__) + +// usage : TTL_7420_NAND(name, A, B, C, D) +// auto connect: VCC, GND +#define TTL_7420_NAND(...) \ + NET_REGISTER_DEVEXT(TTL_7420_NAND, __VA_ARGS__) + +// usage : TTL_7421_AND(name, A, B, C, D) +// auto connect: VCC, GND +#define TTL_7421_AND(...) \ + NET_REGISTER_DEVEXT(TTL_7421_AND, __VA_ARGS__) + +// usage : TTL_7425_NOR(name, A, B, C, D) +// auto connect: VCC, GND +#define TTL_7425_NOR(...) \ + NET_REGISTER_DEVEXT(TTL_7425_NOR, __VA_ARGS__) + +// usage : TTL_7427_NOR(name, A, B, C) +// auto connect: VCC, GND +#define TTL_7427_NOR(...) \ + NET_REGISTER_DEVEXT(TTL_7427_NOR, __VA_ARGS__) + +// usage : TTL_7430_NAND(name, A, B, C, D, E, F, G, H) +// auto connect: VCC, GND +#define TTL_7430_NAND(...) \ + NET_REGISTER_DEVEXT(TTL_7430_NAND, __VA_ARGS__) + +// usage : TTL_7432_OR(name, A, B) +// auto connect: VCC, GND +#define TTL_7432_OR(...) \ + NET_REGISTER_DEVEXT(TTL_7432_OR, __VA_ARGS__) + +// usage : TTL_7437_NAND(name, A, B) +#define TTL_7437_NAND(...) \ + NET_REGISTER_DEVEXT(TTL_7437_NAND, __VA_ARGS__) + +// usage : TTL_7438_NAND(name, A, B) +#define TTL_7438_NAND(...) \ + NET_REGISTER_DEVEXT(TTL_7438_NAND, __VA_ARGS__) + +// usage : TTL_7442(name, ) +#define TTL_7442(...) \ + NET_REGISTER_DEVEXT(TTL_7442, __VA_ARGS__) + +// usage : TTL_7486_XOR(name, A, B) +// auto connect: VCC, GND +#define TTL_7486_XOR(...) \ + NET_REGISTER_DEVEXT(TTL_7486_XOR, __VA_ARGS__) + +// usage : TTL_74139_GATE(name, ) +#define TTL_74139_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74139_GATE, __VA_ARGS__) + +// usage : TTL_74155A_GATE(name, ) +#define TTL_74155A_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74155A_GATE, __VA_ARGS__) + +// usage : TTL_74155B_GATE(name, ) +#define TTL_74155B_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74155B_GATE, __VA_ARGS__) + +// usage : TTL_74156A_GATE(name, ) +#define TTL_74156A_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74156A_GATE, __VA_ARGS__) + +// usage : TTL_74156B_GATE(name, ) +#define TTL_74156B_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74156B_GATE, __VA_ARGS__) + +// usage : TTL_74157_GATE(name, ) +#define TTL_74157_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74157_GATE, __VA_ARGS__) + +// usage : TTL_74260_NOR(name, A, B, C, D, E) +// auto connect: VCC, GND +#define TTL_74260_NOR(...) \ + NET_REGISTER_DEVEXT(TTL_74260_NOR, __VA_ARGS__) + +// usage : TTL_74279A(name, ) +#define TTL_74279A(...) \ + NET_REGISTER_DEVEXT(TTL_74279A, __VA_ARGS__) + +// usage : TTL_74279B(name, ) +#define TTL_74279B(...) \ + NET_REGISTER_DEVEXT(TTL_74279B, __VA_ARGS__) + +// usage : TTL_9312(name, ) +#define TTL_9312(...) \ + NET_REGISTER_DEVEXT(TTL_9312, __VA_ARGS__) + +NETLIST_EXTERNAL(ttl74xx_lib) +// usage : TTL_7400_DIP(name, ) +#define TTL_7400_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7400_DIP, __VA_ARGS__) + +// usage : TTL_7402_DIP(name, ) +#define TTL_7402_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7402_DIP, __VA_ARGS__) + +// usage : TTL_7404_DIP(name, ) +#define TTL_7404_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7404_DIP, __VA_ARGS__) + +// usage : TTL_7406_DIP(name, ) +#define TTL_7406_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7406_DIP, __VA_ARGS__) + +// usage : TTL_7407_DIP(name, ) +#define TTL_7407_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7407_DIP, __VA_ARGS__) + +// usage : TTL_7408_DIP(name, ) +#define TTL_7408_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7408_DIP, __VA_ARGS__) + +// usage : TTL_7410_DIP(name, ) +#define TTL_7410_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7410_DIP, __VA_ARGS__) + +// usage : TTL_7411_DIP(name, ) +#define TTL_7411_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7411_DIP, __VA_ARGS__) + +// usage : TTL_7414_GATE(name, ) +#define TTL_7414_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_7414_GATE, __VA_ARGS__) + +// usage : TTL_74LS14_GATE(name, ) +#define TTL_74LS14_GATE(...) \ + NET_REGISTER_DEVEXT(TTL_74LS14_GATE, __VA_ARGS__) + +// usage : TTL_7414_DIP(name, ) +#define TTL_7414_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7414_DIP, __VA_ARGS__) + +// usage : TTL_74LS14_DIP(name, ) +#define TTL_74LS14_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74LS14_DIP, __VA_ARGS__) + +// usage : TTL_7416_DIP(name, ) +#define TTL_7416_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7416_DIP, __VA_ARGS__) + +// usage : TTL_7417_DIP(name, ) +#define TTL_7417_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7417_DIP, __VA_ARGS__) + +// usage : TTL_7420_DIP(name, ) +#define TTL_7420_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7420_DIP, __VA_ARGS__) + +// usage : TTL_7421_DIP(name, ) +#define TTL_7421_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7421_DIP, __VA_ARGS__) + +// usage : TTL_7425_DIP(name, ) +#define TTL_7425_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7425_DIP, __VA_ARGS__) + +// usage : TTL_7427_DIP(name, ) +#define TTL_7427_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7427_DIP, __VA_ARGS__) + +// usage : TTL_7430_DIP(name, ) +#define TTL_7430_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7430_DIP, __VA_ARGS__) + +// usage : TTL_7432_DIP(name, ) +#define TTL_7432_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7432_DIP, __VA_ARGS__) + +// usage : TTL_7437_DIP(name, ) +#define TTL_7437_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7437_DIP, __VA_ARGS__) + +// usage : TTL_7438_DIP(name, ) +#define TTL_7438_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7438_DIP, __VA_ARGS__) + +// usage : TTL_7442_DIP(name, ) +#define TTL_7442_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7442_DIP, __VA_ARGS__) + +// usage : TTL_7448_DIP(name, ) +#define TTL_7448_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7448_DIP, __VA_ARGS__) + +// usage : TTL_7450_DIP(name, ) +#define TTL_7450_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7450_DIP, __VA_ARGS__) + +// usage : TTL_7473_DIP(name, ) +#define TTL_7473_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7473_DIP, __VA_ARGS__) + +// usage : TTL_7473A_DIP(name, ) +#define TTL_7473A_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7473A_DIP, __VA_ARGS__) + +// usage : TTL_7474_DIP(name, ) +#define TTL_7474_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7474_DIP, __VA_ARGS__) + +// usage : TTL_7475_DIP(name, ) +#define TTL_7475_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7475_DIP, __VA_ARGS__) + +// usage : TTL_7477_DIP(name, ) +#define TTL_7477_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7477_DIP, __VA_ARGS__) + +// usage : TTL_7483_DIP(name, ) +#define TTL_7483_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7483_DIP, __VA_ARGS__) + +// usage : TTL_7485_DIP(name, ) +#define TTL_7485_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7485_DIP, __VA_ARGS__) + +// usage : TTL_7486_DIP(name, ) +#define TTL_7486_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7486_DIP, __VA_ARGS__) + +// usage : TTL_7490_DIP(name, ) +#define TTL_7490_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7490_DIP, __VA_ARGS__) + +// usage : TTL_7492_DIP(name, ) +#define TTL_7492_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7492_DIP, __VA_ARGS__) + +// usage : TTL_7493_DIP(name, ) +#define TTL_7493_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7493_DIP, __VA_ARGS__) + +// usage : TTL_7497_DIP(name, ) +#define TTL_7497_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_7497_DIP, __VA_ARGS__) + +// usage : TTL_74107_DIP(name, ) +#define TTL_74107_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74107_DIP, __VA_ARGS__) + +// usage : TTL_74107A_DIP(name, ) +#define TTL_74107A_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74107A_DIP, __VA_ARGS__) + +// usage : TTL_74113_DIP(name, ) +#define TTL_74113_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74113_DIP, __VA_ARGS__) + +// usage : TTL_74113A_DIP(name, ) +#define TTL_74113A_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74113A_DIP, __VA_ARGS__) + +// usage : TTL_74121_DIP(name, ) +#define TTL_74121_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74121_DIP, __VA_ARGS__) + +// usage : TTL_74123_DIP(name, ) +#define TTL_74123_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74123_DIP, __VA_ARGS__) + +// usage : TTL_9602_DIP(name, ) +#define TTL_9602_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9602_DIP, __VA_ARGS__) + +// usage : TTL_74125_DIP(name, ) +#define TTL_74125_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74125_DIP, __VA_ARGS__) + +// usage : TTL_74126_DIP(name, ) +#define TTL_74126_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74126_DIP, __VA_ARGS__) + +// usage : TTL_74139_DIP(name, ) +#define TTL_74139_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74139_DIP, __VA_ARGS__) + +// usage : TTL_74153_DIP(name, ) +#define TTL_74153_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74153_DIP, __VA_ARGS__) + +// usage : TTL_74155_DIP(name, ) +#define TTL_74155_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74155_DIP, __VA_ARGS__) + +// usage : TTL_74156_DIP(name, ) +#define TTL_74156_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74156_DIP, __VA_ARGS__) + +// usage : TTL_74157_DIP(name, ) +#define TTL_74157_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74157_DIP, __VA_ARGS__) + +// usage : TTL_74161_DIP(name, ) +#define TTL_74161_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74161_DIP, __VA_ARGS__) + +// usage : TTL_74163_DIP(name, ) +#define TTL_74163_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74163_DIP, __VA_ARGS__) + +// usage : TTL_74164_DIP(name, ) +#define TTL_74164_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74164_DIP, __VA_ARGS__) + +// usage : TTL_74165_DIP(name, ) +#define TTL_74165_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74165_DIP, __VA_ARGS__) + +// usage : TTL_74166_DIP(name, ) +#define TTL_74166_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74166_DIP, __VA_ARGS__) + +// usage : TTL_74174_DIP(name, ) +#define TTL_74174_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74174_DIP, __VA_ARGS__) + +// usage : TTL_74175_DIP(name, ) +#define TTL_74175_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74175_DIP, __VA_ARGS__) + +// usage : TTL_74192_DIP(name, ) +#define TTL_74192_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74192_DIP, __VA_ARGS__) + +// usage : TTL_74193_DIP(name, ) +#define TTL_74193_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74193_DIP, __VA_ARGS__) + +// usage : TTL_74194_DIP(name, ) +#define TTL_74194_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74194_DIP, __VA_ARGS__) + +// usage : TTL_74260_DIP(name, ) +#define TTL_74260_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74260_DIP, __VA_ARGS__) + +// usage : TTL_74279_DIP(name, ) +#define TTL_74279_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74279_DIP, __VA_ARGS__) + +// usage : TTL_74290_DIP(name, ) +#define TTL_74290_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74290_DIP, __VA_ARGS__) + +// usage : TTL_74293_DIP(name, ) +#define TTL_74293_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74293_DIP, __VA_ARGS__) + +// usage : TTL_74365_DIP(name, ) +#define TTL_74365_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74365_DIP, __VA_ARGS__) + +// usage : TTL_74377_DIP(name, ) +#define TTL_74377_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74377_DIP, __VA_ARGS__) + +// usage : TTL_74378_DIP(name, ) +#define TTL_74378_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74378_DIP, __VA_ARGS__) + +// usage : TTL_74379_DIP(name, ) +#define TTL_74379_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74379_DIP, __VA_ARGS__) + +// usage : TTL_74393_DIP(name, ) +#define TTL_74393_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_74393_DIP, __VA_ARGS__) + +// usage : SN74LS629_DIP(name, ) +#define SN74LS629_DIP(...) \ + NET_REGISTER_DEVEXT(SN74LS629_DIP, __VA_ARGS__) + +// usage : TTL_9310_DIP(name, ) +#define TTL_9310_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9310_DIP, __VA_ARGS__) + +// usage : TTL_9312_DIP(name, ) +#define TTL_9312_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9312_DIP, __VA_ARGS__) + +// usage : TTL_9314_DIP(name, ) +#define TTL_9314_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9314_DIP, __VA_ARGS__) + +// usage : TTL_9316_DIP(name, ) +#define TTL_9316_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9316_DIP, __VA_ARGS__) + +// usage : TTL_9321_DIP(name, ) +#define TTL_9321_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9321_DIP, __VA_ARGS__) + +// usage : TTL_9322_DIP(name, ) +#define TTL_9322_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9322_DIP, __VA_ARGS__) + +// usage : TTL_9334_DIP(name, ) +#define TTL_9334_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_9334_DIP, __VA_ARGS__) + +// usage : TTL_8277_DIP(name, ) +#define TTL_8277_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_8277_DIP, __VA_ARGS__) + +// usage : TTL_AM2847_DIP(name, ) +#define TTL_AM2847_DIP(...) \ + NET_REGISTER_DEVEXT(TTL_AM2847_DIP, __VA_ARGS__) + +// --------------------------------------------------------------------- +// Source: ../solver/nld_solver.cpp +// --------------------------------------------------------------------- + +// usage : SOLVER(name, FREQ) +#define SOLVER(...) \ + NET_REGISTER_DEVEXT(SOLVER, __VA_ARGS__) + +#endif // __PLIB_PREPROCESSOR__ + +#endif // NLD_DEVINC_H + diff --git a/src/lib/netlist/generated/nlm_modules_lib.cpp b/src/lib/netlist/generated/nlm_modules_lib.cpp new file mode 100644 index 00000000000..f58e2c5d027 --- /dev/null +++ b/src/lib/netlist/generated/nlm_modules_lib.cpp @@ -0,0 +1,15 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +// File programmatically created Sat Jul 2 23:43:48 2022 + +#include "devices/net_lib.h" + +NETLIST_START(modules_lib) +{ + + EXTERNAL_LIB_ENTRY(ICL8038_DIP) + EXTERNAL_LIB_ENTRY(NE556_DIP) + EXTERNAL_LIB_ENTRY(RTEST) + +} diff --git a/src/lib/netlist/generated/static_solvers.cpp b/src/lib/netlist/generated/static_solvers.cpp new file mode 100644 index 00000000000..8f01960ce72 --- /dev/null +++ b/src/lib/netlist/generated/static_solvers.cpp @@ -0,0 +1,83703 @@ +// spell-checker: disable + +#include "plib/pdynlib.h" + +#if !defined(__EMSCRIPTEN__) + +// 1942 +static void nl_gcr_90_double_double_ce766957cb26ff3e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[15]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[16] * *cnV[16]; + RHS5 -= go[17] * *cnV[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A12 += gt[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A19 += go[18]; + m_A13 += go[19]; + m_A15 += go[20]; + m_A17 += go[21]; + m_A18 += go[22]; + m_A16 += go[23]; + m_A14 += go[24]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + m_A20 += gt[25]; + m_A20 += gt[26]; + m_A22 += go[25]; + m_A21 += go[26]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + m_A25 += gt[27]; + m_A25 += gt[28]; + m_A24 += go[27]; + m_A23 += go[28]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + m_A35 += gt[29]; + m_A35 += gt[30]; + m_A33 += go[29]; + m_A32 += go[30]; + double RHS9 = Idr[29]; + RHS9 += Idr[30]; + m_A45 += gt[31]; + m_A45 += gt[32]; + m_A42 += go[31]; + m_A41 += go[32]; + double RHS10 = Idr[31]; + RHS10 += Idr[32]; + m_A55 += gt[33]; + m_A55 += gt[34]; + m_A51 += go[33]; + m_A50 += go[34]; + double RHS11 = Idr[33]; + RHS11 += Idr[34]; + m_A65 += gt[35]; + m_A65 += gt[36]; + m_A60 += go[35]; + m_A59 += go[36]; + double RHS12 = Idr[35]; + RHS12 += Idr[36]; + m_A75 += gt[37]; + m_A75 += gt[38]; + m_A69 += go[37]; + m_A68 += go[38]; + double RHS13 = Idr[37]; + RHS13 += Idr[38]; + m_A85 += gt[39]; + m_A85 += gt[40]; + m_A85 += gt[41]; + m_A78 += go[39]; + m_A77 += go[40]; + double RHS14 = Idr[39]; + RHS14 += Idr[40]; + RHS14 += Idr[41]; + RHS14 -= go[41] * *cnV[41]; + m_A89 += gt[42]; + m_A89 += gt[43]; + m_A87 += go[42]; + double RHS15 = Idr[42]; + RHS15 += Idr[43]; + RHS15 -= go[43] * *cnV[43]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A32; + m_A35 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_11 = -f1 * m_A50; + m_A55 += m_A3 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_13 = -f2 * m_A68; + m_A75 += m_A5 * f2_13; + RHS13 += f2_13 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_12 = -f3 * m_A59; + m_A65 += m_A7 * f3_12; + RHS12 += f3_12 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_10 = -f4 * m_A41; + m_A45 += m_A9 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_8 = -f5 * m_A23; + m_A25 += m_A11 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_8 = -f6 * m_A24; + m_A25 += m_A13 * f6_8; + m_A26 += m_A14 * f6_8; + m_A27 += m_A15 * f6_8; + m_A28 += m_A16 * f6_8; + m_A29 += m_A17 * f6_8; + m_A30 += m_A18 * f6_8; + m_A31 += m_A19 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A33; + m_A34 += m_A13 * f6_9; + m_A35 += m_A14 * f6_9; + m_A36 += m_A15 * f6_9; + m_A37 += m_A16 * f6_9; + m_A38 += m_A17 * f6_9; + m_A39 += m_A18 * f6_9; + m_A40 += m_A19 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_10 = -f6 * m_A42; + m_A43 += m_A13 * f6_10; + m_A44 += m_A14 * f6_10; + m_A45 += m_A15 * f6_10; + m_A46 += m_A16 * f6_10; + m_A47 += m_A17 * f6_10; + m_A48 += m_A18 * f6_10; + m_A49 += m_A19 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_11 = -f6 * m_A51; + m_A52 += m_A13 * f6_11; + m_A53 += m_A14 * f6_11; + m_A54 += m_A15 * f6_11; + m_A55 += m_A16 * f6_11; + m_A56 += m_A17 * f6_11; + m_A57 += m_A18 * f6_11; + m_A58 += m_A19 * f6_11; + RHS11 += f6_11 * RHS6; + const double f6_12 = -f6 * m_A60; + m_A61 += m_A13 * f6_12; + m_A62 += m_A14 * f6_12; + m_A63 += m_A15 * f6_12; + m_A64 += m_A16 * f6_12; + m_A65 += m_A17 * f6_12; + m_A66 += m_A18 * f6_12; + m_A67 += m_A19 * f6_12; + RHS12 += f6_12 * RHS6; + const double f6_13 = -f6 * m_A69; + m_A70 += m_A13 * f6_13; + m_A71 += m_A14 * f6_13; + m_A72 += m_A15 * f6_13; + m_A73 += m_A16 * f6_13; + m_A74 += m_A17 * f6_13; + m_A75 += m_A18 * f6_13; + m_A76 += m_A19 * f6_13; + RHS13 += f6_13 * RHS6; + const double f6_14 = -f6 * m_A77; + m_A79 += m_A13 * f6_14; + m_A80 += m_A14 * f6_14; + m_A81 += m_A15 * f6_14; + m_A82 += m_A16 * f6_14; + m_A83 += m_A17 * f6_14; + m_A84 += m_A18 * f6_14; + m_A85 += m_A19 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A20; + const double f7_14 = -f7 * m_A78; + m_A85 += m_A21 * f7_14; + m_A86 += m_A22 * f7_14; + RHS14 += f7_14 * RHS7; + const double f7_15 = -f7 * m_A87; + m_A88 += m_A21 * f7_15; + m_A89 += m_A22 * f7_15; + RHS15 += f7_15 * RHS7; + const double f8 = 1.0 / m_A25; + const double f8_9 = -f8 * m_A34; + m_A35 += m_A26 * f8_9; + m_A36 += m_A27 * f8_9; + m_A37 += m_A28 * f8_9; + m_A38 += m_A29 * f8_9; + m_A39 += m_A30 * f8_9; + m_A40 += m_A31 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_10 = -f8 * m_A43; + m_A44 += m_A26 * f8_10; + m_A45 += m_A27 * f8_10; + m_A46 += m_A28 * f8_10; + m_A47 += m_A29 * f8_10; + m_A48 += m_A30 * f8_10; + m_A49 += m_A31 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_11 = -f8 * m_A52; + m_A53 += m_A26 * f8_11; + m_A54 += m_A27 * f8_11; + m_A55 += m_A28 * f8_11; + m_A56 += m_A29 * f8_11; + m_A57 += m_A30 * f8_11; + m_A58 += m_A31 * f8_11; + RHS11 += f8_11 * RHS8; + const double f8_12 = -f8 * m_A61; + m_A62 += m_A26 * f8_12; + m_A63 += m_A27 * f8_12; + m_A64 += m_A28 * f8_12; + m_A65 += m_A29 * f8_12; + m_A66 += m_A30 * f8_12; + m_A67 += m_A31 * f8_12; + RHS12 += f8_12 * RHS8; + const double f8_13 = -f8 * m_A70; + m_A71 += m_A26 * f8_13; + m_A72 += m_A27 * f8_13; + m_A73 += m_A28 * f8_13; + m_A74 += m_A29 * f8_13; + m_A75 += m_A30 * f8_13; + m_A76 += m_A31 * f8_13; + RHS13 += f8_13 * RHS8; + const double f8_14 = -f8 * m_A79; + m_A80 += m_A26 * f8_14; + m_A81 += m_A27 * f8_14; + m_A82 += m_A28 * f8_14; + m_A83 += m_A29 * f8_14; + m_A84 += m_A30 * f8_14; + m_A85 += m_A31 * f8_14; + RHS14 += f8_14 * RHS8; + const double f9 = 1.0 / m_A35; + const double f9_10 = -f9 * m_A44; + m_A45 += m_A36 * f9_10; + m_A46 += m_A37 * f9_10; + m_A47 += m_A38 * f9_10; + m_A48 += m_A39 * f9_10; + m_A49 += m_A40 * f9_10; + RHS10 += f9_10 * RHS9; + const double f9_11 = -f9 * m_A53; + m_A54 += m_A36 * f9_11; + m_A55 += m_A37 * f9_11; + m_A56 += m_A38 * f9_11; + m_A57 += m_A39 * f9_11; + m_A58 += m_A40 * f9_11; + RHS11 += f9_11 * RHS9; + const double f9_12 = -f9 * m_A62; + m_A63 += m_A36 * f9_12; + m_A64 += m_A37 * f9_12; + m_A65 += m_A38 * f9_12; + m_A66 += m_A39 * f9_12; + m_A67 += m_A40 * f9_12; + RHS12 += f9_12 * RHS9; + const double f9_13 = -f9 * m_A71; + m_A72 += m_A36 * f9_13; + m_A73 += m_A37 * f9_13; + m_A74 += m_A38 * f9_13; + m_A75 += m_A39 * f9_13; + m_A76 += m_A40 * f9_13; + RHS13 += f9_13 * RHS9; + const double f9_14 = -f9 * m_A80; + m_A81 += m_A36 * f9_14; + m_A82 += m_A37 * f9_14; + m_A83 += m_A38 * f9_14; + m_A84 += m_A39 * f9_14; + m_A85 += m_A40 * f9_14; + RHS14 += f9_14 * RHS9; + const double f10 = 1.0 / m_A45; + const double f10_11 = -f10 * m_A54; + m_A55 += m_A46 * f10_11; + m_A56 += m_A47 * f10_11; + m_A57 += m_A48 * f10_11; + m_A58 += m_A49 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_12 = -f10 * m_A63; + m_A64 += m_A46 * f10_12; + m_A65 += m_A47 * f10_12; + m_A66 += m_A48 * f10_12; + m_A67 += m_A49 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_13 = -f10 * m_A72; + m_A73 += m_A46 * f10_13; + m_A74 += m_A47 * f10_13; + m_A75 += m_A48 * f10_13; + m_A76 += m_A49 * f10_13; + RHS13 += f10_13 * RHS10; + const double f10_14 = -f10 * m_A81; + m_A82 += m_A46 * f10_14; + m_A83 += m_A47 * f10_14; + m_A84 += m_A48 * f10_14; + m_A85 += m_A49 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A55; + const double f11_12 = -f11 * m_A64; + m_A65 += m_A56 * f11_12; + m_A66 += m_A57 * f11_12; + m_A67 += m_A58 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_13 = -f11 * m_A73; + m_A74 += m_A56 * f11_13; + m_A75 += m_A57 * f11_13; + m_A76 += m_A58 * f11_13; + RHS13 += f11_13 * RHS11; + const double f11_14 = -f11 * m_A82; + m_A83 += m_A56 * f11_14; + m_A84 += m_A57 * f11_14; + m_A85 += m_A58 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A65; + const double f12_13 = -f12 * m_A74; + m_A75 += m_A66 * f12_13; + m_A76 += m_A67 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_14 = -f12 * m_A83; + m_A84 += m_A66 * f12_14; + m_A85 += m_A67 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A75; + const double f13_14 = -f13 * m_A84; + m_A85 += m_A76 * f13_14; + RHS14 += f13_14 * RHS13; + const double f14 = 1.0 / m_A85; + const double f14_15 = -f14 * m_A88; + m_A89 += m_A86 * f14_15; + RHS15 += f14_15 * RHS14; + V[15] = RHS15 / m_A89; + double tmp14 = 0.0; + tmp14 += m_A86 * V[15]; + V[14] = (RHS14 - tmp14) / m_A85; + double tmp13 = 0.0; + tmp13 += m_A76 * V[14]; + V[13] = (RHS13 - tmp13) / m_A75; + double tmp12 = 0.0; + tmp12 += m_A66 * V[13]; + tmp12 += m_A67 * V[14]; + V[12] = (RHS12 - tmp12) / m_A65; + double tmp11 = 0.0; + tmp11 += m_A56 * V[12]; + tmp11 += m_A57 * V[13]; + tmp11 += m_A58 * V[14]; + V[11] = (RHS11 - tmp11) / m_A55; + double tmp10 = 0.0; + tmp10 += m_A46 * V[11]; + tmp10 += m_A47 * V[12]; + tmp10 += m_A48 * V[13]; + tmp10 += m_A49 * V[14]; + V[10] = (RHS10 - tmp10) / m_A45; + double tmp9 = 0.0; + tmp9 += m_A36 * V[10]; + tmp9 += m_A37 * V[11]; + tmp9 += m_A38 * V[12]; + tmp9 += m_A39 * V[13]; + tmp9 += m_A40 * V[14]; + V[9] = (RHS9 - tmp9) / m_A35; + double tmp8 = 0.0; + tmp8 += m_A26 * V[9]; + tmp8 += m_A27 * V[10]; + tmp8 += m_A28 * V[11]; + tmp8 += m_A29 * V[12]; + tmp8 += m_A30 * V[13]; + tmp8 += m_A31 * V[14]; + V[8] = (RHS8 - tmp8) / m_A25; + double tmp7 = 0.0; + tmp7 += m_A21 * V[14]; + tmp7 += m_A22 * V[15]; + V[7] = (RHS7 - tmp7) / m_A20; + double tmp6 = 0.0; + tmp6 += m_A13 * V[8]; + tmp6 += m_A14 * V[9]; + tmp6 += m_A15 * V[10]; + tmp6 += m_A16 * V[11]; + tmp6 += m_A17 * V[12]; + tmp6 += m_A18 * V[13]; + tmp6 += m_A19 * V[14]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[8]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[10]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[12]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[13]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[11]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// 280zzzap +static void nl_gcr_149_double_double_fc9971724787b82b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[14]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A10 += gt[22]; + m_A11 += go[16]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[17] * *cnV[17]; + RHS5 -= go[18] * *cnV[18]; + RHS5 -= go[19] * *cnV[19]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A13 += go[23]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + m_A14 += gt[26]; + m_A14 += gt[27]; + m_A16 += go[26]; + m_A15 += go[27]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A18 += go[28]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 -= go[29] * *cnV[29]; + m_A19 += gt[30]; + m_A19 += gt[31]; + m_A20 += go[30]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 -= go[31] * *cnV[31]; + m_A21 += gt[32]; + m_A21 += gt[33]; + m_A22 += go[32]; + double RHS10 = Idr[32]; + RHS10 += Idr[33]; + RHS10 -= go[33] * *cnV[33]; + m_A23 += gt[34]; + m_A23 += gt[35]; + m_A23 += gt[36]; + m_A23 += gt[37]; + m_A23 += gt[38]; + m_A23 += gt[39]; + m_A23 += gt[40]; + m_A24 += go[34]; + double RHS11 = Idr[34]; + RHS11 += Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 += Idr[40]; + RHS11 -= go[35] * *cnV[35]; + RHS11 -= go[36] * *cnV[36]; + RHS11 -= go[37] * *cnV[37]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + RHS11 -= go[40] * *cnV[40]; + m_A25 += gt[41]; + m_A25 += gt[42]; + m_A26 += go[41]; + double RHS12 = Idr[41]; + RHS12 += Idr[42]; + RHS12 -= go[42] * *cnV[42]; + m_A27 += gt[43]; + m_A27 += gt[44]; + m_A27 += gt[45]; + m_A27 += gt[46]; + m_A27 += gt[47]; + m_A27 += gt[48]; + m_A27 += gt[49]; + m_A28 += go[43]; + double RHS13 = Idr[43]; + RHS13 += Idr[44]; + RHS13 += Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 += Idr[48]; + RHS13 += Idr[49]; + RHS13 -= go[44] * *cnV[44]; + RHS13 -= go[45] * *cnV[45]; + RHS13 -= go[46] * *cnV[46]; + RHS13 -= go[47] * *cnV[47]; + RHS13 -= go[48] * *cnV[48]; + RHS13 -= go[49] * *cnV[49]; + m_A29 += gt[50]; + m_A29 += gt[51]; + m_A29 += gt[52]; + m_A30 += go[50]; + double RHS14 = Idr[50]; + RHS14 += Idr[51]; + RHS14 += Idr[52]; + RHS14 -= go[51] * *cnV[51]; + RHS14 -= go[52] * *cnV[52]; + m_A31 += gt[53]; + m_A31 += gt[54]; + m_A32 += go[53]; + double RHS15 = Idr[53]; + RHS15 += Idr[54]; + RHS15 -= go[54] * *cnV[54]; + m_A33 += gt[55]; + m_A33 += gt[56]; + m_A33 += gt[57]; + m_A33 += gt[58]; + m_A34 += go[55]; + m_A35 += go[56]; + double RHS16 = Idr[55]; + RHS16 += Idr[56]; + RHS16 += Idr[57]; + RHS16 += Idr[58]; + RHS16 -= go[57] * *cnV[57]; + RHS16 -= go[58] * *cnV[58]; + m_A36 += gt[59]; + m_A36 += gt[60]; + m_A36 += gt[61]; + m_A37 += go[59]; + double RHS17 = Idr[59]; + RHS17 += Idr[60]; + RHS17 += Idr[61]; + RHS17 -= go[60] * *cnV[60]; + RHS17 -= go[61] * *cnV[61]; + m_A38 += gt[62]; + m_A38 += gt[63]; + m_A39 += go[62]; + m_A40 += go[63]; + double RHS18 = Idr[62]; + RHS18 += Idr[63]; + m_A41 += gt[64]; + m_A41 += gt[65]; + m_A42 += go[64]; + m_A43 += go[65]; + double RHS19 = Idr[64]; + RHS19 += Idr[65]; + m_A45 += gt[66]; + m_A45 += gt[67]; + m_A44 += go[66]; + double RHS20 = Idr[66]; + RHS20 += Idr[67]; + RHS20 -= go[67] * *cnV[67]; + m_A47 += gt[68]; + m_A47 += gt[69]; + m_A47 += gt[70]; + m_A47 += gt[71]; + m_A46 += go[68]; + m_A48 += go[69]; + double RHS21 = Idr[68]; + RHS21 += Idr[69]; + RHS21 += Idr[70]; + RHS21 += Idr[71]; + RHS21 -= go[70] * *cnV[70]; + RHS21 -= go[71] * *cnV[71]; + m_A51 += gt[72]; + m_A51 += gt[73]; + m_A51 += gt[74]; + m_A51 += gt[75]; + m_A51 += gt[76]; + m_A51 += gt[77]; + m_A49 += go[72]; + m_A53 += go[73]; + m_A54 += go[74]; + m_A52 += go[75]; + double RHS22 = Idr[72]; + RHS22 += Idr[73]; + RHS22 += Idr[74]; + RHS22 += Idr[75]; + RHS22 += Idr[76]; + RHS22 += Idr[77]; + RHS22 -= go[76] * *cnV[76]; + RHS22 -= go[77] * *cnV[77]; + m_A56 += gt[78]; + m_A56 += gt[79]; + m_A55 += go[78]; + double RHS23 = Idr[78]; + RHS23 += Idr[79]; + RHS23 -= go[79] * *cnV[79]; + m_A58 += gt[80]; + m_A58 += gt[81]; + m_A58 += gt[82]; + m_A58 += gt[83]; + m_A57 += go[80]; + m_A59 += go[81]; + double RHS24 = Idr[80]; + RHS24 += Idr[81]; + RHS24 += Idr[82]; + RHS24 += Idr[83]; + RHS24 -= go[82] * *cnV[82]; + RHS24 -= go[83] * *cnV[83]; + m_A63 += gt[84]; + m_A63 += gt[85]; + m_A63 += gt[86]; + m_A63 += gt[87]; + m_A63 += gt[88]; + m_A63 += gt[89]; + m_A60 += go[84]; + m_A61 += go[85]; + m_A65 += go[86]; + m_A66 += go[87]; + double RHS25 = Idr[84]; + RHS25 += Idr[85]; + RHS25 += Idr[86]; + RHS25 += Idr[87]; + RHS25 += Idr[88]; + RHS25 += Idr[89]; + RHS25 -= go[88] * *cnV[88]; + RHS25 -= go[89] * *cnV[89]; + m_A69 += gt[90]; + m_A69 += gt[91]; + m_A68 += go[90]; + m_A67 += go[91]; + double RHS26 = Idr[90]; + RHS26 += Idr[91]; + m_A72 += gt[92]; + m_A72 += gt[93]; + m_A71 += go[92]; + m_A73 += go[93]; + double RHS27 = Idr[92]; + RHS27 += Idr[93]; + m_A78 += gt[94]; + m_A78 += gt[95]; + m_A78 += gt[96]; + m_A78 += gt[97]; + m_A76 += go[94]; + m_A75 += go[95]; + m_A81 += go[96]; + m_A74 += go[97]; + double RHS28 = Idr[94]; + RHS28 += Idr[95]; + RHS28 += Idr[96]; + RHS28 += Idr[97]; + m_A85 += gt[98]; + m_A85 += gt[99]; + m_A83 += go[98]; + m_A82 += go[99]; + double RHS29 = Idr[98]; + RHS29 += Idr[99]; + m_A87 += gt[100]; + m_A87 += gt[101]; + m_A87 += gt[102]; + m_A87 += gt[103]; + m_A86 += go[100]; + m_A89 += go[101]; + double RHS30 = Idr[100]; + RHS30 += Idr[101]; + RHS30 += Idr[102]; + RHS30 += Idr[103]; + RHS30 -= go[102] * *cnV[102]; + RHS30 -= go[103] * *cnV[103]; + m_A91 += gt[104]; + m_A91 += gt[105]; + m_A91 += gt[106]; + m_A91 += gt[107]; + m_A90 += go[104]; + m_A92 += go[105]; + double RHS31 = Idr[104]; + RHS31 += Idr[105]; + RHS31 += Idr[106]; + RHS31 += Idr[107]; + RHS31 -= go[106] * *cnV[106]; + RHS31 -= go[107] * *cnV[107]; + m_A97 += gt[108]; + m_A97 += gt[109]; + m_A97 += gt[110]; + m_A97 += gt[111]; + m_A97 += gt[112]; + m_A96 += go[108]; + m_A95 += go[109]; + m_A99 += go[110]; + m_A94 += go[111]; + m_A93 += go[112]; + double RHS32 = Idr[108]; + RHS32 += Idr[109]; + RHS32 += Idr[110]; + RHS32 += Idr[111]; + RHS32 += Idr[112]; + m_A107 += gt[113]; + m_A107 += gt[114]; + m_A107 += gt[115]; + m_A107 += gt[116]; + m_A107 += gt[117]; + m_A104 += go[113]; + m_A103 += go[114]; + m_A101 += go[115]; + m_A100 += go[116]; + m_A102 += go[117]; + double RHS33 = Idr[113]; + RHS33 += Idr[114]; + RHS33 += Idr[115]; + RHS33 += Idr[116]; + RHS33 += Idr[117]; + m_A111 += gt[118]; + m_A111 += gt[119]; + m_A111 += gt[120]; + m_A111 += gt[121]; + m_A110 += go[118]; + m_A112 += go[119]; + double RHS34 = Idr[118]; + RHS34 += Idr[119]; + RHS34 += Idr[120]; + RHS34 += Idr[121]; + RHS34 -= go[120] * *cnV[120]; + RHS34 -= go[121] * *cnV[121]; + m_A117 += gt[122]; + m_A117 += gt[123]; + m_A117 += gt[124]; + m_A117 += gt[125]; + m_A117 += gt[126]; + m_A117 += gt[127]; + m_A113 += go[122]; + m_A115 += go[123]; + m_A114 += go[124]; + m_A119 += go[125]; + double RHS35 = Idr[122]; + RHS35 += Idr[123]; + RHS35 += Idr[124]; + RHS35 += Idr[125]; + RHS35 += Idr[126]; + RHS35 += Idr[127]; + RHS35 -= go[126] * *cnV[126]; + RHS35 -= go[127] * *cnV[127]; + m_A128 += gt[128]; + m_A128 += gt[129]; + m_A128 += gt[130]; + m_A128 += gt[131]; + m_A128 += gt[132]; + m_A125 += go[128]; + m_A122 += go[129]; + m_A123 += go[130]; + m_A121 += go[131]; + m_A120 += go[132]; + double RHS36 = Idr[128]; + RHS36 += Idr[129]; + RHS36 += Idr[130]; + RHS36 += Idr[131]; + RHS36 += Idr[132]; + m_A136 += gt[133]; + m_A136 += gt[134]; + m_A136 += gt[135]; + m_A136 += gt[136]; + m_A136 += gt[137]; + m_A130 += go[133]; + m_A132 += go[134]; + m_A131 += go[135]; + m_A134 += go[136]; + double RHS37 = Idr[133]; + RHS37 += Idr[134]; + RHS37 += Idr[135]; + RHS37 += Idr[136]; + RHS37 += Idr[137]; + RHS37 -= go[137] * *cnV[137]; + m_A148 += gt[138]; + m_A148 += gt[139]; + m_A148 += gt[140]; + m_A148 += gt[141]; + m_A148 += gt[142]; + m_A148 += gt[143]; + m_A148 += gt[144]; + m_A145 += go[138]; + m_A140 += go[139]; + m_A143 += go[140]; + m_A139 += go[141]; + m_A138 += go[142]; + m_A141 += go[143]; + m_A142 += go[144]; + double RHS38 = Idr[138]; + RHS38 += Idr[139]; + RHS38 += Idr[140]; + RHS38 += Idr[141]; + RHS38 += Idr[142]; + RHS38 += Idr[143]; + RHS38 += Idr[144]; + const double f0 = 1.0 / m_A0; + const double f0_20 = -f0 * m_A44; + m_A45 += m_A1 * f0_20; + RHS20 += f0_20 * RHS0; + const double f0_32 = -f0 * m_A93; + m_A95 += m_A1 * f0_32; + RHS32 += f0_32 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_21 = -f1 * m_A46; + m_A48 += m_A3 * f1_21; + RHS21 += f1_21 * RHS1; + const double f1_32 = -f1 * m_A94; + m_A97 += m_A3 * f1_32; + RHS32 += f1_32 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_22 = -f2 * m_A49; + m_A50 += m_A5 * f2_22; + RHS22 += f2_22 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_37 = -f3 * m_A130; + m_A136 += m_A7 * f3_37; + RHS37 += f3_37 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_23 = -f4 * m_A55; + m_A56 += m_A9 * f4_23; + RHS23 += f4_23 * RHS4; + const double f4_33 = -f4 * m_A100; + m_A103 += m_A9 * f4_33; + RHS33 += f4_33 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_25 = -f5 * m_A60; + m_A62 += m_A11 * f5_25; + RHS25 += f5_25 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_24 = -f6 * m_A57; + m_A59 += m_A13 * f6_24; + RHS24 += f6_24 * RHS6; + const double f6_33 = -f6 * m_A101; + m_A107 += m_A13 * f6_33; + RHS33 += f6_33 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_25 = -f7 * m_A61; + m_A63 += m_A15 * f7_25; + m_A64 += m_A16 * f7_25; + RHS25 += f7_25 * RHS7; + const double f7_28 = -f7 * m_A74; + m_A77 += m_A15 * f7_28; + m_A78 += m_A16 * f7_28; + RHS28 += f7_28 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_28 = -f8 * m_A75; + m_A78 += m_A18 * f8_28; + RHS28 += f8_28 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_27 = -f9 * m_A71; + m_A72 += m_A20 * f9_27; + RHS27 += f9_27 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_28 = -f10 * m_A76; + m_A78 += m_A22 * f10_28; + RHS28 += f10_28 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_35 = -f11 * m_A113; + m_A116 += m_A24 * f11_35; + RHS35 += f11_35 * RHS11; + const double f12 = 1.0 / m_A25; + const double f12_29 = -f12 * m_A82; + m_A85 += m_A26 * f12_29; + RHS29 += f12_29 * RHS12; + const double f12_38 = -f12 * m_A138; + m_A143 += m_A26 * f12_38; + RHS38 += f12_38 * RHS12; + const double f13 = 1.0 / m_A27; + const double f13_30 = -f13 * m_A86; + m_A88 += m_A28 * f13_30; + RHS30 += f13_30 * RHS13; + const double f14 = 1.0 / m_A29; + const double f14_34 = -f14 * m_A110; + m_A112 += m_A30 * f14_34; + RHS34 += f14_34 * RHS14; + const double f14_38 = -f14 * m_A139; + m_A148 += m_A30 * f14_38; + RHS38 += f14_38 * RHS14; + const double f15 = 1.0 / m_A31; + const double f15_26 = -f15 * m_A67; + m_A69 += m_A32 * f15_26; + RHS26 += f15_26 * RHS15; + const double f15_36 = -f15 * m_A120; + m_A123 += m_A32 * f15_36; + RHS36 += f15_36 * RHS15; + const double f16 = 1.0 / m_A33; + const double f16_26 = -f16 * m_A68; + m_A69 += m_A34 * f16_26; + m_A70 += m_A35 * f16_26; + RHS26 += f16_26 * RHS16; + const double f16_29 = -f16 * m_A83; + m_A84 += m_A34 * f16_29; + m_A85 += m_A35 * f16_29; + RHS29 += f16_29 * RHS16; + const double f17 = 1.0 / m_A36; + const double f17_31 = -f17 * m_A90; + m_A92 += m_A37 * f17_31; + RHS31 += f17_31 * RHS17; + const double f17_36 = -f17 * m_A121; + m_A128 += m_A37 * f17_36; + RHS36 += f17_36 * RHS17; + const double f18 = 1.0 / m_A38; + const double f18_35 = -f18 * m_A114; + m_A117 += m_A39 * f18_35; + m_A119 += m_A40 * f18_35; + RHS35 += f18_35 * RHS18; + const double f18_38 = -f18 * m_A140; + m_A145 += m_A39 * f18_38; + m_A148 += m_A40 * f18_38; + RHS38 += f18_38 * RHS18; + const double f19 = 1.0 / m_A41; + const double f19_35 = -f19 * m_A115; + m_A117 += m_A42 * f19_35; + m_A118 += m_A43 * f19_35; + RHS35 += f19_35 * RHS19; + const double f19_36 = -f19 * m_A122; + m_A127 += m_A42 * f19_36; + m_A128 += m_A43 * f19_36; + RHS36 += f19_36 * RHS19; + const double f20 = 1.0 / m_A45; + const double f20_32 = -f20 * m_A95; + RHS32 += f20_32 * RHS20; + const double f21 = 1.0 / m_A47; + const double f21_22 = -f21 * m_A50; + m_A52 += m_A48 * f21_22; + RHS22 += f21_22 * RHS21; + const double f22 = 1.0 / m_A51; + const double f22_32 = -f22 * m_A96; + m_A97 += m_A52 * f22_32; + m_A98 += m_A53 * f22_32; + m_A99 += m_A54 * f22_32; + RHS32 += f22_32 * RHS22; + const double f22_33 = -f22 * m_A102; + m_A106 += m_A52 * f22_33; + m_A107 += m_A53 * f22_33; + m_A108 += m_A54 * f22_33; + RHS33 += f22_33 * RHS22; + const double f22_37 = -f22 * m_A131; + m_A134 += m_A52 * f22_37; + m_A135 += m_A53 * f22_37; + m_A136 += m_A54 * f22_37; + RHS37 += f22_37 * RHS22; + const double f23 = 1.0 / m_A56; + const double f23_33 = -f23 * m_A103; + RHS33 += f23_33 * RHS23; + const double f24 = 1.0 / m_A58; + const double f24_25 = -f24 * m_A62; + m_A65 += m_A59 * f24_25; + RHS25 += f24_25 * RHS24; + const double f25 = 1.0 / m_A63; + const double f25_28 = -f25 * m_A77; + m_A78 += m_A64 * f25_28; + m_A79 += m_A65 * f25_28; + m_A80 += m_A66 * f25_28; + RHS28 += f25_28 * RHS25; + const double f25_33 = -f25 * m_A104; + m_A105 += m_A64 * f25_33; + m_A107 += m_A65 * f25_33; + m_A108 += m_A66 * f25_33; + RHS33 += f25_33 * RHS25; + const double f25_37 = -f25 * m_A132; + m_A133 += m_A64 * f25_37; + m_A135 += m_A65 * f25_37; + m_A136 += m_A66 * f25_37; + RHS37 += f25_37 * RHS25; + const double f26 = 1.0 / m_A69; + const double f26_29 = -f26 * m_A84; + m_A85 += m_A70 * f26_29; + RHS29 += f26_29 * RHS26; + const double f26_36 = -f26 * m_A123; + m_A124 += m_A70 * f26_36; + RHS36 += f26_36 * RHS26; + const double f27 = 1.0 / m_A72; + const double f27_38 = -f27 * m_A141; + m_A148 += m_A73 * f27_38; + RHS38 += f27_38 * RHS27; + const double f28 = 1.0 / m_A78; + const double f28_33 = -f28 * m_A105; + m_A107 += m_A79 * f28_33; + m_A108 += m_A80 * f28_33; + m_A109 += m_A81 * f28_33; + RHS33 += f28_33 * RHS28; + const double f28_37 = -f28 * m_A133; + m_A135 += m_A79 * f28_37; + m_A136 += m_A80 * f28_37; + m_A137 += m_A81 * f28_37; + RHS37 += f28_37 * RHS28; + const double f28_38 = -f28 * m_A142; + m_A144 += m_A79 * f28_38; + m_A147 += m_A80 * f28_38; + m_A148 += m_A81 * f28_38; + RHS38 += f28_38 * RHS28; + const double f29 = 1.0 / m_A85; + const double f29_36 = -f29 * m_A124; + RHS36 += f29_36 * RHS29; + const double f29_38 = -f29 * m_A143; + RHS38 += f29_38 * RHS29; + const double f30 = 1.0 / m_A87; + const double f30_36 = -f30 * m_A125; + m_A126 += m_A88 * f30_36; + m_A128 += m_A89 * f30_36; + RHS36 += f30_36 * RHS30; + const double f31 = 1.0 / m_A91; + const double f31_36 = -f31 * m_A126; + m_A128 += m_A92 * f31_36; + RHS36 += f31_36 * RHS31; + const double f32 = 1.0 / m_A97; + const double f32_33 = -f32 * m_A106; + m_A107 += m_A98 * f32_33; + m_A108 += m_A99 * f32_33; + RHS33 += f32_33 * RHS32; + const double f32_37 = -f32 * m_A134; + m_A135 += m_A98 * f32_37; + m_A136 += m_A99 * f32_37; + RHS37 += f32_37 * RHS32; + const double f33 = 1.0 / m_A107; + const double f33_37 = -f33 * m_A135; + m_A136 += m_A108 * f33_37; + m_A137 += m_A109 * f33_37; + RHS37 += f33_37 * RHS33; + const double f33_38 = -f33 * m_A144; + m_A147 += m_A108 * f33_38; + m_A148 += m_A109 * f33_38; + RHS38 += f33_38 * RHS33; + const double f34 = 1.0 / m_A111; + const double f34_35 = -f34 * m_A116; + m_A119 += m_A112 * f34_35; + RHS35 += f34_35 * RHS34; + const double f35 = 1.0 / m_A117; + const double f35_36 = -f35 * m_A127; + m_A128 += m_A118 * f35_36; + m_A129 += m_A119 * f35_36; + RHS36 += f35_36 * RHS35; + const double f35_38 = -f35 * m_A145; + m_A146 += m_A118 * f35_38; + m_A148 += m_A119 * f35_38; + RHS38 += f35_38 * RHS35; + const double f36 = 1.0 / m_A128; + const double f36_38 = -f36 * m_A146; + m_A148 += m_A129 * f36_38; + RHS38 += f36_38 * RHS36; + const double f37 = 1.0 / m_A136; + const double f37_38 = -f37 * m_A147; + m_A148 += m_A137 * f37_38; + RHS38 += f37_38 * RHS37; + V[38] = RHS38 / m_A148; + double tmp37 = 0.0; + tmp37 += m_A137 * V[38]; + V[37] = (RHS37 - tmp37) / m_A136; + double tmp36 = 0.0; + tmp36 += m_A129 * V[38]; + V[36] = (RHS36 - tmp36) / m_A128; + double tmp35 = 0.0; + tmp35 += m_A118 * V[36]; + tmp35 += m_A119 * V[38]; + V[35] = (RHS35 - tmp35) / m_A117; + double tmp34 = 0.0; + tmp34 += m_A112 * V[38]; + V[34] = (RHS34 - tmp34) / m_A111; + double tmp33 = 0.0; + tmp33 += m_A108 * V[37]; + tmp33 += m_A109 * V[38]; + V[33] = (RHS33 - tmp33) / m_A107; + double tmp32 = 0.0; + tmp32 += m_A98 * V[33]; + tmp32 += m_A99 * V[37]; + V[32] = (RHS32 - tmp32) / m_A97; + double tmp31 = 0.0; + tmp31 += m_A92 * V[36]; + V[31] = (RHS31 - tmp31) / m_A91; + double tmp30 = 0.0; + tmp30 += m_A88 * V[31]; + tmp30 += m_A89 * V[36]; + V[30] = (RHS30 - tmp30) / m_A87; + double tmp29 = 0.0; + V[29] = (RHS29 - tmp29) / m_A85; + double tmp28 = 0.0; + tmp28 += m_A79 * V[33]; + tmp28 += m_A80 * V[37]; + tmp28 += m_A81 * V[38]; + V[28] = (RHS28 - tmp28) / m_A78; + double tmp27 = 0.0; + tmp27 += m_A73 * V[38]; + V[27] = (RHS27 - tmp27) / m_A72; + double tmp26 = 0.0; + tmp26 += m_A70 * V[29]; + V[26] = (RHS26 - tmp26) / m_A69; + double tmp25 = 0.0; + tmp25 += m_A64 * V[28]; + tmp25 += m_A65 * V[33]; + tmp25 += m_A66 * V[37]; + V[25] = (RHS25 - tmp25) / m_A63; + double tmp24 = 0.0; + tmp24 += m_A59 * V[33]; + V[24] = (RHS24 - tmp24) / m_A58; + double tmp23 = 0.0; + V[23] = (RHS23 - tmp23) / m_A56; + double tmp22 = 0.0; + tmp22 += m_A52 * V[32]; + tmp22 += m_A53 * V[33]; + tmp22 += m_A54 * V[37]; + V[22] = (RHS22 - tmp22) / m_A51; + double tmp21 = 0.0; + tmp21 += m_A48 * V[32]; + V[21] = (RHS21 - tmp21) / m_A47; + double tmp20 = 0.0; + V[20] = (RHS20 - tmp20) / m_A45; + double tmp19 = 0.0; + tmp19 += m_A42 * V[35]; + tmp19 += m_A43 * V[36]; + V[19] = (RHS19 - tmp19) / m_A41; + double tmp18 = 0.0; + tmp18 += m_A39 * V[35]; + tmp18 += m_A40 * V[38]; + V[18] = (RHS18 - tmp18) / m_A38; + double tmp17 = 0.0; + tmp17 += m_A37 * V[36]; + V[17] = (RHS17 - tmp17) / m_A36; + double tmp16 = 0.0; + tmp16 += m_A34 * V[26]; + tmp16 += m_A35 * V[29]; + V[16] = (RHS16 - tmp16) / m_A33; + double tmp15 = 0.0; + tmp15 += m_A32 * V[26]; + V[15] = (RHS15 - tmp15) / m_A31; + double tmp14 = 0.0; + tmp14 += m_A30 * V[38]; + V[14] = (RHS14 - tmp14) / m_A29; + double tmp13 = 0.0; + tmp13 += m_A28 * V[31]; + V[13] = (RHS13 - tmp13) / m_A27; + double tmp12 = 0.0; + tmp12 += m_A26 * V[29]; + V[12] = (RHS12 - tmp12) / m_A25; + double tmp11 = 0.0; + tmp11 += m_A24 * V[34]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A22 * V[28]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + tmp9 += m_A20 * V[27]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[28]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A15 * V[25]; + tmp7 += m_A16 * V[28]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[33]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[24]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[23]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[37]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[21]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[32]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[20]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// 280zzzap +static void nl_gcr_95_double_double_24643c159711f292(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A5 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A6 += gt[17]; + m_A6 += gt[18]; + m_A6 += gt[19]; + m_A7 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A9 += go[20]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[21] * *cnV[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A11 += go[22]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A12 += gt[26]; + m_A12 += gt[27]; + m_A13 += go[24]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + m_A14 += gt[28]; + m_A14 += gt[29]; + m_A14 += gt[30]; + m_A14 += gt[31]; + m_A15 += go[28]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 -= go[29] * *cnV[29]; + RHS7 -= go[30] * *cnV[30]; + RHS7 -= go[31] * *cnV[31]; + m_A16 += gt[32]; + m_A16 += gt[33]; + m_A17 += go[32]; + double RHS8 = Idr[32]; + RHS8 += Idr[33]; + RHS8 -= go[33] * *cnV[33]; + m_A18 += gt[34]; + m_A18 += gt[35]; + m_A18 += gt[36]; + m_A18 += gt[37]; + m_A19 += go[34]; + double RHS9 = Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 -= go[35] * *cnV[35]; + RHS9 -= go[36] * *cnV[36]; + RHS9 -= go[37] * *cnV[37]; + m_A20 += gt[38]; + m_A20 += gt[39]; + m_A22 += go[38]; + m_A21 += go[39]; + double RHS10 = Idr[38]; + RHS10 += Idr[39]; + m_A23 += gt[40]; + m_A23 += gt[41]; + m_A23 += gt[42]; + m_A23 += gt[43]; + m_A24 += go[40]; + double RHS11 = Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 -= go[41] * *cnV[41]; + RHS11 -= go[42] * *cnV[42]; + RHS11 -= go[43] * *cnV[43]; + m_A25 += gt[44]; + m_A25 += gt[45]; + m_A25 += gt[46]; + m_A27 += go[44]; + m_A28 += go[45]; + m_A26 += go[46]; + double RHS12 = Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + m_A29 += gt[47]; + m_A29 += gt[48]; + m_A31 += go[47]; + m_A30 += go[48]; + double RHS13 = Idr[47]; + RHS13 += Idr[48]; + m_A37 += gt[49]; + m_A37 += gt[50]; + m_A37 += gt[51]; + m_A37 += gt[52]; + m_A37 += gt[53]; + m_A37 += gt[54]; + m_A36 += go[49]; + m_A35 += go[50]; + m_A34 += go[51]; + m_A33 += go[52]; + m_A32 += go[53]; + double RHS14 = Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 += Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 -= go[54] * *cnV[54]; + m_A39 += gt[55]; + m_A39 += gt[56]; + m_A39 += gt[57]; + m_A39 += gt[58]; + m_A38 += go[55]; + m_A40 += go[56]; + double RHS15 = Idr[55]; + RHS15 += Idr[56]; + RHS15 += Idr[57]; + RHS15 += Idr[58]; + RHS15 -= go[57] * *cnV[57]; + RHS15 -= go[58] * *cnV[58]; + m_A42 += gt[59]; + m_A42 += gt[60]; + m_A42 += gt[61]; + m_A42 += gt[62]; + m_A41 += go[59]; + m_A43 += go[60]; + double RHS16 = Idr[59]; + RHS16 += Idr[60]; + RHS16 += Idr[61]; + RHS16 += Idr[62]; + RHS16 -= go[61] * *cnV[61]; + RHS16 -= go[62] * *cnV[62]; + m_A45 += gt[63]; + m_A45 += gt[64]; + m_A45 += gt[65]; + m_A46 += go[63]; + m_A44 += go[64]; + double RHS17 = Idr[63]; + RHS17 += Idr[64]; + RHS17 += Idr[65]; + RHS17 -= go[65] * *cnV[65]; + m_A52 += gt[66]; + m_A52 += gt[67]; + m_A52 += gt[68]; + m_A52 += gt[69]; + m_A52 += gt[70]; + m_A52 += gt[71]; + m_A49 += go[66]; + m_A50 += go[67]; + m_A51 += go[68]; + m_A47 += go[69]; + m_A48 += go[70]; + double RHS18 = Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + RHS18 -= go[71] * *cnV[71]; + m_A59 += gt[72]; + m_A59 += gt[73]; + m_A57 += go[72]; + m_A62 += go[73]; + double RHS19 = Idr[72]; + RHS19 += Idr[73]; + m_A66 += gt[74]; + m_A66 += gt[75]; + m_A66 += gt[76]; + m_A66 += gt[77]; + m_A66 += gt[78]; + m_A66 += gt[79]; + m_A63 += go[74]; + m_A64 += go[75]; + m_A68 += go[76]; + m_A67 += go[77]; + double RHS20 = Idr[74]; + RHS20 += Idr[75]; + RHS20 += Idr[76]; + RHS20 += Idr[77]; + RHS20 += Idr[78]; + RHS20 += Idr[79]; + RHS20 -= go[78] * *cnV[78]; + RHS20 -= go[79] * *cnV[79]; + m_A73 += gt[80]; + m_A73 += gt[81]; + m_A73 += gt[82]; + m_A73 += gt[83]; + m_A72 += go[80]; + m_A71 += go[81]; + m_A69 += go[82]; + m_A70 += go[83]; + double RHS21 = Idr[80]; + RHS21 += Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + m_A80 += gt[84]; + m_A80 += gt[85]; + m_A80 += gt[86]; + m_A80 += gt[87]; + m_A80 += gt[88]; + m_A80 += gt[89]; + m_A80 += gt[90]; + m_A80 += gt[91]; + m_A80 += gt[92]; + m_A80 += gt[93]; + m_A80 += gt[94]; + m_A75 += go[84]; + m_A82 += go[85]; + m_A76 += go[86]; + double RHS22 = Idr[84]; + RHS22 += Idr[85]; + RHS22 += Idr[86]; + RHS22 += Idr[87]; + RHS22 += Idr[88]; + RHS22 += Idr[89]; + RHS22 += Idr[90]; + RHS22 += Idr[91]; + RHS22 += Idr[92]; + RHS22 += Idr[93]; + RHS22 += Idr[94]; + RHS22 -= go[87] * *cnV[87]; + RHS22 -= go[88] * *cnV[88]; + RHS22 -= go[89] * *cnV[89]; + RHS22 -= go[90] * *cnV[90]; + RHS22 -= go[91] * *cnV[91]; + RHS22 -= go[92] * *cnV[92]; + RHS22 -= go[93] * *cnV[93]; + RHS22 -= go[94] * *cnV[94]; + m_A88 += gt[95]; + m_A88 += gt[96]; + m_A88 += gt[97]; + m_A88 += gt[98]; + m_A88 += gt[99]; + m_A83 += go[95]; + m_A85 += go[96]; + m_A84 += go[97]; + m_A86 += go[98]; + double RHS23 = Idr[95]; + RHS23 += Idr[96]; + RHS23 += Idr[97]; + RHS23 += Idr[98]; + RHS23 += Idr[99]; + RHS23 -= go[99] * *cnV[99]; + m_A94 += gt[100]; + m_A94 += gt[101]; + m_A94 += gt[102]; + m_A91 += go[100]; + m_A89 += go[101]; + m_A92 += go[102]; + double RHS24 = Idr[100]; + RHS24 += Idr[101]; + RHS24 += Idr[102]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A38; + m_A40 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f0_21 = -f0 * m_A69; + m_A73 += m_A1 * f0_21; + RHS21 += f0_21 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_20 = -f1 * m_A63; + m_A65 += m_A3 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_16 = -f2 * m_A41; + m_A43 += m_A5 * f2_16; + RHS16 += f2_16 * RHS2; + const double f2_18 = -f2 * m_A47; + m_A52 += m_A5 * f2_18; + RHS18 += f2_18 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_22 = -f3 * m_A75; + m_A77 += m_A7 * f3_22; + RHS22 += f3_22 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_14 = -f4 * m_A32; + m_A37 += m_A9 * f4_14; + RHS14 += f4_14 * RHS4; + const double f4_21 = -f4 * m_A70; + m_A71 += m_A9 * f4_21; + RHS21 += f4_21 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_17 = -f5 * m_A44; + m_A45 += m_A11 * f5_17; + RHS17 += f5_17 * RHS5; + const double f5_18 = -f5 * m_A48; + m_A51 += m_A11 * f5_18; + RHS18 += f5_18 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_14 = -f6 * m_A33; + m_A37 += m_A13 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_14 = -f7 * m_A34; + m_A37 += m_A15 * f7_14; + RHS14 += f7_14 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_23 = -f8 * m_A83; + m_A88 += m_A17 * f8_23; + RHS23 += f8_23 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_14 = -f9 * m_A35; + m_A37 += m_A19 * f9_14; + RHS14 += f9_14 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_20 = -f10 * m_A64; + m_A66 += m_A21 * f10_20; + m_A68 += m_A22 * f10_20; + RHS20 += f10_20 * RHS10; + const double f10_23 = -f10 * m_A84; + m_A86 += m_A21 * f10_23; + m_A88 += m_A22 * f10_23; + RHS23 += f10_23 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_14 = -f11 * m_A36; + m_A37 += m_A24 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A25; + const double f12_18 = -f12 * m_A49; + m_A52 += m_A26 * f12_18; + m_A53 += m_A27 * f12_18; + m_A56 += m_A28 * f12_18; + RHS18 += f12_18 * RHS12; + const double f12_19 = -f12 * m_A57; + m_A58 += m_A26 * f12_19; + m_A59 += m_A27 * f12_19; + m_A62 += m_A28 * f12_19; + RHS19 += f12_19 * RHS12; + const double f12_24 = -f12 * m_A89; + m_A90 += m_A26 * f12_24; + m_A91 += m_A27 * f12_24; + m_A94 += m_A28 * f12_24; + RHS24 += f12_24 * RHS12; + const double f13 = 1.0 / m_A29; + const double f13_18 = -f13 * m_A50; + m_A52 += m_A30 * f13_18; + m_A54 += m_A31 * f13_18; + RHS18 += f13_18 * RHS13; + const double f13_22 = -f13 * m_A76; + m_A78 += m_A30 * f13_22; + m_A80 += m_A31 * f13_22; + RHS22 += f13_22 * RHS13; + const double f14 = 1.0 / m_A37; + const double f14_21 = -f14 * m_A71; + RHS21 += f14_21 * RHS14; + const double f15 = 1.0 / m_A39; + const double f15_20 = -f15 * m_A65; + m_A67 += m_A40 * f15_20; + RHS20 += f15_20 * RHS15; + const double f16 = 1.0 / m_A42; + const double f16_22 = -f16 * m_A77; + m_A78 += m_A43 * f16_22; + RHS22 += f16_22 * RHS16; + const double f17 = 1.0 / m_A45; + const double f17_18 = -f17 * m_A51; + m_A55 += m_A46 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_23 = -f17 * m_A85; + m_A88 += m_A46 * f17_23; + RHS23 += f17_23 * RHS17; + const double f18 = 1.0 / m_A52; + const double f18_19 = -f18 * m_A58; + m_A59 += m_A53 * f18_19; + m_A60 += m_A54 * f18_19; + m_A61 += m_A55 * f18_19; + m_A62 += m_A56 * f18_19; + RHS19 += f18_19 * RHS18; + const double f18_22 = -f18 * m_A78; + m_A79 += m_A53 * f18_22; + m_A80 += m_A54 * f18_22; + m_A81 += m_A55 * f18_22; + m_A82 += m_A56 * f18_22; + RHS22 += f18_22 * RHS18; + const double f18_24 = -f18 * m_A90; + m_A91 += m_A53 * f18_24; + m_A92 += m_A54 * f18_24; + m_A93 += m_A55 * f18_24; + m_A94 += m_A56 * f18_24; + RHS24 += f18_24 * RHS18; + const double f19 = 1.0 / m_A59; + const double f19_22 = -f19 * m_A79; + m_A80 += m_A60 * f19_22; + m_A81 += m_A61 * f19_22; + m_A82 += m_A62 * f19_22; + RHS22 += f19_22 * RHS19; + const double f19_24 = -f19 * m_A91; + m_A92 += m_A60 * f19_24; + m_A93 += m_A61 * f19_24; + m_A94 += m_A62 * f19_24; + RHS24 += f19_24 * RHS19; + const double f20 = 1.0 / m_A66; + const double f20_21 = -f20 * m_A72; + m_A73 += m_A67 * f20_21; + m_A74 += m_A68 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_23 = -f20 * m_A86; + m_A87 += m_A67 * f20_23; + m_A88 += m_A68 * f20_23; + RHS23 += f20_23 * RHS20; + const double f21 = 1.0 / m_A73; + const double f21_23 = -f21 * m_A87; + m_A88 += m_A74 * f21_23; + RHS23 += f21_23 * RHS21; + const double f22 = 1.0 / m_A80; + const double f22_24 = -f22 * m_A92; + m_A93 += m_A81 * f22_24; + m_A94 += m_A82 * f22_24; + RHS24 += f22_24 * RHS22; + const double f23 = 1.0 / m_A88; + const double f23_24 = -f23 * m_A93; + RHS24 += f23_24 * RHS23; + V[24] = RHS24 / m_A94; + double tmp23 = 0.0; + V[23] = (RHS23 - tmp23) / m_A88; + double tmp22 = 0.0; + tmp22 += m_A81 * V[23]; + tmp22 += m_A82 * V[24]; + V[22] = (RHS22 - tmp22) / m_A80; + double tmp21 = 0.0; + tmp21 += m_A74 * V[23]; + V[21] = (RHS21 - tmp21) / m_A73; + double tmp20 = 0.0; + tmp20 += m_A67 * V[21]; + tmp20 += m_A68 * V[23]; + V[20] = (RHS20 - tmp20) / m_A66; + double tmp19 = 0.0; + tmp19 += m_A60 * V[22]; + tmp19 += m_A61 * V[23]; + tmp19 += m_A62 * V[24]; + V[19] = (RHS19 - tmp19) / m_A59; + double tmp18 = 0.0; + tmp18 += m_A53 * V[19]; + tmp18 += m_A54 * V[22]; + tmp18 += m_A55 * V[23]; + tmp18 += m_A56 * V[24]; + V[18] = (RHS18 - tmp18) / m_A52; + double tmp17 = 0.0; + tmp17 += m_A46 * V[23]; + V[17] = (RHS17 - tmp17) / m_A45; + double tmp16 = 0.0; + tmp16 += m_A43 * V[18]; + V[16] = (RHS16 - tmp16) / m_A42; + double tmp15 = 0.0; + tmp15 += m_A40 * V[21]; + V[15] = (RHS15 - tmp15) / m_A39; + double tmp14 = 0.0; + V[14] = (RHS14 - tmp14) / m_A37; + double tmp13 = 0.0; + tmp13 += m_A30 * V[18]; + tmp13 += m_A31 * V[22]; + V[13] = (RHS13 - tmp13) / m_A29; + double tmp12 = 0.0; + tmp12 += m_A26 * V[18]; + tmp12 += m_A27 * V[19]; + tmp12 += m_A28 * V[24]; + V[12] = (RHS12 - tmp12) / m_A25; + double tmp11 = 0.0; + tmp11 += m_A24 * V[14]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A21 * V[20]; + tmp10 += m_A22 * V[23]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[14]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[23]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[14]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[14]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[17]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[14]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[16]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[18]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[21]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// armora +static void nl_gcr_22_double_double_a6cfda6668b153c2(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A7 += go[6]; + m_A6 += go[7]; + m_A6 += go[8]; + m_A5 += go[9]; + m_A5 += go[10]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A9 += go[14]; + m_A9 += go[15]; + m_A8 += go[16]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A16 += go[20]; + m_A16 += go[21]; + m_A13 += go[22]; + m_A13 += go[23]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 -= go[24] * *cnV[24]; + m_A21 += gt[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A20 += go[25]; + m_A20 += go[26]; + m_A18 += go[27]; + m_A17 += go[28]; + double RHS5 = Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A17; + m_A21 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A9; + m_A10 += m_A5 * f2_3; + m_A11 += m_A6 * f2_3; + m_A12 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_4 = -f2 * m_A13; + m_A14 += m_A5 * f2_4; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A18; + m_A19 += m_A5 * f2_5; + m_A20 += m_A6 * f2_5; + m_A21 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + m_A16 += m_A12 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A19; + m_A20 += m_A11 * f3_5; + m_A21 += m_A12 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A20; + m_A21 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A21; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + tmp3 += m_A12 * V[5]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// armora,boxingb +static void nl_gcr_45_double_double_d27a39bc93616187(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A5 += go[4]; + m_A4 += go[5]; + m_A4 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[12]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + RHS2 -= go[15] * *cnV[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A10 += go[16]; + m_A9 += go[17]; + double RHS3 = Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[18] * *cnV[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A11 += gt[23]; + m_A11 += gt[24]; + m_A11 += gt[25]; + m_A11 += gt[26]; + m_A14 += go[19]; + m_A13 += go[20]; + m_A13 += go[21]; + m_A12 += go[22]; + m_A12 += go[23]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 += Idr[26]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + RHS4 -= go[26] * *cnV[26]; + m_A17 += gt[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A17 += gt[30]; + m_A17 += gt[31]; + m_A17 += gt[32]; + m_A16 += go[27]; + m_A16 += go[28]; + m_A15 += go[29]; + double RHS5 = Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 += Idr[30]; + RHS5 += Idr[31]; + RHS5 += Idr[32]; + RHS5 -= go[30] * *cnV[30]; + RHS5 -= go[31] * *cnV[31]; + RHS5 -= go[32] * *cnV[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A22 += gt[37]; + m_A22 += gt[38]; + m_A21 += go[33]; + m_A21 += go[34]; + m_A20 += go[35]; + double RHS6 = Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 += Idr[36]; + RHS6 += Idr[37]; + RHS6 += Idr[38]; + RHS6 -= go[36] * *cnV[36]; + RHS6 -= go[37] * *cnV[37]; + RHS6 -= go[38] * *cnV[38]; + m_A27 += gt[39]; + m_A27 += gt[40]; + m_A27 += gt[41]; + m_A27 += gt[42]; + m_A27 += gt[43]; + m_A28 += go[39]; + m_A28 += go[40]; + m_A25 += go[41]; + m_A25 += go[42]; + double RHS7 = Idr[39]; + RHS7 += Idr[40]; + RHS7 += Idr[41]; + RHS7 += Idr[42]; + RHS7 += Idr[43]; + RHS7 -= go[43] * *cnV[43]; + m_A31 += gt[44]; + m_A31 += gt[45]; + m_A31 += gt[46]; + m_A31 += gt[47]; + m_A31 += gt[48]; + m_A32 += go[44]; + m_A32 += go[45]; + m_A29 += go[46]; + m_A29 += go[47]; + double RHS8 = Idr[44]; + RHS8 += Idr[45]; + RHS8 += Idr[46]; + RHS8 += Idr[47]; + RHS8 += Idr[48]; + RHS8 -= go[48] * *cnV[48]; + m_A37 += gt[49]; + m_A37 += gt[50]; + m_A37 += gt[51]; + m_A37 += gt[52]; + m_A37 += gt[53]; + m_A34 += go[49]; + m_A36 += go[50]; + m_A36 += go[51]; + m_A33 += go[52]; + double RHS9 = Idr[49]; + RHS9 += Idr[50]; + RHS9 += Idr[51]; + RHS9 += Idr[52]; + RHS9 += Idr[53]; + RHS9 -= go[53] * *cnV[53]; + m_A44 += gt[54]; + m_A44 += gt[55]; + m_A44 += gt[56]; + m_A44 += gt[57]; + m_A44 += gt[58]; + m_A42 += go[54]; + m_A42 += go[55]; + m_A40 += go[56]; + m_A39 += go[57]; + double RHS10 = Idr[54]; + RHS10 += Idr[55]; + RHS10 += Idr[56]; + RHS10 += Idr[57]; + RHS10 += Idr[58]; + RHS10 -= go[58] * *cnV[58]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A15; + m_A17 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A16; + m_A17 += m_A3 * f1_5; + m_A18 += m_A4 * f1_5; + m_A19 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_7 = -f1 * m_A25; + m_A26 += m_A3 * f1_7; + m_A27 += m_A4 * f1_7; + m_A28 += m_A5 * f1_7; + RHS7 += f1_7 * RHS1; + const double f1_9 = -f1 * m_A33; + m_A35 += m_A3 * f1_9; + m_A36 += m_A4 * f1_9; + m_A37 += m_A5 * f1_9; + RHS9 += f1_9 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_6 = -f2 * m_A20; + m_A22 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_9 = -f3 * m_A34; + m_A37 += m_A9 * f3_9; + m_A38 += m_A10 * f3_9; + RHS9 += f3_9 * RHS3; + const double f3_10 = -f3 * m_A39; + m_A43 += m_A9 * f3_10; + m_A44 += m_A10 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_6 = -f4 * m_A21; + m_A22 += m_A12 * f4_6; + m_A23 += m_A13 * f4_6; + m_A24 += m_A14 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_8 = -f4 * m_A29; + m_A30 += m_A12 * f4_8; + m_A31 += m_A13 * f4_8; + m_A32 += m_A14 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_10 = -f4 * m_A40; + m_A41 += m_A12 * f4_10; + m_A42 += m_A13 * f4_10; + m_A44 += m_A14 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_7 = -f5 * m_A26; + m_A27 += m_A18 * f5_7; + m_A28 += m_A19 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_9 = -f5 * m_A35; + m_A36 += m_A18 * f5_9; + m_A37 += m_A19 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A22; + const double f6_8 = -f6 * m_A30; + m_A31 += m_A23 * f6_8; + m_A32 += m_A24 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_10 = -f6 * m_A41; + m_A42 += m_A23 * f6_10; + m_A44 += m_A24 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A27; + const double f7_9 = -f7 * m_A36; + m_A37 += m_A28 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A31; + const double f8_10 = -f8 * m_A42; + m_A44 += m_A32 * f8_10; + RHS10 += f8_10 * RHS8; + const double f9 = 1.0 / m_A37; + const double f9_10 = -f9 * m_A43; + m_A44 += m_A38 * f9_10; + RHS10 += f9_10 * RHS9; + V[10] = RHS10 / m_A44; + double tmp9 = 0.0; + tmp9 += m_A38 * V[10]; + V[9] = (RHS9 - tmp9) / m_A37; + double tmp8 = 0.0; + tmp8 += m_A32 * V[10]; + V[8] = (RHS8 - tmp8) / m_A31; + double tmp7 = 0.0; + tmp7 += m_A28 * V[9]; + V[7] = (RHS7 - tmp7) / m_A27; + double tmp6 = 0.0; + tmp6 += m_A23 * V[8]; + tmp6 += m_A24 * V[10]; + V[6] = (RHS6 - tmp6) / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[7]; + tmp5 += m_A19 * V[9]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A12 * V[6]; + tmp4 += m_A13 * V[8]; + tmp4 += m_A14 * V[10]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[9]; + tmp3 += m_A10 * V[10]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[6]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + tmp1 += m_A4 * V[7]; + tmp1 += m_A5 * V[9]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// armora +static void nl_gcr_56_double_double_afcde432efdafb81(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A11 += go[22]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A14 += go[24]; + m_A13 += go[25]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A17 += go[26]; + m_A16 += go[27]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + m_A18 += gt[28]; + m_A18 += gt[29]; + m_A20 += go[28]; + m_A19 += go[29]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + m_A21 += gt[30]; + m_A21 += gt[31]; + m_A21 += gt[32]; + m_A21 += gt[33]; + m_A21 += gt[34]; + m_A21 += gt[35]; + m_A21 += gt[36]; + m_A22 += go[30]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 -= go[31] * *cnV[31]; + RHS9 -= go[32] * *cnV[32]; + RHS9 -= go[33] * *cnV[33]; + RHS9 -= go[34] * *cnV[34]; + RHS9 -= go[35] * *cnV[35]; + RHS9 -= go[36] * *cnV[36]; + m_A25 += gt[37]; + m_A25 += gt[38]; + m_A25 += gt[39]; + m_A24 += go[37]; + m_A23 += go[38]; + double RHS10 = Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 -= go[39] * *cnV[39]; + m_A28 += gt[40]; + m_A28 += gt[41]; + m_A28 += gt[42]; + m_A28 += gt[43]; + m_A28 += gt[44]; + m_A28 += gt[45]; + m_A28 += gt[46]; + m_A29 += go[40]; + m_A27 += go[41]; + double RHS11 = Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 += Idr[46]; + RHS11 -= go[42] * *cnV[42]; + RHS11 -= go[43] * *cnV[43]; + RHS11 -= go[44] * *cnV[44]; + RHS11 -= go[45] * *cnV[45]; + RHS11 -= go[46] * *cnV[46]; + m_A31 += gt[47]; + m_A31 += gt[48]; + m_A32 += go[47]; + m_A30 += go[48]; + double RHS12 = Idr[47]; + RHS12 += Idr[48]; + m_A37 += gt[49]; + m_A37 += gt[50]; + m_A37 += gt[51]; + m_A37 += gt[52]; + m_A37 += gt[53]; + m_A36 += go[49]; + m_A35 += go[50]; + m_A34 += go[51]; + m_A33 += go[52]; + double RHS13 = Idr[49]; + RHS13 += Idr[50]; + RHS13 += Idr[51]; + RHS13 += Idr[52]; + RHS13 += Idr[53]; + RHS13 -= go[53] * *cnV[53]; + m_A42 += gt[54]; + m_A42 += gt[55]; + m_A42 += gt[56]; + m_A42 += gt[57]; + m_A42 += gt[58]; + m_A41 += go[54]; + m_A40 += go[55]; + m_A39 += go[56]; + double RHS14 = Idr[54]; + RHS14 += Idr[55]; + RHS14 += Idr[56]; + RHS14 += Idr[57]; + RHS14 += Idr[58]; + RHS14 -= go[57] * *cnV[57]; + RHS14 -= go[58] * *cnV[58]; + m_A45 += gt[59]; + m_A45 += gt[60]; + m_A45 += gt[61]; + m_A45 += gt[62]; + m_A44 += go[59]; + m_A46 += go[60]; + double RHS15 = Idr[59]; + RHS15 += Idr[60]; + RHS15 += Idr[61]; + RHS15 += Idr[62]; + RHS15 -= go[61] * *cnV[61]; + RHS15 -= go[62] * *cnV[62]; + m_A55 += gt[63]; + m_A55 += gt[64]; + m_A55 += gt[65]; + m_A55 += gt[66]; + m_A55 += gt[67]; + m_A55 += gt[68]; + m_A54 += go[63]; + m_A49 += go[64]; + m_A51 += go[65]; + m_A48 += go[66]; + m_A47 += go[67]; + double RHS16 = Idr[63]; + RHS16 += Idr[64]; + RHS16 += Idr[65]; + RHS16 += Idr[66]; + RHS16 += Idr[67]; + RHS16 += Idr[68]; + RHS16 -= go[68] * *cnV[68]; + const double f0 = 1.0 / m_A0; + const double f0_10 = -f0 * m_A23; + m_A25 += m_A1 * f0_10; + RHS10 += f0_10 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_13 = -f1 * m_A33; + m_A37 += m_A3 * f1_13; + RHS13 += f1_13 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_13 = -f2 * m_A34; + m_A37 += m_A5 * f2_13; + RHS13 += f2_13 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_13 = -f3 * m_A35; + m_A37 += m_A7 * f3_13; + RHS13 += f3_13 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_11 = -f4 * m_A27; + m_A29 += m_A9 * f4_11; + RHS11 += f4_11 * RHS4; + const double f4_14 = -f4 * m_A39; + m_A42 += m_A9 * f4_14; + RHS14 += f4_14 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_12 = -f5 * m_A30; + m_A31 += m_A11 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_10 = -f6 * m_A24; + m_A25 += m_A13 * f6_10; + m_A26 += m_A14 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_16 = -f6 * m_A47; + m_A50 += m_A13 * f6_16; + m_A55 += m_A14 * f6_16; + RHS16 += f6_16 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_13 = -f7 * m_A36; + m_A37 += m_A16 * f7_13; + m_A38 += m_A17 * f7_13; + RHS13 += f7_13 * RHS7; + const double f7_16 = -f7 * m_A48; + m_A52 += m_A16 * f7_16; + m_A55 += m_A17 * f7_16; + RHS16 += f7_16 * RHS7; + const double f8 = 1.0 / m_A18; + const double f8_14 = -f8 * m_A40; + m_A42 += m_A19 * f8_14; + m_A43 += m_A20 * f8_14; + RHS14 += f8_14 * RHS8; + const double f8_16 = -f8 * m_A49; + m_A53 += m_A19 * f8_16; + m_A55 += m_A20 * f8_16; + RHS16 += f8_16 * RHS8; + const double f9 = 1.0 / m_A21; + const double f9_15 = -f9 * m_A44; + m_A46 += m_A22 * f9_15; + RHS15 += f9_15 * RHS9; + const double f10 = 1.0 / m_A25; + const double f10_16 = -f10 * m_A50; + m_A55 += m_A26 * f10_16; + RHS16 += f10_16 * RHS10; + const double f11 = 1.0 / m_A28; + const double f11_14 = -f11 * m_A41; + m_A42 += m_A29 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A31; + const double f12_16 = -f12 * m_A51; + m_A55 += m_A32 * f12_16; + RHS16 += f12_16 * RHS12; + const double f13 = 1.0 / m_A37; + const double f13_16 = -f13 * m_A52; + m_A55 += m_A38 * f13_16; + RHS16 += f13_16 * RHS13; + const double f14 = 1.0 / m_A42; + const double f14_16 = -f14 * m_A53; + m_A55 += m_A43 * f14_16; + RHS16 += f14_16 * RHS14; + const double f15 = 1.0 / m_A45; + const double f15_16 = -f15 * m_A54; + m_A55 += m_A46 * f15_16; + RHS16 += f15_16 * RHS15; + V[16] = RHS16 / m_A55; + double tmp15 = 0.0; + tmp15 += m_A46 * V[16]; + V[15] = (RHS15 - tmp15) / m_A45; + double tmp14 = 0.0; + tmp14 += m_A43 * V[16]; + V[14] = (RHS14 - tmp14) / m_A42; + double tmp13 = 0.0; + tmp13 += m_A38 * V[16]; + V[13] = (RHS13 - tmp13) / m_A37; + double tmp12 = 0.0; + tmp12 += m_A32 * V[16]; + V[12] = (RHS12 - tmp12) / m_A31; + double tmp11 = 0.0; + tmp11 += m_A29 * V[14]; + V[11] = (RHS11 - tmp11) / m_A28; + double tmp10 = 0.0; + tmp10 += m_A26 * V[16]; + V[10] = (RHS10 - tmp10) / m_A25; + double tmp9 = 0.0; + tmp9 += m_A22 * V[16]; + V[9] = (RHS9 - tmp9) / m_A21; + double tmp8 = 0.0; + tmp8 += m_A19 * V[14]; + tmp8 += m_A20 * V[16]; + V[8] = (RHS8 - tmp8) / m_A18; + double tmp7 = 0.0; + tmp7 += m_A16 * V[13]; + tmp7 += m_A17 * V[16]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A13 * V[10]; + tmp6 += m_A14 * V[16]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[12]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[14]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[13]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[13]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[13]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[10]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// armora +static void nl_gcr_58_double_double_64e460d8f716cd89(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[4]; + m_A3 += go[5]; + m_A3 += go[6]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A6 += go[10]; + m_A6 += go[11]; + m_A7 += go[12]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A9 += go[14]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A12 += go[18]; + m_A11 += go[19]; + m_A11 += go[20]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + m_A13 += gt[24]; + m_A13 += gt[25]; + m_A13 += gt[26]; + m_A13 += gt[27]; + m_A14 += go[24]; + m_A14 += go[25]; + m_A15 += go[26]; + double RHS5 = Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 -= go[27] * *cnV[27]; + m_A16 += gt[28]; + m_A16 += gt[29]; + m_A16 += gt[30]; + m_A16 += gt[31]; + m_A16 += gt[32]; + m_A16 += gt[33]; + m_A17 += go[28]; + double RHS6 = Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + RHS6 -= go[31] * *cnV[31]; + RHS6 -= go[32] * *cnV[32]; + RHS6 -= go[33] * *cnV[33]; + m_A18 += gt[34]; + m_A18 += gt[35]; + m_A18 += gt[36]; + m_A18 += gt[37]; + m_A18 += gt[38]; + m_A18 += gt[39]; + m_A20 += go[34]; + m_A19 += go[35]; + m_A19 += go[36]; + double RHS7 = Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 += Idr[38]; + RHS7 += Idr[39]; + RHS7 -= go[37] * *cnV[37]; + RHS7 -= go[38] * *cnV[38]; + RHS7 -= go[39] * *cnV[39]; + m_A21 += gt[40]; + m_A21 += gt[41]; + m_A21 += gt[42]; + m_A21 += gt[43]; + m_A23 += go[40]; + m_A23 += go[41]; + m_A22 += go[42]; + double RHS8 = Idr[40]; + RHS8 += Idr[41]; + RHS8 += Idr[42]; + RHS8 += Idr[43]; + RHS8 -= go[43] * *cnV[43]; + m_A26 += gt[44]; + m_A26 += gt[45]; + m_A26 += gt[46]; + m_A26 += gt[47]; + m_A26 += gt[48]; + m_A26 += gt[49]; + m_A25 += go[44]; + m_A25 += go[45]; + m_A24 += go[46]; + double RHS9 = Idr[44]; + RHS9 += Idr[45]; + RHS9 += Idr[46]; + RHS9 += Idr[47]; + RHS9 += Idr[48]; + RHS9 += Idr[49]; + RHS9 -= go[47] * *cnV[47]; + RHS9 -= go[48] * *cnV[48]; + RHS9 -= go[49] * *cnV[49]; + m_A31 += gt[50]; + m_A31 += gt[51]; + m_A31 += gt[52]; + m_A31 += gt[53]; + m_A31 += gt[54]; + m_A29 += go[50]; + m_A29 += go[51]; + m_A28 += go[52]; + double RHS10 = Idr[50]; + RHS10 += Idr[51]; + RHS10 += Idr[52]; + RHS10 += Idr[53]; + RHS10 += Idr[54]; + RHS10 -= go[53] * *cnV[53]; + RHS10 -= go[54] * *cnV[54]; + m_A35 += gt[55]; + m_A35 += gt[56]; + m_A35 += gt[57]; + m_A35 += gt[58]; + m_A35 += gt[59]; + m_A35 += gt[60]; + m_A34 += go[55]; + m_A34 += go[56]; + m_A33 += go[57]; + double RHS11 = Idr[55]; + RHS11 += Idr[56]; + RHS11 += Idr[57]; + RHS11 += Idr[58]; + RHS11 += Idr[59]; + RHS11 += Idr[60]; + RHS11 -= go[58] * *cnV[58]; + RHS11 -= go[59] * *cnV[59]; + RHS11 -= go[60] * *cnV[60]; + m_A40 += gt[61]; + m_A40 += gt[62]; + m_A40 += gt[63]; + m_A40 += gt[64]; + m_A40 += gt[65]; + m_A38 += go[61]; + m_A38 += go[62]; + m_A37 += go[63]; + double RHS12 = Idr[61]; + RHS12 += Idr[62]; + RHS12 += Idr[63]; + RHS12 += Idr[64]; + RHS12 += Idr[65]; + RHS12 -= go[64] * *cnV[64]; + RHS12 -= go[65] * *cnV[65]; + m_A44 += gt[66]; + m_A44 += gt[67]; + m_A44 += gt[68]; + m_A44 += gt[69]; + m_A44 += gt[70]; + m_A44 += gt[71]; + m_A43 += go[66]; + m_A43 += go[67]; + m_A42 += go[68]; + double RHS13 = Idr[66]; + RHS13 += Idr[67]; + RHS13 += Idr[68]; + RHS13 += Idr[69]; + RHS13 += Idr[70]; + RHS13 += Idr[71]; + RHS13 -= go[69] * *cnV[69]; + RHS13 -= go[70] * *cnV[70]; + RHS13 -= go[71] * *cnV[71]; + m_A51 += gt[72]; + m_A51 += gt[73]; + m_A51 += gt[74]; + m_A51 += gt[75]; + m_A51 += gt[76]; + m_A51 += gt[77]; + m_A48 += go[72]; + m_A47 += go[73]; + m_A46 += go[74]; + double RHS14 = Idr[72]; + RHS14 += Idr[73]; + RHS14 += Idr[74]; + RHS14 += Idr[75]; + RHS14 += Idr[76]; + RHS14 += Idr[77]; + RHS14 -= go[75] * *cnV[75]; + RHS14 -= go[76] * *cnV[76]; + RHS14 -= go[77] * *cnV[77]; + m_A57 += gt[78]; + m_A57 += gt[79]; + m_A57 += gt[80]; + m_A57 += gt[81]; + m_A57 += gt[82]; + m_A54 += go[78]; + m_A54 += go[79]; + m_A53 += go[80]; + double RHS15 = Idr[78]; + RHS15 += Idr[79]; + RHS15 += Idr[80]; + RHS15 += Idr[81]; + RHS15 += Idr[82]; + RHS15 -= go[81] * *cnV[81]; + RHS15 -= go[82] * *cnV[82]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A24; + m_A26 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_9 = -f1 * m_A25; + m_A26 += m_A3 * f1_9; + m_A27 += m_A4 * f1_9; + RHS9 += f1_9 * RHS1; + const double f1_10 = -f1 * m_A28; + m_A30 += m_A3 * f1_10; + m_A31 += m_A4 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_10 = -f2 * m_A29; + m_A31 += m_A6 * f2_10; + m_A32 += m_A7 * f2_10; + RHS10 += f2_10 * RHS2; + const double f2_14 = -f2 * m_A46; + m_A49 += m_A6 * f2_14; + m_A51 += m_A7 * f2_14; + RHS14 += f2_14 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_11 = -f3 * m_A33; + m_A35 += m_A9 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_11 = -f4 * m_A34; + m_A35 += m_A11 * f4_11; + m_A36 += m_A12 * f4_11; + RHS11 += f4_11 * RHS4; + const double f4_12 = -f4 * m_A37; + m_A39 += m_A11 * f4_12; + m_A40 += m_A12 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_12 = -f5 * m_A38; + m_A40 += m_A14 * f5_12; + m_A41 += m_A15 * f5_12; + RHS12 += f5_12 * RHS5; + const double f5_14 = -f5 * m_A47; + m_A50 += m_A14 * f5_14; + m_A51 += m_A15 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_13 = -f6 * m_A42; + m_A44 += m_A17 * f6_13; + RHS13 += f6_13 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_13 = -f7 * m_A43; + m_A44 += m_A19 * f7_13; + m_A45 += m_A20 * f7_13; + RHS13 += f7_13 * RHS7; + const double f7_15 = -f7 * m_A53; + m_A55 += m_A19 * f7_15; + m_A57 += m_A20 * f7_15; + RHS15 += f7_15 * RHS7; + const double f8 = 1.0 / m_A21; + const double f8_14 = -f8 * m_A48; + m_A51 += m_A22 * f8_14; + m_A52 += m_A23 * f8_14; + RHS14 += f8_14 * RHS8; + const double f8_15 = -f8 * m_A54; + m_A56 += m_A22 * f8_15; + m_A57 += m_A23 * f8_15; + RHS15 += f8_15 * RHS8; + const double f9 = 1.0 / m_A26; + const double f9_10 = -f9 * m_A30; + m_A31 += m_A27 * f9_10; + RHS10 += f9_10 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_14 = -f10 * m_A49; + m_A51 += m_A32 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A35; + const double f11_12 = -f11 * m_A39; + m_A40 += m_A36 * f11_12; + RHS12 += f11_12 * RHS11; + const double f12 = 1.0 / m_A40; + const double f12_14 = -f12 * m_A50; + m_A51 += m_A41 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A44; + const double f13_15 = -f13 * m_A55; + m_A57 += m_A45 * f13_15; + RHS15 += f13_15 * RHS13; + const double f14 = 1.0 / m_A51; + const double f14_15 = -f14 * m_A56; + m_A57 += m_A52 * f14_15; + RHS15 += f14_15 * RHS14; + V[15] = RHS15 / m_A57; + double tmp14 = 0.0; + tmp14 += m_A52 * V[15]; + V[14] = (RHS14 - tmp14) / m_A51; + double tmp13 = 0.0; + tmp13 += m_A45 * V[15]; + V[13] = (RHS13 - tmp13) / m_A44; + double tmp12 = 0.0; + tmp12 += m_A41 * V[14]; + V[12] = (RHS12 - tmp12) / m_A40; + double tmp11 = 0.0; + tmp11 += m_A36 * V[12]; + V[11] = (RHS11 - tmp11) / m_A35; + double tmp10 = 0.0; + tmp10 += m_A32 * V[14]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A27 * V[10]; + V[9] = (RHS9 - tmp9) / m_A26; + double tmp8 = 0.0; + tmp8 += m_A22 * V[14]; + tmp8 += m_A23 * V[15]; + V[8] = (RHS8 - tmp8) / m_A21; + double tmp7 = 0.0; + tmp7 += m_A19 * V[13]; + tmp7 += m_A20 * V[15]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A17 * V[13]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[12]; + tmp5 += m_A15 * V[14]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[11]; + tmp4 += m_A12 * V[12]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[11]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[10]; + tmp2 += m_A7 * V[14]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[9]; + tmp1 += m_A4 * V[10]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// armora +static void nl_gcr_67_double_double_ee2cacaa15d32491(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A12 += go[10]; + m_A11 += go[11]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 += Idr[12]; + RHS5 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A15 += go[13]; + m_A14 += go[14]; + double RHS6 = Idr[13]; + RHS6 += Idr[14]; + RHS6 += Idr[15]; + RHS6 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A18 += go[16]; + m_A17 += go[17]; + double RHS7 = Idr[16]; + RHS7 += Idr[17]; + RHS7 += Idr[18]; + RHS7 -= go[18] * *cnV[18]; + m_A19 += gt[19]; + m_A19 += gt[20]; + m_A19 += gt[21]; + m_A19 += gt[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A21 += go[19]; + m_A20 += go[20]; + double RHS8 = Idr[19]; + RHS8 += Idr[20]; + RHS8 += Idr[21]; + RHS8 += Idr[22]; + RHS8 += Idr[23]; + RHS8 += Idr[24]; + RHS8 += Idr[25]; + RHS8 -= go[21] * *cnV[21]; + RHS8 -= go[22] * *cnV[22]; + RHS8 -= go[23] * *cnV[23]; + RHS8 -= go[24] * *cnV[24]; + RHS8 -= go[25] * *cnV[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A23 += go[26]; + m_A24 += go[27]; + double RHS9 = Idr[26]; + RHS9 += Idr[27]; + RHS9 += Idr[28]; + RHS9 -= go[28] * *cnV[28]; + m_A26 += gt[29]; + m_A26 += gt[30]; + m_A26 += gt[31]; + m_A27 += go[29]; + m_A25 += go[30]; + double RHS10 = Idr[29]; + RHS10 += Idr[30]; + RHS10 += Idr[31]; + RHS10 -= go[31] * *cnV[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A29 += go[32]; + m_A28 += go[33]; + double RHS11 = Idr[32]; + RHS11 += Idr[33]; + RHS11 += Idr[34]; + RHS11 -= go[34] * *cnV[34]; + m_A33 += gt[35]; + m_A33 += gt[36]; + m_A33 += gt[37]; + m_A34 += go[35]; + m_A32 += go[36]; + double RHS12 = Idr[35]; + RHS12 += Idr[36]; + RHS12 += Idr[37]; + RHS12 -= go[37] * *cnV[37]; + m_A37 += gt[38]; + m_A37 += gt[39]; + m_A37 += gt[40]; + m_A36 += go[38]; + m_A35 += go[39]; + double RHS13 = Idr[38]; + RHS13 += Idr[39]; + RHS13 += Idr[40]; + RHS13 -= go[40] * *cnV[40]; + m_A41 += gt[41]; + m_A41 += gt[42]; + m_A41 += gt[43]; + m_A39 += go[41]; + m_A42 += go[42]; + double RHS14 = Idr[41]; + RHS14 += Idr[42]; + RHS14 += Idr[43]; + RHS14 -= go[43] * *cnV[43]; + m_A45 += gt[44]; + m_A45 += gt[45]; + m_A45 += gt[46]; + m_A44 += go[44]; + m_A43 += go[45]; + double RHS15 = Idr[44]; + RHS15 += Idr[45]; + RHS15 += Idr[46]; + RHS15 -= go[46] * *cnV[46]; + m_A49 += gt[47]; + m_A49 += gt[48]; + m_A49 += gt[49]; + m_A47 += go[47]; + m_A50 += go[48]; + double RHS16 = Idr[47]; + RHS16 += Idr[48]; + RHS16 += Idr[49]; + RHS16 -= go[49] * *cnV[49]; + m_A53 += gt[50]; + m_A53 += gt[51]; + m_A53 += gt[52]; + m_A51 += go[50]; + m_A52 += go[51]; + double RHS17 = Idr[50]; + RHS17 += Idr[51]; + RHS17 += Idr[52]; + RHS17 -= go[52] * *cnV[52]; + m_A57 += gt[53]; + m_A57 += gt[54]; + m_A57 += gt[55]; + m_A55 += go[53]; + m_A58 += go[54]; + double RHS18 = Idr[53]; + RHS18 += Idr[54]; + RHS18 += Idr[55]; + RHS18 -= go[55] * *cnV[55]; + m_A66 += gt[56]; + m_A66 += gt[57]; + m_A66 += gt[58]; + m_A66 += gt[59]; + m_A66 += gt[60]; + m_A66 += gt[61]; + m_A66 += gt[62]; + m_A66 += gt[63]; + m_A59 += go[56]; + m_A60 += go[57]; + m_A65 += go[58]; + m_A63 += go[59]; + m_A62 += go[60]; + m_A61 += go[61]; + double RHS19 = Idr[56]; + RHS19 += Idr[57]; + RHS19 += Idr[58]; + RHS19 += Idr[59]; + RHS19 += Idr[60]; + RHS19 += Idr[61]; + RHS19 += Idr[62]; + RHS19 += Idr[63]; + RHS19 -= go[62] * *cnV[62]; + RHS19 -= go[63] * *cnV[63]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A28; + m_A30 += m_A1 * f0_11; + RHS11 += f0_11 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_13 = -f1 * m_A35; + m_A37 += m_A3 * f1_13; + RHS13 += f1_13 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_15 = -f2 * m_A43; + m_A45 += m_A5 * f2_15; + RHS15 += f2_15 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_10 = -f3 * m_A25; + m_A26 += m_A7 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_12 = -f4 * m_A32; + m_A33 += m_A9 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_11 = -f5 * m_A29; + m_A30 += m_A11 * f5_11; + m_A31 += m_A12 * f5_11; + RHS11 += f5_11 * RHS5; + const double f5_14 = -f5 * m_A39; + m_A40 += m_A11 * f5_14; + m_A41 += m_A12 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_13 = -f6 * m_A36; + m_A37 += m_A14 * f6_13; + m_A38 += m_A15 * f6_13; + RHS13 += f6_13 * RHS6; + const double f6_16 = -f6 * m_A47; + m_A48 += m_A14 * f6_16; + m_A49 += m_A15 * f6_16; + RHS16 += f6_16 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_15 = -f7 * m_A44; + m_A45 += m_A17 * f7_15; + m_A46 += m_A18 * f7_15; + RHS15 += f7_15 * RHS7; + const double f7_18 = -f7 * m_A55; + m_A56 += m_A17 * f7_18; + m_A57 += m_A18 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_19 = -f8 * m_A59; + m_A61 += m_A20 * f8_19; + m_A66 += m_A21 * f8_19; + RHS19 += f8_19 * RHS8; + const double f9 = 1.0 / m_A22; + const double f9_17 = -f9 * m_A51; + m_A53 += m_A23 * f9_17; + m_A54 += m_A24 * f9_17; + RHS17 += f9_17 * RHS9; + const double f9_19 = -f9 * m_A60; + m_A64 += m_A23 * f9_19; + m_A66 += m_A24 * f9_19; + RHS19 += f9_19 * RHS9; + const double f10 = 1.0 / m_A26; + const double f10_19 = -f10 * m_A61; + m_A66 += m_A27 * f10_19; + RHS19 += f10_19 * RHS10; + const double f11 = 1.0 / m_A30; + const double f11_14 = -f11 * m_A40; + m_A41 += m_A31 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A33; + const double f12_17 = -f12 * m_A52; + m_A53 += m_A34 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A37; + const double f13_16 = -f13 * m_A48; + m_A49 += m_A38 * f13_16; + RHS16 += f13_16 * RHS13; + const double f14 = 1.0 / m_A41; + const double f14_19 = -f14 * m_A62; + m_A66 += m_A42 * f14_19; + RHS19 += f14_19 * RHS14; + const double f15 = 1.0 / m_A45; + const double f15_18 = -f15 * m_A56; + m_A57 += m_A46 * f15_18; + RHS18 += f15_18 * RHS15; + const double f16 = 1.0 / m_A49; + const double f16_19 = -f16 * m_A63; + m_A66 += m_A50 * f16_19; + RHS19 += f16_19 * RHS16; + const double f17 = 1.0 / m_A53; + const double f17_19 = -f17 * m_A64; + m_A66 += m_A54 * f17_19; + RHS19 += f17_19 * RHS17; + const double f18 = 1.0 / m_A57; + const double f18_19 = -f18 * m_A65; + m_A66 += m_A58 * f18_19; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A66; + double tmp18 = 0.0; + tmp18 += m_A58 * V[19]; + V[18] = (RHS18 - tmp18) / m_A57; + double tmp17 = 0.0; + tmp17 += m_A54 * V[19]; + V[17] = (RHS17 - tmp17) / m_A53; + double tmp16 = 0.0; + tmp16 += m_A50 * V[19]; + V[16] = (RHS16 - tmp16) / m_A49; + double tmp15 = 0.0; + tmp15 += m_A46 * V[18]; + V[15] = (RHS15 - tmp15) / m_A45; + double tmp14 = 0.0; + tmp14 += m_A42 * V[19]; + V[14] = (RHS14 - tmp14) / m_A41; + double tmp13 = 0.0; + tmp13 += m_A38 * V[16]; + V[13] = (RHS13 - tmp13) / m_A37; + double tmp12 = 0.0; + tmp12 += m_A34 * V[17]; + V[12] = (RHS12 - tmp12) / m_A33; + double tmp11 = 0.0; + tmp11 += m_A31 * V[14]; + V[11] = (RHS11 - tmp11) / m_A30; + double tmp10 = 0.0; + tmp10 += m_A27 * V[19]; + V[10] = (RHS10 - tmp10) / m_A26; + double tmp9 = 0.0; + tmp9 += m_A23 * V[17]; + tmp9 += m_A24 * V[19]; + V[9] = (RHS9 - tmp9) / m_A22; + double tmp8 = 0.0; + tmp8 += m_A20 * V[10]; + tmp8 += m_A21 * V[19]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A17 * V[15]; + tmp7 += m_A18 * V[18]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A14 * V[13]; + tmp6 += m_A15 * V[16]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[11]; + tmp5 += m_A12 * V[14]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[12]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[10]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[15]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[13]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[11]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_154_double_double_13833bf8c127deaa(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + m_A10 += go[9]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + m_A11 += gt[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A12 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 += Idr[12]; + RHS5 -= go[11] * *cnV[11]; + RHS5 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A13 += gt[16]; + m_A14 += go[13]; + m_A14 += go[14]; + m_A15 += go[15]; + double RHS6 = Idr[13]; + RHS6 += Idr[14]; + RHS6 += Idr[15]; + RHS6 += Idr[16]; + RHS6 -= go[16] * *cnV[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A16 += gt[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A18 += go[17]; + m_A17 += go[18]; + double RHS7 = Idr[17]; + RHS7 += Idr[18]; + RHS7 += Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 -= go[19] * *cnV[19]; + RHS7 -= go[20] * *cnV[20]; + RHS7 -= go[21] * *cnV[21]; + RHS7 -= go[22] * *cnV[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A20 += go[23]; + double RHS8 = Idr[23]; + RHS8 += Idr[24]; + RHS8 += Idr[25]; + RHS8 -= go[24] * *cnV[24]; + RHS8 -= go[25] * *cnV[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A22 += go[26]; + double RHS9 = Idr[26]; + RHS9 += Idr[27]; + RHS9 += Idr[28]; + RHS9 -= go[27] * *cnV[27]; + RHS9 -= go[28] * *cnV[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A23 += gt[31]; + m_A24 += go[29]; + double RHS10 = Idr[29]; + RHS10 += Idr[30]; + RHS10 += Idr[31]; + RHS10 -= go[30] * *cnV[30]; + RHS10 -= go[31] * *cnV[31]; + m_A25 += gt[32]; + m_A25 += gt[33]; + m_A25 += gt[34]; + m_A26 += go[32]; + double RHS11 = Idr[32]; + RHS11 += Idr[33]; + RHS11 += Idr[34]; + RHS11 -= go[33] * *cnV[33]; + RHS11 -= go[34] * *cnV[34]; + m_A27 += gt[35]; + m_A27 += gt[36]; + m_A27 += gt[37]; + m_A28 += go[35]; + double RHS12 = Idr[35]; + RHS12 += Idr[36]; + RHS12 += Idr[37]; + RHS12 -= go[36] * *cnV[36]; + RHS12 -= go[37] * *cnV[37]; + m_A29 += gt[38]; + m_A29 += gt[39]; + m_A30 += go[38]; + double RHS13 = Idr[38]; + RHS13 += Idr[39]; + RHS13 -= go[39] * *cnV[39]; + m_A31 += gt[40]; + m_A31 += gt[41]; + m_A31 += gt[42]; + m_A32 += go[40]; + double RHS14 = Idr[40]; + RHS14 += Idr[41]; + RHS14 += Idr[42]; + RHS14 -= go[41] * *cnV[41]; + RHS14 -= go[42] * *cnV[42]; + m_A33 += gt[43]; + m_A33 += gt[44]; + m_A34 += go[43]; + double RHS15 = Idr[43]; + RHS15 += Idr[44]; + RHS15 -= go[44] * *cnV[44]; + m_A35 += gt[45]; + m_A35 += gt[46]; + m_A36 += go[45]; + double RHS16 = Idr[45]; + RHS16 += Idr[46]; + RHS16 -= go[46] * *cnV[46]; + m_A37 += gt[47]; + m_A37 += gt[48]; + m_A38 += go[47]; + double RHS17 = Idr[47]; + RHS17 += Idr[48]; + RHS17 -= go[48] * *cnV[48]; + m_A39 += gt[49]; + m_A39 += gt[50]; + m_A40 += go[49]; + double RHS18 = Idr[49]; + RHS18 += Idr[50]; + RHS18 -= go[50] * *cnV[50]; + m_A41 += gt[51]; + m_A41 += gt[52]; + m_A42 += go[51]; + double RHS19 = Idr[51]; + RHS19 += Idr[52]; + RHS19 -= go[52] * *cnV[52]; + m_A43 += gt[53]; + m_A43 += gt[54]; + m_A44 += go[53]; + double RHS20 = Idr[53]; + RHS20 += Idr[54]; + RHS20 -= go[54] * *cnV[54]; + m_A45 += gt[55]; + m_A45 += gt[56]; + m_A45 += gt[57]; + m_A45 += gt[58]; + m_A45 += gt[59]; + m_A46 += go[55]; + m_A48 += go[56]; + m_A47 += go[57]; + double RHS21 = Idr[55]; + RHS21 += Idr[56]; + RHS21 += Idr[57]; + RHS21 += Idr[58]; + RHS21 += Idr[59]; + RHS21 -= go[58] * *cnV[58]; + RHS21 -= go[59] * *cnV[59]; + m_A49 += gt[60]; + m_A49 += gt[61]; + m_A49 += gt[62]; + m_A50 += go[60]; + double RHS22 = Idr[60]; + RHS22 += Idr[61]; + RHS22 += Idr[62]; + RHS22 -= go[61] * *cnV[61]; + RHS22 -= go[62] * *cnV[62]; + m_A51 += gt[63]; + m_A51 += gt[64]; + m_A52 += go[63]; + double RHS23 = Idr[63]; + RHS23 += Idr[64]; + RHS23 -= go[64] * *cnV[64]; + m_A55 += gt[65]; + m_A55 += gt[66]; + m_A55 += gt[67]; + m_A55 += gt[68]; + m_A54 += go[65]; + m_A53 += go[66]; + double RHS24 = Idr[65]; + RHS24 += Idr[66]; + RHS24 += Idr[67]; + RHS24 += Idr[68]; + RHS24 -= go[67] * *cnV[67]; + RHS24 -= go[68] * *cnV[68]; + m_A57 += gt[69]; + m_A57 += gt[70]; + m_A58 += go[69]; + double RHS25 = Idr[69]; + RHS25 += Idr[70]; + RHS25 -= go[70] * *cnV[70]; + m_A59 += gt[71]; + m_A59 += gt[72]; + m_A59 += gt[73]; + m_A60 += go[71]; + double RHS26 = Idr[71]; + RHS26 += Idr[72]; + RHS26 += Idr[73]; + RHS26 -= go[72] * *cnV[72]; + RHS26 -= go[73] * *cnV[73]; + m_A61 += gt[74]; + m_A61 += gt[75]; + m_A61 += gt[76]; + m_A62 += go[74]; + double RHS27 = Idr[74]; + RHS27 += Idr[75]; + RHS27 += Idr[76]; + RHS27 -= go[75] * *cnV[75]; + RHS27 -= go[76] * *cnV[76]; + m_A63 += gt[77]; + m_A63 += gt[78]; + m_A63 += gt[79]; + m_A64 += go[77]; + double RHS28 = Idr[77]; + RHS28 += Idr[78]; + RHS28 += Idr[79]; + RHS28 -= go[78] * *cnV[78]; + RHS28 -= go[79] * *cnV[79]; + m_A65 += gt[80]; + m_A65 += gt[81]; + m_A67 += go[80]; + m_A66 += go[81]; + double RHS29 = Idr[80]; + RHS29 += Idr[81]; + m_A68 += gt[82]; + m_A68 += gt[83]; + m_A70 += go[82]; + m_A69 += go[83]; + double RHS30 = Idr[82]; + RHS30 += Idr[83]; + m_A71 += gt[84]; + m_A71 += gt[85]; + m_A73 += go[84]; + m_A72 += go[85]; + double RHS31 = Idr[84]; + RHS31 += Idr[85]; + m_A77 += gt[86]; + m_A77 += gt[87]; + m_A77 += gt[88]; + m_A77 += gt[89]; + m_A77 += gt[90]; + m_A77 += gt[91]; + m_A77 += gt[92]; + m_A74 += go[86]; + m_A75 += go[87]; + m_A75 += go[88]; + m_A78 += go[89]; + m_A78 += go[90]; + double RHS32 = Idr[86]; + RHS32 += Idr[87]; + RHS32 += Idr[88]; + RHS32 += Idr[89]; + RHS32 += Idr[90]; + RHS32 += Idr[91]; + RHS32 += Idr[92]; + RHS32 -= go[91] * *cnV[91]; + RHS32 -= go[92] * *cnV[92]; + m_A83 += gt[93]; + m_A83 += gt[94]; + m_A83 += gt[95]; + m_A83 += gt[96]; + m_A83 += gt[97]; + m_A83 += gt[98]; + m_A83 += gt[99]; + m_A83 += gt[100]; + m_A83 += gt[101]; + m_A85 += go[93]; + m_A85 += go[94]; + m_A84 += go[95]; + m_A84 += go[96]; + m_A82 += go[97]; + m_A81 += go[98]; + m_A80 += go[99]; + m_A79 += go[100]; + double RHS33 = Idr[93]; + RHS33 += Idr[94]; + RHS33 += Idr[95]; + RHS33 += Idr[96]; + RHS33 += Idr[97]; + RHS33 += Idr[98]; + RHS33 += Idr[99]; + RHS33 += Idr[100]; + RHS33 += Idr[101]; + RHS33 -= go[101] * *cnV[101]; + m_A92 += gt[102]; + m_A92 += gt[103]; + m_A92 += gt[104]; + m_A92 += gt[105]; + m_A92 += gt[106]; + m_A92 += gt[107]; + m_A91 += go[102]; + m_A90 += go[103]; + m_A89 += go[104]; + m_A88 += go[105]; + m_A87 += go[106]; + m_A86 += go[107]; + double RHS34 = Idr[102]; + RHS34 += Idr[103]; + RHS34 += Idr[104]; + RHS34 += Idr[105]; + RHS34 += Idr[106]; + RHS34 += Idr[107]; + m_A95 += gt[108]; + m_A95 += gt[109]; + m_A95 += gt[110]; + m_A95 += gt[111]; + m_A95 += gt[112]; + m_A95 += gt[113]; + m_A95 += gt[114]; + m_A97 += go[108]; + m_A94 += go[109]; + double RHS35 = Idr[108]; + RHS35 += Idr[109]; + RHS35 += Idr[110]; + RHS35 += Idr[111]; + RHS35 += Idr[112]; + RHS35 += Idr[113]; + RHS35 += Idr[114]; + RHS35 -= go[110] * *cnV[110]; + RHS35 -= go[111] * *cnV[111]; + RHS35 -= go[112] * *cnV[112]; + RHS35 -= go[113] * *cnV[113]; + RHS35 -= go[114] * *cnV[114]; + m_A99 += gt[115]; + m_A99 += gt[116]; + m_A98 += go[115]; + m_A100 += go[116]; + double RHS36 = Idr[115]; + RHS36 += Idr[116]; + m_A107 += gt[117]; + m_A107 += gt[118]; + m_A107 += gt[119]; + m_A107 += gt[120]; + m_A107 += gt[121]; + m_A107 += gt[122]; + m_A106 += go[117]; + m_A105 += go[118]; + m_A104 += go[119]; + m_A103 += go[120]; + m_A102 += go[121]; + m_A101 += go[122]; + double RHS37 = Idr[117]; + RHS37 += Idr[118]; + RHS37 += Idr[119]; + RHS37 += Idr[120]; + RHS37 += Idr[121]; + RHS37 += Idr[122]; + m_A112 += gt[123]; + m_A112 += gt[124]; + m_A112 += gt[125]; + m_A112 += gt[126]; + m_A112 += gt[127]; + m_A111 += go[123]; + m_A110 += go[124]; + m_A109 += go[125]; + double RHS38 = Idr[123]; + RHS38 += Idr[124]; + RHS38 += Idr[125]; + RHS38 += Idr[126]; + RHS38 += Idr[127]; + RHS38 -= go[126] * *cnV[126]; + RHS38 -= go[127] * *cnV[127]; + m_A118 += gt[128]; + m_A118 += gt[129]; + m_A118 += gt[130]; + m_A118 += gt[131]; + m_A118 += gt[132]; + m_A118 += gt[133]; + m_A118 += gt[134]; + m_A118 += gt[135]; + m_A118 += gt[136]; + m_A119 += go[128]; + m_A115 += go[129]; + m_A114 += go[130]; + m_A116 += go[131]; + m_A116 += go[132]; + m_A117 += go[133]; + m_A117 += go[134]; + double RHS39 = Idr[128]; + RHS39 += Idr[129]; + RHS39 += Idr[130]; + RHS39 += Idr[131]; + RHS39 += Idr[132]; + RHS39 += Idr[133]; + RHS39 += Idr[134]; + RHS39 += Idr[135]; + RHS39 += Idr[136]; + RHS39 -= go[135] * *cnV[135]; + RHS39 -= go[136] * *cnV[136]; + m_A121 += gt[137]; + m_A121 += gt[138]; + m_A120 += go[137]; + m_A122 += go[138]; + double RHS40 = Idr[137]; + RHS40 += Idr[138]; + m_A127 += gt[139]; + m_A127 += gt[140]; + m_A127 += gt[141]; + m_A127 += gt[142]; + m_A127 += gt[143]; + m_A126 += go[139]; + m_A125 += go[140]; + m_A124 += go[141]; + m_A123 += go[142]; + m_A128 += go[143]; + double RHS41 = Idr[139]; + RHS41 += Idr[140]; + RHS41 += Idr[141]; + RHS41 += Idr[142]; + RHS41 += Idr[143]; + m_A134 += gt[144]; + m_A134 += gt[145]; + m_A134 += gt[146]; + m_A134 += gt[147]; + m_A134 += gt[148]; + m_A134 += gt[149]; + m_A130 += go[144]; + m_A129 += go[145]; + m_A133 += go[146]; + m_A131 += go[147]; + m_A131 += go[148]; + double RHS42 = Idr[144]; + RHS42 += Idr[145]; + RHS42 += Idr[146]; + RHS42 += Idr[147]; + RHS42 += Idr[148]; + RHS42 += Idr[149]; + RHS42 -= go[149] * *cnV[149]; + m_A137 += gt[150]; + m_A137 += gt[151]; + m_A136 += go[150]; + m_A138 += go[151]; + double RHS43 = Idr[150]; + RHS43 += Idr[151]; + m_A153 += gt[152]; + m_A153 += gt[153]; + m_A153 += gt[154]; + m_A153 += gt[155]; + m_A153 += gt[156]; + m_A153 += gt[157]; + m_A153 += gt[158]; + m_A153 += gt[159]; + m_A152 += go[152]; + m_A140 += go[153]; + m_A141 += go[154]; + m_A142 += go[155]; + m_A149 += go[156]; + m_A145 += go[157]; + m_A150 += go[158]; + m_A139 += go[159]; + double RHS44 = Idr[152]; + RHS44 += Idr[153]; + RHS44 += Idr[154]; + RHS44 += Idr[155]; + RHS44 += Idr[156]; + RHS44 += Idr[157]; + RHS44 += Idr[158]; + RHS44 += Idr[159]; + const double f0 = 1.0 / m_A0; + const double f0_33 = -f0 * m_A79; + m_A83 += m_A1 * f0_33; + RHS33 += f0_33 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_33 = -f1 * m_A80; + m_A83 += m_A3 * f1_33; + RHS33 += f1_33 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_33 = -f2 * m_A81; + m_A83 += m_A5 * f2_33; + RHS33 += f2_33 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_33 = -f3 * m_A82; + m_A83 += m_A7 * f3_33; + RHS33 += f3_33 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_24 = -f4 * m_A53; + m_A55 += m_A9 * f4_24; + m_A56 += m_A10 * f4_24; + RHS24 += f4_24 * RHS4; + const double f4_32 = -f4 * m_A74; + m_A76 += m_A9 * f4_32; + m_A77 += m_A10 * f4_32; + RHS32 += f4_32 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_24 = -f5 * m_A54; + m_A55 += m_A12 * f5_24; + RHS24 += f5_24 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_32 = -f6 * m_A75; + m_A77 += m_A14 * f6_32; + m_A78 += m_A15 * f6_32; + RHS32 += f6_32 * RHS6; + const double f6_39 = -f6 * m_A114; + m_A116 += m_A14 * f6_39; + m_A118 += m_A15 * f6_39; + RHS39 += f6_39 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_35 = -f7 * m_A94; + m_A96 += m_A17 * f7_35; + m_A97 += m_A18 * f7_35; + RHS35 += f7_35 * RHS7; + const double f7_39 = -f7 * m_A115; + m_A118 += m_A17 * f7_39; + m_A119 += m_A18 * f7_39; + RHS39 += f7_39 * RHS7; + const double f7_42 = -f7 * m_A129; + m_A133 += m_A17 * f7_42; + m_A134 += m_A18 * f7_42; + RHS42 += f7_42 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_37 = -f8 * m_A101; + m_A107 += m_A20 * f8_37; + RHS37 += f8_37 * RHS8; + const double f9 = 1.0 / m_A21; + const double f9_37 = -f9 * m_A102; + m_A107 += m_A22 * f9_37; + RHS37 += f9_37 * RHS9; + const double f10 = 1.0 / m_A23; + const double f10_37 = -f10 * m_A103; + m_A107 += m_A24 * f10_37; + RHS37 += f10_37 * RHS10; + const double f11 = 1.0 / m_A25; + const double f11_37 = -f11 * m_A104; + m_A107 += m_A26 * f11_37; + RHS37 += f11_37 * RHS11; + const double f12 = 1.0 / m_A27; + const double f12_37 = -f12 * m_A105; + m_A107 += m_A28 * f12_37; + RHS37 += f12_37 * RHS12; + const double f13 = 1.0 / m_A29; + const double f13_38 = -f13 * m_A109; + m_A112 += m_A30 * f13_38; + RHS38 += f13_38 * RHS13; + const double f14 = 1.0 / m_A31; + const double f14_34 = -f14 * m_A86; + m_A92 += m_A32 * f14_34; + RHS34 += f14_34 * RHS14; + const double f15 = 1.0 / m_A33; + const double f15_41 = -f15 * m_A123; + m_A127 += m_A34 * f15_41; + RHS41 += f15_41 * RHS15; + const double f16 = 1.0 / m_A35; + const double f16_36 = -f16 * m_A98; + m_A99 += m_A36 * f16_36; + RHS36 += f16_36 * RHS16; + const double f17 = 1.0 / m_A37; + const double f17_40 = -f17 * m_A120; + m_A121 += m_A38 * f17_40; + RHS40 += f17_40 * RHS17; + const double f18 = 1.0 / m_A39; + const double f18_41 = -f18 * m_A124; + m_A127 += m_A40 * f18_41; + RHS41 += f18_41 * RHS18; + const double f19 = 1.0 / m_A41; + const double f19_41 = -f19 * m_A125; + m_A127 += m_A42 * f19_41; + RHS41 += f19_41 * RHS19; + const double f20 = 1.0 / m_A43; + const double f20_41 = -f20 * m_A126; + m_A127 += m_A44 * f20_41; + RHS41 += f20_41 * RHS20; + const double f21 = 1.0 / m_A45; + const double f21_42 = -f21 * m_A130; + m_A132 += m_A46 * f21_42; + m_A134 += m_A47 * f21_42; + m_A135 += m_A48 * f21_42; + RHS42 += f21_42 * RHS21; + const double f21_44 = -f21 * m_A139; + m_A144 += m_A46 * f21_44; + m_A151 += m_A47 * f21_44; + m_A153 += m_A48 * f21_44; + RHS44 += f21_44 * RHS21; + const double f22 = 1.0 / m_A49; + const double f22_34 = -f22 * m_A87; + m_A92 += m_A50 * f22_34; + RHS34 += f22_34 * RHS22; + const double f23 = 1.0 / m_A51; + const double f23_43 = -f23 * m_A136; + m_A137 += m_A52 * f23_43; + RHS43 += f23_43 * RHS23; + const double f24 = 1.0 / m_A55; + const double f24_32 = -f24 * m_A76; + m_A77 += m_A56 * f24_32; + RHS32 += f24_32 * RHS24; + const double f25 = 1.0 / m_A57; + const double f25_38 = -f25 * m_A110; + m_A112 += m_A58 * f25_38; + RHS38 += f25_38 * RHS25; + const double f26 = 1.0 / m_A59; + const double f26_34 = -f26 * m_A88; + m_A92 += m_A60 * f26_34; + RHS34 += f26_34 * RHS26; + const double f27 = 1.0 / m_A61; + const double f27_34 = -f27 * m_A89; + m_A92 += m_A62 * f27_34; + RHS34 += f27_34 * RHS27; + const double f28 = 1.0 / m_A63; + const double f28_34 = -f28 * m_A90; + m_A92 += m_A64 * f28_34; + RHS34 += f28_34 * RHS28; + const double f29 = 1.0 / m_A65; + const double f29_34 = -f29 * m_A91; + m_A92 += m_A66 * f29_34; + m_A93 += m_A67 * f29_34; + RHS34 += f29_34 * RHS29; + const double f29_44 = -f29 * m_A140; + m_A143 += m_A66 * f29_44; + m_A153 += m_A67 * f29_44; + RHS44 += f29_44 * RHS29; + const double f30 = 1.0 / m_A68; + const double f30_37 = -f30 * m_A106; + m_A107 += m_A69 * f30_37; + m_A108 += m_A70 * f30_37; + RHS37 += f30_37 * RHS30; + const double f30_44 = -f30 * m_A141; + m_A146 += m_A69 * f30_44; + m_A153 += m_A70 * f30_44; + RHS44 += f30_44 * RHS30; + const double f31 = 1.0 / m_A71; + const double f31_38 = -f31 * m_A111; + m_A112 += m_A72 * f31_38; + m_A113 += m_A73 * f31_38; + RHS38 += f31_38 * RHS31; + const double f31_44 = -f31 * m_A142; + m_A147 += m_A72 * f31_44; + m_A153 += m_A73 * f31_44; + RHS44 += f31_44 * RHS31; + const double f32 = 1.0 / m_A77; + const double f32_39 = -f32 * m_A116; + m_A118 += m_A78 * f32_39; + RHS39 += f32_39 * RHS32; + const double f33 = 1.0 / m_A83; + const double f33_39 = -f33 * m_A117; + m_A118 += m_A84 * f33_39; + m_A119 += m_A85 * f33_39; + RHS39 += f33_39 * RHS33; + const double f33_42 = -f33 * m_A131; + m_A133 += m_A84 * f33_42; + m_A134 += m_A85 * f33_42; + RHS42 += f33_42 * RHS33; + const double f34 = 1.0 / m_A92; + const double f34_44 = -f34 * m_A143; + m_A153 += m_A93 * f34_44; + RHS44 += f34_44 * RHS34; + const double f35 = 1.0 / m_A95; + const double f35_42 = -f35 * m_A132; + m_A133 += m_A96 * f35_42; + m_A134 += m_A97 * f35_42; + RHS42 += f35_42 * RHS35; + const double f35_44 = -f35 * m_A144; + m_A148 += m_A96 * f35_44; + m_A151 += m_A97 * f35_44; + RHS44 += f35_44 * RHS35; + const double f36 = 1.0 / m_A99; + const double f36_44 = -f36 * m_A145; + m_A153 += m_A100 * f36_44; + RHS44 += f36_44 * RHS36; + const double f37 = 1.0 / m_A107; + const double f37_44 = -f37 * m_A146; + m_A153 += m_A108 * f37_44; + RHS44 += f37_44 * RHS37; + const double f38 = 1.0 / m_A112; + const double f38_44 = -f38 * m_A147; + m_A153 += m_A113 * f38_44; + RHS44 += f38_44 * RHS38; + const double f39 = 1.0 / m_A118; + const double f39_42 = -f39 * m_A133; + m_A134 += m_A119 * f39_42; + RHS42 += f39_42 * RHS39; + const double f39_44 = -f39 * m_A148; + m_A151 += m_A119 * f39_44; + RHS44 += f39_44 * RHS39; + const double f40 = 1.0 / m_A121; + const double f40_44 = -f40 * m_A149; + m_A153 += m_A122 * f40_44; + RHS44 += f40_44 * RHS40; + const double f41 = 1.0 / m_A127; + const double f41_44 = -f41 * m_A150; + m_A153 += m_A128 * f41_44; + RHS44 += f41_44 * RHS41; + const double f42 = 1.0 / m_A134; + const double f42_44 = -f42 * m_A151; + m_A153 += m_A135 * f42_44; + RHS44 += f42_44 * RHS42; + const double f43 = 1.0 / m_A137; + const double f43_44 = -f43 * m_A152; + m_A153 += m_A138 * f43_44; + RHS44 += f43_44 * RHS43; + V[44] = RHS44 / m_A153; + double tmp43 = 0.0; + tmp43 += m_A138 * V[44]; + V[43] = (RHS43 - tmp43) / m_A137; + double tmp42 = 0.0; + tmp42 += m_A135 * V[44]; + V[42] = (RHS42 - tmp42) / m_A134; + double tmp41 = 0.0; + tmp41 += m_A128 * V[44]; + V[41] = (RHS41 - tmp41) / m_A127; + double tmp40 = 0.0; + tmp40 += m_A122 * V[44]; + V[40] = (RHS40 - tmp40) / m_A121; + double tmp39 = 0.0; + tmp39 += m_A119 * V[42]; + V[39] = (RHS39 - tmp39) / m_A118; + double tmp38 = 0.0; + tmp38 += m_A113 * V[44]; + V[38] = (RHS38 - tmp38) / m_A112; + double tmp37 = 0.0; + tmp37 += m_A108 * V[44]; + V[37] = (RHS37 - tmp37) / m_A107; + double tmp36 = 0.0; + tmp36 += m_A100 * V[44]; + V[36] = (RHS36 - tmp36) / m_A99; + double tmp35 = 0.0; + tmp35 += m_A96 * V[39]; + tmp35 += m_A97 * V[42]; + V[35] = (RHS35 - tmp35) / m_A95; + double tmp34 = 0.0; + tmp34 += m_A93 * V[44]; + V[34] = (RHS34 - tmp34) / m_A92; + double tmp33 = 0.0; + tmp33 += m_A84 * V[39]; + tmp33 += m_A85 * V[42]; + V[33] = (RHS33 - tmp33) / m_A83; + double tmp32 = 0.0; + tmp32 += m_A78 * V[39]; + V[32] = (RHS32 - tmp32) / m_A77; + double tmp31 = 0.0; + tmp31 += m_A72 * V[38]; + tmp31 += m_A73 * V[44]; + V[31] = (RHS31 - tmp31) / m_A71; + double tmp30 = 0.0; + tmp30 += m_A69 * V[37]; + tmp30 += m_A70 * V[44]; + V[30] = (RHS30 - tmp30) / m_A68; + double tmp29 = 0.0; + tmp29 += m_A66 * V[34]; + tmp29 += m_A67 * V[44]; + V[29] = (RHS29 - tmp29) / m_A65; + double tmp28 = 0.0; + tmp28 += m_A64 * V[34]; + V[28] = (RHS28 - tmp28) / m_A63; + double tmp27 = 0.0; + tmp27 += m_A62 * V[34]; + V[27] = (RHS27 - tmp27) / m_A61; + double tmp26 = 0.0; + tmp26 += m_A60 * V[34]; + V[26] = (RHS26 - tmp26) / m_A59; + double tmp25 = 0.0; + tmp25 += m_A58 * V[38]; + V[25] = (RHS25 - tmp25) / m_A57; + double tmp24 = 0.0; + tmp24 += m_A56 * V[32]; + V[24] = (RHS24 - tmp24) / m_A55; + double tmp23 = 0.0; + tmp23 += m_A52 * V[43]; + V[23] = (RHS23 - tmp23) / m_A51; + double tmp22 = 0.0; + tmp22 += m_A50 * V[34]; + V[22] = (RHS22 - tmp22) / m_A49; + double tmp21 = 0.0; + tmp21 += m_A46 * V[35]; + tmp21 += m_A47 * V[42]; + tmp21 += m_A48 * V[44]; + V[21] = (RHS21 - tmp21) / m_A45; + double tmp20 = 0.0; + tmp20 += m_A44 * V[41]; + V[20] = (RHS20 - tmp20) / m_A43; + double tmp19 = 0.0; + tmp19 += m_A42 * V[41]; + V[19] = (RHS19 - tmp19) / m_A41; + double tmp18 = 0.0; + tmp18 += m_A40 * V[41]; + V[18] = (RHS18 - tmp18) / m_A39; + double tmp17 = 0.0; + tmp17 += m_A38 * V[40]; + V[17] = (RHS17 - tmp17) / m_A37; + double tmp16 = 0.0; + tmp16 += m_A36 * V[36]; + V[16] = (RHS16 - tmp16) / m_A35; + double tmp15 = 0.0; + tmp15 += m_A34 * V[41]; + V[15] = (RHS15 - tmp15) / m_A33; + double tmp14 = 0.0; + tmp14 += m_A32 * V[34]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + tmp13 += m_A30 * V[38]; + V[13] = (RHS13 - tmp13) / m_A29; + double tmp12 = 0.0; + tmp12 += m_A28 * V[37]; + V[12] = (RHS12 - tmp12) / m_A27; + double tmp11 = 0.0; + tmp11 += m_A26 * V[37]; + V[11] = (RHS11 - tmp11) / m_A25; + double tmp10 = 0.0; + tmp10 += m_A24 * V[37]; + V[10] = (RHS10 - tmp10) / m_A23; + double tmp9 = 0.0; + tmp9 += m_A22 * V[37]; + V[9] = (RHS9 - tmp9) / m_A21; + double tmp8 = 0.0; + tmp8 += m_A20 * V[37]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A17 * V[39]; + tmp7 += m_A18 * V[42]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A14 * V[32]; + tmp6 += m_A15 * V[39]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A12 * V[24]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[24]; + tmp4 += m_A10 * V[32]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[33]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[33]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[33]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[33]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_159_double_double_339c6b457f339538(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A6 += go[10]; + m_A7 += go[11]; + m_A8 += go[12]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A10 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A12 += go[15]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A14 += go[18]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A17 += go[20]; + m_A16 += go[21]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 -= go[22] * *cnV[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A20 += go[23]; + m_A21 += go[24]; + m_A19 += go[25]; + double RHS7 = Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 -= go[26] * *cnV[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A23 += go[27]; + m_A24 += go[28]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + m_A25 += gt[29]; + m_A25 += gt[30]; + m_A25 += gt[31]; + m_A27 += go[29]; + m_A26 += go[30]; + double RHS9 = Idr[29]; + RHS9 += Idr[30]; + RHS9 += Idr[31]; + RHS9 -= go[31] * *cnV[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A30 += go[32]; + m_A31 += go[33]; + m_A29 += go[34]; + double RHS10 = Idr[32]; + RHS10 += Idr[33]; + RHS10 += Idr[34]; + m_A32 += gt[35]; + m_A32 += gt[36]; + m_A32 += gt[37]; + m_A32 += gt[38]; + m_A32 += gt[39]; + m_A32 += gt[40]; + m_A32 += gt[41]; + m_A33 += go[35]; + m_A34 += go[36]; + double RHS11 = Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 += Idr[40]; + RHS11 += Idr[41]; + RHS11 -= go[37] * *cnV[37]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + RHS11 -= go[40] * *cnV[40]; + RHS11 -= go[41] * *cnV[41]; + m_A35 += gt[42]; + m_A35 += gt[43]; + m_A35 += gt[44]; + m_A35 += gt[45]; + m_A35 += gt[46]; + m_A37 += go[42]; + m_A36 += go[43]; + double RHS12 = Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + RHS12 -= go[44] * *cnV[44]; + RHS12 -= go[45] * *cnV[45]; + RHS12 -= go[46] * *cnV[46]; + m_A38 += gt[47]; + m_A38 += gt[48]; + m_A38 += gt[49]; + m_A38 += gt[50]; + m_A38 += gt[51]; + m_A38 += gt[52]; + m_A38 += gt[53]; + m_A40 += go[47]; + m_A39 += go[48]; + double RHS13 = Idr[47]; + RHS13 += Idr[48]; + RHS13 += Idr[49]; + RHS13 += Idr[50]; + RHS13 += Idr[51]; + RHS13 += Idr[52]; + RHS13 += Idr[53]; + RHS13 -= go[49] * *cnV[49]; + RHS13 -= go[50] * *cnV[50]; + RHS13 -= go[51] * *cnV[51]; + RHS13 -= go[52] * *cnV[52]; + RHS13 -= go[53] * *cnV[53]; + m_A41 += gt[54]; + m_A41 += gt[55]; + m_A41 += gt[56]; + m_A42 += go[54]; + m_A44 += go[55]; + m_A43 += go[56]; + double RHS14 = Idr[54]; + RHS14 += Idr[55]; + RHS14 += Idr[56]; + m_A45 += gt[57]; + m_A45 += gt[58]; + m_A45 += gt[59]; + m_A46 += go[57]; + double RHS15 = Idr[57]; + RHS15 += Idr[58]; + RHS15 += Idr[59]; + RHS15 -= go[58] * *cnV[58]; + RHS15 -= go[59] * *cnV[59]; + m_A47 += gt[60]; + m_A47 += gt[61]; + m_A47 += gt[62]; + m_A47 += gt[63]; + m_A47 += gt[64]; + m_A47 += gt[65]; + m_A47 += gt[66]; + m_A48 += go[60]; + m_A49 += go[61]; + double RHS16 = Idr[60]; + RHS16 += Idr[61]; + RHS16 += Idr[62]; + RHS16 += Idr[63]; + RHS16 += Idr[64]; + RHS16 += Idr[65]; + RHS16 += Idr[66]; + RHS16 -= go[62] * *cnV[62]; + RHS16 -= go[63] * *cnV[63]; + RHS16 -= go[64] * *cnV[64]; + RHS16 -= go[65] * *cnV[65]; + RHS16 -= go[66] * *cnV[66]; + m_A52 += gt[67]; + m_A52 += gt[68]; + m_A51 += go[67]; + m_A50 += go[68]; + double RHS17 = Idr[67]; + RHS17 += Idr[68]; + m_A56 += gt[69]; + m_A56 += gt[70]; + m_A56 += gt[71]; + m_A56 += gt[72]; + m_A56 += gt[73]; + m_A59 += go[69]; + m_A55 += go[70]; + m_A58 += go[71]; + double RHS18 = Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + RHS18 += Idr[72]; + RHS18 += Idr[73]; + RHS18 -= go[72] * *cnV[72]; + RHS18 -= go[73] * *cnV[73]; + m_A61 += gt[74]; + m_A61 += gt[75]; + m_A61 += gt[76]; + m_A61 += gt[77]; + m_A62 += go[74]; + m_A60 += go[75]; + double RHS19 = Idr[74]; + RHS19 += Idr[75]; + RHS19 += Idr[76]; + RHS19 += Idr[77]; + RHS19 -= go[76] * *cnV[76]; + RHS19 -= go[77] * *cnV[77]; + m_A65 += gt[78]; + m_A65 += gt[79]; + m_A63 += go[78]; + m_A64 += go[79]; + double RHS20 = Idr[78]; + RHS20 += Idr[79]; + m_A72 += gt[80]; + m_A72 += gt[81]; + m_A72 += gt[82]; + m_A72 += gt[83]; + m_A72 += gt[84]; + m_A69 += go[80]; + m_A68 += go[81]; + m_A67 += go[82]; + double RHS21 = Idr[80]; + RHS21 += Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + RHS21 += Idr[84]; + RHS21 -= go[83] * *cnV[83]; + RHS21 -= go[84] * *cnV[84]; + m_A79 += gt[85]; + m_A79 += gt[86]; + m_A79 += gt[87]; + m_A79 += gt[88]; + m_A79 += gt[89]; + m_A75 += go[85]; + m_A77 += go[86]; + m_A76 += go[87]; + double RHS22 = Idr[85]; + RHS22 += Idr[86]; + RHS22 += Idr[87]; + RHS22 += Idr[88]; + RHS22 += Idr[89]; + RHS22 -= go[88] * *cnV[88]; + RHS22 -= go[89] * *cnV[89]; + m_A88 += gt[90]; + m_A88 += gt[91]; + m_A88 += gt[92]; + m_A88 += gt[93]; + m_A84 += go[90]; + m_A91 += go[91]; + m_A85 += go[92]; + double RHS23 = Idr[90]; + RHS23 += Idr[91]; + RHS23 += Idr[92]; + RHS23 += Idr[93]; + RHS23 -= go[93] * *cnV[93]; + m_A93 += gt[94]; + m_A93 += gt[95]; + m_A93 += gt[96]; + m_A94 += go[94]; + m_A95 += go[95]; + m_A92 += go[96]; + double RHS24 = Idr[94]; + RHS24 += Idr[95]; + RHS24 += Idr[96]; + m_A97 += gt[97]; + m_A97 += gt[98]; + m_A97 += gt[99]; + m_A99 += go[97]; + m_A96 += go[98]; + double RHS25 = Idr[97]; + RHS25 += Idr[98]; + RHS25 += Idr[99]; + RHS25 -= go[99] * *cnV[99]; + m_A108 += gt[100]; + m_A108 += gt[101]; + m_A108 += gt[102]; + m_A108 += gt[103]; + m_A108 += gt[104]; + m_A101 += go[100]; + m_A104 += go[101]; + m_A100 += go[102]; + m_A102 += go[103]; + double RHS26 = Idr[100]; + RHS26 += Idr[101]; + RHS26 += Idr[102]; + RHS26 += Idr[103]; + RHS26 += Idr[104]; + RHS26 -= go[104] * *cnV[104]; + m_A117 += gt[105]; + m_A117 += gt[106]; + m_A117 += gt[107]; + m_A117 += gt[108]; + m_A117 += gt[109]; + m_A117 += gt[110]; + m_A120 += go[105]; + m_A112 += go[106]; + m_A113 += go[107]; + double RHS27 = Idr[105]; + RHS27 += Idr[106]; + RHS27 += Idr[107]; + RHS27 += Idr[108]; + RHS27 += Idr[109]; + RHS27 += Idr[110]; + RHS27 -= go[108] * *cnV[108]; + RHS27 -= go[109] * *cnV[109]; + RHS27 -= go[110] * *cnV[110]; + m_A125 += gt[111]; + m_A125 += gt[112]; + m_A122 += go[111]; + m_A121 += go[112]; + double RHS28 = Idr[111]; + RHS28 += Idr[112]; + m_A135 += gt[113]; + m_A135 += gt[114]; + m_A135 += gt[115]; + m_A135 += gt[116]; + m_A135 += gt[117]; + m_A135 += gt[118]; + m_A129 += go[113]; + m_A131 += go[114]; + m_A128 += go[115]; + double RHS29 = Idr[113]; + RHS29 += Idr[114]; + RHS29 += Idr[115]; + RHS29 += Idr[116]; + RHS29 += Idr[117]; + RHS29 += Idr[118]; + RHS29 -= go[116] * *cnV[116]; + RHS29 -= go[117] * *cnV[117]; + RHS29 -= go[118] * *cnV[118]; + m_A141 += gt[119]; + m_A141 += gt[120]; + m_A141 += gt[121]; + m_A141 += gt[122]; + m_A141 += gt[123]; + m_A137 += go[119]; + m_A138 += go[120]; + m_A139 += go[121]; + double RHS30 = Idr[119]; + RHS30 += Idr[120]; + RHS30 += Idr[121]; + RHS30 += Idr[122]; + RHS30 += Idr[123]; + RHS30 -= go[122] * *cnV[122]; + RHS30 -= go[123] * *cnV[123]; + m_A149 += gt[124]; + m_A149 += gt[125]; + m_A149 += gt[126]; + m_A149 += gt[127]; + m_A149 += gt[128]; + m_A149 += gt[129]; + m_A146 += go[124]; + m_A145 += go[125]; + m_A147 += go[126]; + m_A144 += go[127]; + double RHS31 = Idr[124]; + RHS31 += Idr[125]; + RHS31 += Idr[126]; + RHS31 += Idr[127]; + RHS31 += Idr[128]; + RHS31 += Idr[129]; + RHS31 -= go[128] * *cnV[128]; + RHS31 -= go[129] * *cnV[129]; + m_A158 += gt[130]; + m_A158 += gt[131]; + m_A158 += gt[132]; + m_A158 += gt[133]; + m_A158 += gt[134]; + m_A152 += go[130]; + m_A151 += go[131]; + m_A153 += go[132]; + double RHS32 = Idr[130]; + RHS32 += Idr[131]; + RHS32 += Idr[132]; + RHS32 += Idr[133]; + RHS32 += Idr[134]; + RHS32 -= go[133] * *cnV[133]; + RHS32 -= go[134] * *cnV[134]; + const double f0 = 1.0 / m_A0; + const double f0_17 = -f0 * m_A50; + m_A52 += m_A1 * f0_17; + RHS17 += f0_17 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_22 = -f1 * m_A75; + m_A76 += m_A3 * f1_22; + m_A78 += m_A4 * f1_22; + RHS22 += f1_22 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_18 = -f2 * m_A55; + m_A56 += m_A6 * f2_18; + m_A57 += m_A7 * f2_18; + m_A58 += m_A8 * f2_18; + RHS18 += f2_18 * RHS2; + const double f2_22 = -f2 * m_A76; + m_A78 += m_A6 * f2_22; + m_A79 += m_A7 * f2_22; + m_A81 += m_A8 * f2_22; + RHS22 += f2_22 * RHS2; + const double f2_26 = -f2 * m_A100; + m_A104 += m_A6 * f2_26; + m_A106 += m_A7 * f2_26; + m_A108 += m_A8 * f2_26; + RHS26 += f2_26 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_27 = -f3 * m_A112; + m_A117 += m_A10 * f3_27; + RHS27 += f3_27 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_20 = -f4 * m_A63; + m_A65 += m_A12 * f4_20; + RHS20 += f4_20 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_19 = -f5 * m_A60; + m_A61 += m_A14 * f5_19; + RHS19 += f5_19 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_26 = -f6 * m_A101; + m_A108 += m_A16 * f6_26; + m_A110 += m_A17 * f6_26; + RHS26 += f6_26 * RHS6; + const double f6_28 = -f6 * m_A121; + m_A123 += m_A16 * f6_28; + m_A125 += m_A17 * f6_28; + RHS28 += f6_28 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_17 = -f7 * m_A51; + m_A52 += m_A19 * f7_17; + m_A53 += m_A20 * f7_17; + m_A54 += m_A21 * f7_17; + RHS17 += f7_17 * RHS7; + const double f7_21 = -f7 * m_A67; + m_A70 += m_A19 * f7_21; + m_A72 += m_A20 * f7_21; + m_A74 += m_A21 * f7_21; + RHS21 += f7_21 * RHS7; + const double f7_26 = -f7 * m_A102; + m_A103 += m_A19 * f7_26; + m_A105 += m_A20 * f7_26; + m_A108 += m_A21 * f7_26; + RHS26 += f7_26 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_20 = -f8 * m_A64; + m_A65 += m_A23 * f8_20; + m_A66 += m_A24 * f8_20; + RHS20 += f8_20 * RHS8; + const double f8_21 = -f8 * m_A68; + m_A71 += m_A23 * f8_21; + m_A72 += m_A24 * f8_21; + RHS21 += f8_21 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_21 = -f9 * m_A69; + m_A72 += m_A26 * f9_21; + m_A73 += m_A27 * f9_21; + RHS21 += f9_21 * RHS9; + const double f9_23 = -f9 * m_A84; + m_A86 += m_A26 * f9_23; + m_A88 += m_A27 * f9_23; + RHS23 += f9_23 * RHS9; + const double f10 = 1.0 / m_A28; + const double f10_22 = -f10 * m_A77; + m_A79 += m_A29 * f10_22; + m_A80 += m_A30 * f10_22; + m_A83 += m_A31 * f10_22; + RHS22 += f10_22 * RHS10; + const double f10_23 = -f10 * m_A85; + m_A87 += m_A29 * f10_23; + m_A88 += m_A30 * f10_23; + m_A91 += m_A31 * f10_23; + RHS23 += f10_23 * RHS10; + const double f10_29 = -f10 * m_A128; + m_A130 += m_A29 * f10_29; + m_A131 += m_A30 * f10_29; + m_A135 += m_A31 * f10_29; + RHS29 += f10_29 * RHS10; + const double f11 = 1.0 / m_A32; + const double f11_29 = -f11 * m_A129; + m_A131 += m_A33 * f11_29; + m_A135 += m_A34 * f11_29; + RHS29 += f11_29 * RHS11; + const double f12 = 1.0 / m_A35; + const double f12_24 = -f12 * m_A92; + m_A93 += m_A36 * f12_24; + m_A95 += m_A37 * f12_24; + RHS24 += f12_24 * RHS12; + const double f12_32 = -f12 * m_A151; + m_A152 += m_A36 * f12_32; + m_A158 += m_A37 * f12_32; + RHS32 += f12_32 * RHS12; + const double f13 = 1.0 / m_A38; + const double f13_30 = -f13 * m_A137; + m_A139 += m_A39 * f13_30; + m_A143 += m_A40 * f13_30; + RHS30 += f13_30 * RHS13; + const double f14 = 1.0 / m_A41; + const double f14_25 = -f14 * m_A96; + m_A97 += m_A42 * f14_25; + m_A98 += m_A43 * f14_25; + m_A99 += m_A44 * f14_25; + RHS25 += f14_25 * RHS14; + const double f14_30 = -f14 * m_A138; + m_A140 += m_A42 * f14_30; + m_A141 += m_A43 * f14_30; + m_A142 += m_A44 * f14_30; + RHS30 += f14_30 * RHS14; + const double f14_31 = -f14 * m_A144; + m_A147 += m_A42 * f14_31; + m_A148 += m_A43 * f14_31; + m_A149 += m_A44 * f14_31; + RHS31 += f14_31 * RHS14; + const double f15 = 1.0 / m_A45; + const double f15_31 = -f15 * m_A145; + m_A149 += m_A46 * f15_31; + RHS31 += f15_31 * RHS15; + const double f16 = 1.0 / m_A47; + const double f16_31 = -f16 * m_A146; + m_A147 += m_A48 * f16_31; + m_A149 += m_A49 * f16_31; + RHS31 += f16_31 * RHS16; + const double f17 = 1.0 / m_A52; + const double f17_21 = -f17 * m_A70; + m_A72 += m_A53 * f17_21; + m_A74 += m_A54 * f17_21; + RHS21 += f17_21 * RHS17; + const double f17_26 = -f17 * m_A103; + m_A105 += m_A53 * f17_26; + m_A108 += m_A54 * f17_26; + RHS26 += f17_26 * RHS17; + const double f18 = 1.0 / m_A56; + const double f18_22 = -f18 * m_A78; + m_A79 += m_A57 * f18_22; + m_A81 += m_A58 * f18_22; + m_A82 += m_A59 * f18_22; + RHS22 += f18_22 * RHS18; + const double f18_26 = -f18 * m_A104; + m_A106 += m_A57 * f18_26; + m_A108 += m_A58 * f18_26; + m_A109 += m_A59 * f18_26; + RHS26 += f18_26 * RHS18; + const double f18_27 = -f18 * m_A113; + m_A114 += m_A57 * f18_27; + m_A116 += m_A58 * f18_27; + m_A117 += m_A59 * f18_27; + RHS27 += f18_27 * RHS18; + const double f19 = 1.0 / m_A61; + const double f19_28 = -f19 * m_A122; + m_A125 += m_A62 * f19_28; + RHS28 += f19_28 * RHS19; + const double f20 = 1.0 / m_A65; + const double f20_21 = -f20 * m_A71; + m_A72 += m_A66 * f20_21; + RHS21 += f20_21 * RHS20; + const double f21 = 1.0 / m_A72; + const double f21_23 = -f21 * m_A86; + m_A88 += m_A73 * f21_23; + m_A89 += m_A74 * f21_23; + RHS23 += f21_23 * RHS21; + const double f21_26 = -f21 * m_A105; + m_A107 += m_A73 * f21_26; + m_A108 += m_A74 * f21_26; + RHS26 += f21_26 * RHS21; + const double f22 = 1.0 / m_A79; + const double f22_23 = -f22 * m_A87; + m_A88 += m_A80 * f22_23; + m_A89 += m_A81 * f22_23; + m_A90 += m_A82 * f22_23; + m_A91 += m_A83 * f22_23; + RHS23 += f22_23 * RHS22; + const double f22_26 = -f22 * m_A106; + m_A107 += m_A80 * f22_26; + m_A108 += m_A81 * f22_26; + m_A109 += m_A82 * f22_26; + m_A111 += m_A83 * f22_26; + RHS26 += f22_26 * RHS22; + const double f22_27 = -f22 * m_A114; + m_A115 += m_A80 * f22_27; + m_A116 += m_A81 * f22_27; + m_A117 += m_A82 * f22_27; + m_A119 += m_A83 * f22_27; + RHS27 += f22_27 * RHS22; + const double f22_29 = -f22 * m_A130; + m_A131 += m_A80 * f22_29; + m_A132 += m_A81 * f22_29; + m_A133 += m_A82 * f22_29; + m_A135 += m_A83 * f22_29; + RHS29 += f22_29 * RHS22; + const double f23 = 1.0 / m_A88; + const double f23_26 = -f23 * m_A107; + m_A108 += m_A89 * f23_26; + m_A109 += m_A90 * f23_26; + m_A111 += m_A91 * f23_26; + RHS26 += f23_26 * RHS23; + const double f23_27 = -f23 * m_A115; + m_A116 += m_A89 * f23_27; + m_A117 += m_A90 * f23_27; + m_A119 += m_A91 * f23_27; + RHS27 += f23_27 * RHS23; + const double f23_29 = -f23 * m_A131; + m_A132 += m_A89 * f23_29; + m_A133 += m_A90 * f23_29; + m_A135 += m_A91 * f23_29; + RHS29 += f23_29 * RHS23; + const double f24 = 1.0 / m_A93; + const double f24_30 = -f24 * m_A139; + m_A141 += m_A94 * f24_30; + m_A143 += m_A95 * f24_30; + RHS30 += f24_30 * RHS24; + const double f24_32 = -f24 * m_A152; + m_A156 += m_A94 * f24_32; + m_A158 += m_A95 * f24_32; + RHS32 += f24_32 * RHS24; + const double f25 = 1.0 / m_A97; + const double f25_30 = -f25 * m_A140; + m_A141 += m_A98 * f25_30; + m_A142 += m_A99 * f25_30; + RHS30 += f25_30 * RHS25; + const double f25_31 = -f25 * m_A147; + m_A148 += m_A98 * f25_31; + m_A149 += m_A99 * f25_31; + RHS31 += f25_31 * RHS25; + const double f26 = 1.0 / m_A108; + const double f26_27 = -f26 * m_A116; + m_A117 += m_A109 * f26_27; + m_A118 += m_A110 * f26_27; + m_A119 += m_A111 * f26_27; + RHS27 += f26_27 * RHS26; + const double f26_28 = -f26 * m_A123; + m_A124 += m_A109 * f26_28; + m_A125 += m_A110 * f26_28; + m_A126 += m_A111 * f26_28; + RHS28 += f26_28 * RHS26; + const double f26_29 = -f26 * m_A132; + m_A133 += m_A109 * f26_29; + m_A134 += m_A110 * f26_29; + m_A135 += m_A111 * f26_29; + RHS29 += f26_29 * RHS26; + const double f27 = 1.0 / m_A117; + const double f27_28 = -f27 * m_A124; + m_A125 += m_A118 * f27_28; + m_A126 += m_A119 * f27_28; + m_A127 += m_A120 * f27_28; + RHS28 += f27_28 * RHS27; + const double f27_29 = -f27 * m_A133; + m_A134 += m_A118 * f27_29; + m_A135 += m_A119 * f27_29; + m_A136 += m_A120 * f27_29; + RHS29 += f27_29 * RHS27; + const double f27_32 = -f27 * m_A153; + m_A154 += m_A118 * f27_32; + m_A155 += m_A119 * f27_32; + m_A158 += m_A120 * f27_32; + RHS32 += f27_32 * RHS27; + const double f28 = 1.0 / m_A125; + const double f28_29 = -f28 * m_A134; + m_A135 += m_A126 * f28_29; + m_A136 += m_A127 * f28_29; + RHS29 += f28_29 * RHS28; + const double f28_32 = -f28 * m_A154; + m_A155 += m_A126 * f28_32; + m_A158 += m_A127 * f28_32; + RHS32 += f28_32 * RHS28; + const double f29 = 1.0 / m_A135; + const double f29_32 = -f29 * m_A155; + m_A158 += m_A136 * f29_32; + RHS32 += f29_32 * RHS29; + const double f30 = 1.0 / m_A141; + const double f30_31 = -f30 * m_A148; + m_A149 += m_A142 * f30_31; + m_A150 += m_A143 * f30_31; + RHS31 += f30_31 * RHS30; + const double f30_32 = -f30 * m_A156; + m_A157 += m_A142 * f30_32; + m_A158 += m_A143 * f30_32; + RHS32 += f30_32 * RHS30; + const double f31 = 1.0 / m_A149; + const double f31_32 = -f31 * m_A157; + m_A158 += m_A150 * f31_32; + RHS32 += f31_32 * RHS31; + V[32] = RHS32 / m_A158; + double tmp31 = 0.0; + tmp31 += m_A150 * V[32]; + V[31] = (RHS31 - tmp31) / m_A149; + double tmp30 = 0.0; + tmp30 += m_A142 * V[31]; + tmp30 += m_A143 * V[32]; + V[30] = (RHS30 - tmp30) / m_A141; + double tmp29 = 0.0; + tmp29 += m_A136 * V[32]; + V[29] = (RHS29 - tmp29) / m_A135; + double tmp28 = 0.0; + tmp28 += m_A126 * V[29]; + tmp28 += m_A127 * V[32]; + V[28] = (RHS28 - tmp28) / m_A125; + double tmp27 = 0.0; + tmp27 += m_A118 * V[28]; + tmp27 += m_A119 * V[29]; + tmp27 += m_A120 * V[32]; + V[27] = (RHS27 - tmp27) / m_A117; + double tmp26 = 0.0; + tmp26 += m_A109 * V[27]; + tmp26 += m_A110 * V[28]; + tmp26 += m_A111 * V[29]; + V[26] = (RHS26 - tmp26) / m_A108; + double tmp25 = 0.0; + tmp25 += m_A98 * V[30]; + tmp25 += m_A99 * V[31]; + V[25] = (RHS25 - tmp25) / m_A97; + double tmp24 = 0.0; + tmp24 += m_A94 * V[30]; + tmp24 += m_A95 * V[32]; + V[24] = (RHS24 - tmp24) / m_A93; + double tmp23 = 0.0; + tmp23 += m_A89 * V[26]; + tmp23 += m_A90 * V[27]; + tmp23 += m_A91 * V[29]; + V[23] = (RHS23 - tmp23) / m_A88; + double tmp22 = 0.0; + tmp22 += m_A80 * V[23]; + tmp22 += m_A81 * V[26]; + tmp22 += m_A82 * V[27]; + tmp22 += m_A83 * V[29]; + V[22] = (RHS22 - tmp22) / m_A79; + double tmp21 = 0.0; + tmp21 += m_A73 * V[23]; + tmp21 += m_A74 * V[26]; + V[21] = (RHS21 - tmp21) / m_A72; + double tmp20 = 0.0; + tmp20 += m_A66 * V[21]; + V[20] = (RHS20 - tmp20) / m_A65; + double tmp19 = 0.0; + tmp19 += m_A62 * V[28]; + V[19] = (RHS19 - tmp19) / m_A61; + double tmp18 = 0.0; + tmp18 += m_A57 * V[22]; + tmp18 += m_A58 * V[26]; + tmp18 += m_A59 * V[27]; + V[18] = (RHS18 - tmp18) / m_A56; + double tmp17 = 0.0; + tmp17 += m_A53 * V[21]; + tmp17 += m_A54 * V[26]; + V[17] = (RHS17 - tmp17) / m_A52; + double tmp16 = 0.0; + tmp16 += m_A48 * V[25]; + tmp16 += m_A49 * V[31]; + V[16] = (RHS16 - tmp16) / m_A47; + double tmp15 = 0.0; + tmp15 += m_A46 * V[31]; + V[15] = (RHS15 - tmp15) / m_A45; + double tmp14 = 0.0; + tmp14 += m_A42 * V[25]; + tmp14 += m_A43 * V[30]; + tmp14 += m_A44 * V[31]; + V[14] = (RHS14 - tmp14) / m_A41; + double tmp13 = 0.0; + tmp13 += m_A39 * V[24]; + tmp13 += m_A40 * V[32]; + V[13] = (RHS13 - tmp13) / m_A38; + double tmp12 = 0.0; + tmp12 += m_A36 * V[24]; + tmp12 += m_A37 * V[32]; + V[12] = (RHS12 - tmp12) / m_A35; + double tmp11 = 0.0; + tmp11 += m_A33 * V[23]; + tmp11 += m_A34 * V[29]; + V[11] = (RHS11 - tmp11) / m_A32; + double tmp10 = 0.0; + tmp10 += m_A29 * V[22]; + tmp10 += m_A30 * V[23]; + tmp10 += m_A31 * V[29]; + V[10] = (RHS10 - tmp10) / m_A28; + double tmp9 = 0.0; + tmp9 += m_A26 * V[21]; + tmp9 += m_A27 * V[23]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A23 * V[20]; + tmp8 += m_A24 * V[21]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A19 * V[17]; + tmp7 += m_A20 * V[21]; + tmp7 += m_A21 * V[26]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A16 * V[26]; + tmp6 += m_A17 * V[28]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A14 * V[19]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A12 * V[20]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A10 * V[27]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[18]; + tmp2 += m_A7 * V[22]; + tmp2 += m_A8 * V[26]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[18]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[17]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_15_double_double_6c24726f30e8dc34(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[3]; + m_A4 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A6 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A8 += go[11]; + m_A7 += go[12]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A12 += go[14]; + m_A11 += go[15]; + m_A11 += go[16]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A11; + m_A13 += m_A3 * f1_4; + m_A14 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A12; + m_A14 += m_A6 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A14; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_20_double_double_41c6441d98369158(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A7 += go[5]; + m_A6 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A10 += gt[8]; + m_A10 += gt[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A9 += go[8]; + m_A8 += go[9]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A15 += gt[12]; + m_A15 += gt[13]; + m_A15 += gt[14]; + m_A15 += gt[15]; + m_A13 += go[12]; + m_A12 += go[13]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + m_A19 += gt[16]; + m_A19 += gt[17]; + m_A17 += go[16]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A12; + m_A14 += m_A3 * f1_4; + m_A15 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A13; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A17; + m_A18 += m_A6 * f2_5; + m_A19 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + RHS4 += f3_4 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A19; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_27_double_double_62464664b1c5aa1e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A5 += gt[14]; + m_A5 += gt[15]; + m_A5 += gt[16]; + m_A6 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + RHS2 -= go[15] * *cnV[15]; + RHS2 -= go[16] * *cnV[16]; + m_A7 += gt[17]; + m_A7 += gt[18]; + m_A7 += gt[19]; + m_A7 += gt[20]; + m_A9 += go[17]; + m_A10 += go[18]; + m_A8 += go[19]; + double RHS3 = Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 += Idr[20]; + RHS3 -= go[20] * *cnV[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A14 += gt[25]; + m_A11 += go[21]; + m_A13 += go[22]; + m_A12 += go[23]; + double RHS4 = Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A20 += go[26]; + m_A17 += go[27]; + double RHS5 = Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 -= go[28] * *cnV[28]; + m_A26 += gt[29]; + m_A26 += gt[30]; + m_A26 += gt[31]; + m_A26 += gt[32]; + m_A26 += gt[33]; + m_A26 += gt[34]; + m_A26 += gt[35]; + m_A26 += gt[36]; + m_A22 += go[29]; + m_A25 += go[30]; + m_A23 += go[31]; + m_A21 += go[32]; + double RHS6 = Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 += Idr[36]; + RHS6 -= go[33] * *cnV[33]; + RHS6 -= go[34] * *cnV[34]; + RHS6 -= go[35] * *cnV[35]; + RHS6 -= go[36] * *cnV[36]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A11; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A12; + m_A14 += m_A3 * f1_4; + m_A16 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_6 = -f1 * m_A21; + m_A24 += m_A3 * f1_6; + m_A26 += m_A4 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_6 = -f2 * m_A22; + m_A25 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A8 * f3_4; + m_A15 += m_A9 * f3_4; + m_A16 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A17; + m_A18 += m_A8 * f3_5; + m_A19 += m_A9 * f3_5; + m_A20 += m_A10 * f3_5; + RHS5 += f3_5 * RHS3; + const double f3_6 = -f3 * m_A23; + m_A24 += m_A8 * f3_6; + m_A25 += m_A9 * f3_6; + m_A26 += m_A10 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A14; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A15 * f4_5; + m_A20 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_6 = -f4 * m_A24; + m_A25 += m_A15 * f4_6; + m_A26 += m_A16 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A19; + const double f5_6 = -f5 * m_A25; + m_A26 += m_A20 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A26; + double tmp5 = 0.0; + tmp5 += m_A20 * V[6]; + V[5] = (RHS5 - tmp5) / m_A19; + double tmp4 = 0.0; + tmp4 += m_A15 * V[5]; + tmp4 += m_A16 * V[6]; + V[4] = (RHS4 - tmp4) / m_A14; + double tmp3 = 0.0; + tmp3 += m_A8 * V[4]; + tmp3 += m_A9 * V[5]; + tmp3 += m_A10 * V[6]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_285_double_double_ee61dcaa355fc625(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + double m_A198(0.0); + double m_A199(0.0); + double m_A200(0.0); + double m_A201(0.0); + double m_A202(0.0); + double m_A203(0.0); + double m_A204(0.0); + double m_A205(0.0); + double m_A206(0.0); + double m_A207(0.0); + double m_A208(0.0); + double m_A209(0.0); + double m_A210(0.0); + double m_A211(0.0); + double m_A212(0.0); + double m_A213(0.0); + double m_A214(0.0); + double m_A215(0.0); + double m_A216(0.0); + double m_A217(0.0); + double m_A218(0.0); + double m_A219(0.0); + double m_A220(0.0); + double m_A221(0.0); + double m_A222(0.0); + double m_A223(0.0); + double m_A224(0.0); + double m_A225(0.0); + double m_A226(0.0); + double m_A227(0.0); + double m_A228(0.0); + double m_A229(0.0); + double m_A230(0.0); + double m_A231(0.0); + double m_A232(0.0); + double m_A233(0.0); + double m_A234(0.0); + double m_A235(0.0); + double m_A236(0.0); + double m_A237(0.0); + double m_A238(0.0); + double m_A239(0.0); + double m_A240(0.0); + double m_A241(0.0); + double m_A242(0.0); + double m_A243(0.0); + double m_A244(0.0); + double m_A245(0.0); + double m_A246(0.0); + double m_A247(0.0); + double m_A248(0.0); + double m_A249(0.0); + double m_A250(0.0); + double m_A251(0.0); + double m_A252(0.0); + double m_A253(0.0); + double m_A254(0.0); + double m_A255(0.0); + double m_A256(0.0); + double m_A257(0.0); + double m_A258(0.0); + double m_A259(0.0); + double m_A260(0.0); + double m_A261(0.0); + double m_A262(0.0); + double m_A263(0.0); + double m_A264(0.0); + double m_A265(0.0); + double m_A266(0.0); + double m_A267(0.0); + double m_A268(0.0); + double m_A269(0.0); + double m_A270(0.0); + double m_A271(0.0); + double m_A272(0.0); + double m_A273(0.0); + double m_A274(0.0); + double m_A275(0.0); + double m_A276(0.0); + double m_A277(0.0); + double m_A278(0.0); + double m_A279(0.0); + double m_A280(0.0); + double m_A281(0.0); + double m_A282(0.0); + double m_A283(0.0); + double m_A284(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[15]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[16] * *cnV[16]; + RHS5 -= go[17] * *cnV[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A13 += go[18]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A15 += go[21]; + double RHS7 = Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 -= go[22] * *cnV[22]; + RHS7 -= go[23] * *cnV[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A17 += go[24]; + double RHS8 = Idr[24]; + RHS8 += Idr[25]; + RHS8 += Idr[26]; + RHS8 -= go[25] * *cnV[25]; + RHS8 -= go[26] * *cnV[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A18 += gt[29]; + m_A19 += go[27]; + double RHS9 = Idr[27]; + RHS9 += Idr[28]; + RHS9 += Idr[29]; + RHS9 -= go[28] * *cnV[28]; + RHS9 -= go[29] * *cnV[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A21 += go[30]; + double RHS10 = Idr[30]; + RHS10 += Idr[31]; + RHS10 += Idr[32]; + RHS10 -= go[31] * *cnV[31]; + RHS10 -= go[32] * *cnV[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A22 += gt[37]; + m_A22 += gt[38]; + m_A22 += gt[39]; + m_A24 += go[33]; + m_A23 += go[34]; + double RHS11 = Idr[33]; + RHS11 += Idr[34]; + RHS11 += Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[35] * *cnV[35]; + RHS11 -= go[36] * *cnV[36]; + RHS11 -= go[37] * *cnV[37]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + m_A25 += gt[40]; + m_A25 += gt[41]; + m_A26 += go[40]; + double RHS12 = Idr[40]; + RHS12 += Idr[41]; + RHS12 -= go[41] * *cnV[41]; + m_A27 += gt[42]; + m_A27 += gt[43]; + m_A28 += go[42]; + double RHS13 = Idr[42]; + RHS13 += Idr[43]; + RHS13 -= go[43] * *cnV[43]; + m_A29 += gt[44]; + m_A29 += gt[45]; + m_A30 += go[44]; + double RHS14 = Idr[44]; + RHS14 += Idr[45]; + RHS14 -= go[45] * *cnV[45]; + m_A31 += gt[46]; + m_A31 += gt[47]; + m_A31 += gt[48]; + m_A32 += go[46]; + double RHS15 = Idr[46]; + RHS15 += Idr[47]; + RHS15 += Idr[48]; + RHS15 -= go[47] * *cnV[47]; + RHS15 -= go[48] * *cnV[48]; + m_A33 += gt[49]; + m_A33 += gt[50]; + m_A33 += gt[51]; + m_A34 += go[49]; + double RHS16 = Idr[49]; + RHS16 += Idr[50]; + RHS16 += Idr[51]; + RHS16 -= go[50] * *cnV[50]; + RHS16 -= go[51] * *cnV[51]; + m_A35 += gt[52]; + m_A35 += gt[53]; + m_A35 += gt[54]; + m_A36 += go[52]; + double RHS17 = Idr[52]; + RHS17 += Idr[53]; + RHS17 += Idr[54]; + RHS17 -= go[53] * *cnV[53]; + RHS17 -= go[54] * *cnV[54]; + m_A37 += gt[55]; + m_A37 += gt[56]; + m_A37 += gt[57]; + m_A38 += go[55]; + double RHS18 = Idr[55]; + RHS18 += Idr[56]; + RHS18 += Idr[57]; + RHS18 -= go[56] * *cnV[56]; + RHS18 -= go[57] * *cnV[57]; + m_A39 += gt[58]; + m_A39 += gt[59]; + m_A40 += go[58]; + double RHS19 = Idr[58]; + RHS19 += Idr[59]; + RHS19 -= go[59] * *cnV[59]; + m_A41 += gt[60]; + m_A41 += gt[61]; + m_A41 += gt[62]; + m_A41 += gt[63]; + m_A41 += gt[64]; + m_A41 += gt[65]; + m_A41 += gt[66]; + m_A42 += go[60]; + double RHS20 = Idr[60]; + RHS20 += Idr[61]; + RHS20 += Idr[62]; + RHS20 += Idr[63]; + RHS20 += Idr[64]; + RHS20 += Idr[65]; + RHS20 += Idr[66]; + RHS20 -= go[61] * *cnV[61]; + RHS20 -= go[62] * *cnV[62]; + RHS20 -= go[63] * *cnV[63]; + RHS20 -= go[64] * *cnV[64]; + RHS20 -= go[65] * *cnV[65]; + RHS20 -= go[66] * *cnV[66]; + m_A43 += gt[67]; + m_A43 += gt[68]; + m_A43 += gt[69]; + m_A44 += go[67]; + double RHS21 = Idr[67]; + RHS21 += Idr[68]; + RHS21 += Idr[69]; + RHS21 -= go[68] * *cnV[68]; + RHS21 -= go[69] * *cnV[69]; + m_A45 += gt[70]; + m_A45 += gt[71]; + m_A45 += gt[72]; + m_A45 += gt[73]; + m_A45 += gt[74]; + m_A45 += gt[75]; + m_A45 += gt[76]; + m_A46 += go[70]; + double RHS22 = Idr[70]; + RHS22 += Idr[71]; + RHS22 += Idr[72]; + RHS22 += Idr[73]; + RHS22 += Idr[74]; + RHS22 += Idr[75]; + RHS22 += Idr[76]; + RHS22 -= go[71] * *cnV[71]; + RHS22 -= go[72] * *cnV[72]; + RHS22 -= go[73] * *cnV[73]; + RHS22 -= go[74] * *cnV[74]; + RHS22 -= go[75] * *cnV[75]; + RHS22 -= go[76] * *cnV[76]; + m_A47 += gt[77]; + m_A47 += gt[78]; + m_A47 += gt[79]; + m_A48 += go[77]; + m_A49 += go[78]; + double RHS23 = Idr[77]; + RHS23 += Idr[78]; + RHS23 += Idr[79]; + RHS23 -= go[79] * *cnV[79]; + m_A50 += gt[80]; + m_A50 += gt[81]; + m_A50 += gt[82]; + m_A52 += go[80]; + m_A51 += go[81]; + double RHS24 = Idr[80]; + RHS24 += Idr[81]; + RHS24 += Idr[82]; + RHS24 -= go[82] * *cnV[82]; + m_A53 += gt[83]; + m_A53 += gt[84]; + m_A54 += go[83]; + double RHS25 = Idr[83]; + RHS25 += Idr[84]; + RHS25 -= go[84] * *cnV[84]; + m_A55 += gt[85]; + m_A55 += gt[86]; + m_A55 += gt[87]; + m_A55 += gt[88]; + m_A55 += gt[89]; + m_A55 += gt[90]; + m_A55 += gt[91]; + m_A55 += gt[92]; + m_A55 += gt[93]; + m_A55 += gt[94]; + m_A55 += gt[95]; + m_A55 += gt[96]; + m_A67 += go[85]; + m_A56 += go[86]; + m_A58 += go[87]; + m_A60 += go[88]; + m_A62 += go[89]; + m_A64 += go[90]; + m_A66 += go[91]; + m_A65 += go[92]; + m_A63 += go[93]; + m_A61 += go[94]; + m_A59 += go[95]; + m_A57 += go[96]; + double RHS26 = Idr[85]; + RHS26 += Idr[86]; + RHS26 += Idr[87]; + RHS26 += Idr[88]; + RHS26 += Idr[89]; + RHS26 += Idr[90]; + RHS26 += Idr[91]; + RHS26 += Idr[92]; + RHS26 += Idr[93]; + RHS26 += Idr[94]; + RHS26 += Idr[95]; + RHS26 += Idr[96]; + m_A69 += gt[97]; + m_A69 += gt[98]; + m_A69 += gt[99]; + m_A68 += go[97]; + m_A70 += go[98]; + double RHS27 = Idr[97]; + RHS27 += Idr[98]; + RHS27 += Idr[99]; + RHS27 -= go[99] * *cnV[99]; + m_A72 += gt[100]; + m_A72 += gt[101]; + m_A72 += gt[102]; + m_A71 += go[100]; + m_A73 += go[101]; + double RHS28 = Idr[100]; + RHS28 += Idr[101]; + RHS28 += Idr[102]; + RHS28 -= go[102] * *cnV[102]; + m_A75 += gt[103]; + m_A75 += gt[104]; + m_A75 += gt[105]; + m_A74 += go[103]; + m_A76 += go[104]; + double RHS29 = Idr[103]; + RHS29 += Idr[104]; + RHS29 += Idr[105]; + RHS29 -= go[105] * *cnV[105]; + m_A82 += gt[106]; + m_A82 += gt[107]; + m_A82 += gt[108]; + m_A82 += gt[109]; + m_A82 += gt[110]; + m_A82 += gt[111]; + m_A82 += gt[112]; + m_A81 += go[106]; + m_A80 += go[107]; + m_A79 += go[108]; + m_A78 += go[109]; + m_A77 += go[110]; + m_A83 += go[111]; + double RHS30 = Idr[106]; + RHS30 += Idr[107]; + RHS30 += Idr[108]; + RHS30 += Idr[109]; + RHS30 += Idr[110]; + RHS30 += Idr[111]; + RHS30 += Idr[112]; + RHS30 -= go[112] * *cnV[112]; + m_A84 += gt[113]; + m_A84 += gt[114]; + m_A86 += go[113]; + m_A85 += go[114]; + double RHS31 = Idr[113]; + RHS31 += Idr[114]; + m_A89 += gt[115]; + m_A89 += gt[116]; + m_A89 += gt[117]; + m_A89 += gt[118]; + m_A89 += gt[119]; + m_A87 += go[115]; + m_A91 += go[116]; + m_A88 += go[117]; + double RHS32 = Idr[115]; + RHS32 += Idr[116]; + RHS32 += Idr[117]; + RHS32 += Idr[118]; + RHS32 += Idr[119]; + RHS32 -= go[118] * *cnV[118]; + RHS32 -= go[119] * *cnV[119]; + m_A94 += gt[120]; + m_A94 += gt[121]; + m_A94 += gt[122]; + m_A94 += gt[123]; + m_A92 += go[120]; + m_A93 += go[121]; + double RHS33 = Idr[120]; + RHS33 += Idr[121]; + RHS33 += Idr[122]; + RHS33 += Idr[123]; + RHS33 -= go[122] * *cnV[122]; + RHS33 -= go[123] * *cnV[123]; + m_A109 += gt[124]; + m_A109 += gt[125]; + m_A107 += go[124]; + m_A106 += go[125]; + double RHS34 = Idr[124]; + RHS34 += Idr[125]; + m_A124 += gt[126]; + m_A124 += gt[127]; + m_A121 += go[126]; + m_A120 += go[127]; + double RHS35 = Idr[126]; + RHS35 += Idr[127]; + m_A139 += gt[128]; + m_A139 += gt[129]; + m_A135 += go[128]; + m_A134 += go[129]; + double RHS36 = Idr[128]; + RHS36 += Idr[129]; + m_A154 += gt[130]; + m_A154 += gt[131]; + m_A149 += go[130]; + m_A148 += go[131]; + double RHS37 = Idr[130]; + RHS37 += Idr[131]; + m_A169 += gt[132]; + m_A169 += gt[133]; + m_A163 += go[132]; + m_A162 += go[133]; + double RHS38 = Idr[132]; + RHS38 += Idr[133]; + m_A184 += gt[134]; + m_A184 += gt[135]; + m_A177 += go[134]; + m_A176 += go[135]; + double RHS39 = Idr[134]; + RHS39 += Idr[135]; + m_A199 += gt[136]; + m_A199 += gt[137]; + m_A191 += go[136]; + m_A190 += go[137]; + double RHS40 = Idr[136]; + RHS40 += Idr[137]; + m_A214 += gt[138]; + m_A214 += gt[139]; + m_A205 += go[138]; + m_A204 += go[139]; + double RHS41 = Idr[138]; + RHS41 += Idr[139]; + m_A229 += gt[140]; + m_A229 += gt[141]; + m_A219 += go[140]; + m_A218 += go[141]; + double RHS42 = Idr[140]; + RHS42 += Idr[141]; + m_A244 += gt[142]; + m_A244 += gt[143]; + m_A233 += go[142]; + m_A232 += go[143]; + double RHS43 = Idr[142]; + RHS43 += Idr[143]; + m_A263 += gt[144]; + m_A263 += gt[145]; + m_A263 += gt[146]; + m_A263 += gt[147]; + m_A263 += gt[148]; + m_A263 += gt[149]; + m_A263 += gt[150]; + m_A263 += gt[151]; + m_A263 += gt[152]; + m_A246 += go[144]; + m_A264 += go[145]; + m_A251 += go[146]; + m_A250 += go[147]; + m_A249 += go[148]; + m_A248 += go[149]; + m_A247 += go[150]; + double RHS44 = Idr[144]; + RHS44 += Idr[145]; + RHS44 += Idr[146]; + RHS44 += Idr[147]; + RHS44 += Idr[148]; + RHS44 += Idr[149]; + RHS44 += Idr[150]; + RHS44 += Idr[151]; + RHS44 += Idr[152]; + RHS44 -= go[151] * *cnV[151]; + RHS44 -= go[152] * *cnV[152]; + m_A270 += gt[153]; + m_A270 += gt[154]; + m_A270 += gt[155]; + m_A270 += gt[156]; + m_A270 += gt[157]; + m_A270 += gt[158]; + m_A270 += gt[159]; + m_A265 += go[153]; + m_A268 += go[154]; + m_A267 += go[155]; + m_A272 += go[156]; + m_A266 += go[157]; + double RHS45 = Idr[153]; + RHS45 += Idr[154]; + RHS45 += Idr[155]; + RHS45 += Idr[156]; + RHS45 += Idr[157]; + RHS45 += Idr[158]; + RHS45 += Idr[159]; + RHS45 -= go[158] * *cnV[158]; + RHS45 -= go[159] * *cnV[159]; + m_A277 += gt[160]; + m_A277 += gt[161]; + m_A277 += gt[162]; + m_A277 += gt[163]; + m_A273 += go[160]; + m_A274 += go[161]; + m_A275 += go[162]; + double RHS46 = Idr[160]; + RHS46 += Idr[161]; + RHS46 += Idr[162]; + RHS46 += Idr[163]; + RHS46 -= go[163] * *cnV[163]; + m_A284 += gt[164]; + m_A284 += gt[165]; + m_A284 += gt[166]; + m_A284 += gt[167]; + m_A284 += gt[168]; + m_A280 += go[164]; + m_A279 += go[165]; + m_A281 += go[166]; + m_A282 += go[167]; + double RHS47 = Idr[164]; + RHS47 += Idr[165]; + RHS47 += Idr[166]; + RHS47 += Idr[167]; + RHS47 += Idr[168]; + RHS47 -= go[168] * *cnV[168]; + const double f0 = 1.0 / m_A0; + const double f0_34 = -f0 * m_A106; + m_A109 += m_A1 * f0_34; + RHS34 += f0_34 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_36 = -f1 * m_A134; + m_A139 += m_A3 * f1_36; + RHS36 += f1_36 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_38 = -f2 * m_A162; + m_A169 += m_A5 * f2_38; + RHS38 += f2_38 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_40 = -f3 * m_A190; + m_A199 += m_A7 * f3_40; + RHS40 += f3_40 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_42 = -f4 * m_A218; + m_A229 += m_A9 * f4_42; + RHS42 += f4_42 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_43 = -f5 * m_A232; + m_A244 += m_A11 * f5_43; + RHS43 += f5_43 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_41 = -f6 * m_A204; + m_A214 += m_A13 * f6_41; + RHS41 += f6_41 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_39 = -f7 * m_A176; + m_A184 += m_A15 * f7_39; + RHS39 += f7_39 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_37 = -f8 * m_A148; + m_A154 += m_A17 * f8_37; + RHS37 += f8_37 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_35 = -f9 * m_A120; + m_A124 += m_A19 * f9_35; + RHS35 += f9_35 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_33 = -f10 * m_A92; + m_A94 += m_A21 * f10_33; + RHS33 += f10_33 * RHS10; + const double f11 = 1.0 / m_A22; + const double f11_44 = -f11 * m_A246; + m_A247 += m_A23 * f11_44; + m_A252 += m_A24 * f11_44; + RHS44 += f11_44 * RHS11; + const double f12 = 1.0 / m_A25; + const double f12_27 = -f12 * m_A68; + m_A69 += m_A26 * f12_27; + RHS27 += f12_27 * RHS12; + const double f13 = 1.0 / m_A27; + const double f13_28 = -f13 * m_A71; + m_A72 += m_A28 * f13_28; + RHS28 += f13_28 * RHS13; + const double f14 = 1.0 / m_A29; + const double f14_29 = -f14 * m_A74; + m_A75 += m_A30 * f14_29; + RHS29 += f14_29 * RHS14; + const double f15 = 1.0 / m_A31; + const double f15_30 = -f15 * m_A77; + m_A82 += m_A32 * f15_30; + RHS30 += f15_30 * RHS15; + const double f16 = 1.0 / m_A33; + const double f16_30 = -f16 * m_A78; + m_A82 += m_A34 * f16_30; + RHS30 += f16_30 * RHS16; + const double f17 = 1.0 / m_A35; + const double f17_30 = -f17 * m_A79; + m_A82 += m_A36 * f17_30; + RHS30 += f17_30 * RHS17; + const double f18 = 1.0 / m_A37; + const double f18_30 = -f18 * m_A80; + m_A82 += m_A38 * f18_30; + RHS30 += f18_30 * RHS18; + const double f19 = 1.0 / m_A39; + const double f19_30 = -f19 * m_A81; + m_A82 += m_A40 * f19_30; + RHS30 += f19_30 * RHS19; + const double f20 = 1.0 / m_A41; + const double f20_32 = -f20 * m_A87; + m_A88 += m_A42 * f20_32; + RHS32 += f20_32 * RHS20; + const double f21 = 1.0 / m_A43; + const double f21_47 = -f21 * m_A279; + m_A284 += m_A44 * f21_47; + RHS47 += f21_47 * RHS21; + const double f22 = 1.0 / m_A45; + const double f22_45 = -f22 * m_A265; + m_A267 += m_A46 * f22_45; + RHS45 += f22_45 * RHS22; + const double f23 = 1.0 / m_A47; + const double f23_32 = -f23 * m_A88; + m_A89 += m_A48 * f23_32; + m_A90 += m_A49 * f23_32; + RHS32 += f23_32 * RHS23; + const double f23_45 = -f23 * m_A266; + m_A269 += m_A48 * f23_45; + m_A270 += m_A49 * f23_45; + RHS45 += f23_45 * RHS23; + const double f24 = 1.0 / m_A50; + const double f24_45 = -f24 * m_A267; + m_A270 += m_A51 * f24_45; + m_A272 += m_A52 * f24_45; + RHS45 += f24_45 * RHS24; + const double f24_47 = -f24 * m_A280; + m_A282 += m_A51 * f24_47; + m_A284 += m_A52 * f24_47; + RHS47 += f24_47 * RHS24; + const double f25 = 1.0 / m_A53; + const double f25_46 = -f25 * m_A273; + m_A277 += m_A54 * f25_46; + RHS46 += f25_46 * RHS25; + const double f26 = 1.0 / m_A55; + const double f26_33 = -f26 * m_A93; + m_A94 += m_A56 * f26_33; + m_A95 += m_A57 * f26_33; + m_A96 += m_A58 * f26_33; + m_A97 += m_A59 * f26_33; + m_A98 += m_A60 * f26_33; + m_A99 += m_A61 * f26_33; + m_A100 += m_A62 * f26_33; + m_A101 += m_A63 * f26_33; + m_A102 += m_A64 * f26_33; + m_A103 += m_A65 * f26_33; + m_A104 += m_A66 * f26_33; + m_A105 += m_A67 * f26_33; + RHS33 += f26_33 * RHS26; + const double f26_34 = -f26 * m_A107; + m_A108 += m_A56 * f26_34; + m_A109 += m_A57 * f26_34; + m_A110 += m_A58 * f26_34; + m_A111 += m_A59 * f26_34; + m_A112 += m_A60 * f26_34; + m_A113 += m_A61 * f26_34; + m_A114 += m_A62 * f26_34; + m_A115 += m_A63 * f26_34; + m_A116 += m_A64 * f26_34; + m_A117 += m_A65 * f26_34; + m_A118 += m_A66 * f26_34; + m_A119 += m_A67 * f26_34; + RHS34 += f26_34 * RHS26; + const double f26_35 = -f26 * m_A121; + m_A122 += m_A56 * f26_35; + m_A123 += m_A57 * f26_35; + m_A124 += m_A58 * f26_35; + m_A125 += m_A59 * f26_35; + m_A126 += m_A60 * f26_35; + m_A127 += m_A61 * f26_35; + m_A128 += m_A62 * f26_35; + m_A129 += m_A63 * f26_35; + m_A130 += m_A64 * f26_35; + m_A131 += m_A65 * f26_35; + m_A132 += m_A66 * f26_35; + m_A133 += m_A67 * f26_35; + RHS35 += f26_35 * RHS26; + const double f26_36 = -f26 * m_A135; + m_A136 += m_A56 * f26_36; + m_A137 += m_A57 * f26_36; + m_A138 += m_A58 * f26_36; + m_A139 += m_A59 * f26_36; + m_A140 += m_A60 * f26_36; + m_A141 += m_A61 * f26_36; + m_A142 += m_A62 * f26_36; + m_A143 += m_A63 * f26_36; + m_A144 += m_A64 * f26_36; + m_A145 += m_A65 * f26_36; + m_A146 += m_A66 * f26_36; + m_A147 += m_A67 * f26_36; + RHS36 += f26_36 * RHS26; + const double f26_37 = -f26 * m_A149; + m_A150 += m_A56 * f26_37; + m_A151 += m_A57 * f26_37; + m_A152 += m_A58 * f26_37; + m_A153 += m_A59 * f26_37; + m_A154 += m_A60 * f26_37; + m_A155 += m_A61 * f26_37; + m_A156 += m_A62 * f26_37; + m_A157 += m_A63 * f26_37; + m_A158 += m_A64 * f26_37; + m_A159 += m_A65 * f26_37; + m_A160 += m_A66 * f26_37; + m_A161 += m_A67 * f26_37; + RHS37 += f26_37 * RHS26; + const double f26_38 = -f26 * m_A163; + m_A164 += m_A56 * f26_38; + m_A165 += m_A57 * f26_38; + m_A166 += m_A58 * f26_38; + m_A167 += m_A59 * f26_38; + m_A168 += m_A60 * f26_38; + m_A169 += m_A61 * f26_38; + m_A170 += m_A62 * f26_38; + m_A171 += m_A63 * f26_38; + m_A172 += m_A64 * f26_38; + m_A173 += m_A65 * f26_38; + m_A174 += m_A66 * f26_38; + m_A175 += m_A67 * f26_38; + RHS38 += f26_38 * RHS26; + const double f26_39 = -f26 * m_A177; + m_A178 += m_A56 * f26_39; + m_A179 += m_A57 * f26_39; + m_A180 += m_A58 * f26_39; + m_A181 += m_A59 * f26_39; + m_A182 += m_A60 * f26_39; + m_A183 += m_A61 * f26_39; + m_A184 += m_A62 * f26_39; + m_A185 += m_A63 * f26_39; + m_A186 += m_A64 * f26_39; + m_A187 += m_A65 * f26_39; + m_A188 += m_A66 * f26_39; + m_A189 += m_A67 * f26_39; + RHS39 += f26_39 * RHS26; + const double f26_40 = -f26 * m_A191; + m_A192 += m_A56 * f26_40; + m_A193 += m_A57 * f26_40; + m_A194 += m_A58 * f26_40; + m_A195 += m_A59 * f26_40; + m_A196 += m_A60 * f26_40; + m_A197 += m_A61 * f26_40; + m_A198 += m_A62 * f26_40; + m_A199 += m_A63 * f26_40; + m_A200 += m_A64 * f26_40; + m_A201 += m_A65 * f26_40; + m_A202 += m_A66 * f26_40; + m_A203 += m_A67 * f26_40; + RHS40 += f26_40 * RHS26; + const double f26_41 = -f26 * m_A205; + m_A206 += m_A56 * f26_41; + m_A207 += m_A57 * f26_41; + m_A208 += m_A58 * f26_41; + m_A209 += m_A59 * f26_41; + m_A210 += m_A60 * f26_41; + m_A211 += m_A61 * f26_41; + m_A212 += m_A62 * f26_41; + m_A213 += m_A63 * f26_41; + m_A214 += m_A64 * f26_41; + m_A215 += m_A65 * f26_41; + m_A216 += m_A66 * f26_41; + m_A217 += m_A67 * f26_41; + RHS41 += f26_41 * RHS26; + const double f26_42 = -f26 * m_A219; + m_A220 += m_A56 * f26_42; + m_A221 += m_A57 * f26_42; + m_A222 += m_A58 * f26_42; + m_A223 += m_A59 * f26_42; + m_A224 += m_A60 * f26_42; + m_A225 += m_A61 * f26_42; + m_A226 += m_A62 * f26_42; + m_A227 += m_A63 * f26_42; + m_A228 += m_A64 * f26_42; + m_A229 += m_A65 * f26_42; + m_A230 += m_A66 * f26_42; + m_A231 += m_A67 * f26_42; + RHS42 += f26_42 * RHS26; + const double f26_43 = -f26 * m_A233; + m_A234 += m_A56 * f26_43; + m_A235 += m_A57 * f26_43; + m_A236 += m_A58 * f26_43; + m_A237 += m_A59 * f26_43; + m_A238 += m_A60 * f26_43; + m_A239 += m_A61 * f26_43; + m_A240 += m_A62 * f26_43; + m_A241 += m_A63 * f26_43; + m_A242 += m_A64 * f26_43; + m_A243 += m_A65 * f26_43; + m_A244 += m_A66 * f26_43; + m_A245 += m_A67 * f26_43; + RHS43 += f26_43 * RHS26; + const double f26_44 = -f26 * m_A247; + m_A252 += m_A56 * f26_44; + m_A253 += m_A57 * f26_44; + m_A254 += m_A58 * f26_44; + m_A255 += m_A59 * f26_44; + m_A256 += m_A60 * f26_44; + m_A257 += m_A61 * f26_44; + m_A258 += m_A62 * f26_44; + m_A259 += m_A63 * f26_44; + m_A260 += m_A64 * f26_44; + m_A261 += m_A65 * f26_44; + m_A262 += m_A66 * f26_44; + m_A263 += m_A67 * f26_44; + RHS44 += f26_44 * RHS26; + const double f27 = 1.0 / m_A69; + const double f27_44 = -f27 * m_A248; + m_A263 += m_A70 * f27_44; + RHS44 += f27_44 * RHS27; + const double f28 = 1.0 / m_A72; + const double f28_44 = -f28 * m_A249; + m_A263 += m_A73 * f28_44; + RHS44 += f28_44 * RHS28; + const double f29 = 1.0 / m_A75; + const double f29_44 = -f29 * m_A250; + m_A263 += m_A76 * f29_44; + RHS44 += f29_44 * RHS29; + const double f30 = 1.0 / m_A82; + const double f30_44 = -f30 * m_A251; + m_A263 += m_A83 * f30_44; + RHS44 += f30_44 * RHS30; + const double f31 = 1.0 / m_A84; + const double f31_45 = -f31 * m_A268; + m_A270 += m_A85 * f31_45; + m_A271 += m_A86 * f31_45; + RHS45 += f31_45 * RHS31; + const double f31_46 = -f31 * m_A274; + m_A276 += m_A85 * f31_46; + m_A277 += m_A86 * f31_46; + RHS46 += f31_46 * RHS31; + const double f32 = 1.0 / m_A89; + const double f32_45 = -f32 * m_A269; + m_A270 += m_A90 * f32_45; + m_A272 += m_A91 * f32_45; + RHS45 += f32_45 * RHS32; + const double f32_47 = -f32 * m_A281; + m_A282 += m_A90 * f32_47; + m_A284 += m_A91 * f32_47; + RHS47 += f32_47 * RHS32; + const double f33 = 1.0 / m_A94; + const double f33_34 = -f33 * m_A108; + m_A109 += m_A95 * f33_34; + m_A110 += m_A96 * f33_34; + m_A111 += m_A97 * f33_34; + m_A112 += m_A98 * f33_34; + m_A113 += m_A99 * f33_34; + m_A114 += m_A100 * f33_34; + m_A115 += m_A101 * f33_34; + m_A116 += m_A102 * f33_34; + m_A117 += m_A103 * f33_34; + m_A118 += m_A104 * f33_34; + m_A119 += m_A105 * f33_34; + RHS34 += f33_34 * RHS33; + const double f33_35 = -f33 * m_A122; + m_A123 += m_A95 * f33_35; + m_A124 += m_A96 * f33_35; + m_A125 += m_A97 * f33_35; + m_A126 += m_A98 * f33_35; + m_A127 += m_A99 * f33_35; + m_A128 += m_A100 * f33_35; + m_A129 += m_A101 * f33_35; + m_A130 += m_A102 * f33_35; + m_A131 += m_A103 * f33_35; + m_A132 += m_A104 * f33_35; + m_A133 += m_A105 * f33_35; + RHS35 += f33_35 * RHS33; + const double f33_36 = -f33 * m_A136; + m_A137 += m_A95 * f33_36; + m_A138 += m_A96 * f33_36; + m_A139 += m_A97 * f33_36; + m_A140 += m_A98 * f33_36; + m_A141 += m_A99 * f33_36; + m_A142 += m_A100 * f33_36; + m_A143 += m_A101 * f33_36; + m_A144 += m_A102 * f33_36; + m_A145 += m_A103 * f33_36; + m_A146 += m_A104 * f33_36; + m_A147 += m_A105 * f33_36; + RHS36 += f33_36 * RHS33; + const double f33_37 = -f33 * m_A150; + m_A151 += m_A95 * f33_37; + m_A152 += m_A96 * f33_37; + m_A153 += m_A97 * f33_37; + m_A154 += m_A98 * f33_37; + m_A155 += m_A99 * f33_37; + m_A156 += m_A100 * f33_37; + m_A157 += m_A101 * f33_37; + m_A158 += m_A102 * f33_37; + m_A159 += m_A103 * f33_37; + m_A160 += m_A104 * f33_37; + m_A161 += m_A105 * f33_37; + RHS37 += f33_37 * RHS33; + const double f33_38 = -f33 * m_A164; + m_A165 += m_A95 * f33_38; + m_A166 += m_A96 * f33_38; + m_A167 += m_A97 * f33_38; + m_A168 += m_A98 * f33_38; + m_A169 += m_A99 * f33_38; + m_A170 += m_A100 * f33_38; + m_A171 += m_A101 * f33_38; + m_A172 += m_A102 * f33_38; + m_A173 += m_A103 * f33_38; + m_A174 += m_A104 * f33_38; + m_A175 += m_A105 * f33_38; + RHS38 += f33_38 * RHS33; + const double f33_39 = -f33 * m_A178; + m_A179 += m_A95 * f33_39; + m_A180 += m_A96 * f33_39; + m_A181 += m_A97 * f33_39; + m_A182 += m_A98 * f33_39; + m_A183 += m_A99 * f33_39; + m_A184 += m_A100 * f33_39; + m_A185 += m_A101 * f33_39; + m_A186 += m_A102 * f33_39; + m_A187 += m_A103 * f33_39; + m_A188 += m_A104 * f33_39; + m_A189 += m_A105 * f33_39; + RHS39 += f33_39 * RHS33; + const double f33_40 = -f33 * m_A192; + m_A193 += m_A95 * f33_40; + m_A194 += m_A96 * f33_40; + m_A195 += m_A97 * f33_40; + m_A196 += m_A98 * f33_40; + m_A197 += m_A99 * f33_40; + m_A198 += m_A100 * f33_40; + m_A199 += m_A101 * f33_40; + m_A200 += m_A102 * f33_40; + m_A201 += m_A103 * f33_40; + m_A202 += m_A104 * f33_40; + m_A203 += m_A105 * f33_40; + RHS40 += f33_40 * RHS33; + const double f33_41 = -f33 * m_A206; + m_A207 += m_A95 * f33_41; + m_A208 += m_A96 * f33_41; + m_A209 += m_A97 * f33_41; + m_A210 += m_A98 * f33_41; + m_A211 += m_A99 * f33_41; + m_A212 += m_A100 * f33_41; + m_A213 += m_A101 * f33_41; + m_A214 += m_A102 * f33_41; + m_A215 += m_A103 * f33_41; + m_A216 += m_A104 * f33_41; + m_A217 += m_A105 * f33_41; + RHS41 += f33_41 * RHS33; + const double f33_42 = -f33 * m_A220; + m_A221 += m_A95 * f33_42; + m_A222 += m_A96 * f33_42; + m_A223 += m_A97 * f33_42; + m_A224 += m_A98 * f33_42; + m_A225 += m_A99 * f33_42; + m_A226 += m_A100 * f33_42; + m_A227 += m_A101 * f33_42; + m_A228 += m_A102 * f33_42; + m_A229 += m_A103 * f33_42; + m_A230 += m_A104 * f33_42; + m_A231 += m_A105 * f33_42; + RHS42 += f33_42 * RHS33; + const double f33_43 = -f33 * m_A234; + m_A235 += m_A95 * f33_43; + m_A236 += m_A96 * f33_43; + m_A237 += m_A97 * f33_43; + m_A238 += m_A98 * f33_43; + m_A239 += m_A99 * f33_43; + m_A240 += m_A100 * f33_43; + m_A241 += m_A101 * f33_43; + m_A242 += m_A102 * f33_43; + m_A243 += m_A103 * f33_43; + m_A244 += m_A104 * f33_43; + m_A245 += m_A105 * f33_43; + RHS43 += f33_43 * RHS33; + const double f33_44 = -f33 * m_A252; + m_A253 += m_A95 * f33_44; + m_A254 += m_A96 * f33_44; + m_A255 += m_A97 * f33_44; + m_A256 += m_A98 * f33_44; + m_A257 += m_A99 * f33_44; + m_A258 += m_A100 * f33_44; + m_A259 += m_A101 * f33_44; + m_A260 += m_A102 * f33_44; + m_A261 += m_A103 * f33_44; + m_A262 += m_A104 * f33_44; + m_A263 += m_A105 * f33_44; + RHS44 += f33_44 * RHS33; + const double f34 = 1.0 / m_A109; + const double f34_35 = -f34 * m_A123; + m_A124 += m_A110 * f34_35; + m_A125 += m_A111 * f34_35; + m_A126 += m_A112 * f34_35; + m_A127 += m_A113 * f34_35; + m_A128 += m_A114 * f34_35; + m_A129 += m_A115 * f34_35; + m_A130 += m_A116 * f34_35; + m_A131 += m_A117 * f34_35; + m_A132 += m_A118 * f34_35; + m_A133 += m_A119 * f34_35; + RHS35 += f34_35 * RHS34; + const double f34_36 = -f34 * m_A137; + m_A138 += m_A110 * f34_36; + m_A139 += m_A111 * f34_36; + m_A140 += m_A112 * f34_36; + m_A141 += m_A113 * f34_36; + m_A142 += m_A114 * f34_36; + m_A143 += m_A115 * f34_36; + m_A144 += m_A116 * f34_36; + m_A145 += m_A117 * f34_36; + m_A146 += m_A118 * f34_36; + m_A147 += m_A119 * f34_36; + RHS36 += f34_36 * RHS34; + const double f34_37 = -f34 * m_A151; + m_A152 += m_A110 * f34_37; + m_A153 += m_A111 * f34_37; + m_A154 += m_A112 * f34_37; + m_A155 += m_A113 * f34_37; + m_A156 += m_A114 * f34_37; + m_A157 += m_A115 * f34_37; + m_A158 += m_A116 * f34_37; + m_A159 += m_A117 * f34_37; + m_A160 += m_A118 * f34_37; + m_A161 += m_A119 * f34_37; + RHS37 += f34_37 * RHS34; + const double f34_38 = -f34 * m_A165; + m_A166 += m_A110 * f34_38; + m_A167 += m_A111 * f34_38; + m_A168 += m_A112 * f34_38; + m_A169 += m_A113 * f34_38; + m_A170 += m_A114 * f34_38; + m_A171 += m_A115 * f34_38; + m_A172 += m_A116 * f34_38; + m_A173 += m_A117 * f34_38; + m_A174 += m_A118 * f34_38; + m_A175 += m_A119 * f34_38; + RHS38 += f34_38 * RHS34; + const double f34_39 = -f34 * m_A179; + m_A180 += m_A110 * f34_39; + m_A181 += m_A111 * f34_39; + m_A182 += m_A112 * f34_39; + m_A183 += m_A113 * f34_39; + m_A184 += m_A114 * f34_39; + m_A185 += m_A115 * f34_39; + m_A186 += m_A116 * f34_39; + m_A187 += m_A117 * f34_39; + m_A188 += m_A118 * f34_39; + m_A189 += m_A119 * f34_39; + RHS39 += f34_39 * RHS34; + const double f34_40 = -f34 * m_A193; + m_A194 += m_A110 * f34_40; + m_A195 += m_A111 * f34_40; + m_A196 += m_A112 * f34_40; + m_A197 += m_A113 * f34_40; + m_A198 += m_A114 * f34_40; + m_A199 += m_A115 * f34_40; + m_A200 += m_A116 * f34_40; + m_A201 += m_A117 * f34_40; + m_A202 += m_A118 * f34_40; + m_A203 += m_A119 * f34_40; + RHS40 += f34_40 * RHS34; + const double f34_41 = -f34 * m_A207; + m_A208 += m_A110 * f34_41; + m_A209 += m_A111 * f34_41; + m_A210 += m_A112 * f34_41; + m_A211 += m_A113 * f34_41; + m_A212 += m_A114 * f34_41; + m_A213 += m_A115 * f34_41; + m_A214 += m_A116 * f34_41; + m_A215 += m_A117 * f34_41; + m_A216 += m_A118 * f34_41; + m_A217 += m_A119 * f34_41; + RHS41 += f34_41 * RHS34; + const double f34_42 = -f34 * m_A221; + m_A222 += m_A110 * f34_42; + m_A223 += m_A111 * f34_42; + m_A224 += m_A112 * f34_42; + m_A225 += m_A113 * f34_42; + m_A226 += m_A114 * f34_42; + m_A227 += m_A115 * f34_42; + m_A228 += m_A116 * f34_42; + m_A229 += m_A117 * f34_42; + m_A230 += m_A118 * f34_42; + m_A231 += m_A119 * f34_42; + RHS42 += f34_42 * RHS34; + const double f34_43 = -f34 * m_A235; + m_A236 += m_A110 * f34_43; + m_A237 += m_A111 * f34_43; + m_A238 += m_A112 * f34_43; + m_A239 += m_A113 * f34_43; + m_A240 += m_A114 * f34_43; + m_A241 += m_A115 * f34_43; + m_A242 += m_A116 * f34_43; + m_A243 += m_A117 * f34_43; + m_A244 += m_A118 * f34_43; + m_A245 += m_A119 * f34_43; + RHS43 += f34_43 * RHS34; + const double f34_44 = -f34 * m_A253; + m_A254 += m_A110 * f34_44; + m_A255 += m_A111 * f34_44; + m_A256 += m_A112 * f34_44; + m_A257 += m_A113 * f34_44; + m_A258 += m_A114 * f34_44; + m_A259 += m_A115 * f34_44; + m_A260 += m_A116 * f34_44; + m_A261 += m_A117 * f34_44; + m_A262 += m_A118 * f34_44; + m_A263 += m_A119 * f34_44; + RHS44 += f34_44 * RHS34; + const double f35 = 1.0 / m_A124; + const double f35_36 = -f35 * m_A138; + m_A139 += m_A125 * f35_36; + m_A140 += m_A126 * f35_36; + m_A141 += m_A127 * f35_36; + m_A142 += m_A128 * f35_36; + m_A143 += m_A129 * f35_36; + m_A144 += m_A130 * f35_36; + m_A145 += m_A131 * f35_36; + m_A146 += m_A132 * f35_36; + m_A147 += m_A133 * f35_36; + RHS36 += f35_36 * RHS35; + const double f35_37 = -f35 * m_A152; + m_A153 += m_A125 * f35_37; + m_A154 += m_A126 * f35_37; + m_A155 += m_A127 * f35_37; + m_A156 += m_A128 * f35_37; + m_A157 += m_A129 * f35_37; + m_A158 += m_A130 * f35_37; + m_A159 += m_A131 * f35_37; + m_A160 += m_A132 * f35_37; + m_A161 += m_A133 * f35_37; + RHS37 += f35_37 * RHS35; + const double f35_38 = -f35 * m_A166; + m_A167 += m_A125 * f35_38; + m_A168 += m_A126 * f35_38; + m_A169 += m_A127 * f35_38; + m_A170 += m_A128 * f35_38; + m_A171 += m_A129 * f35_38; + m_A172 += m_A130 * f35_38; + m_A173 += m_A131 * f35_38; + m_A174 += m_A132 * f35_38; + m_A175 += m_A133 * f35_38; + RHS38 += f35_38 * RHS35; + const double f35_39 = -f35 * m_A180; + m_A181 += m_A125 * f35_39; + m_A182 += m_A126 * f35_39; + m_A183 += m_A127 * f35_39; + m_A184 += m_A128 * f35_39; + m_A185 += m_A129 * f35_39; + m_A186 += m_A130 * f35_39; + m_A187 += m_A131 * f35_39; + m_A188 += m_A132 * f35_39; + m_A189 += m_A133 * f35_39; + RHS39 += f35_39 * RHS35; + const double f35_40 = -f35 * m_A194; + m_A195 += m_A125 * f35_40; + m_A196 += m_A126 * f35_40; + m_A197 += m_A127 * f35_40; + m_A198 += m_A128 * f35_40; + m_A199 += m_A129 * f35_40; + m_A200 += m_A130 * f35_40; + m_A201 += m_A131 * f35_40; + m_A202 += m_A132 * f35_40; + m_A203 += m_A133 * f35_40; + RHS40 += f35_40 * RHS35; + const double f35_41 = -f35 * m_A208; + m_A209 += m_A125 * f35_41; + m_A210 += m_A126 * f35_41; + m_A211 += m_A127 * f35_41; + m_A212 += m_A128 * f35_41; + m_A213 += m_A129 * f35_41; + m_A214 += m_A130 * f35_41; + m_A215 += m_A131 * f35_41; + m_A216 += m_A132 * f35_41; + m_A217 += m_A133 * f35_41; + RHS41 += f35_41 * RHS35; + const double f35_42 = -f35 * m_A222; + m_A223 += m_A125 * f35_42; + m_A224 += m_A126 * f35_42; + m_A225 += m_A127 * f35_42; + m_A226 += m_A128 * f35_42; + m_A227 += m_A129 * f35_42; + m_A228 += m_A130 * f35_42; + m_A229 += m_A131 * f35_42; + m_A230 += m_A132 * f35_42; + m_A231 += m_A133 * f35_42; + RHS42 += f35_42 * RHS35; + const double f35_43 = -f35 * m_A236; + m_A237 += m_A125 * f35_43; + m_A238 += m_A126 * f35_43; + m_A239 += m_A127 * f35_43; + m_A240 += m_A128 * f35_43; + m_A241 += m_A129 * f35_43; + m_A242 += m_A130 * f35_43; + m_A243 += m_A131 * f35_43; + m_A244 += m_A132 * f35_43; + m_A245 += m_A133 * f35_43; + RHS43 += f35_43 * RHS35; + const double f35_44 = -f35 * m_A254; + m_A255 += m_A125 * f35_44; + m_A256 += m_A126 * f35_44; + m_A257 += m_A127 * f35_44; + m_A258 += m_A128 * f35_44; + m_A259 += m_A129 * f35_44; + m_A260 += m_A130 * f35_44; + m_A261 += m_A131 * f35_44; + m_A262 += m_A132 * f35_44; + m_A263 += m_A133 * f35_44; + RHS44 += f35_44 * RHS35; + const double f36 = 1.0 / m_A139; + const double f36_37 = -f36 * m_A153; + m_A154 += m_A140 * f36_37; + m_A155 += m_A141 * f36_37; + m_A156 += m_A142 * f36_37; + m_A157 += m_A143 * f36_37; + m_A158 += m_A144 * f36_37; + m_A159 += m_A145 * f36_37; + m_A160 += m_A146 * f36_37; + m_A161 += m_A147 * f36_37; + RHS37 += f36_37 * RHS36; + const double f36_38 = -f36 * m_A167; + m_A168 += m_A140 * f36_38; + m_A169 += m_A141 * f36_38; + m_A170 += m_A142 * f36_38; + m_A171 += m_A143 * f36_38; + m_A172 += m_A144 * f36_38; + m_A173 += m_A145 * f36_38; + m_A174 += m_A146 * f36_38; + m_A175 += m_A147 * f36_38; + RHS38 += f36_38 * RHS36; + const double f36_39 = -f36 * m_A181; + m_A182 += m_A140 * f36_39; + m_A183 += m_A141 * f36_39; + m_A184 += m_A142 * f36_39; + m_A185 += m_A143 * f36_39; + m_A186 += m_A144 * f36_39; + m_A187 += m_A145 * f36_39; + m_A188 += m_A146 * f36_39; + m_A189 += m_A147 * f36_39; + RHS39 += f36_39 * RHS36; + const double f36_40 = -f36 * m_A195; + m_A196 += m_A140 * f36_40; + m_A197 += m_A141 * f36_40; + m_A198 += m_A142 * f36_40; + m_A199 += m_A143 * f36_40; + m_A200 += m_A144 * f36_40; + m_A201 += m_A145 * f36_40; + m_A202 += m_A146 * f36_40; + m_A203 += m_A147 * f36_40; + RHS40 += f36_40 * RHS36; + const double f36_41 = -f36 * m_A209; + m_A210 += m_A140 * f36_41; + m_A211 += m_A141 * f36_41; + m_A212 += m_A142 * f36_41; + m_A213 += m_A143 * f36_41; + m_A214 += m_A144 * f36_41; + m_A215 += m_A145 * f36_41; + m_A216 += m_A146 * f36_41; + m_A217 += m_A147 * f36_41; + RHS41 += f36_41 * RHS36; + const double f36_42 = -f36 * m_A223; + m_A224 += m_A140 * f36_42; + m_A225 += m_A141 * f36_42; + m_A226 += m_A142 * f36_42; + m_A227 += m_A143 * f36_42; + m_A228 += m_A144 * f36_42; + m_A229 += m_A145 * f36_42; + m_A230 += m_A146 * f36_42; + m_A231 += m_A147 * f36_42; + RHS42 += f36_42 * RHS36; + const double f36_43 = -f36 * m_A237; + m_A238 += m_A140 * f36_43; + m_A239 += m_A141 * f36_43; + m_A240 += m_A142 * f36_43; + m_A241 += m_A143 * f36_43; + m_A242 += m_A144 * f36_43; + m_A243 += m_A145 * f36_43; + m_A244 += m_A146 * f36_43; + m_A245 += m_A147 * f36_43; + RHS43 += f36_43 * RHS36; + const double f36_44 = -f36 * m_A255; + m_A256 += m_A140 * f36_44; + m_A257 += m_A141 * f36_44; + m_A258 += m_A142 * f36_44; + m_A259 += m_A143 * f36_44; + m_A260 += m_A144 * f36_44; + m_A261 += m_A145 * f36_44; + m_A262 += m_A146 * f36_44; + m_A263 += m_A147 * f36_44; + RHS44 += f36_44 * RHS36; + const double f37 = 1.0 / m_A154; + const double f37_38 = -f37 * m_A168; + m_A169 += m_A155 * f37_38; + m_A170 += m_A156 * f37_38; + m_A171 += m_A157 * f37_38; + m_A172 += m_A158 * f37_38; + m_A173 += m_A159 * f37_38; + m_A174 += m_A160 * f37_38; + m_A175 += m_A161 * f37_38; + RHS38 += f37_38 * RHS37; + const double f37_39 = -f37 * m_A182; + m_A183 += m_A155 * f37_39; + m_A184 += m_A156 * f37_39; + m_A185 += m_A157 * f37_39; + m_A186 += m_A158 * f37_39; + m_A187 += m_A159 * f37_39; + m_A188 += m_A160 * f37_39; + m_A189 += m_A161 * f37_39; + RHS39 += f37_39 * RHS37; + const double f37_40 = -f37 * m_A196; + m_A197 += m_A155 * f37_40; + m_A198 += m_A156 * f37_40; + m_A199 += m_A157 * f37_40; + m_A200 += m_A158 * f37_40; + m_A201 += m_A159 * f37_40; + m_A202 += m_A160 * f37_40; + m_A203 += m_A161 * f37_40; + RHS40 += f37_40 * RHS37; + const double f37_41 = -f37 * m_A210; + m_A211 += m_A155 * f37_41; + m_A212 += m_A156 * f37_41; + m_A213 += m_A157 * f37_41; + m_A214 += m_A158 * f37_41; + m_A215 += m_A159 * f37_41; + m_A216 += m_A160 * f37_41; + m_A217 += m_A161 * f37_41; + RHS41 += f37_41 * RHS37; + const double f37_42 = -f37 * m_A224; + m_A225 += m_A155 * f37_42; + m_A226 += m_A156 * f37_42; + m_A227 += m_A157 * f37_42; + m_A228 += m_A158 * f37_42; + m_A229 += m_A159 * f37_42; + m_A230 += m_A160 * f37_42; + m_A231 += m_A161 * f37_42; + RHS42 += f37_42 * RHS37; + const double f37_43 = -f37 * m_A238; + m_A239 += m_A155 * f37_43; + m_A240 += m_A156 * f37_43; + m_A241 += m_A157 * f37_43; + m_A242 += m_A158 * f37_43; + m_A243 += m_A159 * f37_43; + m_A244 += m_A160 * f37_43; + m_A245 += m_A161 * f37_43; + RHS43 += f37_43 * RHS37; + const double f37_44 = -f37 * m_A256; + m_A257 += m_A155 * f37_44; + m_A258 += m_A156 * f37_44; + m_A259 += m_A157 * f37_44; + m_A260 += m_A158 * f37_44; + m_A261 += m_A159 * f37_44; + m_A262 += m_A160 * f37_44; + m_A263 += m_A161 * f37_44; + RHS44 += f37_44 * RHS37; + const double f38 = 1.0 / m_A169; + const double f38_39 = -f38 * m_A183; + m_A184 += m_A170 * f38_39; + m_A185 += m_A171 * f38_39; + m_A186 += m_A172 * f38_39; + m_A187 += m_A173 * f38_39; + m_A188 += m_A174 * f38_39; + m_A189 += m_A175 * f38_39; + RHS39 += f38_39 * RHS38; + const double f38_40 = -f38 * m_A197; + m_A198 += m_A170 * f38_40; + m_A199 += m_A171 * f38_40; + m_A200 += m_A172 * f38_40; + m_A201 += m_A173 * f38_40; + m_A202 += m_A174 * f38_40; + m_A203 += m_A175 * f38_40; + RHS40 += f38_40 * RHS38; + const double f38_41 = -f38 * m_A211; + m_A212 += m_A170 * f38_41; + m_A213 += m_A171 * f38_41; + m_A214 += m_A172 * f38_41; + m_A215 += m_A173 * f38_41; + m_A216 += m_A174 * f38_41; + m_A217 += m_A175 * f38_41; + RHS41 += f38_41 * RHS38; + const double f38_42 = -f38 * m_A225; + m_A226 += m_A170 * f38_42; + m_A227 += m_A171 * f38_42; + m_A228 += m_A172 * f38_42; + m_A229 += m_A173 * f38_42; + m_A230 += m_A174 * f38_42; + m_A231 += m_A175 * f38_42; + RHS42 += f38_42 * RHS38; + const double f38_43 = -f38 * m_A239; + m_A240 += m_A170 * f38_43; + m_A241 += m_A171 * f38_43; + m_A242 += m_A172 * f38_43; + m_A243 += m_A173 * f38_43; + m_A244 += m_A174 * f38_43; + m_A245 += m_A175 * f38_43; + RHS43 += f38_43 * RHS38; + const double f38_44 = -f38 * m_A257; + m_A258 += m_A170 * f38_44; + m_A259 += m_A171 * f38_44; + m_A260 += m_A172 * f38_44; + m_A261 += m_A173 * f38_44; + m_A262 += m_A174 * f38_44; + m_A263 += m_A175 * f38_44; + RHS44 += f38_44 * RHS38; + const double f39 = 1.0 / m_A184; + const double f39_40 = -f39 * m_A198; + m_A199 += m_A185 * f39_40; + m_A200 += m_A186 * f39_40; + m_A201 += m_A187 * f39_40; + m_A202 += m_A188 * f39_40; + m_A203 += m_A189 * f39_40; + RHS40 += f39_40 * RHS39; + const double f39_41 = -f39 * m_A212; + m_A213 += m_A185 * f39_41; + m_A214 += m_A186 * f39_41; + m_A215 += m_A187 * f39_41; + m_A216 += m_A188 * f39_41; + m_A217 += m_A189 * f39_41; + RHS41 += f39_41 * RHS39; + const double f39_42 = -f39 * m_A226; + m_A227 += m_A185 * f39_42; + m_A228 += m_A186 * f39_42; + m_A229 += m_A187 * f39_42; + m_A230 += m_A188 * f39_42; + m_A231 += m_A189 * f39_42; + RHS42 += f39_42 * RHS39; + const double f39_43 = -f39 * m_A240; + m_A241 += m_A185 * f39_43; + m_A242 += m_A186 * f39_43; + m_A243 += m_A187 * f39_43; + m_A244 += m_A188 * f39_43; + m_A245 += m_A189 * f39_43; + RHS43 += f39_43 * RHS39; + const double f39_44 = -f39 * m_A258; + m_A259 += m_A185 * f39_44; + m_A260 += m_A186 * f39_44; + m_A261 += m_A187 * f39_44; + m_A262 += m_A188 * f39_44; + m_A263 += m_A189 * f39_44; + RHS44 += f39_44 * RHS39; + const double f40 = 1.0 / m_A199; + const double f40_41 = -f40 * m_A213; + m_A214 += m_A200 * f40_41; + m_A215 += m_A201 * f40_41; + m_A216 += m_A202 * f40_41; + m_A217 += m_A203 * f40_41; + RHS41 += f40_41 * RHS40; + const double f40_42 = -f40 * m_A227; + m_A228 += m_A200 * f40_42; + m_A229 += m_A201 * f40_42; + m_A230 += m_A202 * f40_42; + m_A231 += m_A203 * f40_42; + RHS42 += f40_42 * RHS40; + const double f40_43 = -f40 * m_A241; + m_A242 += m_A200 * f40_43; + m_A243 += m_A201 * f40_43; + m_A244 += m_A202 * f40_43; + m_A245 += m_A203 * f40_43; + RHS43 += f40_43 * RHS40; + const double f40_44 = -f40 * m_A259; + m_A260 += m_A200 * f40_44; + m_A261 += m_A201 * f40_44; + m_A262 += m_A202 * f40_44; + m_A263 += m_A203 * f40_44; + RHS44 += f40_44 * RHS40; + const double f41 = 1.0 / m_A214; + const double f41_42 = -f41 * m_A228; + m_A229 += m_A215 * f41_42; + m_A230 += m_A216 * f41_42; + m_A231 += m_A217 * f41_42; + RHS42 += f41_42 * RHS41; + const double f41_43 = -f41 * m_A242; + m_A243 += m_A215 * f41_43; + m_A244 += m_A216 * f41_43; + m_A245 += m_A217 * f41_43; + RHS43 += f41_43 * RHS41; + const double f41_44 = -f41 * m_A260; + m_A261 += m_A215 * f41_44; + m_A262 += m_A216 * f41_44; + m_A263 += m_A217 * f41_44; + RHS44 += f41_44 * RHS41; + const double f42 = 1.0 / m_A229; + const double f42_43 = -f42 * m_A243; + m_A244 += m_A230 * f42_43; + m_A245 += m_A231 * f42_43; + RHS43 += f42_43 * RHS42; + const double f42_44 = -f42 * m_A261; + m_A262 += m_A230 * f42_44; + m_A263 += m_A231 * f42_44; + RHS44 += f42_44 * RHS42; + const double f43 = 1.0 / m_A244; + const double f43_44 = -f43 * m_A262; + m_A263 += m_A245 * f43_44; + RHS44 += f43_44 * RHS43; + const double f44 = 1.0 / m_A263; + const double f44_46 = -f44 * m_A275; + m_A277 += m_A264 * f44_46; + RHS46 += f44_46 * RHS44; + const double f45 = 1.0 / m_A270; + const double f45_46 = -f45 * m_A276; + m_A277 += m_A271 * f45_46; + m_A278 += m_A272 * f45_46; + RHS46 += f45_46 * RHS45; + const double f45_47 = -f45 * m_A282; + m_A283 += m_A271 * f45_47; + m_A284 += m_A272 * f45_47; + RHS47 += f45_47 * RHS45; + const double f46 = 1.0 / m_A277; + const double f46_47 = -f46 * m_A283; + m_A284 += m_A278 * f46_47; + RHS47 += f46_47 * RHS46; + V[47] = RHS47 / m_A284; + double tmp46 = 0.0; + tmp46 += m_A278 * V[47]; + V[46] = (RHS46 - tmp46) / m_A277; + double tmp45 = 0.0; + tmp45 += m_A271 * V[46]; + tmp45 += m_A272 * V[47]; + V[45] = (RHS45 - tmp45) / m_A270; + double tmp44 = 0.0; + tmp44 += m_A264 * V[46]; + V[44] = (RHS44 - tmp44) / m_A263; + double tmp43 = 0.0; + tmp43 += m_A245 * V[44]; + V[43] = (RHS43 - tmp43) / m_A244; + double tmp42 = 0.0; + tmp42 += m_A230 * V[43]; + tmp42 += m_A231 * V[44]; + V[42] = (RHS42 - tmp42) / m_A229; + double tmp41 = 0.0; + tmp41 += m_A215 * V[42]; + tmp41 += m_A216 * V[43]; + tmp41 += m_A217 * V[44]; + V[41] = (RHS41 - tmp41) / m_A214; + double tmp40 = 0.0; + tmp40 += m_A200 * V[41]; + tmp40 += m_A201 * V[42]; + tmp40 += m_A202 * V[43]; + tmp40 += m_A203 * V[44]; + V[40] = (RHS40 - tmp40) / m_A199; + double tmp39 = 0.0; + tmp39 += m_A185 * V[40]; + tmp39 += m_A186 * V[41]; + tmp39 += m_A187 * V[42]; + tmp39 += m_A188 * V[43]; + tmp39 += m_A189 * V[44]; + V[39] = (RHS39 - tmp39) / m_A184; + double tmp38 = 0.0; + tmp38 += m_A170 * V[39]; + tmp38 += m_A171 * V[40]; + tmp38 += m_A172 * V[41]; + tmp38 += m_A173 * V[42]; + tmp38 += m_A174 * V[43]; + tmp38 += m_A175 * V[44]; + V[38] = (RHS38 - tmp38) / m_A169; + double tmp37 = 0.0; + tmp37 += m_A155 * V[38]; + tmp37 += m_A156 * V[39]; + tmp37 += m_A157 * V[40]; + tmp37 += m_A158 * V[41]; + tmp37 += m_A159 * V[42]; + tmp37 += m_A160 * V[43]; + tmp37 += m_A161 * V[44]; + V[37] = (RHS37 - tmp37) / m_A154; + double tmp36 = 0.0; + tmp36 += m_A140 * V[37]; + tmp36 += m_A141 * V[38]; + tmp36 += m_A142 * V[39]; + tmp36 += m_A143 * V[40]; + tmp36 += m_A144 * V[41]; + tmp36 += m_A145 * V[42]; + tmp36 += m_A146 * V[43]; + tmp36 += m_A147 * V[44]; + V[36] = (RHS36 - tmp36) / m_A139; + double tmp35 = 0.0; + tmp35 += m_A125 * V[36]; + tmp35 += m_A126 * V[37]; + tmp35 += m_A127 * V[38]; + tmp35 += m_A128 * V[39]; + tmp35 += m_A129 * V[40]; + tmp35 += m_A130 * V[41]; + tmp35 += m_A131 * V[42]; + tmp35 += m_A132 * V[43]; + tmp35 += m_A133 * V[44]; + V[35] = (RHS35 - tmp35) / m_A124; + double tmp34 = 0.0; + tmp34 += m_A110 * V[35]; + tmp34 += m_A111 * V[36]; + tmp34 += m_A112 * V[37]; + tmp34 += m_A113 * V[38]; + tmp34 += m_A114 * V[39]; + tmp34 += m_A115 * V[40]; + tmp34 += m_A116 * V[41]; + tmp34 += m_A117 * V[42]; + tmp34 += m_A118 * V[43]; + tmp34 += m_A119 * V[44]; + V[34] = (RHS34 - tmp34) / m_A109; + double tmp33 = 0.0; + tmp33 += m_A95 * V[34]; + tmp33 += m_A96 * V[35]; + tmp33 += m_A97 * V[36]; + tmp33 += m_A98 * V[37]; + tmp33 += m_A99 * V[38]; + tmp33 += m_A100 * V[39]; + tmp33 += m_A101 * V[40]; + tmp33 += m_A102 * V[41]; + tmp33 += m_A103 * V[42]; + tmp33 += m_A104 * V[43]; + tmp33 += m_A105 * V[44]; + V[33] = (RHS33 - tmp33) / m_A94; + double tmp32 = 0.0; + tmp32 += m_A90 * V[45]; + tmp32 += m_A91 * V[47]; + V[32] = (RHS32 - tmp32) / m_A89; + double tmp31 = 0.0; + tmp31 += m_A85 * V[45]; + tmp31 += m_A86 * V[46]; + V[31] = (RHS31 - tmp31) / m_A84; + double tmp30 = 0.0; + tmp30 += m_A83 * V[44]; + V[30] = (RHS30 - tmp30) / m_A82; + double tmp29 = 0.0; + tmp29 += m_A76 * V[44]; + V[29] = (RHS29 - tmp29) / m_A75; + double tmp28 = 0.0; + tmp28 += m_A73 * V[44]; + V[28] = (RHS28 - tmp28) / m_A72; + double tmp27 = 0.0; + tmp27 += m_A70 * V[44]; + V[27] = (RHS27 - tmp27) / m_A69; + double tmp26 = 0.0; + tmp26 += m_A56 * V[33]; + tmp26 += m_A57 * V[34]; + tmp26 += m_A58 * V[35]; + tmp26 += m_A59 * V[36]; + tmp26 += m_A60 * V[37]; + tmp26 += m_A61 * V[38]; + tmp26 += m_A62 * V[39]; + tmp26 += m_A63 * V[40]; + tmp26 += m_A64 * V[41]; + tmp26 += m_A65 * V[42]; + tmp26 += m_A66 * V[43]; + tmp26 += m_A67 * V[44]; + V[26] = (RHS26 - tmp26) / m_A55; + double tmp25 = 0.0; + tmp25 += m_A54 * V[46]; + V[25] = (RHS25 - tmp25) / m_A53; + double tmp24 = 0.0; + tmp24 += m_A51 * V[45]; + tmp24 += m_A52 * V[47]; + V[24] = (RHS24 - tmp24) / m_A50; + double tmp23 = 0.0; + tmp23 += m_A48 * V[32]; + tmp23 += m_A49 * V[45]; + V[23] = (RHS23 - tmp23) / m_A47; + double tmp22 = 0.0; + tmp22 += m_A46 * V[24]; + V[22] = (RHS22 - tmp22) / m_A45; + double tmp21 = 0.0; + tmp21 += m_A44 * V[47]; + V[21] = (RHS21 - tmp21) / m_A43; + double tmp20 = 0.0; + tmp20 += m_A42 * V[23]; + V[20] = (RHS20 - tmp20) / m_A41; + double tmp19 = 0.0; + tmp19 += m_A40 * V[30]; + V[19] = (RHS19 - tmp19) / m_A39; + double tmp18 = 0.0; + tmp18 += m_A38 * V[30]; + V[18] = (RHS18 - tmp18) / m_A37; + double tmp17 = 0.0; + tmp17 += m_A36 * V[30]; + V[17] = (RHS17 - tmp17) / m_A35; + double tmp16 = 0.0; + tmp16 += m_A34 * V[30]; + V[16] = (RHS16 - tmp16) / m_A33; + double tmp15 = 0.0; + tmp15 += m_A32 * V[30]; + V[15] = (RHS15 - tmp15) / m_A31; + double tmp14 = 0.0; + tmp14 += m_A30 * V[29]; + V[14] = (RHS14 - tmp14) / m_A29; + double tmp13 = 0.0; + tmp13 += m_A28 * V[28]; + V[13] = (RHS13 - tmp13) / m_A27; + double tmp12 = 0.0; + tmp12 += m_A26 * V[27]; + V[12] = (RHS12 - tmp12) / m_A25; + double tmp11 = 0.0; + tmp11 += m_A23 * V[26]; + tmp11 += m_A24 * V[33]; + V[11] = (RHS11 - tmp11) / m_A22; + double tmp10 = 0.0; + tmp10 += m_A21 * V[33]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[35]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[37]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[39]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[41]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[43]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[42]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[40]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[38]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[36]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[34]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_43_double_double_cf1018e7ed626623(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A9 += go[11]; + double RHS4 = Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A10 += gt[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A11 += go[13]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[14] * *cnV[14]; + RHS5 -= go[15] * *cnV[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A13 += go[16]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 -= go[17] * *cnV[17]; + RHS6 -= go[18] * *cnV[18]; + m_A16 += gt[19]; + m_A16 += gt[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A15 += go[19]; + m_A14 += go[20]; + m_A17 += go[21]; + m_A17 += go[22]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 -= go[23] * *cnV[23]; + RHS7 -= go[24] * *cnV[24]; + RHS7 -= go[25] * *cnV[25]; + m_A18 += gt[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A19 += go[26]; + double RHS8 = Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 -= go[27] * *cnV[27]; + RHS8 -= go[28] * *cnV[28]; + m_A20 += gt[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A21 += go[29]; + double RHS9 = Idr[29]; + RHS9 += Idr[30]; + RHS9 += Idr[31]; + RHS9 -= go[30] * *cnV[30]; + RHS9 -= go[31] * *cnV[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A23 += go[32]; + double RHS10 = Idr[32]; + RHS10 += Idr[33]; + RHS10 += Idr[34]; + RHS10 -= go[33] * *cnV[33]; + RHS10 -= go[34] * *cnV[34]; + m_A24 += gt[35]; + m_A24 += gt[36]; + m_A24 += gt[37]; + m_A25 += go[35]; + double RHS11 = Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 -= go[36] * *cnV[36]; + RHS11 -= go[37] * *cnV[37]; + m_A26 += gt[38]; + m_A26 += gt[39]; + m_A26 += gt[40]; + m_A27 += go[38]; + double RHS12 = Idr[38]; + RHS12 += Idr[39]; + RHS12 += Idr[40]; + RHS12 -= go[39] * *cnV[39]; + RHS12 -= go[40] * *cnV[40]; + m_A29 += gt[41]; + m_A29 += gt[42]; + m_A29 += gt[43]; + m_A29 += gt[44]; + m_A29 += gt[45]; + m_A28 += go[41]; + m_A28 += go[42]; + m_A30 += go[43]; + double RHS13 = Idr[41]; + RHS13 += Idr[42]; + RHS13 += Idr[43]; + RHS13 += Idr[44]; + RHS13 += Idr[45]; + RHS13 -= go[44] * *cnV[44]; + RHS13 -= go[45] * *cnV[45]; + m_A42 += gt[46]; + m_A42 += gt[47]; + m_A42 += gt[48]; + m_A42 += gt[49]; + m_A42 += gt[50]; + m_A42 += gt[51]; + m_A42 += gt[52]; + m_A42 += gt[53]; + m_A42 += gt[54]; + m_A42 += gt[55]; + m_A42 += gt[56]; + m_A42 += gt[57]; + m_A41 += go[46]; + m_A40 += go[47]; + m_A39 += go[48]; + m_A38 += go[49]; + m_A37 += go[50]; + m_A36 += go[51]; + m_A35 += go[52]; + m_A34 += go[53]; + m_A33 += go[54]; + m_A32 += go[55]; + m_A31 += go[56]; + double RHS14 = Idr[46]; + RHS14 += Idr[47]; + RHS14 += Idr[48]; + RHS14 += Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 += Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 += Idr[55]; + RHS14 += Idr[56]; + RHS14 += Idr[57]; + RHS14 -= go[57] * *cnV[57]; + const double f0 = 1.0 / m_A0; + const double f0_14 = -f0 * m_A31; + m_A42 += m_A1 * f0_14; + RHS14 += f0_14 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_14 = -f1 * m_A32; + m_A42 += m_A3 * f1_14; + RHS14 += f1_14 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_14 = -f2 * m_A33; + m_A42 += m_A5 * f2_14; + RHS14 += f2_14 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_7 = -f3 * m_A14; + m_A16 += m_A7 * f3_7; + RHS7 += f3_7 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_7 = -f4 * m_A15; + m_A16 += m_A9 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_14 = -f5 * m_A34; + m_A42 += m_A11 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_14 = -f6 * m_A35; + m_A42 += m_A13 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_13 = -f7 * m_A28; + m_A29 += m_A17 * f7_13; + RHS13 += f7_13 * RHS7; + const double f8 = 1.0 / m_A18; + const double f8_14 = -f8 * m_A36; + m_A42 += m_A19 * f8_14; + RHS14 += f8_14 * RHS8; + const double f9 = 1.0 / m_A20; + const double f9_14 = -f9 * m_A37; + m_A42 += m_A21 * f9_14; + RHS14 += f9_14 * RHS9; + const double f10 = 1.0 / m_A22; + const double f10_14 = -f10 * m_A38; + m_A42 += m_A23 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A24; + const double f11_14 = -f11 * m_A39; + m_A42 += m_A25 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_14 = -f12 * m_A40; + m_A42 += m_A27 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A29; + const double f13_14 = -f13 * m_A41; + m_A42 += m_A30 * f13_14; + RHS14 += f13_14 * RHS13; + V[14] = RHS14 / m_A42; + double tmp13 = 0.0; + tmp13 += m_A30 * V[14]; + V[13] = (RHS13 - tmp13) / m_A29; + double tmp12 = 0.0; + tmp12 += m_A27 * V[14]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A25 * V[14]; + V[11] = (RHS11 - tmp11) / m_A24; + double tmp10 = 0.0; + tmp10 += m_A23 * V[14]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + tmp9 += m_A21 * V[14]; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A19 * V[14]; + V[8] = (RHS8 - tmp8) / m_A18; + double tmp7 = 0.0; + tmp7 += m_A17 * V[13]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A13 * V[14]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[14]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[7]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[7]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[14]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[14]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[14]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// astrob +static void nl_gcr_46_double_double_536c3652eb3bc075(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A3 += go[7]; + m_A4 += go[8]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A6 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A7 += gt[15]; + m_A8 += go[13]; + m_A9 += go[14]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[17] * *cnV[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A14 += go[18]; + m_A13 += go[19]; + m_A13 += go[20]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[21] * *cnV[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A15 += go[22]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + RHS6 -= go[28] * *cnV[28]; + m_A21 += gt[29]; + m_A21 += gt[30]; + m_A21 += gt[31]; + m_A21 += gt[32]; + m_A21 += gt[33]; + m_A19 += go[29]; + m_A22 += go[30]; + m_A20 += go[31]; + double RHS7 = Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 -= go[32] * *cnV[32]; + RHS7 -= go[33] * *cnV[33]; + m_A26 += gt[34]; + m_A26 += gt[35]; + m_A26 += gt[36]; + m_A26 += gt[37]; + m_A26 += gt[38]; + m_A26 += gt[39]; + m_A27 += go[34]; + m_A27 += go[35]; + m_A25 += go[36]; + m_A25 += go[37]; + m_A24 += go[38]; + m_A28 += go[39]; + double RHS8 = Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 += Idr[38]; + RHS8 += Idr[39]; + m_A31 += gt[40]; + m_A31 += gt[41]; + m_A31 += gt[42]; + m_A31 += gt[43]; + m_A31 += gt[44]; + m_A29 += go[40]; + m_A30 += go[41]; + m_A30 += go[42]; + double RHS9 = Idr[40]; + RHS9 += Idr[41]; + RHS9 += Idr[42]; + RHS9 += Idr[43]; + RHS9 += Idr[44]; + RHS9 -= go[43] * *cnV[43]; + RHS9 -= go[44] * *cnV[44]; + m_A36 += gt[45]; + m_A36 += gt[46]; + m_A36 += gt[47]; + m_A36 += gt[48]; + m_A36 += gt[49]; + m_A34 += go[45]; + m_A33 += go[46]; + m_A35 += go[47]; + m_A37 += go[48]; + double RHS10 = Idr[45]; + RHS10 += Idr[46]; + RHS10 += Idr[47]; + RHS10 += Idr[48]; + RHS10 += Idr[49]; + RHS10 -= go[49] * *cnV[49]; + m_A45 += gt[50]; + m_A45 += gt[51]; + m_A45 += gt[52]; + m_A45 += gt[53]; + m_A45 += gt[54]; + m_A45 += gt[55]; + m_A45 += gt[56]; + m_A40 += go[50]; + m_A42 += go[51]; + m_A39 += go[52]; + m_A44 += go[53]; + m_A38 += go[54]; + double RHS11 = Idr[50]; + RHS11 += Idr[51]; + RHS11 += Idr[52]; + RHS11 += Idr[53]; + RHS11 += Idr[54]; + RHS11 += Idr[55]; + RHS11 += Idr[56]; + RHS11 -= go[55] * *cnV[55]; + RHS11 -= go[56] * *cnV[56]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A19; + m_A20 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A20; + m_A21 += m_A3 * f1_7; + m_A23 += m_A4 * f1_7; + RHS7 += f1_7 * RHS1; + const double f1_11 = -f1 * m_A38; + m_A41 += m_A3 * f1_11; + m_A45 += m_A4 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_10 = -f2 * m_A33; + m_A36 += m_A6 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_6 = -f3 * m_A15; + m_A17 += m_A8 * f3_6; + m_A18 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_10 = -f3 * m_A34; + m_A36 += m_A8 * f3_10; + m_A37 += m_A9 * f3_10; + RHS10 += f3_10 * RHS3; + const double f3_11 = -f3 * m_A39; + m_A44 += m_A8 * f3_11; + m_A45 += m_A9 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_8 = -f4 * m_A24; + m_A26 += m_A11 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_8 = -f5 * m_A25; + m_A26 += m_A13 * f5_8; + m_A27 += m_A14 * f5_8; + RHS8 += f5_8 * RHS5; + const double f5_9 = -f5 * m_A29; + m_A30 += m_A13 * f5_9; + m_A31 += m_A14 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_11 = -f6 * m_A40; + m_A44 += m_A17 * f6_11; + m_A45 += m_A18 * f6_11; + RHS11 += f6_11 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_10 = -f7 * m_A35; + m_A36 += m_A22 * f7_10; + m_A37 += m_A23 * f7_10; + RHS10 += f7_10 * RHS7; + const double f7_11 = -f7 * m_A41; + m_A44 += m_A22 * f7_11; + m_A45 += m_A23 * f7_11; + RHS11 += f7_11 * RHS7; + const double f8 = 1.0 / m_A26; + const double f8_9 = -f8 * m_A30; + m_A31 += m_A27 * f8_9; + m_A32 += m_A28 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_11 = -f8 * m_A42; + m_A43 += m_A27 * f8_11; + m_A45 += m_A28 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A31; + const double f9_11 = -f9 * m_A43; + m_A45 += m_A32 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A36; + const double f10_11 = -f10 * m_A44; + m_A45 += m_A37 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A45; + double tmp10 = 0.0; + tmp10 += m_A37 * V[11]; + V[10] = (RHS10 - tmp10) / m_A36; + double tmp9 = 0.0; + tmp9 += m_A32 * V[11]; + V[9] = (RHS9 - tmp9) / m_A31; + double tmp8 = 0.0; + tmp8 += m_A27 * V[9]; + tmp8 += m_A28 * V[11]; + V[8] = (RHS8 - tmp8) / m_A26; + double tmp7 = 0.0; + tmp7 += m_A22 * V[10]; + tmp7 += m_A23 * V[11]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A17 * V[10]; + tmp6 += m_A18 * V[11]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A13 * V[8]; + tmp5 += m_A14 * V[9]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A11 * V[8]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[10]; + tmp3 += m_A9 * V[11]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[10]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + tmp1 += m_A4 * V[11]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// barrier,spacewar +static void nl_gcr_10_double_double_a50a4b733e95414a(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A4 += go[6]; + m_A6 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A7 += go[10]; + m_A8 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// barrier,spacewar +static void nl_gcr_10_double_double_ecf17036ce1c07cf(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A4 += go[6]; + m_A6 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A7 += go[10]; + m_A8 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// barrier +static void nl_gcr_13_double_double_f425d4008ae1d2c6(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 -= go[8] * *cnV[8]; + m_A12 += gt[9]; + m_A12 += gt[10]; + m_A12 += gt[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A11 += go[9]; + m_A10 += go[10]; + m_A9 += go[11]; + m_A8 += go[12]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[13] * *cnV[13]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A8; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A9; + m_A12 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A7 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A7 * V[4]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// barrier +static void nl_gcr_15_double_double_d06bd7ddbfd17b5e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A4 += go[2]; + m_A3 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + m_A5 += gt[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A6 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + m_A9 += gt[7]; + m_A9 += gt[8]; + m_A7 += go[7]; + m_A8 += go[8]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + m_A14 += gt[9]; + m_A14 += gt[10]; + m_A12 += go[9]; + m_A11 += go[10]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A11; + m_A13 += m_A3 * f1_4; + m_A14 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A12; + m_A14 += m_A6 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A14; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// barrier +static void nl_gcr_19_double_double_cc913f9c3f9293e7(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[2]; + m_A4 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A7 += go[9]; + m_A6 += go[10]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A9 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A11 += go[14]; + m_A10 += go[15]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[16] * *cnV[16]; + m_A18 += gt[17]; + m_A18 += gt[18]; + m_A18 += gt[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A14 += go[17]; + m_A16 += go[18]; + m_A15 += go[19]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A14; + m_A15 += m_A3 * f1_5; + m_A17 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A11; + m_A12 += m_A6 * f2_4; + m_A13 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A15; + m_A17 += m_A6 * f2_5; + m_A18 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_5 = -f3 * m_A16; + m_A18 += m_A9 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_5 = -f4 * m_A17; + m_A18 += m_A13 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A18; + double tmp4 = 0.0; + tmp4 += m_A13 * V[5]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[5]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// barrier +static void nl_gcr_31_double_double_79e756c5892cf87d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A8 += go[11]; + m_A9 += go[12]; + m_A7 += go[13]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A11 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A12 += go[19]; + m_A13 += go[20]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A17 += go[21]; + m_A19 += go[22]; + double RHS6 = Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 -= go[23] * *cnV[23]; + m_A23 += gt[24]; + m_A23 += gt[25]; + m_A21 += go[24]; + m_A20 += go[25]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + m_A30 += gt[26]; + m_A30 += gt[27]; + m_A30 += gt[28]; + m_A30 += gt[29]; + m_A30 += gt[30]; + m_A25 += go[26]; + m_A26 += go[27]; + m_A28 += go[28]; + double RHS8 = Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 -= go[29] * *cnV[29]; + RHS8 -= go[30] * *cnV[30]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A12; + m_A14 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A17; + m_A18 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_8 = -f2 * m_A25; + m_A28 += m_A5 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_5 = -f3 * m_A13; + m_A14 += m_A7 * f3_5; + m_A15 += m_A8 * f3_5; + m_A16 += m_A9 * f3_5; + RHS5 += f3_5 * RHS3; + const double f3_7 = -f3 * m_A20; + m_A22 += m_A7 * f3_7; + m_A23 += m_A8 * f3_7; + m_A24 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_8 = -f3 * m_A26; + m_A27 += m_A7 * f3_8; + m_A29 += m_A8 * f3_8; + m_A30 += m_A9 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_7 = -f4 * m_A21; + m_A23 += m_A11 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_7 = -f5 * m_A22; + m_A23 += m_A15 * f5_7; + m_A24 += m_A16 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_8 = -f5 * m_A27; + m_A29 += m_A15 * f5_8; + m_A30 += m_A16 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_8 = -f6 * m_A28; + m_A30 += m_A19 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A23; + const double f7_8 = -f7 * m_A29; + m_A30 += m_A24 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A30; + double tmp7 = 0.0; + tmp7 += m_A24 * V[8]; + V[7] = (RHS7 - tmp7) / m_A23; + double tmp6 = 0.0; + tmp6 += m_A19 * V[8]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A15 * V[7]; + tmp5 += m_A16 * V[8]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A11 * V[7]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A7 * V[5]; + tmp3 += m_A8 * V[7]; + tmp3 += m_A9 * V[8]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// barrier,spacewar +static void nl_gcr_47_double_double_6ef39a62161d596c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A7 += go[11]; + m_A7 += go[12]; + m_A7 += go[13]; + m_A9 += go[14]; + m_A8 += go[15]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[16] * *cnV[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A11 += go[17]; + m_A12 += go[18]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A13 += gt[24]; + m_A13 += gt[25]; + m_A14 += go[19]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A16 += gt[29]; + m_A16 += gt[30]; + m_A15 += go[26]; + m_A15 += go[27]; + m_A15 += go[28]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A20 += gt[34]; + m_A19 += go[31]; + m_A21 += go[32]; + m_A21 += go[33]; + double RHS7 = Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 -= go[34] * *cnV[34]; + m_A23 += gt[35]; + m_A23 += gt[36]; + m_A22 += go[35]; + m_A24 += go[36]; + double RHS8 = Idr[35]; + RHS8 += Idr[36]; + m_A26 += gt[37]; + m_A26 += gt[38]; + m_A26 += gt[39]; + m_A28 += go[37]; + m_A25 += go[38]; + double RHS9 = Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 -= go[39] * *cnV[39]; + m_A33 += gt[40]; + m_A33 += gt[41]; + m_A33 += gt[42]; + m_A33 += gt[43]; + m_A33 += gt[44]; + m_A33 += gt[45]; + m_A33 += gt[46]; + m_A29 += go[40]; + m_A30 += go[41]; + m_A32 += go[42]; + m_A32 += go[43]; + double RHS10 = Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + RHS10 -= go[44] * *cnV[44]; + RHS10 -= go[45] * *cnV[45]; + RHS10 -= go[46] * *cnV[46]; + m_A41 += gt[47]; + m_A41 += gt[48]; + m_A41 += gt[49]; + m_A41 += gt[50]; + m_A41 += gt[51]; + m_A41 += gt[52]; + m_A36 += go[47]; + m_A35 += go[48]; + m_A38 += go[49]; + double RHS11 = Idr[47]; + RHS11 += Idr[48]; + RHS11 += Idr[49]; + RHS11 += Idr[50]; + RHS11 += Idr[51]; + RHS11 += Idr[52]; + RHS11 -= go[50] * *cnV[50]; + RHS11 -= go[51] * *cnV[51]; + RHS11 -= go[52] * *cnV[52]; + m_A46 += gt[53]; + m_A46 += gt[54]; + m_A46 += gt[55]; + m_A46 += gt[56]; + m_A46 += gt[57]; + m_A43 += go[53]; + m_A44 += go[54]; + double RHS12 = Idr[53]; + RHS12 += Idr[54]; + RHS12 += Idr[55]; + RHS12 += Idr[56]; + RHS12 += Idr[57]; + RHS12 -= go[55] * *cnV[55]; + RHS12 -= go[56] * *cnV[56]; + RHS12 -= go[57] * *cnV[57]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A19; + m_A20 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A29; + m_A32 += m_A3 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_8 = -f2 * m_A22; + m_A23 += m_A5 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A15; + m_A16 += m_A7 * f3_6; + m_A17 += m_A8 * f3_6; + m_A18 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_10 = -f3 * m_A30; + m_A31 += m_A7 * f3_10; + m_A33 += m_A8 * f3_10; + m_A34 += m_A9 * f3_10; + RHS10 += f3_10 * RHS3; + const double f3_11 = -f3 * m_A35; + m_A37 += m_A7 * f3_11; + m_A40 += m_A8 * f3_11; + m_A41 += m_A9 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_9 = -f4 * m_A25; + m_A26 += m_A11 * f4_9; + m_A27 += m_A12 * f4_9; + RHS9 += f4_9 * RHS4; + const double f4_11 = -f4 * m_A36; + m_A39 += m_A11 * f4_11; + m_A41 += m_A12 * f4_11; + RHS11 += f4_11 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_12 = -f5 * m_A43; + m_A44 += m_A14 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_10 = -f6 * m_A31; + m_A33 += m_A17 * f6_10; + m_A34 += m_A18 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_11 = -f6 * m_A37; + m_A40 += m_A17 * f6_11; + m_A41 += m_A18 * f6_11; + RHS11 += f6_11 * RHS6; + const double f7 = 1.0 / m_A20; + const double f7_10 = -f7 * m_A32; + m_A33 += m_A21 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A23; + const double f8_11 = -f8 * m_A38; + m_A41 += m_A24 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A26; + const double f9_11 = -f9 * m_A39; + m_A41 += m_A27 * f9_11; + m_A42 += m_A28 * f9_11; + RHS11 += f9_11 * RHS9; + const double f9_12 = -f9 * m_A44; + m_A45 += m_A27 * f9_12; + m_A46 += m_A28 * f9_12; + RHS12 += f9_12 * RHS9; + const double f10 = 1.0 / m_A33; + const double f10_11 = -f10 * m_A40; + m_A41 += m_A34 * f10_11; + RHS11 += f10_11 * RHS10; + const double f11 = 1.0 / m_A41; + const double f11_12 = -f11 * m_A45; + m_A46 += m_A42 * f11_12; + RHS12 += f11_12 * RHS11; + V[12] = RHS12 / m_A46; + double tmp11 = 0.0; + tmp11 += m_A42 * V[12]; + V[11] = (RHS11 - tmp11) / m_A41; + double tmp10 = 0.0; + tmp10 += m_A34 * V[11]; + V[10] = (RHS10 - tmp10) / m_A33; + double tmp9 = 0.0; + tmp9 += m_A27 * V[11]; + tmp9 += m_A28 * V[12]; + V[9] = (RHS9 - tmp9) / m_A26; + double tmp8 = 0.0; + tmp8 += m_A24 * V[11]; + V[8] = (RHS8 - tmp8) / m_A23; + double tmp7 = 0.0; + tmp7 += m_A21 * V[10]; + V[7] = (RHS7 - tmp7) / m_A20; + double tmp6 = 0.0; + tmp6 += m_A17 * V[10]; + tmp6 += m_A18 * V[11]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[9]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[9]; + tmp4 += m_A12 * V[11]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + tmp3 += m_A8 * V[10]; + tmp3 += m_A9 * V[11]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[8]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_16_double_double_50f5194a994d56ec(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A6 += go[10]; + m_A8 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A9 += go[12]; + m_A11 += go[13]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + m_A15 += gt[14]; + m_A15 += gt[15]; + m_A15 += gt[16]; + m_A15 += gt[17]; + m_A13 += go[14]; + m_A14 += go[15]; + m_A12 += go[16]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A12; + m_A15 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A6; + m_A7 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A9; + m_A10 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_5 = -f3 * m_A13; + m_A15 += m_A8 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_5 = -f4 * m_A14; + m_A15 += m_A11 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A15; + double tmp4 = 0.0; + tmp4 += m_A11 * V[5]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[5]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_22_double_double_2f84bc98d737730b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A3 += go[6]; + double RHS1 = Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[7] * *cnV[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A7 += go[8]; + m_A6 += go[9]; + m_A6 += go[10]; + m_A5 += go[11]; + m_A5 += go[12]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + RHS2 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A8 += go[16]; + m_A9 += go[17]; + m_A9 += go[18]; + double RHS3 = Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 += Idr[20]; + RHS3 -= go[19] * *cnV[19]; + RHS3 -= go[20] * *cnV[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A15 += gt[25]; + m_A16 += go[21]; + m_A16 += go[22]; + m_A13 += go[23]; + m_A13 += go[24]; + double RHS4 = Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 -= go[25] * *cnV[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A21 += gt[30]; + m_A20 += go[26]; + m_A20 += go[27]; + m_A18 += go[28]; + m_A17 += go[29]; + double RHS5 = Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 += Idr[30]; + RHS5 -= go[30] * *cnV[30]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A17; + m_A21 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A9; + m_A10 += m_A5 * f2_3; + m_A11 += m_A6 * f2_3; + m_A12 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_4 = -f2 * m_A13; + m_A14 += m_A5 * f2_4; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A18; + m_A19 += m_A5 * f2_5; + m_A20 += m_A6 * f2_5; + m_A21 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + m_A16 += m_A12 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A19; + m_A20 += m_A11 * f3_5; + m_A21 += m_A12 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A20; + m_A21 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A21; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + tmp3 += m_A12 * V[5]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_22_double_double_a6b734322b3ea924(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A4 += gt[14]; + m_A7 += go[7]; + m_A6 += go[8]; + m_A6 += go[9]; + m_A5 += go[10]; + m_A5 += go[11]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A8 += go[15]; + m_A9 += go[16]; + m_A9 += go[17]; + double RHS3 = Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A16 += go[20]; + m_A16 += go[21]; + m_A13 += go[22]; + m_A13 += go[23]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 -= go[24] * *cnV[24]; + m_A21 += gt[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A20 += go[25]; + m_A20 += go[26]; + m_A18 += go[27]; + m_A17 += go[28]; + double RHS5 = Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 -= go[29] * *cnV[29]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A17; + m_A21 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A9; + m_A10 += m_A5 * f2_3; + m_A11 += m_A6 * f2_3; + m_A12 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_4 = -f2 * m_A13; + m_A14 += m_A5 * f2_4; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A18; + m_A19 += m_A5 * f2_5; + m_A20 += m_A6 * f2_5; + m_A21 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + m_A16 += m_A12 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A19; + m_A20 += m_A11 * f3_5; + m_A21 += m_A12 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A20; + m_A21 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A21; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + tmp3 += m_A12 * V[5]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_23_double_double_53e1117fdb16f546(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[4]; + m_A3 += go[5]; + m_A3 += go[6]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A7 += go[10]; + m_A6 += go[11]; + m_A6 += go[12]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[14]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[15] * *cnV[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A11 += go[16]; + m_A11 += go[17]; + m_A10 += go[18]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A15 += go[21]; + m_A15 += go[22]; + m_A14 += go[23]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A20 += go[26]; + m_A19 += go[27]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 -= go[28] * *cnV[28]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A11; + m_A12 += m_A3 * f1_4; + m_A13 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A14; + m_A16 += m_A3 * f1_5; + m_A17 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_5 = -f2 * m_A15; + m_A17 += m_A6 * f2_5; + m_A18 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_6 = -f2 * m_A19; + m_A21 += m_A6 * f2_6; + m_A22 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_6 = -f3 * m_A20; + m_A22 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_5 = -f4 * m_A16; + m_A17 += m_A13 * f4_5; + RHS5 += f4_5 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A18 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[6]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A13 * V[5]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[6]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[5]; + tmp2 += m_A7 * V[6]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_23_double_double_f43cf2a28a5a5561(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[3]; + m_A3 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A7 += go[9]; + m_A6 += go[10]; + m_A6 += go[11]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A11 += go[15]; + m_A11 += go[16]; + m_A10 += go[17]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A15 += go[21]; + m_A15 += go[22]; + m_A14 += go[23]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A20 += go[26]; + m_A19 += go[27]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 -= go[28] * *cnV[28]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A11; + m_A12 += m_A3 * f1_4; + m_A13 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A14; + m_A16 += m_A3 * f1_5; + m_A17 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_5 = -f2 * m_A15; + m_A17 += m_A6 * f2_5; + m_A18 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_6 = -f2 * m_A19; + m_A21 += m_A6 * f2_6; + m_A22 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_6 = -f3 * m_A20; + m_A22 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_5 = -f4 * m_A16; + m_A17 += m_A13 * f4_5; + RHS5 += f4_5 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A18 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[6]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A13 * V[5]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[6]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[5]; + tmp2 += m_A7 * V[6]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_25_double_double_a0bf548977306172(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A6 += go[4]; + m_A5 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A8 += go[11]; + m_A9 += go[12]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A12 += go[14]; + m_A10 += go[15]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[16] * *cnV[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A15 += go[17]; + m_A13 += go[18]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[19] * *cnV[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A16 += go[20]; + m_A17 += go[21]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 -= go[22] * *cnV[22]; + m_A24 += gt[23]; + m_A24 += gt[24]; + m_A24 += gt[25]; + m_A24 += gt[26]; + m_A24 += gt[27]; + m_A20 += go[23]; + m_A21 += go[24]; + m_A22 += go[25]; + double RHS7 = Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A11 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A13; + m_A14 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A20; + m_A22 += m_A5 * f2_7; + m_A24 += m_A6 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_6 = -f3 * m_A16; + m_A18 += m_A8 * f3_6; + m_A19 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_7 = -f3 * m_A21; + m_A23 += m_A8 * f3_7; + m_A24 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_6 = -f4 * m_A17; + m_A18 += m_A12 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_7 = -f5 * m_A22; + m_A24 += m_A15 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_7 = -f6 * m_A23; + m_A24 += m_A19 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A24; + double tmp6 = 0.0; + tmp6 += m_A19 * V[7]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A15 * V[7]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A12 * V[6]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[6]; + tmp3 += m_A9 * V[7]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[5]; + tmp2 += m_A6 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_29_double_double_a6f74be7f61e6db2(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[3]; + m_A3 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A7 += go[9]; + m_A6 += go[10]; + m_A6 += go[11]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A11 += go[15]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[16] * *cnV[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A13 += go[17]; + m_A13 += go[18]; + m_A12 += go[19]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A17 += go[23]; + m_A17 += go[24]; + m_A16 += go[25]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A24 += gt[30]; + m_A24 += gt[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A22 += go[28]; + m_A25 += go[29]; + m_A21 += go[30]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 -= go[31] * *cnV[31]; + RHS7 -= go[32] * *cnV[32]; + RHS7 -= go[33] * *cnV[33]; + m_A28 += gt[34]; + m_A28 += gt[35]; + m_A26 += go[34]; + m_A27 += go[35]; + double RHS8 = Idr[34]; + RHS8 += Idr[35]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A12; + m_A14 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A13; + m_A14 += m_A3 * f1_5; + m_A15 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_6 = -f1 * m_A16; + m_A18 += m_A3 * f1_6; + m_A19 += m_A4 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_6 = -f2 * m_A17; + m_A19 += m_A6 * f2_6; + m_A20 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_7 = -f2 * m_A21; + m_A23 += m_A6 * f2_7; + m_A24 += m_A7 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_7 = -f3 * m_A22; + m_A24 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_8 = -f4 * m_A26; + m_A28 += m_A11 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_6 = -f5 * m_A18; + m_A19 += m_A15 * f5_6; + RHS6 += f5_6 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_7 = -f6 * m_A23; + m_A24 += m_A20 * f6_7; + RHS7 += f6_7 * RHS6; + const double f7 = 1.0 / m_A24; + const double f7_8 = -f7 * m_A27; + m_A28 += m_A25 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A28; + double tmp7 = 0.0; + tmp7 += m_A25 * V[8]; + V[7] = (RHS7 - tmp7) / m_A24; + double tmp6 = 0.0; + tmp6 += m_A20 * V[7]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A15 * V[6]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A11 * V[8]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[7]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[6]; + tmp2 += m_A7 * V[7]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + tmp1 += m_A4 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_55_double_double_b8d6d148a50bdb8f(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A5 += go[4]; + m_A4 += go[5]; + m_A4 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A8 += go[12]; + m_A7 += go[13]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 -= go[14] * *cnV[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A9 += gt[17]; + m_A9 += gt[18]; + m_A10 += go[15]; + double RHS3 = Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A11 += gt[23]; + m_A11 += gt[24]; + m_A11 += gt[25]; + m_A11 += gt[26]; + m_A14 += go[19]; + m_A13 += go[20]; + m_A13 += go[21]; + m_A12 += go[22]; + m_A12 += go[23]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 += Idr[26]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + RHS4 -= go[26] * *cnV[26]; + m_A15 += gt[27]; + m_A15 += gt[28]; + m_A15 += gt[29]; + m_A17 += go[27]; + m_A16 += go[28]; + double RHS5 = Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 -= go[29] * *cnV[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A20 += gt[34]; + m_A20 += gt[35]; + m_A19 += go[30]; + m_A19 += go[31]; + m_A18 += go[32]; + double RHS6 = Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 -= go[33] * *cnV[33]; + RHS6 -= go[34] * *cnV[34]; + RHS6 -= go[35] * *cnV[35]; + m_A25 += gt[36]; + m_A25 += gt[37]; + m_A25 += gt[38]; + m_A25 += gt[39]; + m_A25 += gt[40]; + m_A26 += go[36]; + m_A26 += go[37]; + m_A23 += go[38]; + m_A23 += go[39]; + double RHS7 = Idr[36]; + RHS7 += Idr[37]; + RHS7 += Idr[38]; + RHS7 += Idr[39]; + RHS7 += Idr[40]; + RHS7 -= go[40] * *cnV[40]; + m_A29 += gt[41]; + m_A29 += gt[42]; + m_A29 += gt[43]; + m_A29 += gt[44]; + m_A29 += gt[45]; + m_A29 += gt[46]; + m_A28 += go[41]; + m_A28 += go[42]; + m_A27 += go[43]; + double RHS8 = Idr[41]; + RHS8 += Idr[42]; + RHS8 += Idr[43]; + RHS8 += Idr[44]; + RHS8 += Idr[45]; + RHS8 += Idr[46]; + RHS8 -= go[44] * *cnV[44]; + RHS8 -= go[45] * *cnV[45]; + RHS8 -= go[46] * *cnV[46]; + m_A34 += gt[47]; + m_A34 += gt[48]; + m_A34 += gt[49]; + m_A34 += gt[50]; + m_A34 += gt[51]; + m_A35 += go[47]; + m_A35 += go[48]; + m_A32 += go[49]; + m_A32 += go[50]; + double RHS9 = Idr[47]; + RHS9 += Idr[48]; + RHS9 += Idr[49]; + RHS9 += Idr[50]; + RHS9 += Idr[51]; + RHS9 -= go[51] * *cnV[51]; + m_A38 += gt[52]; + m_A38 += gt[53]; + m_A38 += gt[54]; + m_A37 += go[52]; + m_A36 += go[53]; + double RHS10 = Idr[52]; + RHS10 += Idr[53]; + RHS10 += Idr[54]; + RHS10 -= go[54] * *cnV[54]; + m_A46 += gt[55]; + m_A46 += gt[56]; + m_A46 += gt[57]; + m_A46 += gt[58]; + m_A42 += go[55]; + m_A44 += go[56]; + m_A44 += go[57]; + m_A41 += go[58]; + double RHS11 = Idr[55]; + RHS11 += Idr[56]; + RHS11 += Idr[57]; + RHS11 += Idr[58]; + m_A54 += gt[59]; + m_A54 += gt[60]; + m_A54 += gt[61]; + m_A54 += gt[62]; + m_A49 += go[59]; + m_A51 += go[60]; + m_A51 += go[61]; + m_A48 += go[62]; + double RHS12 = Idr[59]; + RHS12 += Idr[60]; + RHS12 += Idr[61]; + RHS12 += Idr[62]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A18; + m_A20 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A19; + m_A20 += m_A3 * f1_6; + m_A21 += m_A4 * f1_6; + m_A22 += m_A5 * f1_6; + RHS6 += f1_6 * RHS1; + const double f1_7 = -f1 * m_A23; + m_A24 += m_A3 * f1_7; + m_A25 += m_A4 * f1_7; + m_A26 += m_A5 * f1_7; + RHS7 += f1_7 * RHS1; + const double f1_11 = -f1 * m_A41; + m_A43 += m_A3 * f1_11; + m_A44 += m_A4 * f1_11; + m_A46 += m_A5 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_10 = -f2 * m_A36; + m_A38 += m_A7 * f2_10; + m_A39 += m_A8 * f2_10; + RHS10 += f2_10 * RHS2; + const double f2_11 = -f2 * m_A42; + m_A45 += m_A7 * f2_11; + m_A46 += m_A8 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_8 = -f3 * m_A27; + m_A29 += m_A10 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_8 = -f4 * m_A28; + m_A29 += m_A12 * f4_8; + m_A30 += m_A13 * f4_8; + m_A31 += m_A14 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_9 = -f4 * m_A32; + m_A33 += m_A12 * f4_9; + m_A34 += m_A13 * f4_9; + m_A35 += m_A14 * f4_9; + RHS9 += f4_9 * RHS4; + const double f4_12 = -f4 * m_A48; + m_A50 += m_A12 * f4_12; + m_A51 += m_A13 * f4_12; + m_A54 += m_A14 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_10 = -f5 * m_A37; + m_A38 += m_A16 * f5_10; + m_A40 += m_A17 * f5_10; + RHS10 += f5_10 * RHS5; + const double f5_12 = -f5 * m_A49; + m_A52 += m_A16 * f5_12; + m_A54 += m_A17 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A20; + const double f6_7 = -f6 * m_A24; + m_A25 += m_A21 * f6_7; + m_A26 += m_A22 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_11 = -f6 * m_A43; + m_A44 += m_A21 * f6_11; + m_A46 += m_A22 * f6_11; + RHS11 += f6_11 * RHS6; + const double f7 = 1.0 / m_A25; + const double f7_11 = -f7 * m_A44; + m_A46 += m_A26 * f7_11; + RHS11 += f7_11 * RHS7; + const double f8 = 1.0 / m_A29; + const double f8_9 = -f8 * m_A33; + m_A34 += m_A30 * f8_9; + m_A35 += m_A31 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_12 = -f8 * m_A50; + m_A51 += m_A30 * f8_12; + m_A54 += m_A31 * f8_12; + RHS12 += f8_12 * RHS8; + const double f9 = 1.0 / m_A34; + const double f9_12 = -f9 * m_A51; + m_A54 += m_A35 * f9_12; + RHS12 += f9_12 * RHS9; + const double f10 = 1.0 / m_A38; + const double f10_11 = -f10 * m_A45; + m_A46 += m_A39 * f10_11; + m_A47 += m_A40 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_12 = -f10 * m_A52; + m_A53 += m_A39 * f10_12; + m_A54 += m_A40 * f10_12; + RHS12 += f10_12 * RHS10; + const double f11 = 1.0 / m_A46; + const double f11_12 = -f11 * m_A53; + m_A54 += m_A47 * f11_12; + RHS12 += f11_12 * RHS11; + V[12] = RHS12 / m_A54; + double tmp11 = 0.0; + tmp11 += m_A47 * V[12]; + V[11] = (RHS11 - tmp11) / m_A46; + double tmp10 = 0.0; + tmp10 += m_A39 * V[11]; + tmp10 += m_A40 * V[12]; + V[10] = (RHS10 - tmp10) / m_A38; + double tmp9 = 0.0; + tmp9 += m_A35 * V[12]; + V[9] = (RHS9 - tmp9) / m_A34; + double tmp8 = 0.0; + tmp8 += m_A30 * V[9]; + tmp8 += m_A31 * V[12]; + V[8] = (RHS8 - tmp8) / m_A29; + double tmp7 = 0.0; + tmp7 += m_A26 * V[11]; + V[7] = (RHS7 - tmp7) / m_A25; + double tmp6 = 0.0; + tmp6 += m_A21 * V[7]; + tmp6 += m_A22 * V[11]; + V[6] = (RHS6 - tmp6) / m_A20; + double tmp5 = 0.0; + tmp5 += m_A16 * V[10]; + tmp5 += m_A17 * V[12]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A12 * V[8]; + tmp4 += m_A13 * V[9]; + tmp4 += m_A14 * V[12]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A10 * V[8]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[10]; + tmp2 += m_A8 * V[11]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + tmp1 += m_A4 * V[7]; + tmp1 += m_A5 * V[11]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// boxingb +static void nl_gcr_96_double_double_a1132c8737d5d463(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A5 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A7 += go[10]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[13]; + double RHS4 = Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A11 += go[16]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 -= go[17] * *cnV[17]; + RHS5 -= go[18] * *cnV[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A13 += go[19]; + double RHS6 = Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 -= go[20] * *cnV[20]; + RHS6 -= go[21] * *cnV[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A15 += go[22]; + double RHS7 = Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 -= go[23] * *cnV[23]; + RHS7 -= go[24] * *cnV[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A17 += go[25]; + double RHS8 = Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 -= go[26] * *cnV[26]; + RHS8 -= go[27] * *cnV[27]; + m_A18 += gt[28]; + m_A18 += gt[29]; + m_A18 += gt[30]; + m_A19 += go[28]; + double RHS9 = Idr[28]; + RHS9 += Idr[29]; + RHS9 += Idr[30]; + RHS9 -= go[29] * *cnV[29]; + RHS9 -= go[30] * *cnV[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A21 += go[31]; + double RHS10 = Idr[31]; + RHS10 += Idr[32]; + RHS10 += Idr[33]; + RHS10 -= go[32] * *cnV[32]; + RHS10 -= go[33] * *cnV[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A24 += go[34]; + m_A23 += go[35]; + double RHS11 = Idr[34]; + RHS11 += Idr[35]; + m_A25 += gt[36]; + m_A25 += gt[37]; + m_A27 += go[36]; + m_A26 += go[37]; + double RHS12 = Idr[36]; + RHS12 += Idr[37]; + m_A28 += gt[38]; + m_A28 += gt[39]; + m_A30 += go[38]; + m_A29 += go[39]; + double RHS13 = Idr[38]; + RHS13 += Idr[39]; + m_A31 += gt[40]; + m_A31 += gt[41]; + m_A32 += go[40]; + double RHS14 = Idr[40]; + RHS14 += Idr[41]; + RHS14 -= go[41] * *cnV[41]; + m_A33 += gt[42]; + m_A33 += gt[43]; + m_A35 += go[42]; + m_A34 += go[43]; + double RHS15 = Idr[42]; + RHS15 += Idr[43]; + m_A36 += gt[44]; + m_A36 += gt[45]; + m_A36 += gt[46]; + m_A36 += gt[47]; + m_A36 += gt[48]; + m_A36 += gt[49]; + m_A36 += gt[50]; + m_A37 += go[44]; + double RHS16 = Idr[44]; + RHS16 += Idr[45]; + RHS16 += Idr[46]; + RHS16 += Idr[47]; + RHS16 += Idr[48]; + RHS16 += Idr[49]; + RHS16 += Idr[50]; + RHS16 -= go[45] * *cnV[45]; + RHS16 -= go[46] * *cnV[46]; + RHS16 -= go[47] * *cnV[47]; + RHS16 -= go[48] * *cnV[48]; + RHS16 -= go[49] * *cnV[49]; + RHS16 -= go[50] * *cnV[50]; + m_A42 += gt[51]; + m_A42 += gt[52]; + m_A42 += gt[53]; + m_A42 += gt[54]; + m_A42 += gt[55]; + m_A41 += go[51]; + m_A40 += go[52]; + m_A39 += go[53]; + m_A38 += go[54]; + double RHS17 = Idr[51]; + RHS17 += Idr[52]; + RHS17 += Idr[53]; + RHS17 += Idr[54]; + RHS17 += Idr[55]; + RHS17 -= go[55] * *cnV[55]; + m_A48 += gt[56]; + m_A48 += gt[57]; + m_A48 += gt[58]; + m_A48 += gt[59]; + m_A48 += gt[60]; + m_A47 += go[56]; + m_A46 += go[57]; + m_A45 += go[58]; + m_A44 += go[59]; + double RHS18 = Idr[56]; + RHS18 += Idr[57]; + RHS18 += Idr[58]; + RHS18 += Idr[59]; + RHS18 += Idr[60]; + RHS18 -= go[60] * *cnV[60]; + m_A50 += gt[61]; + m_A50 += gt[62]; + m_A51 += go[61]; + m_A52 += go[62]; + double RHS19 = Idr[61]; + RHS19 += Idr[62]; + m_A55 += gt[63]; + m_A55 += gt[64]; + m_A55 += gt[65]; + m_A54 += go[63]; + m_A53 += go[64]; + double RHS20 = Idr[63]; + RHS20 += Idr[64]; + RHS20 += Idr[65]; + RHS20 -= go[65] * *cnV[65]; + m_A58 += gt[66]; + m_A58 += gt[67]; + m_A58 += gt[68]; + m_A59 += go[66]; + m_A57 += go[67]; + double RHS21 = Idr[66]; + RHS21 += Idr[67]; + RHS21 += Idr[68]; + RHS21 -= go[68] * *cnV[68]; + m_A62 += gt[69]; + m_A62 += gt[70]; + m_A62 += gt[71]; + m_A61 += go[69]; + m_A60 += go[70]; + double RHS22 = Idr[69]; + RHS22 += Idr[70]; + RHS22 += Idr[71]; + RHS22 -= go[71] * *cnV[71]; + m_A65 += gt[72]; + m_A65 += gt[73]; + m_A65 += gt[74]; + m_A65 += gt[75]; + m_A65 += gt[76]; + m_A65 += gt[77]; + m_A65 += gt[78]; + m_A64 += go[72]; + m_A66 += go[73]; + double RHS23 = Idr[72]; + RHS23 += Idr[73]; + RHS23 += Idr[74]; + RHS23 += Idr[75]; + RHS23 += Idr[76]; + RHS23 += Idr[77]; + RHS23 += Idr[78]; + RHS23 -= go[74] * *cnV[74]; + RHS23 -= go[75] * *cnV[75]; + RHS23 -= go[76] * *cnV[76]; + RHS23 -= go[77] * *cnV[77]; + RHS23 -= go[78] * *cnV[78]; + m_A68 += gt[79]; + m_A68 += gt[80]; + m_A69 += go[79]; + m_A67 += go[80]; + double RHS24 = Idr[79]; + RHS24 += Idr[80]; + m_A73 += gt[81]; + m_A73 += gt[82]; + m_A73 += gt[83]; + m_A73 += gt[84]; + m_A73 += gt[85]; + m_A72 += go[81]; + m_A70 += go[82]; + m_A71 += go[83]; + double RHS25 = Idr[81]; + RHS25 += Idr[82]; + RHS25 += Idr[83]; + RHS25 += Idr[84]; + RHS25 += Idr[85]; + RHS25 -= go[84] * *cnV[84]; + RHS25 -= go[85] * *cnV[85]; + m_A76 += gt[86]; + m_A76 += gt[87]; + m_A77 += go[86]; + m_A75 += go[87]; + double RHS26 = Idr[86]; + RHS26 += Idr[87]; + m_A79 += gt[88]; + m_A79 += gt[89]; + m_A79 += gt[90]; + m_A79 += gt[91]; + m_A79 += gt[92]; + m_A78 += go[88]; + m_A80 += go[89]; + m_A80 += go[90]; + double RHS27 = Idr[88]; + RHS27 += Idr[89]; + RHS27 += Idr[90]; + RHS27 += Idr[91]; + RHS27 += Idr[92]; + RHS27 -= go[91] * *cnV[91]; + RHS27 -= go[92] * *cnV[92]; + m_A95 += gt[93]; + m_A95 += gt[94]; + m_A95 += gt[95]; + m_A95 += gt[96]; + m_A95 += gt[97]; + m_A95 += gt[98]; + m_A95 += gt[99]; + m_A95 += gt[100]; + m_A95 += gt[101]; + m_A95 += gt[102]; + m_A95 += gt[103]; + m_A87 += go[93]; + m_A94 += go[94]; + m_A94 += go[95]; + m_A93 += go[96]; + m_A91 += go[97]; + m_A84 += go[98]; + m_A83 += go[99]; + m_A82 += go[100]; + m_A81 += go[101]; + m_A89 += go[102]; + double RHS28 = Idr[93]; + RHS28 += Idr[94]; + RHS28 += Idr[95]; + RHS28 += Idr[96]; + RHS28 += Idr[97]; + RHS28 += Idr[98]; + RHS28 += Idr[99]; + RHS28 += Idr[100]; + RHS28 += Idr[101]; + RHS28 += Idr[102]; + RHS28 += Idr[103]; + RHS28 -= go[103] * *cnV[103]; + const double f0 = 1.0 / m_A0; + const double f0_21 = -f0 * m_A57; + m_A58 += m_A1 * f0_21; + RHS21 += f0_21 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_17 = -f1 * m_A38; + m_A42 += m_A3 * f1_17; + RHS17 += f1_17 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_17 = -f2 * m_A39; + m_A42 += m_A5 * f2_17; + RHS17 += f2_17 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_17 = -f3 * m_A40; + m_A42 += m_A7 * f3_17; + RHS17 += f3_17 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_18 = -f4 * m_A44; + m_A48 += m_A9 * f4_18; + RHS18 += f4_18 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_20 = -f5 * m_A53; + m_A55 += m_A11 * f5_20; + RHS20 += f5_20 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_22 = -f6 * m_A60; + m_A62 += m_A13 * f6_22; + RHS22 += f6_22 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_18 = -f7 * m_A45; + m_A48 += m_A15 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_18 = -f8 * m_A46; + m_A48 += m_A17 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_24 = -f9 * m_A67; + m_A68 += m_A19 * f9_24; + RHS24 += f9_24 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_26 = -f10 * m_A75; + m_A76 += m_A21 * f10_26; + RHS26 += f10_26 * RHS10; + const double f11 = 1.0 / m_A22; + const double f11_17 = -f11 * m_A41; + m_A42 += m_A23 * f11_17; + m_A43 += m_A24 * f11_17; + RHS17 += f11_17 * RHS11; + const double f11_28 = -f11 * m_A81; + m_A85 += m_A23 * f11_28; + m_A95 += m_A24 * f11_28; + RHS28 += f11_28 * RHS11; + const double f12 = 1.0 / m_A25; + const double f12_18 = -f12 * m_A47; + m_A48 += m_A26 * f12_18; + m_A49 += m_A27 * f12_18; + RHS18 += f12_18 * RHS12; + const double f12_28 = -f12 * m_A82; + m_A86 += m_A26 * f12_28; + m_A95 += m_A27 * f12_28; + RHS28 += f12_28 * RHS12; + const double f13 = 1.0 / m_A28; + const double f13_20 = -f13 * m_A54; + m_A55 += m_A29 * f13_20; + m_A56 += m_A30 * f13_20; + RHS20 += f13_20 * RHS13; + const double f13_28 = -f13 * m_A83; + m_A88 += m_A29 * f13_28; + m_A95 += m_A30 * f13_28; + RHS28 += f13_28 * RHS13; + const double f14 = 1.0 / m_A31; + const double f14_23 = -f14 * m_A64; + m_A66 += m_A32 * f14_23; + RHS23 += f14_23 * RHS14; + const double f14_25 = -f14 * m_A70; + m_A73 += m_A32 * f14_25; + RHS25 += f14_25 * RHS14; + const double f15 = 1.0 / m_A33; + const double f15_22 = -f15 * m_A61; + m_A62 += m_A34 * f15_22; + m_A63 += m_A35 * f15_22; + RHS22 += f15_22 * RHS15; + const double f15_28 = -f15 * m_A84; + m_A90 += m_A34 * f15_28; + m_A95 += m_A35 * f15_28; + RHS28 += f15_28 * RHS15; + const double f16 = 1.0 / m_A36; + const double f16_27 = -f16 * m_A78; + m_A80 += m_A37 * f16_27; + RHS27 += f16_27 * RHS16; + const double f17 = 1.0 / m_A42; + const double f17_28 = -f17 * m_A85; + m_A95 += m_A43 * f17_28; + RHS28 += f17_28 * RHS17; + const double f18 = 1.0 / m_A48; + const double f18_28 = -f18 * m_A86; + m_A95 += m_A49 * f18_28; + RHS28 += f18_28 * RHS18; + const double f19 = 1.0 / m_A50; + const double f19_25 = -f19 * m_A71; + m_A73 += m_A51 * f19_25; + m_A74 += m_A52 * f19_25; + RHS25 += f19_25 * RHS19; + const double f19_28 = -f19 * m_A87; + m_A92 += m_A51 * f19_28; + m_A95 += m_A52 * f19_28; + RHS28 += f19_28 * RHS19; + const double f20 = 1.0 / m_A55; + const double f20_28 = -f20 * m_A88; + m_A95 += m_A56 * f20_28; + RHS28 += f20_28 * RHS20; + const double f21 = 1.0 / m_A58; + const double f21_28 = -f21 * m_A89; + m_A95 += m_A59 * f21_28; + RHS28 += f21_28 * RHS21; + const double f22 = 1.0 / m_A62; + const double f22_28 = -f22 * m_A90; + m_A95 += m_A63 * f22_28; + RHS28 += f22_28 * RHS22; + const double f23 = 1.0 / m_A65; + const double f23_25 = -f23 * m_A72; + m_A73 += m_A66 * f23_25; + RHS25 += f23_25 * RHS23; + const double f24 = 1.0 / m_A68; + const double f24_28 = -f24 * m_A91; + m_A95 += m_A69 * f24_28; + RHS28 += f24_28 * RHS24; + const double f25 = 1.0 / m_A73; + const double f25_28 = -f25 * m_A92; + m_A95 += m_A74 * f25_28; + RHS28 += f25_28 * RHS25; + const double f26 = 1.0 / m_A76; + const double f26_28 = -f26 * m_A93; + m_A95 += m_A77 * f26_28; + RHS28 += f26_28 * RHS26; + const double f27 = 1.0 / m_A79; + const double f27_28 = -f27 * m_A94; + m_A95 += m_A80 * f27_28; + RHS28 += f27_28 * RHS27; + V[28] = RHS28 / m_A95; + double tmp27 = 0.0; + tmp27 += m_A80 * V[28]; + V[27] = (RHS27 - tmp27) / m_A79; + double tmp26 = 0.0; + tmp26 += m_A77 * V[28]; + V[26] = (RHS26 - tmp26) / m_A76; + double tmp25 = 0.0; + tmp25 += m_A74 * V[28]; + V[25] = (RHS25 - tmp25) / m_A73; + double tmp24 = 0.0; + tmp24 += m_A69 * V[28]; + V[24] = (RHS24 - tmp24) / m_A68; + double tmp23 = 0.0; + tmp23 += m_A66 * V[25]; + V[23] = (RHS23 - tmp23) / m_A65; + double tmp22 = 0.0; + tmp22 += m_A63 * V[28]; + V[22] = (RHS22 - tmp22) / m_A62; + double tmp21 = 0.0; + tmp21 += m_A59 * V[28]; + V[21] = (RHS21 - tmp21) / m_A58; + double tmp20 = 0.0; + tmp20 += m_A56 * V[28]; + V[20] = (RHS20 - tmp20) / m_A55; + double tmp19 = 0.0; + tmp19 += m_A51 * V[25]; + tmp19 += m_A52 * V[28]; + V[19] = (RHS19 - tmp19) / m_A50; + double tmp18 = 0.0; + tmp18 += m_A49 * V[28]; + V[18] = (RHS18 - tmp18) / m_A48; + double tmp17 = 0.0; + tmp17 += m_A43 * V[28]; + V[17] = (RHS17 - tmp17) / m_A42; + double tmp16 = 0.0; + tmp16 += m_A37 * V[28]; + V[16] = (RHS16 - tmp16) / m_A36; + double tmp15 = 0.0; + tmp15 += m_A34 * V[22]; + tmp15 += m_A35 * V[28]; + V[15] = (RHS15 - tmp15) / m_A33; + double tmp14 = 0.0; + tmp14 += m_A32 * V[25]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + tmp13 += m_A29 * V[20]; + tmp13 += m_A30 * V[28]; + V[13] = (RHS13 - tmp13) / m_A28; + double tmp12 = 0.0; + tmp12 += m_A26 * V[18]; + tmp12 += m_A27 * V[28]; + V[12] = (RHS12 - tmp12) / m_A25; + double tmp11 = 0.0; + tmp11 += m_A23 * V[17]; + tmp11 += m_A24 * V[28]; + V[11] = (RHS11 - tmp11) / m_A22; + double tmp10 = 0.0; + tmp10 += m_A21 * V[26]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[24]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[18]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[18]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[22]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[20]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[18]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[17]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[17]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[17]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[21]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_134_double_double_c05df522276e65fd(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A7 += go[6]; + m_A6 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A11 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A12 += gt[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A12 += gt[26]; + m_A14 += go[20]; + m_A13 += go[21]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + m_A15 += gt[27]; + m_A15 += gt[28]; + m_A15 += gt[29]; + m_A16 += go[27]; + m_A17 += go[28]; + double RHS6 = Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 -= go[29] * *cnV[29]; + m_A18 += gt[30]; + m_A18 += gt[31]; + m_A18 += gt[32]; + m_A18 += gt[33]; + m_A19 += go[30]; + double RHS7 = Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 -= go[31] * *cnV[31]; + RHS7 -= go[32] * *cnV[32]; + RHS7 -= go[33] * *cnV[33]; + m_A20 += gt[34]; + m_A20 += gt[35]; + m_A20 += gt[36]; + m_A21 += go[34]; + m_A22 += go[35]; + double RHS8 = Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[36] * *cnV[36]; + m_A23 += gt[37]; + m_A23 += gt[38]; + m_A23 += gt[39]; + m_A23 += gt[40]; + m_A23 += gt[41]; + m_A24 += go[37]; + m_A25 += go[38]; + m_A26 += go[39]; + double RHS9 = Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + RHS9 -= go[40] * *cnV[40]; + RHS9 -= go[41] * *cnV[41]; + m_A27 += gt[42]; + m_A27 += gt[43]; + m_A27 += gt[44]; + m_A28 += go[42]; + double RHS10 = Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 -= go[43] * *cnV[43]; + RHS10 -= go[44] * *cnV[44]; + m_A29 += gt[45]; + m_A29 += gt[46]; + m_A30 += go[45]; + double RHS11 = Idr[45]; + RHS11 += Idr[46]; + RHS11 -= go[46] * *cnV[46]; + m_A31 += gt[47]; + m_A31 += gt[48]; + m_A32 += go[47]; + double RHS12 = Idr[47]; + RHS12 += Idr[48]; + RHS12 -= go[48] * *cnV[48]; + m_A33 += gt[49]; + m_A33 += gt[50]; + m_A33 += gt[51]; + m_A34 += go[49]; + m_A35 += go[50]; + double RHS13 = Idr[49]; + RHS13 += Idr[50]; + RHS13 += Idr[51]; + RHS13 -= go[51] * *cnV[51]; + m_A36 += gt[52]; + m_A36 += gt[53]; + m_A36 += gt[54]; + m_A36 += gt[55]; + m_A36 += gt[56]; + m_A36 += gt[57]; + m_A37 += go[52]; + m_A39 += go[53]; + m_A39 += go[54]; + m_A38 += go[55]; + double RHS14 = Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 += Idr[55]; + RHS14 += Idr[56]; + RHS14 += Idr[57]; + RHS14 -= go[56] * *cnV[56]; + RHS14 -= go[57] * *cnV[57]; + m_A40 += gt[58]; + m_A40 += gt[59]; + m_A40 += gt[60]; + m_A40 += gt[61]; + m_A41 += go[58]; + double RHS15 = Idr[58]; + RHS15 += Idr[59]; + RHS15 += Idr[60]; + RHS15 += Idr[61]; + RHS15 -= go[59] * *cnV[59]; + RHS15 -= go[60] * *cnV[60]; + RHS15 -= go[61] * *cnV[61]; + m_A44 += gt[62]; + m_A44 += gt[63]; + m_A43 += go[62]; + m_A42 += go[63]; + double RHS16 = Idr[62]; + RHS16 += Idr[63]; + m_A48 += gt[64]; + m_A48 += gt[65]; + m_A48 += gt[66]; + m_A49 += go[64]; + m_A46 += go[65]; + double RHS17 = Idr[64]; + RHS17 += Idr[65]; + RHS17 += Idr[66]; + RHS17 -= go[66] * *cnV[66]; + m_A51 += gt[67]; + m_A51 += gt[68]; + m_A51 += gt[69]; + m_A51 += gt[70]; + m_A51 += gt[71]; + m_A51 += gt[72]; + m_A51 += gt[73]; + m_A52 += go[67]; + m_A50 += go[68]; + double RHS18 = Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + RHS18 += Idr[72]; + RHS18 += Idr[73]; + RHS18 -= go[69] * *cnV[69]; + RHS18 -= go[70] * *cnV[70]; + RHS18 -= go[71] * *cnV[71]; + RHS18 -= go[72] * *cnV[72]; + RHS18 -= go[73] * *cnV[73]; + m_A54 += gt[74]; + m_A54 += gt[75]; + m_A54 += gt[76]; + m_A53 += go[74]; + m_A55 += go[75]; + double RHS19 = Idr[74]; + RHS19 += Idr[75]; + RHS19 += Idr[76]; + RHS19 -= go[76] * *cnV[76]; + m_A57 += gt[77]; + m_A57 += gt[78]; + m_A57 += gt[79]; + m_A56 += go[77]; + m_A58 += go[78]; + double RHS20 = Idr[77]; + RHS20 += Idr[78]; + RHS20 += Idr[79]; + RHS20 -= go[79] * *cnV[79]; + m_A61 += gt[80]; + m_A61 += gt[81]; + m_A61 += gt[82]; + m_A61 += gt[83]; + m_A61 += gt[84]; + m_A59 += go[80]; + m_A62 += go[81]; + m_A63 += go[82]; + double RHS21 = Idr[80]; + RHS21 += Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + RHS21 += Idr[84]; + RHS21 -= go[83] * *cnV[83]; + RHS21 -= go[84] * *cnV[84]; + m_A66 += gt[85]; + m_A66 += gt[86]; + m_A66 += gt[87]; + m_A66 += gt[88]; + m_A66 += gt[89]; + m_A66 += gt[90]; + m_A66 += gt[91]; + m_A67 += go[85]; + m_A65 += go[86]; + double RHS22 = Idr[85]; + RHS22 += Idr[86]; + RHS22 += Idr[87]; + RHS22 += Idr[88]; + RHS22 += Idr[89]; + RHS22 += Idr[90]; + RHS22 += Idr[91]; + RHS22 -= go[87] * *cnV[87]; + RHS22 -= go[88] * *cnV[88]; + RHS22 -= go[89] * *cnV[89]; + RHS22 -= go[90] * *cnV[90]; + RHS22 -= go[91] * *cnV[91]; + m_A70 += gt[92]; + m_A70 += gt[93]; + m_A70 += gt[94]; + m_A70 += gt[95]; + m_A70 += gt[96]; + m_A70 += gt[97]; + m_A70 += gt[98]; + m_A71 += go[92]; + m_A69 += go[93]; + double RHS23 = Idr[92]; + RHS23 += Idr[93]; + RHS23 += Idr[94]; + RHS23 += Idr[95]; + RHS23 += Idr[96]; + RHS23 += Idr[97]; + RHS23 += Idr[98]; + RHS23 -= go[94] * *cnV[94]; + RHS23 -= go[95] * *cnV[95]; + RHS23 -= go[96] * *cnV[96]; + RHS23 -= go[97] * *cnV[97]; + RHS23 -= go[98] * *cnV[98]; + m_A77 += gt[99]; + m_A77 += gt[100]; + m_A77 += gt[101]; + m_A77 += gt[102]; + m_A77 += gt[103]; + m_A74 += go[99]; + m_A73 += go[100]; + m_A75 += go[101]; + double RHS24 = Idr[99]; + RHS24 += Idr[100]; + RHS24 += Idr[101]; + RHS24 += Idr[102]; + RHS24 += Idr[103]; + RHS24 -= go[102] * *cnV[102]; + RHS24 -= go[103] * *cnV[103]; + m_A81 += gt[104]; + m_A81 += gt[105]; + m_A81 += gt[106]; + m_A83 += go[104]; + m_A80 += go[105]; + m_A82 += go[106]; + double RHS25 = Idr[104]; + RHS25 += Idr[105]; + RHS25 += Idr[106]; + m_A88 += gt[107]; + m_A88 += gt[108]; + m_A88 += gt[109]; + m_A88 += gt[110]; + m_A88 += gt[111]; + m_A85 += go[107]; + m_A85 += go[108]; + m_A89 += go[109]; + m_A84 += go[110]; + m_A90 += go[111]; + double RHS26 = Idr[107]; + RHS26 += Idr[108]; + RHS26 += Idr[109]; + RHS26 += Idr[110]; + RHS26 += Idr[111]; + m_A95 += gt[112]; + m_A95 += gt[113]; + m_A95 += gt[114]; + m_A92 += go[112]; + m_A91 += go[113]; + m_A93 += go[114]; + double RHS27 = Idr[112]; + RHS27 += Idr[113]; + RHS27 += Idr[114]; + m_A104 += gt[115]; + m_A104 += gt[116]; + m_A104 += gt[117]; + m_A104 += gt[118]; + m_A100 += go[115]; + m_A101 += go[116]; + m_A99 += go[117]; + m_A106 += go[118]; + double RHS28 = Idr[115]; + RHS28 += Idr[116]; + RHS28 += Idr[117]; + RHS28 += Idr[118]; + m_A112 += gt[119]; + m_A112 += gt[120]; + m_A112 += gt[121]; + m_A112 += gt[122]; + m_A109 += go[119]; + m_A108 += go[120]; + m_A107 += go[121]; + m_A113 += go[122]; + double RHS29 = Idr[119]; + RHS29 += Idr[120]; + RHS29 += Idr[121]; + RHS29 += Idr[122]; + m_A117 += gt[123]; + m_A117 += gt[124]; + m_A117 += gt[125]; + m_A117 += gt[126]; + m_A117 += gt[127]; + m_A114 += go[123]; + m_A116 += go[124]; + m_A115 += go[125]; + double RHS30 = Idr[123]; + RHS30 += Idr[124]; + RHS30 += Idr[125]; + RHS30 += Idr[126]; + RHS30 += Idr[127]; + RHS30 -= go[126] * *cnV[126]; + RHS30 -= go[127] * *cnV[127]; + m_A121 += gt[128]; + m_A121 += gt[129]; + m_A121 += gt[130]; + m_A119 += go[128]; + m_A120 += go[129]; + double RHS31 = Idr[128]; + RHS31 += Idr[129]; + RHS31 += Idr[130]; + RHS31 -= go[130] * *cnV[130]; + m_A133 += gt[131]; + m_A133 += gt[132]; + m_A133 += gt[133]; + m_A133 += gt[134]; + m_A133 += gt[135]; + m_A133 += gt[136]; + m_A133 += gt[137]; + m_A133 += gt[138]; + m_A133 += gt[139]; + m_A133 += gt[140]; + m_A126 += go[131]; + m_A128 += go[132]; + m_A125 += go[133]; + m_A129 += go[134]; + m_A124 += go[135]; + m_A130 += go[136]; + m_A123 += go[137]; + m_A127 += go[138]; + double RHS32 = Idr[131]; + RHS32 += Idr[132]; + RHS32 += Idr[133]; + RHS32 += Idr[134]; + RHS32 += Idr[135]; + RHS32 += Idr[136]; + RHS32 += Idr[137]; + RHS32 += Idr[138]; + RHS32 += Idr[139]; + RHS32 += Idr[140]; + RHS32 -= go[139] * *cnV[139]; + RHS32 -= go[140] * *cnV[140]; + const double f0 = 1.0 / m_A0; + const double f0_16 = -f0 * m_A42; + m_A44 += m_A1 * f0_16; + RHS16 += f0_16 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_16 = -f1 * m_A43; + m_A44 += m_A3 * f1_16; + m_A45 += m_A4 * f1_16; + RHS16 += f1_16 * RHS1; + const double f1_17 = -f1 * m_A46; + m_A47 += m_A3 * f1_17; + m_A48 += m_A4 * f1_17; + RHS17 += f1_17 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_30 = -f2 * m_A114; + m_A115 += m_A6 * f2_30; + m_A117 += m_A7 * f2_30; + RHS30 += f2_30 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_18 = -f3 * m_A50; + m_A52 += m_A9 * f3_18; + RHS18 += f3_18 * RHS3; + const double f3_25 = -f3 * m_A80; + m_A81 += m_A9 * f3_25; + RHS25 += f3_25 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_19 = -f4 * m_A53; + m_A54 += m_A11 * f4_19; + RHS19 += f4_19 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_21 = -f5 * m_A59; + m_A60 += m_A13 * f5_21; + m_A63 += m_A14 * f5_21; + RHS21 += f5_21 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_21 = -f6 * m_A60; + m_A63 += m_A16 * f6_21; + m_A64 += m_A17 * f6_21; + RHS21 += f6_21 * RHS6; + const double f6_29 = -f6 * m_A107; + m_A112 += m_A16 * f6_29; + m_A113 += m_A17 * f6_29; + RHS29 += f6_29 * RHS6; + const double f6_32 = -f6 * m_A123; + m_A130 += m_A16 * f6_32; + m_A133 += m_A17 * f6_32; + RHS32 += f6_32 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_20 = -f7 * m_A56; + m_A57 += m_A19 * f7_20; + RHS20 += f7_20 * RHS7; + const double f8 = 1.0 / m_A20; + const double f8_22 = -f8 * m_A65; + m_A67 += m_A21 * f8_22; + m_A68 += m_A22 * f8_22; + RHS22 += f8_22 * RHS8; + const double f8_28 = -f8 * m_A99; + m_A104 += m_A21 * f8_28; + m_A106 += m_A22 * f8_28; + RHS28 += f8_28 * RHS8; + const double f8_32 = -f8 * m_A124; + m_A129 += m_A21 * f8_32; + m_A133 += m_A22 * f8_32; + RHS32 += f8_32 * RHS8; + const double f9 = 1.0 / m_A23; + const double f9_27 = -f9 * m_A91; + m_A94 += m_A24 * f9_27; + m_A95 += m_A25 * f9_27; + m_A96 += m_A26 * f9_27; + RHS27 += f9_27 * RHS9; + const double f9_28 = -f9 * m_A100; + m_A102 += m_A24 * f9_28; + m_A103 += m_A25 * f9_28; + m_A104 += m_A26 * f9_28; + RHS28 += f9_28 * RHS9; + const double f10 = 1.0 / m_A27; + const double f10_27 = -f10 * m_A92; + m_A95 += m_A28 * f10_27; + RHS27 += f10_27 * RHS10; + const double f11 = 1.0 / m_A29; + const double f11_24 = -f11 * m_A73; + m_A77 += m_A30 * f11_24; + RHS24 += f11_24 * RHS11; + const double f12 = 1.0 / m_A31; + const double f12_24 = -f12 * m_A74; + m_A77 += m_A32 * f12_24; + RHS24 += f12_24 * RHS12; + const double f13 = 1.0 / m_A33; + const double f13_23 = -f13 * m_A69; + m_A71 += m_A34 * f13_23; + m_A72 += m_A35 * f13_23; + RHS23 += f13_23 * RHS13; + const double f13_26 = -f13 * m_A84; + m_A88 += m_A34 * f13_26; + m_A90 += m_A35 * f13_26; + RHS26 += f13_26 * RHS13; + const double f13_32 = -f13 * m_A125; + m_A128 += m_A34 * f13_32; + m_A133 += m_A35 * f13_32; + RHS32 += f13_32 * RHS13; + const double f14 = 1.0 / m_A36; + const double f14_24 = -f14 * m_A75; + m_A76 += m_A37 * f14_24; + m_A77 += m_A38 * f14_24; + m_A78 += m_A39 * f14_24; + RHS24 += f14_24 * RHS14; + const double f14_26 = -f14 * m_A85; + m_A86 += m_A37 * f14_26; + m_A87 += m_A38 * f14_26; + m_A88 += m_A39 * f14_26; + RHS26 += f14_26 * RHS14; + const double f15 = 1.0 / m_A40; + const double f15_31 = -f15 * m_A119; + m_A121 += m_A41 * f15_31; + RHS31 += f15_31 * RHS15; + const double f16 = 1.0 / m_A44; + const double f16_17 = -f16 * m_A47; + m_A48 += m_A45 * f16_17; + RHS17 += f16_17 * RHS16; + const double f17 = 1.0 / m_A48; + const double f17_30 = -f17 * m_A115; + m_A117 += m_A49 * f17_30; + RHS30 += f17_30 * RHS17; + const double f18 = 1.0 / m_A51; + const double f18_32 = -f18 * m_A126; + m_A127 += m_A52 * f18_32; + RHS32 += f18_32 * RHS18; + const double f19 = 1.0 / m_A54; + const double f19_29 = -f19 * m_A108; + m_A112 += m_A55 * f19_29; + RHS29 += f19_29 * RHS19; + const double f20 = 1.0 / m_A57; + const double f20_28 = -f20 * m_A101; + m_A104 += m_A58 * f20_28; + RHS28 += f20_28 * RHS20; + const double f21 = 1.0 / m_A61; + const double f21_27 = -f21 * m_A93; + m_A95 += m_A62 * f21_27; + m_A97 += m_A63 * f21_27; + m_A98 += m_A64 * f21_27; + RHS27 += f21_27 * RHS21; + const double f21_29 = -f21 * m_A109; + m_A110 += m_A62 * f21_29; + m_A112 += m_A63 * f21_29; + m_A113 += m_A64 * f21_29; + RHS29 += f21_29 * RHS21; + const double f22 = 1.0 / m_A66; + const double f22_27 = -f22 * m_A94; + m_A96 += m_A67 * f22_27; + m_A98 += m_A68 * f22_27; + RHS27 += f22_27 * RHS22; + const double f22_28 = -f22 * m_A102; + m_A104 += m_A67 * f22_28; + m_A106 += m_A68 * f22_28; + RHS28 += f22_28 * RHS22; + const double f23 = 1.0 / m_A70; + const double f23_24 = -f23 * m_A76; + m_A78 += m_A71 * f23_24; + m_A79 += m_A72 * f23_24; + RHS24 += f23_24 * RHS23; + const double f23_26 = -f23 * m_A86; + m_A88 += m_A71 * f23_26; + m_A90 += m_A72 * f23_26; + RHS26 += f23_26 * RHS23; + const double f24 = 1.0 / m_A77; + const double f24_26 = -f24 * m_A87; + m_A88 += m_A78 * f24_26; + m_A90 += m_A79 * f24_26; + RHS26 += f24_26 * RHS24; + const double f25 = 1.0 / m_A81; + const double f25_30 = -f25 * m_A116; + m_A117 += m_A82 * f25_30; + m_A118 += m_A83 * f25_30; + RHS30 += f25_30 * RHS25; + const double f25_32 = -f25 * m_A127; + m_A131 += m_A82 * f25_32; + m_A133 += m_A83 * f25_32; + RHS32 += f25_32 * RHS25; + const double f26 = 1.0 / m_A88; + const double f26_31 = -f26 * m_A120; + m_A121 += m_A89 * f26_31; + m_A122 += m_A90 * f26_31; + RHS31 += f26_31 * RHS26; + const double f26_32 = -f26 * m_A128; + m_A132 += m_A89 * f26_32; + m_A133 += m_A90 * f26_32; + RHS32 += f26_32 * RHS26; + const double f27 = 1.0 / m_A95; + const double f27_28 = -f27 * m_A103; + m_A104 += m_A96 * f27_28; + m_A105 += m_A97 * f27_28; + m_A106 += m_A98 * f27_28; + RHS28 += f27_28 * RHS27; + const double f27_29 = -f27 * m_A110; + m_A111 += m_A96 * f27_29; + m_A112 += m_A97 * f27_29; + m_A113 += m_A98 * f27_29; + RHS29 += f27_29 * RHS27; + const double f28 = 1.0 / m_A104; + const double f28_29 = -f28 * m_A111; + m_A112 += m_A105 * f28_29; + m_A113 += m_A106 * f28_29; + RHS29 += f28_29 * RHS28; + const double f28_32 = -f28 * m_A129; + m_A130 += m_A105 * f28_32; + m_A133 += m_A106 * f28_32; + RHS32 += f28_32 * RHS28; + const double f29 = 1.0 / m_A112; + const double f29_32 = -f29 * m_A130; + m_A133 += m_A113 * f29_32; + RHS32 += f29_32 * RHS29; + const double f30 = 1.0 / m_A117; + const double f30_32 = -f30 * m_A131; + m_A133 += m_A118 * f30_32; + RHS32 += f30_32 * RHS30; + const double f31 = 1.0 / m_A121; + const double f31_32 = -f31 * m_A132; + m_A133 += m_A122 * f31_32; + RHS32 += f31_32 * RHS31; + V[32] = RHS32 / m_A133; + double tmp31 = 0.0; + tmp31 += m_A122 * V[32]; + V[31] = (RHS31 - tmp31) / m_A121; + double tmp30 = 0.0; + tmp30 += m_A118 * V[32]; + V[30] = (RHS30 - tmp30) / m_A117; + double tmp29 = 0.0; + tmp29 += m_A113 * V[32]; + V[29] = (RHS29 - tmp29) / m_A112; + double tmp28 = 0.0; + tmp28 += m_A105 * V[29]; + tmp28 += m_A106 * V[32]; + V[28] = (RHS28 - tmp28) / m_A104; + double tmp27 = 0.0; + tmp27 += m_A96 * V[28]; + tmp27 += m_A97 * V[29]; + tmp27 += m_A98 * V[32]; + V[27] = (RHS27 - tmp27) / m_A95; + double tmp26 = 0.0; + tmp26 += m_A89 * V[31]; + tmp26 += m_A90 * V[32]; + V[26] = (RHS26 - tmp26) / m_A88; + double tmp25 = 0.0; + tmp25 += m_A82 * V[30]; + tmp25 += m_A83 * V[32]; + V[25] = (RHS25 - tmp25) / m_A81; + double tmp24 = 0.0; + tmp24 += m_A78 * V[26]; + tmp24 += m_A79 * V[32]; + V[24] = (RHS24 - tmp24) / m_A77; + double tmp23 = 0.0; + tmp23 += m_A71 * V[26]; + tmp23 += m_A72 * V[32]; + V[23] = (RHS23 - tmp23) / m_A70; + double tmp22 = 0.0; + tmp22 += m_A67 * V[28]; + tmp22 += m_A68 * V[32]; + V[22] = (RHS22 - tmp22) / m_A66; + double tmp21 = 0.0; + tmp21 += m_A62 * V[27]; + tmp21 += m_A63 * V[29]; + tmp21 += m_A64 * V[32]; + V[21] = (RHS21 - tmp21) / m_A61; + double tmp20 = 0.0; + tmp20 += m_A58 * V[28]; + V[20] = (RHS20 - tmp20) / m_A57; + double tmp19 = 0.0; + tmp19 += m_A55 * V[29]; + V[19] = (RHS19 - tmp19) / m_A54; + double tmp18 = 0.0; + tmp18 += m_A52 * V[25]; + V[18] = (RHS18 - tmp18) / m_A51; + double tmp17 = 0.0; + tmp17 += m_A49 * V[30]; + V[17] = (RHS17 - tmp17) / m_A48; + double tmp16 = 0.0; + tmp16 += m_A45 * V[17]; + V[16] = (RHS16 - tmp16) / m_A44; + double tmp15 = 0.0; + tmp15 += m_A41 * V[31]; + V[15] = (RHS15 - tmp15) / m_A40; + double tmp14 = 0.0; + tmp14 += m_A37 * V[23]; + tmp14 += m_A38 * V[24]; + tmp14 += m_A39 * V[26]; + V[14] = (RHS14 - tmp14) / m_A36; + double tmp13 = 0.0; + tmp13 += m_A34 * V[26]; + tmp13 += m_A35 * V[32]; + V[13] = (RHS13 - tmp13) / m_A33; + double tmp12 = 0.0; + tmp12 += m_A32 * V[24]; + V[12] = (RHS12 - tmp12) / m_A31; + double tmp11 = 0.0; + tmp11 += m_A30 * V[24]; + V[11] = (RHS11 - tmp11) / m_A29; + double tmp10 = 0.0; + tmp10 += m_A28 * V[27]; + V[10] = (RHS10 - tmp10) / m_A27; + double tmp9 = 0.0; + tmp9 += m_A24 * V[22]; + tmp9 += m_A25 * V[27]; + tmp9 += m_A26 * V[28]; + V[9] = (RHS9 - tmp9) / m_A23; + double tmp8 = 0.0; + tmp8 += m_A21 * V[28]; + tmp8 += m_A22 * V[32]; + V[8] = (RHS8 - tmp8) / m_A20; + double tmp7 = 0.0; + tmp7 += m_A19 * V[20]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A16 * V[29]; + tmp6 += m_A17 * V[32]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A13 * V[6]; + tmp5 += m_A14 * V[29]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A11 * V[19]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[25]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[17]; + tmp2 += m_A7 * V[30]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[16]; + tmp1 += m_A4 * V[17]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[16]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_13_double_double_576f391d0418cb76(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + m_A12 += gt[10]; + m_A12 += gt[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A11 += go[10]; + m_A10 += go[11]; + m_A9 += go[12]; + m_A8 += go[13]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[14] * *cnV[14]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A8; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A9; + m_A12 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A7 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A7 * V[4]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_20_double_double_e03f0bc5ac056326(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A7 += go[6]; + m_A6 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A9 += go[10]; + m_A8 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + m_A15 += gt[12]; + m_A15 += gt[13]; + m_A15 += gt[14]; + m_A13 += go[12]; + m_A12 += go[13]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[14] * *cnV[14]; + m_A19 += gt[15]; + m_A19 += gt[16]; + m_A19 += gt[17]; + m_A19 += gt[18]; + m_A19 += gt[19]; + m_A19 += gt[20]; + m_A19 += gt[21]; + m_A17 += go[15]; + m_A18 += go[16]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[17] * *cnV[17]; + RHS5 -= go[18] * *cnV[18]; + RHS5 -= go[19] * *cnV[19]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A12; + m_A14 += m_A3 * f1_4; + m_A15 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A13; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A17; + m_A18 += m_A6 * f2_5; + m_A19 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + RHS4 += f3_4 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A19; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_21_double_double_c5b523ed6a9677e6(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A4 += go[2]; + m_A3 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + m_A5 += gt[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A6 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A7 += gt[11]; + m_A8 += go[11]; + double RHS3 = Idr[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A10 += go[12]; + m_A9 += go[13]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[14] * *cnV[14]; + m_A15 += gt[15]; + m_A15 += gt[16]; + m_A15 += gt[17]; + m_A16 += go[15]; + m_A13 += go[16]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + m_A20 += gt[18]; + m_A20 += gt[19]; + m_A20 += gt[20]; + m_A20 += gt[21]; + m_A20 += gt[22]; + m_A17 += go[18]; + m_A18 += go[19]; + m_A19 += go[20]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 -= go[21] * *cnV[21]; + RHS6 -= go[22] * *cnV[22]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A9; + m_A11 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A10; + m_A11 += m_A3 * f1_4; + m_A12 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A13; + m_A14 += m_A3 * f1_5; + m_A15 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_6 = -f2 * m_A17; + m_A19 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_6 = -f3 * m_A18; + m_A20 += m_A8 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_5 = -f4 * m_A14; + m_A15 += m_A12 * f4_5; + RHS5 += f4_5 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_6 = -f5 * m_A19; + m_A20 += m_A16 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A20; + double tmp5 = 0.0; + tmp5 += m_A16 * V[6]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A12 * V[5]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[6]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_23_double_double_2753fc1815ce0cba(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[7]; + m_A6 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A9 += go[11]; + m_A7 += go[12]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A13 += go[18]; + m_A12 += go[19]; + m_A10 += go[20]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[21] * *cnV[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A14 += go[22]; + m_A15 += go[23]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 -= go[24] * *cnV[24]; + m_A22 += gt[25]; + m_A22 += gt[26]; + m_A18 += go[25]; + m_A20 += go[26]; + double RHS6 = Idr[25]; + RHS6 += Idr[26]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f0_4 = -f0 * m_A10; + m_A11 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A14; + m_A16 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A18; + m_A19 += m_A5 * f2_6; + m_A22 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_6 = -f3 * m_A19; + m_A20 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_5 = -f4 * m_A15; + m_A16 += m_A12 * f4_5; + m_A17 += m_A13 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_6 = -f4 * m_A20; + m_A21 += m_A12 * f4_6; + m_A22 += m_A13 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A16; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A17 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A22; + double tmp5 = 0.0; + tmp5 += m_A17 * V[6]; + V[5] = (RHS5 - tmp5) / m_A16; + double tmp4 = 0.0; + tmp4 += m_A12 * V[5]; + tmp4 += m_A13 * V[6]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[4]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + tmp2 += m_A6 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_30_double_double_d5e1c37cfa2d2853(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + m_A4 += go[5]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A6 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A8 += go[9]; + m_A9 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[11] * *cnV[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A10 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A15 += go[14]; + m_A13 += go[15]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 -= go[16] * *cnV[16]; + m_A17 += gt[17]; + m_A17 += gt[18]; + m_A17 += gt[19]; + m_A17 += gt[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A16 += go[17]; + m_A18 += go[18]; + double RHS6 = Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + RHS6 -= go[21] * *cnV[21]; + RHS6 -= go[22] * *cnV[22]; + RHS6 -= go[23] * *cnV[23]; + m_A22 += gt[24]; + m_A22 += gt[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A20 += go[24]; + m_A19 += go[25]; + m_A21 += go[26]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[27] * *cnV[27]; + m_A29 += gt[28]; + m_A29 += gt[29]; + m_A29 += gt[30]; + m_A29 += gt[31]; + m_A29 += gt[32]; + m_A27 += go[28]; + m_A25 += go[29]; + m_A24 += go[30]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 -= go[31] * *cnV[31]; + RHS8 -= go[32] * *cnV[32]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A13; + m_A14 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A19; + m_A22 += m_A3 * f1_7; + m_A23 += m_A4 * f1_7; + RHS7 += f1_7 * RHS1; + const double f1_8 = -f1 * m_A24; + m_A28 += m_A3 * f1_8; + m_A29 += m_A4 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_6 = -f2 * m_A16; + m_A18 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_7 = -f2 * m_A20; + m_A22 += m_A6 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_4 = -f3 * m_A10; + m_A11 += m_A8 * f3_4; + m_A12 += m_A9 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_8 = -f3 * m_A25; + m_A26 += m_A8 * f3_8; + m_A29 += m_A9 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_8 = -f4 * m_A26; + m_A29 += m_A12 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_7 = -f5 * m_A21; + m_A22 += m_A15 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_8 = -f6 * m_A27; + m_A28 += m_A18 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_8 = -f7 * m_A28; + m_A29 += m_A23 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A29; + double tmp7 = 0.0; + tmp7 += m_A23 * V[8]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A18 * V[7]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A15 * V[7]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A12 * V[8]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[4]; + tmp3 += m_A9 * V[8]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[7]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + tmp1 += m_A4 * V[8]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_34_double_double_1fec893028a7b809(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A13 += go[12]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A15 += go[14]; + double RHS7 = Idr[14]; + RHS7 += Idr[15]; + RHS7 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A17 += go[16]; + double RHS8 = Idr[16]; + RHS8 += Idr[17]; + RHS8 -= go[17] * *cnV[17]; + m_A18 += gt[18]; + m_A18 += gt[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A19 += go[18]; + double RHS9 = Idr[18]; + RHS9 += Idr[19]; + RHS9 += Idr[20]; + RHS9 += Idr[21]; + RHS9 += Idr[22]; + RHS9 += Idr[23]; + RHS9 += Idr[24]; + RHS9 -= go[19] * *cnV[19]; + RHS9 -= go[20] * *cnV[20]; + RHS9 -= go[21] * *cnV[21]; + RHS9 -= go[22] * *cnV[22]; + RHS9 -= go[23] * *cnV[23]; + RHS9 -= go[24] * *cnV[24]; + m_A28 += gt[25]; + m_A28 += gt[26]; + m_A28 += gt[27]; + m_A28 += gt[28]; + m_A28 += gt[29]; + m_A28 += gt[30]; + m_A28 += gt[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A29 += go[25]; + m_A27 += go[26]; + m_A26 += go[27]; + m_A25 += go[28]; + m_A24 += go[29]; + m_A23 += go[30]; + m_A22 += go[31]; + m_A21 += go[32]; + m_A20 += go[33]; + double RHS10 = Idr[25]; + RHS10 += Idr[26]; + RHS10 += Idr[27]; + RHS10 += Idr[28]; + RHS10 += Idr[29]; + RHS10 += Idr[30]; + RHS10 += Idr[31]; + RHS10 += Idr[32]; + RHS10 += Idr[33]; + RHS10 += Idr[34]; + RHS10 -= go[34] * *cnV[34]; + m_A33 += gt[35]; + m_A33 += gt[36]; + m_A33 += gt[37]; + m_A33 += gt[38]; + m_A33 += gt[39]; + m_A31 += go[35]; + m_A30 += go[36]; + m_A32 += go[37]; + double RHS11 = Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + const double f0 = 1.0 / m_A0; + const double f0_10 = -f0 * m_A20; + m_A28 += m_A1 * f0_10; + RHS10 += f0_10 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A21; + m_A28 += m_A3 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_11 = -f2 * m_A30; + m_A33 += m_A5 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_10 = -f3 * m_A22; + m_A28 += m_A7 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_10 = -f4 * m_A23; + m_A28 += m_A9 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_10 = -f5 * m_A24; + m_A28 += m_A11 * f5_10; + RHS10 += f5_10 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_10 = -f6 * m_A25; + m_A28 += m_A13 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_10 = -f7 * m_A26; + m_A28 += m_A15 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_10 = -f8 * m_A27; + m_A28 += m_A17 * f8_10; + RHS10 += f8_10 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_11 = -f9 * m_A31; + m_A32 += m_A19 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A28; + const double f10_11 = -f10 * m_A32; + m_A33 += m_A29 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A33; + double tmp10 = 0.0; + tmp10 += m_A29 * V[11]; + V[10] = (RHS10 - tmp10) / m_A28; + double tmp9 = 0.0; + tmp9 += m_A19 * V[10]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[10]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[10]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[10]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[10]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[10]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[10]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[10]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[10]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_47_double_double_aa68b74ffdea9bd8(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A6 += go[9]; + m_A5 += go[10]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A8 += go[12]; + m_A9 += go[13]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A13 += go[15]; + m_A12 += go[16]; + m_A11 += go[17]; + m_A14 += go[18]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A16 += go[21]; + m_A15 += go[22]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + m_A21 += gt[23]; + m_A21 += gt[24]; + m_A21 += gt[25]; + m_A20 += go[23]; + m_A19 += go[24]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 -= go[25] * *cnV[25]; + m_A28 += gt[26]; + m_A28 += gt[27]; + m_A28 += gt[28]; + m_A28 += gt[29]; + m_A28 += gt[30]; + m_A25 += go[26]; + m_A29 += go[27]; + m_A26 += go[28]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 -= go[29] * *cnV[29]; + RHS7 -= go[30] * *cnV[30]; + m_A32 += gt[31]; + m_A32 += gt[32]; + m_A32 += gt[33]; + m_A30 += go[31]; + double RHS8 = Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 -= go[32] * *cnV[32]; + RHS8 -= go[33] * *cnV[33]; + m_A38 += gt[34]; + m_A38 += gt[35]; + m_A38 += gt[36]; + m_A38 += gt[37]; + m_A38 += gt[38]; + m_A38 += gt[39]; + m_A38 += gt[40]; + m_A36 += go[34]; + m_A35 += go[35]; + double RHS9 = Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 += Idr[40]; + RHS9 -= go[36] * *cnV[36]; + RHS9 -= go[37] * *cnV[37]; + RHS9 -= go[38] * *cnV[38]; + RHS9 -= go[39] * *cnV[39]; + RHS9 -= go[40] * *cnV[40]; + m_A46 += gt[41]; + m_A46 += gt[42]; + m_A46 += gt[43]; + m_A41 += go[41]; + m_A40 += go[42]; + m_A43 += go[43]; + double RHS10 = Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A15; + m_A17 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A25; + m_A26 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_5 = -f2 * m_A16; + m_A17 += m_A5 * f2_5; + m_A18 += m_A6 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_7 = -f2 * m_A26; + m_A27 += m_A5 * f2_7; + m_A28 += m_A6 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_6 = -f3 * m_A19; + m_A21 += m_A8 * f3_6; + m_A24 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_9 = -f3 * m_A35; + m_A36 += m_A8 * f3_9; + m_A39 += m_A9 * f3_9; + RHS9 += f3_9 * RHS3; + const double f3_10 = -f3 * m_A40; + m_A42 += m_A8 * f3_10; + m_A46 += m_A9 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_6 = -f4 * m_A20; + m_A21 += m_A11 * f4_6; + m_A22 += m_A12 * f4_6; + m_A23 += m_A13 * f4_6; + m_A24 += m_A14 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_8 = -f4 * m_A30; + m_A31 += m_A11 * f4_8; + m_A32 += m_A12 * f4_8; + m_A33 += m_A13 * f4_8; + m_A34 += m_A14 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_10 = -f4 * m_A41; + m_A42 += m_A11 * f4_10; + m_A44 += m_A12 * f4_10; + m_A45 += m_A13 * f4_10; + m_A46 += m_A14 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_7 = -f5 * m_A27; + m_A28 += m_A18 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A21; + const double f6_8 = -f6 * m_A31; + m_A32 += m_A22 * f6_8; + m_A33 += m_A23 * f6_8; + m_A34 += m_A24 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A36; + m_A37 += m_A22 * f6_9; + m_A38 += m_A23 * f6_9; + m_A39 += m_A24 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_10 = -f6 * m_A42; + m_A44 += m_A22 * f6_10; + m_A45 += m_A23 * f6_10; + m_A46 += m_A24 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A28; + const double f7_10 = -f7 * m_A43; + m_A46 += m_A29 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A32; + const double f8_9 = -f8 * m_A37; + m_A38 += m_A33 * f8_9; + m_A39 += m_A34 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_10 = -f8 * m_A44; + m_A45 += m_A33 * f8_10; + m_A46 += m_A34 * f8_10; + RHS10 += f8_10 * RHS8; + const double f9 = 1.0 / m_A38; + const double f9_10 = -f9 * m_A45; + m_A46 += m_A39 * f9_10; + RHS10 += f9_10 * RHS9; + V[10] = RHS10 / m_A46; + double tmp9 = 0.0; + tmp9 += m_A39 * V[10]; + V[9] = (RHS9 - tmp9) / m_A38; + double tmp8 = 0.0; + tmp8 += m_A33 * V[9]; + tmp8 += m_A34 * V[10]; + V[8] = (RHS8 - tmp8) / m_A32; + double tmp7 = 0.0; + tmp7 += m_A29 * V[10]; + V[7] = (RHS7 - tmp7) / m_A28; + double tmp6 = 0.0; + tmp6 += m_A22 * V[8]; + tmp6 += m_A23 * V[9]; + tmp6 += m_A24 * V[10]; + V[6] = (RHS6 - tmp6) / m_A21; + double tmp5 = 0.0; + tmp5 += m_A18 * V[7]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A11 * V[6]; + tmp4 += m_A12 * V[8]; + tmp4 += m_A13 * V[9]; + tmp4 += m_A14 * V[10]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[6]; + tmp3 += m_A9 * V[10]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[5]; + tmp2 += m_A6 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_75_double_double_75400df5d559a266(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A8 += go[10]; + m_A7 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A10 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A12 += go[15]; + m_A15 += go[16]; + m_A14 += go[17]; + m_A13 += go[18]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 -= go[19] * *cnV[19]; + RHS5 -= go[20] * *cnV[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A18 += go[21]; + m_A17 += go[22]; + double RHS6 = Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A19 += gt[30]; + m_A19 += gt[31]; + m_A20 += go[28]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 -= go[29] * *cnV[29]; + RHS7 -= go[30] * *cnV[30]; + RHS7 -= go[31] * *cnV[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A22 += gt[37]; + m_A22 += gt[38]; + m_A23 += go[32]; + m_A21 += go[33]; + double RHS8 = Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 += Idr[38]; + RHS8 -= go[34] * *cnV[34]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + RHS8 -= go[38] * *cnV[38]; + m_A25 += gt[39]; + m_A25 += gt[40]; + m_A25 += gt[41]; + m_A24 += go[39]; + m_A26 += go[40]; + double RHS9 = Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + RHS9 -= go[41] * *cnV[41]; + m_A28 += gt[42]; + m_A28 += gt[43]; + m_A28 += gt[44]; + m_A28 += gt[45]; + m_A28 += gt[46]; + m_A28 += gt[47]; + m_A28 += gt[48]; + m_A29 += go[42]; + m_A27 += go[43]; + double RHS10 = Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + RHS10 += Idr[47]; + RHS10 += Idr[48]; + RHS10 -= go[44] * *cnV[44]; + RHS10 -= go[45] * *cnV[45]; + RHS10 -= go[46] * *cnV[46]; + RHS10 -= go[47] * *cnV[47]; + RHS10 -= go[48] * *cnV[48]; + m_A33 += gt[49]; + m_A33 += gt[50]; + m_A33 += gt[51]; + m_A31 += go[49]; + m_A30 += go[50]; + m_A35 += go[51]; + double RHS11 = Idr[49]; + RHS11 += Idr[50]; + RHS11 += Idr[51]; + m_A40 += gt[52]; + m_A40 += gt[53]; + m_A40 += gt[54]; + m_A42 += go[52]; + m_A37 += go[53]; + double RHS12 = Idr[52]; + RHS12 += Idr[53]; + RHS12 += Idr[54]; + RHS12 -= go[54] * *cnV[54]; + m_A44 += gt[55]; + m_A44 += gt[56]; + m_A45 += go[55]; + m_A43 += go[56]; + double RHS13 = Idr[55]; + RHS13 += Idr[56]; + m_A47 += gt[57]; + m_A47 += gt[58]; + m_A47 += gt[59]; + m_A46 += go[57]; + m_A48 += go[58]; + double RHS14 = Idr[57]; + RHS14 += Idr[58]; + RHS14 += Idr[59]; + RHS14 -= go[59] * *cnV[59]; + m_A52 += gt[60]; + m_A52 += gt[61]; + m_A52 += gt[62]; + m_A52 += gt[63]; + m_A51 += go[60]; + m_A50 += go[61]; + m_A49 += go[62]; + double RHS15 = Idr[60]; + RHS15 += Idr[61]; + RHS15 += Idr[62]; + RHS15 += Idr[63]; + RHS15 -= go[63] * *cnV[63]; + m_A59 += gt[64]; + m_A59 += gt[65]; + m_A59 += gt[66]; + m_A59 += gt[67]; + m_A59 += gt[68]; + m_A55 += go[64]; + m_A56 += go[65]; + m_A54 += go[66]; + double RHS16 = Idr[64]; + RHS16 += Idr[65]; + RHS16 += Idr[66]; + RHS16 += Idr[67]; + RHS16 += Idr[68]; + RHS16 -= go[67] * *cnV[67]; + RHS16 -= go[68] * *cnV[68]; + m_A65 += gt[69]; + m_A65 += gt[70]; + m_A65 += gt[71]; + m_A65 += gt[72]; + m_A65 += gt[73]; + m_A61 += go[69]; + m_A66 += go[70]; + m_A63 += go[71]; + double RHS17 = Idr[69]; + RHS17 += Idr[70]; + RHS17 += Idr[71]; + RHS17 += Idr[72]; + RHS17 += Idr[73]; + RHS17 -= go[72] * *cnV[72]; + RHS17 -= go[73] * *cnV[73]; + m_A74 += gt[74]; + m_A74 += gt[75]; + m_A74 += gt[76]; + m_A74 += gt[77]; + m_A73 += go[74]; + m_A71 += go[75]; + m_A70 += go[76]; + m_A67 += go[77]; + double RHS18 = Idr[74]; + RHS18 += Idr[75]; + RHS18 += Idr[76]; + RHS18 += Idr[77]; + const double f0 = 1.0 / m_A0; + const double f0_13 = -f0 * m_A43; + m_A44 += m_A1 * f0_13; + RHS13 += f0_13 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A21; + m_A23 += m_A3 * f1_8; + RHS8 += f1_8 * RHS1; + const double f1_15 = -f1 * m_A49; + m_A52 += m_A3 * f1_15; + RHS15 += f1_15 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_9 = -f2 * m_A24; + m_A25 += m_A5 * f2_9; + RHS9 += f2_9 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_15 = -f3 * m_A50; + m_A52 += m_A7 * f3_15; + m_A53 += m_A8 * f3_15; + RHS15 += f3_15 * RHS3; + const double f3_16 = -f3 * m_A54; + m_A58 += m_A7 * f3_16; + m_A59 += m_A8 * f3_16; + RHS16 += f3_16 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_10 = -f4 * m_A27; + m_A29 += m_A10 * f4_10; + RHS10 += f4_10 * RHS4; + const double f4_11 = -f4 * m_A30; + m_A33 += m_A10 * f4_11; + RHS11 += f4_11 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_11 = -f5 * m_A31; + m_A32 += m_A12 * f5_11; + m_A33 += m_A13 * f5_11; + m_A34 += m_A14 * f5_11; + m_A36 += m_A15 * f5_11; + RHS11 += f5_11 * RHS5; + const double f5_12 = -f5 * m_A37; + m_A38 += m_A12 * f5_12; + m_A39 += m_A13 * f5_12; + m_A40 += m_A14 * f5_12; + m_A42 += m_A15 * f5_12; + RHS12 += f5_12 * RHS5; + const double f5_18 = -f5 * m_A67; + m_A68 += m_A12 * f5_18; + m_A69 += m_A13 * f5_18; + m_A70 += m_A14 * f5_18; + m_A74 += m_A15 * f5_18; + RHS18 += f5_18 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_17 = -f6 * m_A61; + m_A62 += m_A17 * f6_17; + m_A66 += m_A18 * f6_17; + RHS17 += f6_17 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_14 = -f7 * m_A46; + m_A47 += m_A20 * f7_14; + RHS14 += f7_14 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_16 = -f8 * m_A55; + m_A58 += m_A23 * f8_16; + RHS16 += f8_16 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_15 = -f9 * m_A51; + m_A52 += m_A26 * f9_15; + RHS15 += f9_15 * RHS9; + const double f10 = 1.0 / m_A28; + const double f10_11 = -f10 * m_A32; + m_A33 += m_A29 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_12 = -f10 * m_A38; + m_A39 += m_A29 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_18 = -f10 * m_A68; + m_A69 += m_A29 * f10_18; + RHS18 += f10_18 * RHS10; + const double f11 = 1.0 / m_A33; + const double f11_12 = -f11 * m_A39; + m_A40 += m_A34 * f11_12; + m_A41 += m_A35 * f11_12; + m_A42 += m_A36 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_16 = -f11 * m_A56; + m_A57 += m_A34 * f11_16; + m_A59 += m_A35 * f11_16; + m_A60 += m_A36 * f11_16; + RHS16 += f11_16 * RHS11; + const double f11_18 = -f11 * m_A69; + m_A70 += m_A34 * f11_18; + m_A72 += m_A35 * f11_18; + m_A74 += m_A36 * f11_18; + RHS18 += f11_18 * RHS11; + const double f12 = 1.0 / m_A40; + const double f12_16 = -f12 * m_A57; + m_A59 += m_A41 * f12_16; + m_A60 += m_A42 * f12_16; + RHS16 += f12_16 * RHS12; + const double f12_17 = -f12 * m_A62; + m_A64 += m_A41 * f12_17; + m_A66 += m_A42 * f12_17; + RHS17 += f12_17 * RHS12; + const double f12_18 = -f12 * m_A70; + m_A72 += m_A41 * f12_18; + m_A74 += m_A42 * f12_18; + RHS18 += f12_18 * RHS12; + const double f13 = 1.0 / m_A44; + const double f13_17 = -f13 * m_A63; + m_A65 += m_A45 * f13_17; + RHS17 += f13_17 * RHS13; + const double f14 = 1.0 / m_A47; + const double f14_18 = -f14 * m_A71; + m_A74 += m_A48 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A52; + const double f15_16 = -f15 * m_A58; + m_A59 += m_A53 * f15_16; + RHS16 += f15_16 * RHS15; + const double f16 = 1.0 / m_A59; + const double f16_17 = -f16 * m_A64; + m_A66 += m_A60 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_18 = -f16 * m_A72; + m_A74 += m_A60 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A65; + const double f17_18 = -f17 * m_A73; + m_A74 += m_A66 * f17_18; + RHS18 += f17_18 * RHS17; + V[18] = RHS18 / m_A74; + double tmp17 = 0.0; + tmp17 += m_A66 * V[18]; + V[17] = (RHS17 - tmp17) / m_A65; + double tmp16 = 0.0; + tmp16 += m_A60 * V[18]; + V[16] = (RHS16 - tmp16) / m_A59; + double tmp15 = 0.0; + tmp15 += m_A53 * V[16]; + V[15] = (RHS15 - tmp15) / m_A52; + double tmp14 = 0.0; + tmp14 += m_A48 * V[18]; + V[14] = (RHS14 - tmp14) / m_A47; + double tmp13 = 0.0; + tmp13 += m_A45 * V[17]; + V[13] = (RHS13 - tmp13) / m_A44; + double tmp12 = 0.0; + tmp12 += m_A41 * V[16]; + tmp12 += m_A42 * V[18]; + V[12] = (RHS12 - tmp12) / m_A40; + double tmp11 = 0.0; + tmp11 += m_A34 * V[12]; + tmp11 += m_A35 * V[16]; + tmp11 += m_A36 * V[18]; + V[11] = (RHS11 - tmp11) / m_A33; + double tmp10 = 0.0; + tmp10 += m_A29 * V[11]; + V[10] = (RHS10 - tmp10) / m_A28; + double tmp9 = 0.0; + tmp9 += m_A26 * V[15]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A23 * V[15]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A20 * V[14]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A17 * V[12]; + tmp6 += m_A18 * V[18]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A12 * V[10]; + tmp5 += m_A13 * V[11]; + tmp5 += m_A14 * V[12]; + tmp5 += m_A15 * V[18]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[11]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A7 * V[15]; + tmp3 += m_A8 * V[16]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[9]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[13]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_77_double_double_437326911721091(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[2]; + m_A5 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A7 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A10 += go[10]; + m_A9 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A12 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A16 += go[16]; + m_A15 += go[17]; + m_A14 += go[18]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 -= go[19] * *cnV[19]; + RHS5 -= go[20] * *cnV[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A18 += go[21]; + double RHS6 = Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 -= go[22] * *cnV[22]; + RHS6 -= go[23] * *cnV[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A20 += go[24]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[25] * *cnV[25]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + m_A23 += gt[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A21 += go[28]; + m_A22 += go[29]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 -= go[30] * *cnV[30]; + m_A28 += gt[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A28 += gt[35]; + m_A28 += gt[36]; + m_A28 += gt[37]; + m_A29 += go[31]; + m_A26 += go[32]; + double RHS9 = Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 -= go[33] * *cnV[33]; + RHS9 -= go[34] * *cnV[34]; + RHS9 -= go[35] * *cnV[35]; + RHS9 -= go[36] * *cnV[36]; + RHS9 -= go[37] * *cnV[37]; + m_A31 += gt[38]; + m_A31 += gt[39]; + m_A31 += gt[40]; + m_A31 += gt[41]; + m_A31 += gt[42]; + m_A31 += gt[43]; + m_A31 += gt[44]; + m_A32 += go[38]; + m_A30 += go[39]; + double RHS10 = Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 -= go[40] * *cnV[40]; + RHS10 -= go[41] * *cnV[41]; + RHS10 -= go[42] * *cnV[42]; + RHS10 -= go[43] * *cnV[43]; + RHS10 -= go[44] * *cnV[44]; + m_A35 += gt[45]; + m_A35 += gt[46]; + m_A35 += gt[47]; + m_A35 += gt[48]; + m_A36 += go[45]; + m_A34 += go[46]; + m_A33 += go[47]; + double RHS11 = Idr[45]; + RHS11 += Idr[46]; + RHS11 += Idr[47]; + RHS11 += Idr[48]; + RHS11 -= go[48] * *cnV[48]; + m_A42 += gt[49]; + m_A42 += gt[50]; + m_A42 += gt[51]; + m_A39 += go[49]; + m_A45 += go[50]; + m_A38 += go[51]; + double RHS12 = Idr[49]; + RHS12 += Idr[50]; + RHS12 += Idr[51]; + m_A48 += gt[52]; + m_A48 += gt[53]; + m_A46 += go[52]; + m_A51 += go[53]; + double RHS13 = Idr[52]; + RHS13 += Idr[53]; + m_A53 += gt[54]; + m_A53 += gt[55]; + m_A53 += gt[56]; + m_A53 += gt[57]; + m_A53 += gt[58]; + m_A53 += gt[59]; + m_A53 += gt[60]; + m_A54 += go[54]; + m_A52 += go[55]; + double RHS14 = Idr[54]; + RHS14 += Idr[55]; + RHS14 += Idr[56]; + RHS14 += Idr[57]; + RHS14 += Idr[58]; + RHS14 += Idr[59]; + RHS14 += Idr[60]; + RHS14 -= go[56] * *cnV[56]; + RHS14 -= go[57] * *cnV[57]; + RHS14 -= go[58] * *cnV[58]; + RHS14 -= go[59] * *cnV[59]; + RHS14 -= go[60] * *cnV[60]; + m_A56 += gt[61]; + m_A56 += gt[62]; + m_A56 += gt[63]; + m_A55 += go[61]; + m_A57 += go[62]; + double RHS15 = Idr[61]; + RHS15 += Idr[62]; + RHS15 += Idr[63]; + RHS15 -= go[63] * *cnV[63]; + m_A60 += gt[64]; + m_A60 += gt[65]; + m_A60 += gt[66]; + m_A58 += go[64]; + m_A59 += go[65]; + double RHS16 = Idr[64]; + RHS16 += Idr[65]; + RHS16 += Idr[66]; + RHS16 -= go[66] * *cnV[66]; + m_A69 += gt[67]; + m_A69 += gt[68]; + m_A69 += gt[69]; + m_A69 += gt[70]; + m_A69 += gt[71]; + m_A63 += go[67]; + m_A62 += go[68]; + m_A65 += go[69]; + double RHS17 = Idr[67]; + RHS17 += Idr[68]; + RHS17 += Idr[69]; + RHS17 += Idr[70]; + RHS17 += Idr[71]; + RHS17 -= go[70] * *cnV[70]; + RHS17 -= go[71] * *cnV[71]; + m_A76 += gt[72]; + m_A76 += gt[73]; + m_A76 += gt[74]; + m_A76 += gt[75]; + m_A74 += go[72]; + m_A72 += go[73]; + m_A71 += go[74]; + double RHS18 = Idr[72]; + RHS18 += Idr[73]; + RHS18 += Idr[74]; + RHS18 += Idr[75]; + RHS18 -= go[75] * *cnV[75]; + const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A21; + m_A23 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A22; + m_A23 += m_A3 * f1_8; + m_A24 += m_A4 * f1_8; + m_A25 += m_A5 * f1_8; + RHS8 += f1_8 * RHS1; + const double f1_9 = -f1 * m_A26; + m_A27 += m_A3 * f1_9; + m_A28 += m_A4 * f1_9; + m_A29 += m_A5 * f1_9; + RHS9 += f1_9 * RHS1; + const double f1_12 = -f1 * m_A38; + m_A40 += m_A3 * f1_12; + m_A41 += m_A4 * f1_12; + m_A42 += m_A5 * f1_12; + RHS12 += f1_12 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_10 = -f2 * m_A30; + m_A32 += m_A7 * f2_10; + RHS10 += f2_10 * RHS2; + const double f2_11 = -f2 * m_A33; + m_A35 += m_A7 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_11 = -f3 * m_A34; + m_A35 += m_A9 * f3_11; + m_A37 += m_A10 * f3_11; + RHS11 += f3_11 * RHS3; + const double f3_17 = -f3 * m_A62; + m_A64 += m_A9 * f3_17; + m_A69 += m_A10 * f3_17; + RHS17 += f3_17 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_16 = -f4 * m_A58; + m_A60 += m_A12 * f4_16; + RHS16 += f4_16 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_12 = -f5 * m_A39; + m_A42 += m_A14 * f5_12; + m_A43 += m_A15 * f5_12; + m_A44 += m_A16 * f5_12; + RHS12 += f5_12 * RHS5; + const double f5_13 = -f5 * m_A46; + m_A47 += m_A14 * f5_13; + m_A48 += m_A15 * f5_13; + m_A49 += m_A16 * f5_13; + RHS13 += f5_13 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_14 = -f6 * m_A52; + m_A54 += m_A18 * f6_14; + RHS14 += f6_14 * RHS6; + const double f6_18 = -f6 * m_A71; + m_A76 += m_A18 * f6_18; + RHS18 += f6_18 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_15 = -f7 * m_A55; + m_A56 += m_A20 * f7_15; + RHS15 += f7_15 * RHS7; + const double f8 = 1.0 / m_A23; + const double f8_9 = -f8 * m_A27; + m_A28 += m_A24 * f8_9; + m_A29 += m_A25 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_12 = -f8 * m_A40; + m_A41 += m_A24 * f8_12; + m_A42 += m_A25 * f8_12; + RHS12 += f8_12 * RHS8; + const double f9 = 1.0 / m_A28; + const double f9_12 = -f9 * m_A41; + m_A42 += m_A29 * f9_12; + RHS12 += f9_12 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_17 = -f10 * m_A63; + m_A64 += m_A32 * f10_17; + RHS17 += f10_17 * RHS10; + const double f11 = 1.0 / m_A35; + const double f11_16 = -f11 * m_A59; + m_A60 += m_A36 * f11_16; + m_A61 += m_A37 * f11_16; + RHS16 += f11_16 * RHS11; + const double f11_17 = -f11 * m_A64; + m_A68 += m_A36 * f11_17; + m_A69 += m_A37 * f11_17; + RHS17 += f11_17 * RHS11; + const double f12 = 1.0 / m_A42; + const double f12_13 = -f12 * m_A47; + m_A48 += m_A43 * f12_13; + m_A49 += m_A44 * f12_13; + m_A50 += m_A45 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_17 = -f12 * m_A65; + m_A66 += m_A43 * f12_17; + m_A67 += m_A44 * f12_17; + m_A69 += m_A45 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A48; + const double f13_17 = -f13 * m_A66; + m_A67 += m_A49 * f13_17; + m_A69 += m_A50 * f13_17; + m_A70 += m_A51 * f13_17; + RHS17 += f13_17 * RHS13; + const double f13_18 = -f13 * m_A72; + m_A73 += m_A49 * f13_18; + m_A75 += m_A50 * f13_18; + m_A76 += m_A51 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A53; + const double f14_17 = -f14 * m_A67; + m_A70 += m_A54 * f14_17; + RHS17 += f14_17 * RHS14; + const double f14_18 = -f14 * m_A73; + m_A76 += m_A54 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A56; + const double f15_18 = -f15 * m_A74; + m_A76 += m_A57 * f15_18; + RHS18 += f15_18 * RHS15; + const double f16 = 1.0 / m_A60; + const double f16_17 = -f16 * m_A68; + m_A69 += m_A61 * f16_17; + RHS17 += f16_17 * RHS16; + const double f17 = 1.0 / m_A69; + const double f17_18 = -f17 * m_A75; + m_A76 += m_A70 * f17_18; + RHS18 += f17_18 * RHS17; + V[18] = RHS18 / m_A76; + double tmp17 = 0.0; + tmp17 += m_A70 * V[18]; + V[17] = (RHS17 - tmp17) / m_A69; + double tmp16 = 0.0; + tmp16 += m_A61 * V[17]; + V[16] = (RHS16 - tmp16) / m_A60; + double tmp15 = 0.0; + tmp15 += m_A57 * V[18]; + V[15] = (RHS15 - tmp15) / m_A56; + double tmp14 = 0.0; + tmp14 += m_A54 * V[18]; + V[14] = (RHS14 - tmp14) / m_A53; + double tmp13 = 0.0; + tmp13 += m_A49 * V[14]; + tmp13 += m_A50 * V[17]; + tmp13 += m_A51 * V[18]; + V[13] = (RHS13 - tmp13) / m_A48; + double tmp12 = 0.0; + tmp12 += m_A43 * V[13]; + tmp12 += m_A44 * V[14]; + tmp12 += m_A45 * V[17]; + V[12] = (RHS12 - tmp12) / m_A42; + double tmp11 = 0.0; + tmp11 += m_A36 * V[16]; + tmp11 += m_A37 * V[17]; + V[11] = (RHS11 - tmp11) / m_A35; + double tmp10 = 0.0; + tmp10 += m_A32 * V[11]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A29 * V[12]; + V[9] = (RHS9 - tmp9) / m_A28; + double tmp8 = 0.0; + tmp8 += m_A24 * V[9]; + tmp8 += m_A25 * V[12]; + V[8] = (RHS8 - tmp8) / m_A23; + double tmp7 = 0.0; + tmp7 += m_A20 * V[15]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A18 * V[18]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A14 * V[12]; + tmp5 += m_A15 * V[13]; + tmp5 += m_A16 * V[14]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A12 * V[16]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[11]; + tmp3 += m_A10 * V[17]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[11]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[8]; + tmp1 += m_A4 * V[9]; + tmp1 += m_A5 * V[12]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_83_double_double_f99b1245e708ec85(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A6 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A8 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[9] * *cnV[9]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A10 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A14 += go[15]; + m_A13 += go[16]; + m_A15 += go[17]; + m_A12 += go[18]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 -= go[19] * *cnV[19]; + RHS5 -= go[20] * *cnV[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A17 += go[21]; + double RHS6 = Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 -= go[22] * *cnV[22]; + RHS6 -= go[23] * *cnV[23]; + m_A18 += gt[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A18 += gt[27]; + m_A19 += go[24]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[25] * *cnV[25]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A20 += go[28]; + m_A21 += go[29]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 -= go[30] * *cnV[30]; + m_A27 += gt[31]; + m_A27 += gt[32]; + m_A27 += gt[33]; + m_A27 += gt[34]; + m_A27 += gt[35]; + m_A27 += gt[36]; + m_A28 += go[31]; + m_A29 += go[32]; + m_A29 += go[33]; + m_A26 += go[34]; + double RHS9 = Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 -= go[35] * *cnV[35]; + RHS9 -= go[36] * *cnV[36]; + m_A31 += gt[37]; + m_A31 += gt[38]; + m_A31 += gt[39]; + m_A31 += gt[40]; + m_A31 += gt[41]; + m_A31 += gt[42]; + m_A31 += gt[43]; + m_A33 += go[37]; + m_A30 += go[38]; + double RHS10 = Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 -= go[39] * *cnV[39]; + RHS10 -= go[40] * *cnV[40]; + RHS10 -= go[41] * *cnV[41]; + RHS10 -= go[42] * *cnV[42]; + RHS10 -= go[43] * *cnV[43]; + m_A35 += gt[44]; + m_A35 += gt[45]; + m_A35 += gt[46]; + m_A35 += gt[47]; + m_A35 += gt[48]; + m_A35 += gt[49]; + m_A36 += go[44]; + m_A37 += go[45]; + m_A38 += go[46]; + m_A34 += go[47]; + double RHS11 = Idr[44]; + RHS11 += Idr[45]; + RHS11 += Idr[46]; + RHS11 += Idr[47]; + RHS11 += Idr[48]; + RHS11 += Idr[49]; + RHS11 -= go[48] * *cnV[48]; + RHS11 -= go[49] * *cnV[49]; + m_A40 += gt[50]; + m_A40 += gt[51]; + m_A40 += gt[52]; + m_A39 += go[50]; + m_A41 += go[51]; + double RHS12 = Idr[50]; + RHS12 += Idr[51]; + RHS12 += Idr[52]; + RHS12 -= go[52] * *cnV[52]; + m_A43 += gt[53]; + m_A43 += gt[54]; + m_A43 += gt[55]; + m_A43 += gt[56]; + m_A43 += gt[57]; + m_A43 += gt[58]; + m_A43 += gt[59]; + m_A44 += go[53]; + m_A42 += go[54]; + double RHS13 = Idr[53]; + RHS13 += Idr[54]; + RHS13 += Idr[55]; + RHS13 += Idr[56]; + RHS13 += Idr[57]; + RHS13 += Idr[58]; + RHS13 += Idr[59]; + RHS13 -= go[55] * *cnV[55]; + RHS13 -= go[56] * *cnV[56]; + RHS13 -= go[57] * *cnV[57]; + RHS13 -= go[58] * *cnV[58]; + RHS13 -= go[59] * *cnV[59]; + m_A47 += gt[60]; + m_A47 += gt[61]; + m_A50 += go[60]; + m_A45 += go[61]; + double RHS14 = Idr[60]; + RHS14 += Idr[61]; + m_A52 += gt[62]; + m_A52 += gt[63]; + m_A52 += gt[64]; + m_A52 += gt[65]; + m_A52 += gt[66]; + m_A52 += gt[67]; + m_A52 += gt[68]; + m_A51 += go[62]; + m_A53 += go[63]; + double RHS15 = Idr[62]; + RHS15 += Idr[63]; + RHS15 += Idr[64]; + RHS15 += Idr[65]; + RHS15 += Idr[66]; + RHS15 += Idr[67]; + RHS15 += Idr[68]; + RHS15 -= go[64] * *cnV[64]; + RHS15 -= go[65] * *cnV[65]; + RHS15 -= go[66] * *cnV[66]; + RHS15 -= go[67] * *cnV[67]; + RHS15 -= go[68] * *cnV[68]; + m_A61 += gt[69]; + m_A61 += gt[70]; + m_A61 += gt[71]; + m_A54 += go[69]; + m_A55 += go[70]; + m_A57 += go[71]; + double RHS16 = Idr[69]; + RHS16 += Idr[70]; + RHS16 += Idr[71]; + m_A71 += gt[72]; + m_A71 += gt[73]; + m_A71 += gt[74]; + m_A71 += gt[75]; + m_A71 += gt[76]; + m_A68 += go[72]; + m_A64 += go[73]; + m_A67 += go[74]; + m_A65 += go[75]; + m_A65 += go[76]; + double RHS17 = Idr[72]; + RHS17 += Idr[73]; + RHS17 += Idr[74]; + RHS17 += Idr[75]; + RHS17 += Idr[76]; + m_A74 += gt[77]; + m_A74 += gt[78]; + m_A74 += gt[79]; + m_A73 += go[77]; + m_A75 += go[78]; + double RHS18 = Idr[77]; + RHS18 += Idr[78]; + RHS18 += Idr[79]; + RHS18 -= go[79] * *cnV[79]; + m_A82 += gt[80]; + m_A82 += gt[81]; + m_A82 += gt[82]; + m_A82 += gt[83]; + m_A81 += go[80]; + m_A76 += go[81]; + m_A77 += go[82]; + double RHS19 = Idr[80]; + RHS19 += Idr[81]; + RHS19 += Idr[82]; + RHS19 += Idr[83]; + RHS19 -= go[83] * *cnV[83]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A26; + m_A27 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A30; + m_A32 += m_A3 * f1_10; + m_A33 += m_A4 * f1_10; + RHS10 += f1_10 * RHS1; + const double f1_11 = -f1 * m_A34; + m_A35 += m_A3 * f1_11; + m_A38 += m_A4 * f1_11; + RHS11 += f1_11 * RHS1; + const double f1_17 = -f1 * m_A64; + m_A67 += m_A3 * f1_17; + m_A71 += m_A4 * f1_17; + RHS17 += f1_17 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_8 = -f2 * m_A20; + m_A22 += m_A6 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_12 = -f3 * m_A39; + m_A40 += m_A8 * f3_12; + RHS12 += f3_12 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_13 = -f4 * m_A42; + m_A44 += m_A10 * f4_13; + RHS13 += f4_13 * RHS4; + const double f4_16 = -f4 * m_A54; + m_A61 += m_A10 * f4_16; + RHS16 += f4_16 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_8 = -f5 * m_A21; + m_A22 += m_A12 * f5_8; + m_A23 += m_A13 * f5_8; + m_A24 += m_A14 * f5_8; + m_A25 += m_A15 * f5_8; + RHS8 += f5_8 * RHS5; + const double f5_14 = -f5 * m_A45; + m_A46 += m_A12 * f5_14; + m_A47 += m_A13 * f5_14; + m_A48 += m_A14 * f5_14; + m_A49 += m_A15 * f5_14; + RHS14 += f5_14 * RHS5; + const double f5_16 = -f5 * m_A55; + m_A56 += m_A12 * f5_16; + m_A59 += m_A13 * f5_16; + m_A60 += m_A14 * f5_16; + m_A61 += m_A15 * f5_16; + RHS16 += f5_16 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_15 = -f6 * m_A51; + m_A53 += m_A17 * f6_15; + RHS15 += f6_15 * RHS6; + const double f6_19 = -f6 * m_A76; + m_A82 += m_A17 * f6_19; + RHS19 += f6_19 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_18 = -f7 * m_A73; + m_A74 += m_A19 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_14 = -f8 * m_A46; + m_A47 += m_A23 * f8_14; + m_A48 += m_A24 * f8_14; + m_A49 += m_A25 * f8_14; + RHS14 += f8_14 * RHS8; + const double f8_16 = -f8 * m_A56; + m_A59 += m_A23 * f8_16; + m_A60 += m_A24 * f8_16; + m_A61 += m_A25 * f8_16; + RHS16 += f8_16 * RHS8; + const double f9 = 1.0 / m_A27; + const double f9_17 = -f9 * m_A65; + m_A66 += m_A28 * f9_17; + m_A71 += m_A29 * f9_17; + RHS17 += f9_17 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_17 = -f10 * m_A66; + m_A67 += m_A32 * f10_17; + m_A71 += m_A33 * f10_17; + RHS17 += f10_17 * RHS10; + const double f11 = 1.0 / m_A35; + const double f11_16 = -f11 * m_A57; + m_A58 += m_A36 * f11_16; + m_A61 += m_A37 * f11_16; + m_A62 += m_A38 * f11_16; + RHS16 += f11_16 * RHS11; + const double f11_17 = -f11 * m_A67; + m_A69 += m_A36 * f11_17; + m_A70 += m_A37 * f11_17; + m_A71 += m_A38 * f11_17; + RHS17 += f11_17 * RHS11; + const double f12 = 1.0 / m_A40; + const double f12_17 = -f12 * m_A68; + m_A71 += m_A41 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A43; + const double f13_16 = -f13 * m_A58; + m_A61 += m_A44 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_17 = -f13 * m_A69; + m_A70 += m_A44 * f13_17; + RHS17 += f13_17 * RHS13; + const double f14 = 1.0 / m_A47; + const double f14_16 = -f14 * m_A59; + m_A60 += m_A48 * f14_16; + m_A61 += m_A49 * f14_16; + m_A63 += m_A50 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_19 = -f14 * m_A77; + m_A78 += m_A48 * f14_19; + m_A79 += m_A49 * f14_19; + m_A82 += m_A50 * f14_19; + RHS19 += f14_19 * RHS14; + const double f15 = 1.0 / m_A52; + const double f15_16 = -f15 * m_A60; + m_A63 += m_A53 * f15_16; + RHS16 += f15_16 * RHS15; + const double f15_19 = -f15 * m_A78; + m_A82 += m_A53 * f15_19; + RHS19 += f15_19 * RHS15; + const double f16 = 1.0 / m_A61; + const double f16_17 = -f16 * m_A70; + m_A71 += m_A62 * f16_17; + m_A72 += m_A63 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_19 = -f16 * m_A79; + m_A80 += m_A62 * f16_19; + m_A82 += m_A63 * f16_19; + RHS19 += f16_19 * RHS16; + const double f17 = 1.0 / m_A71; + const double f17_19 = -f17 * m_A80; + m_A82 += m_A72 * f17_19; + RHS19 += f17_19 * RHS17; + const double f18 = 1.0 / m_A74; + const double f18_19 = -f18 * m_A81; + m_A82 += m_A75 * f18_19; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A82; + double tmp18 = 0.0; + tmp18 += m_A75 * V[19]; + V[18] = (RHS18 - tmp18) / m_A74; + double tmp17 = 0.0; + tmp17 += m_A72 * V[19]; + V[17] = (RHS17 - tmp17) / m_A71; + double tmp16 = 0.0; + tmp16 += m_A62 * V[17]; + tmp16 += m_A63 * V[19]; + V[16] = (RHS16 - tmp16) / m_A61; + double tmp15 = 0.0; + tmp15 += m_A53 * V[19]; + V[15] = (RHS15 - tmp15) / m_A52; + double tmp14 = 0.0; + tmp14 += m_A48 * V[15]; + tmp14 += m_A49 * V[16]; + tmp14 += m_A50 * V[19]; + V[14] = (RHS14 - tmp14) / m_A47; + double tmp13 = 0.0; + tmp13 += m_A44 * V[16]; + V[13] = (RHS13 - tmp13) / m_A43; + double tmp12 = 0.0; + tmp12 += m_A41 * V[17]; + V[12] = (RHS12 - tmp12) / m_A40; + double tmp11 = 0.0; + tmp11 += m_A36 * V[13]; + tmp11 += m_A37 * V[16]; + tmp11 += m_A38 * V[17]; + V[11] = (RHS11 - tmp11) / m_A35; + double tmp10 = 0.0; + tmp10 += m_A32 * V[11]; + tmp10 += m_A33 * V[17]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A28 * V[10]; + tmp9 += m_A29 * V[17]; + V[9] = (RHS9 - tmp9) / m_A27; + double tmp8 = 0.0; + tmp8 += m_A23 * V[14]; + tmp8 += m_A24 * V[15]; + tmp8 += m_A25 * V[16]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A19 * V[18]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A17 * V[19]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A12 * V[8]; + tmp5 += m_A13 * V[14]; + tmp5 += m_A14 * V[15]; + tmp5 += m_A15 * V[16]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[16]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[12]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[8]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[11]; + tmp1 += m_A4 * V[17]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_89_double_double_3c79fd354e01fa8c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A6 += go[7]; + m_A7 += go[8]; + m_A5 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A11 += go[11]; + m_A10 += go[12]; + m_A9 += go[13]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A13 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A15 += go[19]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A17 += go[23]; + m_A19 += go[24]; + m_A20 += go[25]; + m_A18 += go[26]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 -= go[27] * *cnV[27]; + RHS6 -= go[28] * *cnV[28]; + m_A21 += gt[29]; + m_A21 += gt[30]; + m_A21 += gt[31]; + m_A21 += gt[32]; + m_A21 += gt[33]; + m_A22 += go[29]; + m_A24 += go[30]; + m_A23 += go[31]; + double RHS7 = Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 -= go[32] * *cnV[32]; + RHS7 -= go[33] * *cnV[33]; + m_A27 += gt[34]; + m_A27 += gt[35]; + m_A27 += gt[36]; + m_A26 += go[34]; + m_A25 += go[35]; + double RHS8 = Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[36] * *cnV[36]; + m_A32 += gt[37]; + m_A32 += gt[38]; + m_A32 += gt[39]; + m_A30 += go[37]; + double RHS9 = Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 -= go[38] * *cnV[38]; + RHS9 -= go[39] * *cnV[39]; + m_A38 += gt[40]; + m_A38 += gt[41]; + m_A34 += go[40]; + m_A35 += go[41]; + double RHS10 = Idr[40]; + RHS10 += Idr[41]; + m_A42 += gt[42]; + m_A42 += gt[43]; + m_A42 += gt[44]; + m_A42 += gt[45]; + m_A42 += gt[46]; + m_A42 += gt[47]; + m_A42 += gt[48]; + m_A41 += go[42]; + m_A43 += go[43]; + double RHS11 = Idr[42]; + RHS11 += Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 += Idr[46]; + RHS11 += Idr[47]; + RHS11 += Idr[48]; + RHS11 -= go[44] * *cnV[44]; + RHS11 -= go[45] * *cnV[45]; + RHS11 -= go[46] * *cnV[46]; + RHS11 -= go[47] * *cnV[47]; + RHS11 -= go[48] * *cnV[48]; + m_A49 += gt[49]; + m_A49 += gt[50]; + m_A49 += gt[51]; + m_A45 += go[49]; + m_A46 += go[50]; + m_A44 += go[51]; + double RHS12 = Idr[49]; + RHS12 += Idr[50]; + RHS12 += Idr[51]; + m_A53 += gt[52]; + m_A53 += gt[53]; + m_A53 += gt[54]; + m_A53 += gt[55]; + m_A53 += gt[56]; + m_A53 += gt[57]; + m_A53 += gt[58]; + m_A54 += go[52]; + m_A55 += go[53]; + double RHS13 = Idr[52]; + RHS13 += Idr[53]; + RHS13 += Idr[54]; + RHS13 += Idr[55]; + RHS13 += Idr[56]; + RHS13 += Idr[57]; + RHS13 += Idr[58]; + RHS13 -= go[54] * *cnV[54]; + RHS13 -= go[55] * *cnV[55]; + RHS13 -= go[56] * *cnV[56]; + RHS13 -= go[57] * *cnV[57]; + RHS13 -= go[58] * *cnV[58]; + m_A57 += gt[59]; + m_A57 += gt[60]; + m_A57 += gt[61]; + m_A58 += go[59]; + m_A56 += go[60]; + double RHS14 = Idr[59]; + RHS14 += Idr[60]; + RHS14 += Idr[61]; + RHS14 -= go[61] * *cnV[61]; + m_A62 += gt[62]; + m_A62 += gt[63]; + m_A60 += go[62]; + m_A59 += go[63]; + double RHS15 = Idr[62]; + RHS15 += Idr[63]; + m_A68 += gt[64]; + m_A68 += gt[65]; + m_A68 += gt[66]; + m_A70 += go[64]; + m_A65 += go[65]; + double RHS16 = Idr[64]; + RHS16 += Idr[65]; + RHS16 += Idr[66]; + RHS16 -= go[66] * *cnV[66]; + m_A77 += gt[67]; + m_A77 += gt[68]; + m_A77 += gt[69]; + m_A77 += gt[70]; + m_A77 += gt[71]; + m_A77 += gt[72]; + m_A77 += gt[73]; + m_A73 += go[67]; + m_A71 += go[68]; + double RHS17 = Idr[67]; + RHS17 += Idr[68]; + RHS17 += Idr[69]; + RHS17 += Idr[70]; + RHS17 += Idr[71]; + RHS17 += Idr[72]; + RHS17 += Idr[73]; + RHS17 -= go[69] * *cnV[69]; + RHS17 -= go[70] * *cnV[70]; + RHS17 -= go[71] * *cnV[71]; + RHS17 -= go[72] * *cnV[72]; + RHS17 -= go[73] * *cnV[73]; + m_A88 += gt[74]; + m_A88 += gt[75]; + m_A88 += gt[76]; + m_A88 += gt[77]; + m_A86 += go[74]; + m_A84 += go[75]; + m_A79 += go[76]; + m_A80 += go[77]; + double RHS18 = Idr[74]; + RHS18 += Idr[75]; + RHS18 += Idr[76]; + RHS18 += Idr[77]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A59; + m_A62 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A25; + m_A27 += m_A3 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_8 = -f2 * m_A26; + m_A27 += m_A5 * f2_8; + m_A28 += m_A6 * f2_8; + m_A29 += m_A7 * f2_8; + RHS8 += f2_8 * RHS2; + const double f2_9 = -f2 * m_A30; + m_A31 += m_A5 * f2_9; + m_A32 += m_A6 * f2_9; + m_A33 += m_A7 * f2_9; + RHS9 += f2_9 * RHS2; + const double f2_10 = -f2 * m_A34; + m_A36 += m_A5 * f2_10; + m_A37 += m_A6 * f2_10; + m_A38 += m_A7 * f2_10; + RHS10 += f2_10 * RHS2; + const double f2_17 = -f2 * m_A71; + m_A72 += m_A5 * f2_17; + m_A73 += m_A6 * f2_17; + m_A74 += m_A7 * f2_17; + RHS17 += f2_17 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_10 = -f3 * m_A35; + m_A38 += m_A9 * f3_10; + m_A39 += m_A10 * f3_10; + m_A40 += m_A11 * f3_10; + RHS10 += f3_10 * RHS3; + const double f3_12 = -f3 * m_A44; + m_A47 += m_A9 * f3_12; + m_A49 += m_A10 * f3_12; + m_A51 += m_A11 * f3_12; + RHS12 += f3_12 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_11 = -f4 * m_A41; + m_A43 += m_A13 * f4_11; + RHS11 += f4_11 * RHS4; + const double f4_12 = -f4 * m_A45; + m_A49 += m_A13 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_14 = -f5 * m_A56; + m_A57 += m_A15 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_12 = -f6 * m_A46; + m_A48 += m_A17 * f6_12; + m_A49 += m_A18 * f6_12; + m_A50 += m_A19 * f6_12; + m_A52 += m_A20 * f6_12; + RHS12 += f6_12 * RHS6; + const double f6_16 = -f6 * m_A65; + m_A66 += m_A17 * f6_16; + m_A67 += m_A18 * f6_16; + m_A68 += m_A19 * f6_16; + m_A70 += m_A20 * f6_16; + RHS16 += f6_16 * RHS6; + const double f6_18 = -f6 * m_A79; + m_A81 += m_A17 * f6_18; + m_A82 += m_A18 * f6_18; + m_A86 += m_A19 * f6_18; + m_A88 += m_A20 * f6_18; + RHS18 += f6_18 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_15 = -f7 * m_A60; + m_A61 += m_A22 * f7_15; + m_A62 += m_A23 * f7_15; + m_A64 += m_A24 * f7_15; + RHS15 += f7_15 * RHS7; + const double f7_18 = -f7 * m_A80; + m_A83 += m_A22 * f7_18; + m_A85 += m_A23 * f7_18; + m_A88 += m_A24 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A27; + const double f8_9 = -f8 * m_A31; + m_A32 += m_A28 * f8_9; + m_A33 += m_A29 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_10 = -f8 * m_A36; + m_A37 += m_A28 * f8_10; + m_A38 += m_A29 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_17 = -f8 * m_A72; + m_A73 += m_A28 * f8_17; + m_A74 += m_A29 * f8_17; + RHS17 += f8_17 * RHS8; + const double f9 = 1.0 / m_A32; + const double f9_10 = -f9 * m_A37; + m_A38 += m_A33 * f9_10; + RHS10 += f9_10 * RHS9; + const double f9_17 = -f9 * m_A73; + m_A74 += m_A33 * f9_17; + RHS17 += f9_17 * RHS9; + const double f10 = 1.0 / m_A38; + const double f10_12 = -f10 * m_A47; + m_A49 += m_A39 * f10_12; + m_A51 += m_A40 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_17 = -f10 * m_A74; + m_A75 += m_A39 * f10_17; + m_A77 += m_A40 * f10_17; + RHS17 += f10_17 * RHS10; + const double f11 = 1.0 / m_A42; + const double f11_12 = -f11 * m_A48; + m_A49 += m_A43 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_16 = -f11 * m_A66; + m_A67 += m_A43 * f11_16; + RHS16 += f11_16 * RHS11; + const double f11_18 = -f11 * m_A81; + m_A82 += m_A43 * f11_18; + RHS18 += f11_18 * RHS11; + const double f12 = 1.0 / m_A49; + const double f12_16 = -f12 * m_A67; + m_A68 += m_A50 * f12_16; + m_A69 += m_A51 * f12_16; + m_A70 += m_A52 * f12_16; + RHS16 += f12_16 * RHS12; + const double f12_17 = -f12 * m_A75; + m_A76 += m_A50 * f12_17; + m_A77 += m_A51 * f12_17; + m_A78 += m_A52 * f12_17; + RHS17 += f12_17 * RHS12; + const double f12_18 = -f12 * m_A82; + m_A86 += m_A50 * f12_18; + m_A87 += m_A51 * f12_18; + m_A88 += m_A52 * f12_18; + RHS18 += f12_18 * RHS12; + const double f13 = 1.0 / m_A53; + const double f13_15 = -f13 * m_A61; + m_A63 += m_A54 * f13_15; + m_A64 += m_A55 * f13_15; + RHS15 += f13_15 * RHS13; + const double f13_18 = -f13 * m_A83; + m_A86 += m_A54 * f13_18; + m_A88 += m_A55 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A57; + const double f14_18 = -f14 * m_A84; + m_A88 += m_A58 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A62; + const double f15_18 = -f15 * m_A85; + m_A86 += m_A63 * f15_18; + m_A88 += m_A64 * f15_18; + RHS18 += f15_18 * RHS15; + const double f16 = 1.0 / m_A68; + const double f16_17 = -f16 * m_A76; + m_A77 += m_A69 * f16_17; + m_A78 += m_A70 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_18 = -f16 * m_A86; + m_A87 += m_A69 * f16_18; + m_A88 += m_A70 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A77; + const double f17_18 = -f17 * m_A87; + m_A88 += m_A78 * f17_18; + RHS18 += f17_18 * RHS17; + V[18] = RHS18 / m_A88; + double tmp17 = 0.0; + tmp17 += m_A78 * V[18]; + V[17] = (RHS17 - tmp17) / m_A77; + double tmp16 = 0.0; + tmp16 += m_A69 * V[17]; + tmp16 += m_A70 * V[18]; + V[16] = (RHS16 - tmp16) / m_A68; + double tmp15 = 0.0; + tmp15 += m_A63 * V[16]; + tmp15 += m_A64 * V[18]; + V[15] = (RHS15 - tmp15) / m_A62; + double tmp14 = 0.0; + tmp14 += m_A58 * V[18]; + V[14] = (RHS14 - tmp14) / m_A57; + double tmp13 = 0.0; + tmp13 += m_A54 * V[16]; + tmp13 += m_A55 * V[18]; + V[13] = (RHS13 - tmp13) / m_A53; + double tmp12 = 0.0; + tmp12 += m_A50 * V[16]; + tmp12 += m_A51 * V[17]; + tmp12 += m_A52 * V[18]; + V[12] = (RHS12 - tmp12) / m_A49; + double tmp11 = 0.0; + tmp11 += m_A43 * V[12]; + V[11] = (RHS11 - tmp11) / m_A42; + double tmp10 = 0.0; + tmp10 += m_A39 * V[12]; + tmp10 += m_A40 * V[17]; + V[10] = (RHS10 - tmp10) / m_A38; + double tmp9 = 0.0; + tmp9 += m_A33 * V[10]; + V[9] = (RHS9 - tmp9) / m_A32; + double tmp8 = 0.0; + tmp8 += m_A28 * V[9]; + tmp8 += m_A29 * V[10]; + V[8] = (RHS8 - tmp8) / m_A27; + double tmp7 = 0.0; + tmp7 += m_A22 * V[13]; + tmp7 += m_A23 * V[15]; + tmp7 += m_A24 * V[18]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A17 * V[11]; + tmp6 += m_A18 * V[12]; + tmp6 += m_A19 * V[16]; + tmp6 += m_A20 * V[18]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A15 * V[14]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A13 * V[12]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[10]; + tmp3 += m_A10 * V[12]; + tmp3 += m_A11 * V[17]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[8]; + tmp2 += m_A6 * V[9]; + tmp2 += m_A7 * V[10]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[8]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[15]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_8_double_double_30923b54310ae144(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A3 += gt[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A4 += go[3]; + m_A2 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A7 += gt[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A5 += go[7]; + m_A6 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + const double f0 = 1.0 / m_A0; + const double f0_1 = -f0 * m_A2; + m_A3 += m_A1 * f0_1; + RHS1 += f0_1 * RHS0; + const double f0_2 = -f0 * m_A5; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_2 = -f1 * m_A6; + m_A7 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A7; + double tmp1 = 0.0; + tmp1 += m_A4 * V[2]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// brdrline +static void nl_gcr_97_double_double_b66df357763b1dce(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A5 += go[3]; + m_A4 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[8]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A9 += go[11]; + m_A10 += go[12]; + m_A12 += go[13]; + m_A11 += go[14]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A14 += go[17]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A16 += go[20]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A17 += gt[26]; + m_A17 += gt[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A18 += go[24]; + m_A21 += go[25]; + m_A20 += go[26]; + m_A19 += go[27]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 -= go[28] * *cnV[28]; + RHS6 -= go[29] * *cnV[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A24 += go[30]; + m_A23 += go[31]; + double RHS7 = Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 -= go[32] * *cnV[32]; + RHS7 -= go[33] * *cnV[33]; + RHS7 -= go[34] * *cnV[34]; + RHS7 -= go[35] * *cnV[35]; + RHS7 -= go[36] * *cnV[36]; + m_A25 += gt[37]; + m_A25 += gt[38]; + m_A26 += go[37]; + m_A27 += go[38]; + double RHS8 = Idr[37]; + RHS8 += Idr[38]; + m_A30 += gt[39]; + m_A30 += gt[40]; + m_A30 += gt[41]; + m_A29 += go[39]; + m_A28 += go[40]; + double RHS9 = Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + RHS9 -= go[41] * *cnV[41]; + m_A34 += gt[42]; + m_A34 += gt[43]; + m_A34 += gt[44]; + m_A34 += gt[45]; + m_A34 += gt[46]; + m_A34 += gt[47]; + m_A34 += gt[48]; + m_A35 += go[42]; + m_A33 += go[43]; + double RHS10 = Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + RHS10 += Idr[47]; + RHS10 += Idr[48]; + RHS10 -= go[44] * *cnV[44]; + RHS10 -= go[45] * *cnV[45]; + RHS10 -= go[46] * *cnV[46]; + RHS10 -= go[47] * *cnV[47]; + RHS10 -= go[48] * *cnV[48]; + m_A37 += gt[49]; + m_A37 += gt[50]; + m_A37 += gt[51]; + m_A37 += gt[52]; + m_A37 += gt[53]; + m_A37 += gt[54]; + m_A37 += gt[55]; + m_A38 += go[49]; + m_A36 += go[50]; + double RHS11 = Idr[49]; + RHS11 += Idr[50]; + RHS11 += Idr[51]; + RHS11 += Idr[52]; + RHS11 += Idr[53]; + RHS11 += Idr[54]; + RHS11 += Idr[55]; + RHS11 -= go[51] * *cnV[51]; + RHS11 -= go[52] * *cnV[52]; + RHS11 -= go[53] * *cnV[53]; + RHS11 -= go[54] * *cnV[54]; + RHS11 -= go[55] * *cnV[55]; + m_A44 += gt[56]; + m_A44 += gt[57]; + m_A44 += gt[58]; + m_A41 += go[56]; + m_A40 += go[57]; + m_A39 += go[58]; + double RHS12 = Idr[56]; + RHS12 += Idr[57]; + RHS12 += Idr[58]; + m_A54 += gt[59]; + m_A54 += gt[60]; + m_A54 += gt[61]; + m_A56 += go[59]; + m_A50 += go[60]; + m_A49 += go[61]; + double RHS13 = Idr[59]; + RHS13 += Idr[60]; + RHS13 += Idr[61]; + m_A59 += gt[62]; + m_A59 += gt[63]; + m_A59 += gt[64]; + m_A58 += go[62]; + m_A60 += go[63]; + double RHS14 = Idr[62]; + RHS14 += Idr[63]; + RHS14 += Idr[64]; + RHS14 -= go[64] * *cnV[64]; + m_A65 += gt[65]; + m_A65 += gt[66]; + m_A65 += gt[67]; + m_A67 += go[65]; + m_A61 += go[66]; + double RHS15 = Idr[65]; + RHS15 += Idr[66]; + RHS15 += Idr[67]; + RHS15 -= go[67] * *cnV[67]; + m_A69 += gt[68]; + m_A69 += gt[69]; + m_A69 += gt[70]; + m_A68 += go[68]; + double RHS16 = Idr[68]; + RHS16 += Idr[69]; + RHS16 += Idr[70]; + RHS16 -= go[69] * *cnV[69]; + RHS16 -= go[70] * *cnV[70]; + m_A79 += gt[71]; + m_A79 += gt[72]; + m_A79 += gt[73]; + m_A79 += gt[74]; + m_A79 += gt[75]; + m_A72 += go[71]; + m_A73 += go[72]; + m_A77 += go[73]; + m_A71 += go[74]; + double RHS17 = Idr[71]; + RHS17 += Idr[72]; + RHS17 += Idr[73]; + RHS17 += Idr[74]; + RHS17 += Idr[75]; + RHS17 -= go[75] * *cnV[75]; + m_A86 += gt[76]; + m_A86 += gt[77]; + m_A86 += gt[78]; + m_A86 += gt[79]; + m_A86 += gt[80]; + m_A81 += go[76]; + m_A82 += go[77]; + m_A87 += go[78]; + double RHS18 = Idr[76]; + RHS18 += Idr[77]; + RHS18 += Idr[78]; + RHS18 += Idr[79]; + RHS18 += Idr[80]; + RHS18 -= go[79] * *cnV[79]; + RHS18 -= go[80] * *cnV[80]; + m_A96 += gt[81]; + m_A96 += gt[82]; + m_A96 += gt[83]; + m_A96 += gt[84]; + m_A95 += go[81]; + m_A92 += go[82]; + m_A93 += go[83]; + m_A88 += go[84]; + double RHS19 = Idr[81]; + RHS19 += Idr[82]; + RHS19 += Idr[83]; + RHS19 += Idr[84]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A28; + m_A30 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_9 = -f1 * m_A29; + m_A30 += m_A3 * f1_9; + m_A31 += m_A4 * f1_9; + m_A32 += m_A5 * f1_9; + RHS9 += f1_9 * RHS1; + const double f1_13 = -f1 * m_A49; + m_A51 += m_A3 * f1_13; + m_A54 += m_A4 * f1_13; + m_A56 += m_A5 * f1_13; + RHS13 += f1_13 * RHS1; + const double f1_17 = -f1 * m_A71; + m_A74 += m_A3 * f1_17; + m_A77 += m_A4 * f1_17; + m_A79 += m_A5 * f1_17; + RHS17 += f1_17 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_11 = -f2 * m_A36; + m_A38 += m_A7 * f2_11; + RHS11 += f2_11 * RHS2; + const double f2_17 = -f2 * m_A72; + m_A79 += m_A7 * f2_17; + RHS17 += f2_17 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_12 = -f3 * m_A39; + m_A43 += m_A9 * f3_12; + m_A44 += m_A10 * f3_12; + m_A45 += m_A11 * f3_12; + m_A47 += m_A12 * f3_12; + RHS12 += f3_12 * RHS3; + const double f3_13 = -f3 * m_A50; + m_A52 += m_A9 * f3_13; + m_A53 += m_A10 * f3_13; + m_A54 += m_A11 * f3_13; + m_A56 += m_A12 * f3_13; + RHS13 += f3_13 * RHS3; + const double f3_17 = -f3 * m_A73; + m_A75 += m_A9 * f3_17; + m_A76 += m_A10 * f3_17; + m_A77 += m_A11 * f3_17; + m_A79 += m_A12 * f3_17; + RHS17 += f3_17 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_10 = -f4 * m_A33; + m_A35 += m_A14 * f4_10; + RHS10 += f4_10 * RHS4; + const double f4_12 = -f4 * m_A40; + m_A44 += m_A14 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_14 = -f5 * m_A58; + m_A59 += m_A16 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_12 = -f6 * m_A41; + m_A42 += m_A18 * f6_12; + m_A44 += m_A19 * f6_12; + m_A46 += m_A20 * f6_12; + m_A48 += m_A21 * f6_12; + RHS12 += f6_12 * RHS6; + const double f6_15 = -f6 * m_A61; + m_A62 += m_A18 * f6_15; + m_A63 += m_A19 * f6_15; + m_A65 += m_A20 * f6_15; + m_A67 += m_A21 * f6_15; + RHS15 += f6_15 * RHS6; + const double f6_19 = -f6 * m_A88; + m_A89 += m_A18 * f6_19; + m_A90 += m_A19 * f6_19; + m_A93 += m_A20 * f6_19; + m_A96 += m_A21 * f6_19; + RHS19 += f6_19 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_18 = -f7 * m_A81; + m_A83 += m_A23 * f7_18; + m_A87 += m_A24 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A25; + const double f8_16 = -f8 * m_A68; + m_A69 += m_A26 * f8_16; + m_A70 += m_A27 * f8_16; + RHS16 += f8_16 * RHS8; + const double f8_18 = -f8 * m_A82; + m_A84 += m_A26 * f8_18; + m_A86 += m_A27 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A30; + const double f9_13 = -f9 * m_A51; + m_A54 += m_A31 * f9_13; + m_A56 += m_A32 * f9_13; + RHS13 += f9_13 * RHS9; + const double f9_17 = -f9 * m_A74; + m_A77 += m_A31 * f9_17; + m_A79 += m_A32 * f9_17; + RHS17 += f9_17 * RHS9; + const double f10 = 1.0 / m_A34; + const double f10_12 = -f10 * m_A42; + m_A44 += m_A35 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_15 = -f10 * m_A62; + m_A63 += m_A35 * f10_15; + RHS15 += f10_15 * RHS10; + const double f10_19 = -f10 * m_A89; + m_A90 += m_A35 * f10_19; + RHS19 += f10_19 * RHS10; + const double f11 = 1.0 / m_A37; + const double f11_12 = -f11 * m_A43; + m_A47 += m_A38 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_13 = -f11 * m_A52; + m_A56 += m_A38 * f11_13; + RHS13 += f11_13 * RHS11; + const double f11_17 = -f11 * m_A75; + m_A79 += m_A38 * f11_17; + RHS17 += f11_17 * RHS11; + const double f12 = 1.0 / m_A44; + const double f12_13 = -f12 * m_A53; + m_A54 += m_A45 * f12_13; + m_A55 += m_A46 * f12_13; + m_A56 += m_A47 * f12_13; + m_A57 += m_A48 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_15 = -f12 * m_A63; + m_A64 += m_A45 * f12_15; + m_A65 += m_A46 * f12_15; + m_A66 += m_A47 * f12_15; + m_A67 += m_A48 * f12_15; + RHS15 += f12_15 * RHS12; + const double f12_17 = -f12 * m_A76; + m_A77 += m_A45 * f12_17; + m_A78 += m_A46 * f12_17; + m_A79 += m_A47 * f12_17; + m_A80 += m_A48 * f12_17; + RHS17 += f12_17 * RHS12; + const double f12_19 = -f12 * m_A90; + m_A91 += m_A45 * f12_19; + m_A93 += m_A46 * f12_19; + m_A94 += m_A47 * f12_19; + m_A96 += m_A48 * f12_19; + RHS19 += f12_19 * RHS12; + const double f13 = 1.0 / m_A54; + const double f13_15 = -f13 * m_A64; + m_A65 += m_A55 * f13_15; + m_A66 += m_A56 * f13_15; + m_A67 += m_A57 * f13_15; + RHS15 += f13_15 * RHS13; + const double f13_17 = -f13 * m_A77; + m_A78 += m_A55 * f13_17; + m_A79 += m_A56 * f13_17; + m_A80 += m_A57 * f13_17; + RHS17 += f13_17 * RHS13; + const double f13_19 = -f13 * m_A91; + m_A93 += m_A55 * f13_19; + m_A94 += m_A56 * f13_19; + m_A96 += m_A57 * f13_19; + RHS19 += f13_19 * RHS13; + const double f14 = 1.0 / m_A59; + const double f14_19 = -f14 * m_A92; + m_A96 += m_A60 * f14_19; + RHS19 += f14_19 * RHS14; + const double f15 = 1.0 / m_A65; + const double f15_17 = -f15 * m_A78; + m_A79 += m_A66 * f15_17; + m_A80 += m_A67 * f15_17; + RHS17 += f15_17 * RHS15; + const double f15_18 = -f15 * m_A83; + m_A85 += m_A66 * f15_18; + m_A87 += m_A67 * f15_18; + RHS18 += f15_18 * RHS15; + const double f15_19 = -f15 * m_A93; + m_A94 += m_A66 * f15_19; + m_A96 += m_A67 * f15_19; + RHS19 += f15_19 * RHS15; + const double f16 = 1.0 / m_A69; + const double f16_18 = -f16 * m_A84; + m_A86 += m_A70 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A79; + const double f17_18 = -f17 * m_A85; + m_A87 += m_A80 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_19 = -f17 * m_A94; + m_A96 += m_A80 * f17_19; + RHS19 += f17_19 * RHS17; + const double f18 = 1.0 / m_A86; + const double f18_19 = -f18 * m_A95; + m_A96 += m_A87 * f18_19; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A96; + double tmp18 = 0.0; + tmp18 += m_A87 * V[19]; + V[18] = (RHS18 - tmp18) / m_A86; + double tmp17 = 0.0; + tmp17 += m_A80 * V[19]; + V[17] = (RHS17 - tmp17) / m_A79; + double tmp16 = 0.0; + tmp16 += m_A70 * V[18]; + V[16] = (RHS16 - tmp16) / m_A69; + double tmp15 = 0.0; + tmp15 += m_A66 * V[17]; + tmp15 += m_A67 * V[19]; + V[15] = (RHS15 - tmp15) / m_A65; + double tmp14 = 0.0; + tmp14 += m_A60 * V[19]; + V[14] = (RHS14 - tmp14) / m_A59; + double tmp13 = 0.0; + tmp13 += m_A55 * V[15]; + tmp13 += m_A56 * V[17]; + tmp13 += m_A57 * V[19]; + V[13] = (RHS13 - tmp13) / m_A54; + double tmp12 = 0.0; + tmp12 += m_A45 * V[13]; + tmp12 += m_A46 * V[15]; + tmp12 += m_A47 * V[17]; + tmp12 += m_A48 * V[19]; + V[12] = (RHS12 - tmp12) / m_A44; + double tmp11 = 0.0; + tmp11 += m_A38 * V[17]; + V[11] = (RHS11 - tmp11) / m_A37; + double tmp10 = 0.0; + tmp10 += m_A35 * V[12]; + V[10] = (RHS10 - tmp10) / m_A34; + double tmp9 = 0.0; + tmp9 += m_A31 * V[13]; + tmp9 += m_A32 * V[17]; + V[9] = (RHS9 - tmp9) / m_A30; + double tmp8 = 0.0; + tmp8 += m_A26 * V[16]; + tmp8 += m_A27 * V[18]; + V[8] = (RHS8 - tmp8) / m_A25; + double tmp7 = 0.0; + tmp7 += m_A23 * V[15]; + tmp7 += m_A24 * V[19]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A18 * V[10]; + tmp6 += m_A19 * V[12]; + tmp6 += m_A20 * V[15]; + tmp6 += m_A21 * V[19]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A16 * V[14]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A14 * V[12]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A9 * V[11]; + tmp3 += m_A10 * V[12]; + tmp3 += m_A11 * V[13]; + tmp3 += m_A12 * V[17]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[17]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[9]; + tmp1 += m_A4 * V[13]; + tmp1 += m_A5 * V[17]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// breakout +static void nl_gcr_10_double_double_b66ff415b228d5f8(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A8 += go[8]; + m_A7 += go[9]; + m_A6 += go[10]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A6; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A5 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// breakout +static void nl_gcr_13_double_double_5a3419e2809520de(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A11 += go[12]; + m_A10 += go[13]; + m_A9 += go[14]; + m_A8 += go[15]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A8; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A9; + m_A12 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A7 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A7 * V[4]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// breakout +static void nl_gcr_13_double_double_a971eeb2ef76f75f(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A11 += go[12]; + m_A10 += go[13]; + m_A9 += go[14]; + m_A8 += go[15]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A8; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A9; + m_A12 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A7 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A7 * V[4]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// breakout +static void nl_gcr_31_double_double_8a1565d1413f42f7(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A3 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[8]; + m_A6 += go[9]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A8 += go[11]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A10 += go[14]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[15] * *cnV[15]; + RHS4 -= go[16] * *cnV[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A12 += gt[22]; + m_A12 += gt[23]; + m_A14 += go[17]; + m_A13 += go[18]; + m_A11 += go[19]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A18 += go[24]; + m_A15 += go[25]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + RHS6 -= go[28] * *cnV[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A23 += gt[31]; + m_A19 += go[29]; + m_A20 += go[30]; + m_A21 += go[31]; + double RHS7 = Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A26 += go[32]; + m_A25 += go[33]; + m_A28 += go[34]; + m_A27 += go[35]; + double RHS8 = Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[36] * *cnV[36]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A11; + m_A12 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A19; + m_A23 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A15; + m_A16 += m_A5 * f2_6; + m_A17 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_7 = -f2 * m_A20; + m_A22 += m_A5 * f2_7; + m_A23 += m_A6 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_8 = -f3 * m_A25; + m_A30 += m_A8 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_8 = -f4 * m_A26; + m_A30 += m_A10 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_7 = -f5 * m_A21; + m_A23 += m_A13 * f5_7; + m_A24 += m_A14 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_8 = -f5 * m_A27; + m_A29 += m_A13 * f5_8; + m_A30 += m_A14 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_7 = -f6 * m_A22; + m_A23 += m_A17 * f6_7; + m_A24 += m_A18 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A28; + m_A29 += m_A17 * f6_8; + m_A30 += m_A18 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A23; + const double f7_8 = -f7 * m_A29; + m_A30 += m_A24 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A30; + double tmp7 = 0.0; + tmp7 += m_A24 * V[8]; + V[7] = (RHS7 - tmp7) / m_A23; + double tmp6 = 0.0; + tmp6 += m_A17 * V[7]; + tmp6 += m_A18 * V[8]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A13 * V[7]; + tmp5 += m_A14 * V[8]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A10 * V[8]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[8]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + tmp2 += m_A6 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// breakout +static void nl_gcr_7_double_double_7a42b97d838ca073(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A5 += go[7]; + m_A4 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[9] * *cnV[9]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// breakout +static void nl_gcr_7_double_double_cb2aae3366e0ac1c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A5 += go[6]; + m_A4 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// breakout +static void nl_gcr_7_double_double_f7dc4f87b5a8ba93(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A5 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// bship +static void nl_gcr_137_double_double_401090c1ee6d0345(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[4]; + m_A5 += go[5]; + m_A4 += go[6]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A9 += go[11]; + m_A10 += go[12]; + m_A10 += go[13]; + m_A10 += go[14]; + m_A10 += go[15]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 += Idr[20]; + RHS3 += Idr[21]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + RHS3 -= go[20] * *cnV[20]; + RHS3 -= go[21] * *cnV[21]; + m_A11 += gt[22]; + m_A11 += gt[23]; + m_A11 += gt[24]; + m_A11 += gt[25]; + m_A11 += gt[26]; + m_A11 += gt[27]; + m_A11 += gt[28]; + m_A12 += go[22]; + m_A13 += go[23]; + double RHS4 = Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 += Idr[26]; + RHS4 += Idr[27]; + RHS4 += Idr[28]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + RHS4 -= go[26] * *cnV[26]; + RHS4 -= go[27] * *cnV[27]; + RHS4 -= go[28] * *cnV[28]; + m_A14 += gt[29]; + m_A14 += gt[30]; + m_A14 += gt[31]; + m_A14 += gt[32]; + m_A14 += gt[33]; + m_A14 += gt[34]; + m_A14 += gt[35]; + m_A15 += go[29]; + m_A16 += go[30]; + double RHS5 = Idr[29]; + RHS5 += Idr[30]; + RHS5 += Idr[31]; + RHS5 += Idr[32]; + RHS5 += Idr[33]; + RHS5 += Idr[34]; + RHS5 += Idr[35]; + RHS5 -= go[31] * *cnV[31]; + RHS5 -= go[32] * *cnV[32]; + RHS5 -= go[33] * *cnV[33]; + RHS5 -= go[34] * *cnV[34]; + RHS5 -= go[35] * *cnV[35]; + m_A17 += gt[36]; + m_A17 += gt[37]; + m_A19 += go[36]; + m_A18 += go[37]; + double RHS6 = Idr[36]; + RHS6 += Idr[37]; + m_A20 += gt[38]; + m_A20 += gt[39]; + m_A20 += gt[40]; + m_A20 += gt[41]; + m_A20 += gt[42]; + m_A20 += gt[43]; + m_A22 += go[38]; + m_A23 += go[39]; + m_A21 += go[40]; + double RHS7 = Idr[38]; + RHS7 += Idr[39]; + RHS7 += Idr[40]; + RHS7 += Idr[41]; + RHS7 += Idr[42]; + RHS7 += Idr[43]; + RHS7 -= go[41] * *cnV[41]; + RHS7 -= go[42] * *cnV[42]; + RHS7 -= go[43] * *cnV[43]; + m_A24 += gt[44]; + m_A24 += gt[45]; + m_A26 += go[44]; + m_A25 += go[45]; + double RHS8 = Idr[44]; + RHS8 += Idr[45]; + m_A27 += gt[46]; + m_A27 += gt[47]; + m_A29 += go[46]; + m_A28 += go[47]; + double RHS9 = Idr[46]; + RHS9 += Idr[47]; + m_A30 += gt[48]; + m_A30 += gt[49]; + m_A30 += gt[50]; + m_A31 += go[48]; + m_A32 += go[49]; + double RHS10 = Idr[48]; + RHS10 += Idr[49]; + RHS10 += Idr[50]; + RHS10 -= go[50] * *cnV[50]; + m_A33 += gt[51]; + m_A33 += gt[52]; + m_A33 += gt[53]; + m_A33 += gt[54]; + m_A35 += go[51]; + m_A34 += go[52]; + double RHS11 = Idr[51]; + RHS11 += Idr[52]; + RHS11 += Idr[53]; + RHS11 += Idr[54]; + RHS11 -= go[53] * *cnV[53]; + RHS11 -= go[54] * *cnV[54]; + m_A36 += gt[55]; + m_A36 += gt[56]; + m_A36 += gt[57]; + m_A36 += gt[58]; + m_A38 += go[55]; + m_A37 += go[56]; + m_A37 += go[57]; + double RHS12 = Idr[55]; + RHS12 += Idr[56]; + RHS12 += Idr[57]; + RHS12 += Idr[58]; + RHS12 -= go[58] * *cnV[58]; + m_A44 += gt[59]; + m_A44 += gt[60]; + m_A44 += gt[61]; + m_A44 += gt[62]; + m_A43 += go[59]; + m_A42 += go[60]; + m_A40 += go[61]; + m_A39 += go[62]; + double RHS13 = Idr[59]; + RHS13 += Idr[60]; + RHS13 += Idr[61]; + RHS13 += Idr[62]; + m_A53 += gt[63]; + m_A53 += gt[64]; + m_A55 += go[63]; + m_A49 += go[64]; + double RHS14 = Idr[63]; + RHS14 += Idr[64]; + m_A63 += gt[65]; + m_A63 += gt[66]; + m_A63 += gt[67]; + m_A63 += gt[68]; + m_A63 += gt[69]; + m_A63 += gt[70]; + m_A63 += gt[71]; + m_A63 += gt[72]; + m_A58 += go[65]; + m_A58 += go[66]; + m_A58 += go[67]; + m_A58 += go[68]; + m_A57 += go[69]; + m_A65 += go[70]; + double RHS15 = Idr[65]; + RHS15 += Idr[66]; + RHS15 += Idr[67]; + RHS15 += Idr[68]; + RHS15 += Idr[69]; + RHS15 += Idr[70]; + RHS15 += Idr[71]; + RHS15 += Idr[72]; + RHS15 -= go[71] * *cnV[71]; + RHS15 -= go[72] * *cnV[72]; + m_A71 += gt[73]; + m_A71 += gt[74]; + m_A71 += gt[75]; + m_A67 += go[73]; + m_A68 += go[74]; + m_A74 += go[75]; + double RHS16 = Idr[73]; + RHS16 += Idr[74]; + RHS16 += Idr[75]; + m_A76 += gt[76]; + m_A76 += gt[77]; + m_A76 += gt[78]; + m_A75 += go[76]; + m_A78 += go[77]; + double RHS17 = Idr[76]; + RHS17 += Idr[77]; + RHS17 += Idr[78]; + RHS17 -= go[78] * *cnV[78]; + m_A81 += gt[79]; + m_A81 += gt[80]; + m_A81 += gt[81]; + m_A81 += gt[82]; + m_A81 += gt[83]; + m_A79 += go[79]; + m_A82 += go[80]; + m_A82 += go[81]; + double RHS18 = Idr[79]; + RHS18 += Idr[80]; + RHS18 += Idr[81]; + RHS18 += Idr[82]; + RHS18 += Idr[83]; + RHS18 -= go[82] * *cnV[82]; + RHS18 -= go[83] * *cnV[83]; + m_A85 += gt[84]; + m_A85 += gt[85]; + m_A85 += gt[86]; + m_A85 += gt[87]; + m_A85 += gt[88]; + m_A84 += go[84]; + m_A83 += go[85]; + double RHS19 = Idr[84]; + RHS19 += Idr[85]; + RHS19 += Idr[86]; + RHS19 += Idr[87]; + RHS19 += Idr[88]; + RHS19 -= go[86] * *cnV[86]; + RHS19 -= go[87] * *cnV[87]; + RHS19 -= go[88] * *cnV[88]; + m_A92 += gt[89]; + m_A92 += gt[90]; + m_A92 += gt[91]; + m_A92 += gt[92]; + m_A92 += gt[93]; + m_A92 += gt[94]; + m_A92 += gt[95]; + m_A88 += go[89]; + m_A91 += go[90]; + double RHS20 = Idr[89]; + RHS20 += Idr[90]; + RHS20 += Idr[91]; + RHS20 += Idr[92]; + RHS20 += Idr[93]; + RHS20 += Idr[94]; + RHS20 += Idr[95]; + RHS20 -= go[91] * *cnV[91]; + RHS20 -= go[92] * *cnV[92]; + RHS20 -= go[93] * *cnV[93]; + RHS20 -= go[94] * *cnV[94]; + RHS20 -= go[95] * *cnV[95]; + m_A99 += gt[96]; + m_A99 += gt[97]; + m_A99 += gt[98]; + m_A99 += gt[99]; + m_A99 += gt[100]; + m_A101 += go[96]; + m_A101 += go[97]; + m_A97 += go[98]; + m_A97 += go[99]; + m_A96 += go[100]; + double RHS21 = Idr[96]; + RHS21 += Idr[97]; + RHS21 += Idr[98]; + RHS21 += Idr[99]; + RHS21 += Idr[100]; + m_A107 += gt[101]; + m_A107 += gt[102]; + m_A107 += gt[103]; + m_A107 += gt[104]; + m_A102 += go[101]; + m_A110 += go[102]; + m_A105 += go[103]; + m_A104 += go[104]; + double RHS22 = Idr[101]; + RHS22 += Idr[102]; + RHS22 += Idr[103]; + RHS22 += Idr[104]; + m_A119 += gt[105]; + m_A119 += gt[106]; + m_A119 += gt[107]; + m_A119 += gt[108]; + m_A119 += gt[109]; + m_A119 += gt[110]; + m_A112 += go[105]; + m_A115 += go[106]; + m_A115 += go[107]; + m_A114 += go[108]; + m_A111 += go[109]; + double RHS23 = Idr[105]; + RHS23 += Idr[106]; + RHS23 += Idr[107]; + RHS23 += Idr[108]; + RHS23 += Idr[109]; + RHS23 += Idr[110]; + RHS23 -= go[110] * *cnV[110]; + m_A129 += gt[111]; + m_A129 += gt[112]; + m_A129 += gt[113]; + m_A129 += gt[114]; + m_A129 += gt[115]; + m_A126 += go[111]; + m_A125 += go[112]; + m_A122 += go[113]; + double RHS24 = Idr[111]; + RHS24 += Idr[112]; + RHS24 += Idr[113]; + RHS24 += Idr[114]; + RHS24 += Idr[115]; + RHS24 -= go[114] * *cnV[114]; + RHS24 -= go[115] * *cnV[115]; + m_A136 += gt[116]; + m_A136 += gt[117]; + m_A136 += gt[118]; + m_A136 += gt[119]; + m_A131 += go[116]; + m_A132 += go[117]; + m_A132 += go[118]; + m_A133 += go[119]; + double RHS25 = Idr[116]; + RHS25 += Idr[117]; + RHS25 += Idr[118]; + RHS25 += Idr[119]; + const double f0 = 1.0 / m_A0; + const double f0_13 = -f0 * m_A39; + m_A44 += m_A1 * f0_13; + RHS13 += f0_13 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_13 = -f1 * m_A40; + m_A41 += m_A3 * f1_13; + m_A44 += m_A4 * f1_13; + m_A45 += m_A5 * f1_13; + RHS13 += f1_13 * RHS1; + const double f1_14 = -f1 * m_A49; + m_A50 += m_A3 * f1_14; + m_A52 += m_A4 * f1_14; + m_A53 += m_A5 * f1_14; + RHS14 += f1_14 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_15 = -f2 * m_A57; + m_A63 += m_A7 * f2_15; + RHS15 += f2_15 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_15 = -f3 * m_A58; + m_A59 += m_A9 * f3_15; + m_A63 += m_A10 * f3_15; + RHS15 += f3_15 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_13 = -f4 * m_A41; + m_A43 += m_A12 * f4_13; + m_A44 += m_A13 * f4_13; + RHS13 += f4_13 * RHS4; + const double f4_14 = -f4 * m_A50; + m_A51 += m_A12 * f4_14; + m_A52 += m_A13 * f4_14; + RHS14 += f4_14 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_15 = -f5 * m_A59; + m_A60 += m_A15 * f5_15; + m_A65 += m_A16 * f5_15; + RHS15 += f5_15 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_13 = -f6 * m_A42; + m_A44 += m_A18 * f6_13; + m_A48 += m_A19 * f6_13; + RHS13 += f6_13 * RHS6; + const double f6_24 = -f6 * m_A122; + m_A123 += m_A18 * f6_24; + m_A129 += m_A19 * f6_24; + RHS24 += f6_24 * RHS6; + const double f7 = 1.0 / m_A20; + const double f7_13 = -f7 * m_A43; + m_A44 += m_A21 * f7_13; + m_A46 += m_A22 * f7_13; + m_A47 += m_A23 * f7_13; + RHS13 += f7_13 * RHS7; + const double f7_14 = -f7 * m_A51; + m_A52 += m_A21 * f7_14; + m_A54 += m_A22 * f7_14; + m_A55 += m_A23 * f7_14; + RHS14 += f7_14 * RHS7; + const double f7_15 = -f7 * m_A60; + m_A61 += m_A21 * f7_15; + m_A64 += m_A22 * f7_15; + m_A65 += m_A23 * f7_15; + RHS15 += f7_15 * RHS7; + const double f7_16 = -f7 * m_A67; + m_A69 += m_A21 * f7_16; + m_A71 += m_A22 * f7_16; + m_A72 += m_A23 * f7_16; + RHS16 += f7_16 * RHS7; + const double f7_20 = -f7 * m_A88; + m_A89 += m_A21 * f7_20; + m_A91 += m_A22 * f7_20; + m_A93 += m_A23 * f7_20; + RHS20 += f7_20 * RHS7; + const double f7_22 = -f7 * m_A102; + m_A103 += m_A21 * f7_22; + m_A106 += m_A22 * f7_22; + m_A107 += m_A23 * f7_22; + RHS22 += f7_22 * RHS7; + const double f8 = 1.0 / m_A24; + const double f8_17 = -f8 * m_A75; + m_A76 += m_A25 * f8_17; + m_A77 += m_A26 * f8_17; + RHS17 += f8_17 * RHS8; + const double f8_18 = -f8 * m_A79; + m_A80 += m_A25 * f8_18; + m_A81 += m_A26 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A27; + const double f9_16 = -f9 * m_A68; + m_A71 += m_A28 * f9_16; + m_A73 += m_A29 * f9_16; + RHS16 += f9_16 * RHS9; + const double f9_23 = -f9 * m_A111; + m_A113 += m_A28 * f9_23; + m_A119 += m_A29 * f9_23; + RHS23 += f9_23 * RHS9; + const double f10 = 1.0 / m_A30; + const double f10_19 = -f10 * m_A83; + m_A85 += m_A31 * f10_19; + m_A87 += m_A32 * f10_19; + RHS19 += f10_19 * RHS10; + const double f10_23 = -f10 * m_A112; + m_A116 += m_A31 * f10_23; + m_A119 += m_A32 * f10_23; + RHS23 += f10_23 * RHS10; + const double f11 = 1.0 / m_A33; + const double f11_19 = -f11 * m_A84; + m_A85 += m_A34 * f11_19; + m_A86 += m_A35 * f11_19; + RHS19 += f11_19 * RHS11; + const double f11_21 = -f11 * m_A96; + m_A98 += m_A34 * f11_21; + m_A99 += m_A35 * f11_21; + RHS21 += f11_21 * RHS11; + const double f12 = 1.0 / m_A36; + const double f12_21 = -f12 * m_A97; + m_A99 += m_A37 * f12_21; + m_A101 += m_A38 * f12_21; + RHS21 += f12_21 * RHS12; + const double f12_25 = -f12 * m_A131; + m_A132 += m_A37 * f12_25; + m_A136 += m_A38 * f12_25; + RHS25 += f12_25 * RHS12; + const double f13 = 1.0 / m_A44; + const double f13_14 = -f13 * m_A52; + m_A53 += m_A45 * f13_14; + m_A54 += m_A46 * f13_14; + m_A55 += m_A47 * f13_14; + m_A56 += m_A48 * f13_14; + RHS14 += f13_14 * RHS13; + const double f13_15 = -f13 * m_A61; + m_A62 += m_A45 * f13_15; + m_A64 += m_A46 * f13_15; + m_A65 += m_A47 * f13_15; + m_A66 += m_A48 * f13_15; + RHS15 += f13_15 * RHS13; + const double f13_16 = -f13 * m_A69; + m_A70 += m_A45 * f13_16; + m_A71 += m_A46 * f13_16; + m_A72 += m_A47 * f13_16; + m_A74 += m_A48 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_20 = -f13 * m_A89; + m_A90 += m_A45 * f13_20; + m_A91 += m_A46 * f13_20; + m_A93 += m_A47 * f13_20; + m_A95 += m_A48 * f13_20; + RHS20 += f13_20 * RHS13; + const double f13_22 = -f13 * m_A103; + m_A104 += m_A45 * f13_22; + m_A106 += m_A46 * f13_22; + m_A107 += m_A47 * f13_22; + m_A109 += m_A48 * f13_22; + RHS22 += f13_22 * RHS13; + const double f13_24 = -f13 * m_A123; + m_A124 += m_A45 * f13_24; + m_A125 += m_A46 * f13_24; + m_A127 += m_A47 * f13_24; + m_A129 += m_A48 * f13_24; + RHS24 += f13_24 * RHS13; + const double f14 = 1.0 / m_A53; + const double f14_15 = -f14 * m_A62; + m_A64 += m_A54 * f14_15; + m_A65 += m_A55 * f14_15; + m_A66 += m_A56 * f14_15; + RHS15 += f14_15 * RHS14; + const double f14_16 = -f14 * m_A70; + m_A71 += m_A54 * f14_16; + m_A72 += m_A55 * f14_16; + m_A74 += m_A56 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_20 = -f14 * m_A90; + m_A91 += m_A54 * f14_20; + m_A93 += m_A55 * f14_20; + m_A95 += m_A56 * f14_20; + RHS20 += f14_20 * RHS14; + const double f14_22 = -f14 * m_A104; + m_A106 += m_A54 * f14_22; + m_A107 += m_A55 * f14_22; + m_A109 += m_A56 * f14_22; + RHS22 += f14_22 * RHS14; + const double f14_24 = -f14 * m_A124; + m_A125 += m_A54 * f14_24; + m_A127 += m_A55 * f14_24; + m_A129 += m_A56 * f14_24; + RHS24 += f14_24 * RHS14; + const double f15 = 1.0 / m_A63; + const double f15_22 = -f15 * m_A105; + m_A106 += m_A64 * f15_22; + m_A107 += m_A65 * f15_22; + m_A109 += m_A66 * f15_22; + RHS22 += f15_22 * RHS15; + const double f16 = 1.0 / m_A71; + const double f16_20 = -f16 * m_A91; + m_A93 += m_A72 * f16_20; + m_A94 += m_A73 * f16_20; + m_A95 += m_A74 * f16_20; + RHS20 += f16_20 * RHS16; + const double f16_22 = -f16 * m_A106; + m_A107 += m_A72 * f16_22; + m_A108 += m_A73 * f16_22; + m_A109 += m_A74 * f16_22; + RHS22 += f16_22 * RHS16; + const double f16_23 = -f16 * m_A113; + m_A118 += m_A72 * f16_23; + m_A119 += m_A73 * f16_23; + m_A120 += m_A74 * f16_23; + RHS23 += f16_23 * RHS16; + const double f16_24 = -f16 * m_A125; + m_A127 += m_A72 * f16_24; + m_A128 += m_A73 * f16_24; + m_A129 += m_A74 * f16_24; + RHS24 += f16_24 * RHS16; + const double f17 = 1.0 / m_A76; + const double f17_18 = -f17 * m_A80; + m_A81 += m_A77 * f17_18; + m_A82 += m_A78 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_23 = -f17 * m_A114; + m_A115 += m_A77 * f17_23; + m_A119 += m_A78 * f17_23; + RHS23 += f17_23 * RHS17; + const double f18 = 1.0 / m_A81; + const double f18_23 = -f18 * m_A115; + m_A119 += m_A82 * f18_23; + RHS23 += f18_23 * RHS18; + const double f19 = 1.0 / m_A85; + const double f19_21 = -f19 * m_A98; + m_A99 += m_A86 * f19_21; + m_A100 += m_A87 * f19_21; + RHS21 += f19_21 * RHS19; + const double f19_23 = -f19 * m_A116; + m_A117 += m_A86 * f19_23; + m_A119 += m_A87 * f19_23; + RHS23 += f19_23 * RHS19; + const double f20 = 1.0 / m_A92; + const double f20_24 = -f20 * m_A126; + m_A127 += m_A93 * f20_24; + m_A128 += m_A94 * f20_24; + m_A129 += m_A95 * f20_24; + RHS24 += f20_24 * RHS20; + const double f21 = 1.0 / m_A99; + const double f21_23 = -f21 * m_A117; + m_A119 += m_A100 * f21_23; + m_A121 += m_A101 * f21_23; + RHS23 += f21_23 * RHS21; + const double f21_25 = -f21 * m_A132; + m_A134 += m_A100 * f21_25; + m_A136 += m_A101 * f21_25; + RHS25 += f21_25 * RHS21; + const double f22 = 1.0 / m_A107; + const double f22_23 = -f22 * m_A118; + m_A119 += m_A108 * f22_23; + m_A120 += m_A109 * f22_23; + m_A121 += m_A110 * f22_23; + RHS23 += f22_23 * RHS22; + const double f22_24 = -f22 * m_A127; + m_A128 += m_A108 * f22_24; + m_A129 += m_A109 * f22_24; + m_A130 += m_A110 * f22_24; + RHS24 += f22_24 * RHS22; + const double f22_25 = -f22 * m_A133; + m_A134 += m_A108 * f22_25; + m_A135 += m_A109 * f22_25; + m_A136 += m_A110 * f22_25; + RHS25 += f22_25 * RHS22; + const double f23 = 1.0 / m_A119; + const double f23_24 = -f23 * m_A128; + m_A129 += m_A120 * f23_24; + m_A130 += m_A121 * f23_24; + RHS24 += f23_24 * RHS23; + const double f23_25 = -f23 * m_A134; + m_A135 += m_A120 * f23_25; + m_A136 += m_A121 * f23_25; + RHS25 += f23_25 * RHS23; + const double f24 = 1.0 / m_A129; + const double f24_25 = -f24 * m_A135; + m_A136 += m_A130 * f24_25; + RHS25 += f24_25 * RHS24; + V[25] = RHS25 / m_A136; + double tmp24 = 0.0; + tmp24 += m_A130 * V[25]; + V[24] = (RHS24 - tmp24) / m_A129; + double tmp23 = 0.0; + tmp23 += m_A120 * V[24]; + tmp23 += m_A121 * V[25]; + V[23] = (RHS23 - tmp23) / m_A119; + double tmp22 = 0.0; + tmp22 += m_A108 * V[23]; + tmp22 += m_A109 * V[24]; + tmp22 += m_A110 * V[25]; + V[22] = (RHS22 - tmp22) / m_A107; + double tmp21 = 0.0; + tmp21 += m_A100 * V[23]; + tmp21 += m_A101 * V[25]; + V[21] = (RHS21 - tmp21) / m_A99; + double tmp20 = 0.0; + tmp20 += m_A93 * V[22]; + tmp20 += m_A94 * V[23]; + tmp20 += m_A95 * V[24]; + V[20] = (RHS20 - tmp20) / m_A92; + double tmp19 = 0.0; + tmp19 += m_A86 * V[21]; + tmp19 += m_A87 * V[23]; + V[19] = (RHS19 - tmp19) / m_A85; + double tmp18 = 0.0; + tmp18 += m_A82 * V[23]; + V[18] = (RHS18 - tmp18) / m_A81; + double tmp17 = 0.0; + tmp17 += m_A77 * V[18]; + tmp17 += m_A78 * V[23]; + V[17] = (RHS17 - tmp17) / m_A76; + double tmp16 = 0.0; + tmp16 += m_A72 * V[22]; + tmp16 += m_A73 * V[23]; + tmp16 += m_A74 * V[24]; + V[16] = (RHS16 - tmp16) / m_A71; + double tmp15 = 0.0; + tmp15 += m_A64 * V[16]; + tmp15 += m_A65 * V[22]; + tmp15 += m_A66 * V[24]; + V[15] = (RHS15 - tmp15) / m_A63; + double tmp14 = 0.0; + tmp14 += m_A54 * V[16]; + tmp14 += m_A55 * V[22]; + tmp14 += m_A56 * V[24]; + V[14] = (RHS14 - tmp14) / m_A53; + double tmp13 = 0.0; + tmp13 += m_A45 * V[14]; + tmp13 += m_A46 * V[16]; + tmp13 += m_A47 * V[22]; + tmp13 += m_A48 * V[24]; + V[13] = (RHS13 - tmp13) / m_A44; + double tmp12 = 0.0; + tmp12 += m_A37 * V[21]; + tmp12 += m_A38 * V[25]; + V[12] = (RHS12 - tmp12) / m_A36; + double tmp11 = 0.0; + tmp11 += m_A34 * V[19]; + tmp11 += m_A35 * V[21]; + V[11] = (RHS11 - tmp11) / m_A33; + double tmp10 = 0.0; + tmp10 += m_A31 * V[19]; + tmp10 += m_A32 * V[23]; + V[10] = (RHS10 - tmp10) / m_A30; + double tmp9 = 0.0; + tmp9 += m_A28 * V[16]; + tmp9 += m_A29 * V[23]; + V[9] = (RHS9 - tmp9) / m_A27; + double tmp8 = 0.0; + tmp8 += m_A25 * V[17]; + tmp8 += m_A26 * V[18]; + V[8] = (RHS8 - tmp8) / m_A24; + double tmp7 = 0.0; + tmp7 += m_A21 * V[13]; + tmp7 += m_A22 * V[16]; + tmp7 += m_A23 * V[22]; + V[7] = (RHS7 - tmp7) / m_A20; + double tmp6 = 0.0; + tmp6 += m_A18 * V[13]; + tmp6 += m_A19 * V[24]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A15 * V[7]; + tmp5 += m_A16 * V[22]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A12 * V[7]; + tmp4 += m_A13 * V[13]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[5]; + tmp3 += m_A10 * V[15]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[15]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[13]; + tmp1 += m_A5 * V[14]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[13]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// bship +static void nl_gcr_44_double_double_6a0b8563aaaa6b06(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A7 += go[11]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A10 += go[15]; + m_A9 += go[16]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A12 += go[17]; + m_A13 += go[18]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[19] * *cnV[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A14 += gt[25]; + m_A14 += gt[26]; + m_A15 += go[20]; + m_A16 += go[21]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 -= go[22] * *cnV[22]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A19 += go[27]; + m_A17 += go[28]; + double RHS7 = Idr[27]; + RHS7 += Idr[28]; + m_A21 += gt[29]; + m_A21 += gt[30]; + m_A20 += go[29]; + m_A22 += go[30]; + double RHS8 = Idr[29]; + RHS8 += Idr[30]; + m_A25 += gt[31]; + m_A25 += gt[32]; + m_A25 += gt[33]; + m_A25 += gt[34]; + m_A26 += go[31]; + m_A24 += go[32]; + m_A23 += go[33]; + double RHS9 = Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 -= go[34] * *cnV[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A29 += gt[38]; + m_A29 += gt[39]; + m_A28 += go[35]; + m_A27 += go[36]; + m_A31 += go[37]; + double RHS10 = Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 -= go[38] * *cnV[38]; + RHS10 -= go[39] * *cnV[39]; + m_A36 += gt[40]; + m_A36 += gt[41]; + m_A36 += gt[42]; + m_A36 += gt[43]; + m_A33 += go[40]; + m_A32 += go[41]; + m_A34 += go[42]; + double RHS11 = Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 -= go[43] * *cnV[43]; + m_A43 += gt[44]; + m_A43 += gt[45]; + m_A43 += gt[46]; + m_A43 += gt[47]; + m_A43 += gt[48]; + m_A43 += gt[49]; + m_A38 += go[44]; + m_A41 += go[45]; + m_A40 += go[46]; + m_A39 += go[47]; + double RHS12 = Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 += Idr[49]; + RHS12 -= go[48] * *cnV[48]; + RHS12 -= go[49] * *cnV[49]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A17; + m_A18 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_12 = -f1 * m_A38; + m_A43 += m_A3 * f1_12; + RHS12 += f1_12 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_8 = -f2 * m_A20; + m_A21 += m_A5 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_9 = -f3 * m_A23; + m_A25 += m_A7 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_9 = -f4 * m_A24; + m_A25 += m_A9 * f4_9; + m_A26 += m_A10 * f4_9; + RHS9 += f4_9 * RHS4; + const double f4_11 = -f4 * m_A32; + m_A34 += m_A9 * f4_11; + m_A36 += m_A10 * f4_11; + RHS11 += f4_11 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_10 = -f5 * m_A27; + m_A29 += m_A12 * f5_10; + m_A30 += m_A13 * f5_10; + RHS10 += f5_10 * RHS5; + const double f5_11 = -f5 * m_A33; + m_A35 += m_A12 * f5_11; + m_A36 += m_A13 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_10 = -f6 * m_A28; + m_A29 += m_A15 * f6_10; + m_A31 += m_A16 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_12 = -f7 * m_A39; + m_A43 += m_A19 * f7_12; + RHS12 += f7_12 * RHS7; + const double f8 = 1.0 / m_A21; + const double f8_12 = -f8 * m_A40; + m_A43 += m_A22 * f8_12; + RHS12 += f8_12 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_11 = -f9 * m_A34; + m_A36 += m_A26 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A29; + const double f10_11 = -f10 * m_A35; + m_A36 += m_A30 * f10_11; + m_A37 += m_A31 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_12 = -f10 * m_A41; + m_A42 += m_A30 * f10_12; + m_A43 += m_A31 * f10_12; + RHS12 += f10_12 * RHS10; + const double f11 = 1.0 / m_A36; + const double f11_12 = -f11 * m_A42; + m_A43 += m_A37 * f11_12; + RHS12 += f11_12 * RHS11; + V[12] = RHS12 / m_A43; + double tmp11 = 0.0; + tmp11 += m_A37 * V[12]; + V[11] = (RHS11 - tmp11) / m_A36; + double tmp10 = 0.0; + tmp10 += m_A30 * V[11]; + tmp10 += m_A31 * V[12]; + V[10] = (RHS10 - tmp10) / m_A29; + double tmp9 = 0.0; + tmp9 += m_A26 * V[11]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A22 * V[12]; + V[8] = (RHS8 - tmp8) / m_A21; + double tmp7 = 0.0; + tmp7 += m_A19 * V[12]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A15 * V[10]; + tmp6 += m_A16 * V[12]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[10]; + tmp5 += m_A13 * V[11]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[9]; + tmp4 += m_A10 * V[11]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[8]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[12]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// carpolo +static void nl_gcr_34_double_double_a8f1d076330f06b7(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A5 += go[6]; + m_A6 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A9 += go[8]; + m_A8 += go[9]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 -= go[10] * *cnV[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A11 += go[11]; + double RHS4 = Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[12] * *cnV[12]; + RHS4 -= go[13] * *cnV[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A13 += go[14]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 -= go[15] * *cnV[15]; + RHS5 -= go[16] * *cnV[16]; + m_A15 += gt[17]; + m_A15 += gt[18]; + m_A15 += gt[19]; + m_A15 += gt[20]; + m_A16 += go[17]; + m_A14 += go[18]; + double RHS6 = Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + m_A19 += gt[21]; + m_A19 += gt[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A21 += go[21]; + m_A21 += go[22]; + m_A18 += go[23]; + m_A17 += go[24]; + m_A20 += go[25]; + double RHS7 = Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + m_A26 += gt[28]; + m_A26 += gt[29]; + m_A26 += gt[30]; + m_A26 += gt[31]; + m_A22 += go[28]; + m_A25 += go[29]; + m_A23 += go[30]; + m_A24 += go[31]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + m_A33 += gt[32]; + m_A33 += gt[33]; + m_A33 += gt[34]; + m_A33 += gt[35]; + m_A33 += gt[36]; + m_A33 += gt[37]; + m_A30 += go[32]; + m_A29 += go[33]; + m_A28 += go[34]; + m_A31 += go[35]; + m_A31 += go[36]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 -= go[37] * *cnV[37]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A14; + m_A15 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A22; + m_A26 += m_A3 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A17; + m_A19 += m_A5 * f2_7; + m_A20 += m_A6 * f2_7; + RHS7 += f2_7 * RHS2; + const double f2_8 = -f2 * m_A23; + m_A25 += m_A5 * f2_8; + m_A26 += m_A6 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_7 = -f3 * m_A18; + m_A19 += m_A8 * f3_7; + m_A21 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_9 = -f3 * m_A28; + m_A31 += m_A8 * f3_9; + m_A33 += m_A9 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_9 = -f4 * m_A29; + m_A33 += m_A11 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_9 = -f5 * m_A30; + m_A33 += m_A13 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_8 = -f6 * m_A24; + m_A26 += m_A16 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_8 = -f7 * m_A25; + m_A26 += m_A20 * f7_8; + m_A27 += m_A21 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_9 = -f7 * m_A31; + m_A32 += m_A20 * f7_9; + m_A33 += m_A21 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A26; + const double f8_9 = -f8 * m_A32; + m_A33 += m_A27 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A33; + double tmp8 = 0.0; + tmp8 += m_A27 * V[9]; + V[8] = (RHS8 - tmp8) / m_A26; + double tmp7 = 0.0; + tmp7 += m_A20 * V[8]; + tmp7 += m_A21 * V[9]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A16 * V[8]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A13 * V[9]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A11 * V[9]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[7]; + tmp3 += m_A9 * V[9]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + tmp2 += m_A6 * V[8]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[8]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// cheekyms +static void nl_gcr_12_double_double_546396f65ce48700(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A2 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[2] * *cnV[2]; + m_A3 += gt[3]; + m_A3 += gt[4]; + m_A4 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A7 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + m_A11 += gt[7]; + m_A11 += gt[8]; + m_A11 += gt[9]; + m_A11 += gt[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A9 += go[7]; + m_A10 += go[8]; + m_A8 += go[9]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A6 += m_A1 * f0_2; + m_A7 += m_A2 * f0_2; + RHS2 += f0_2 * RHS0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + m_A11 += m_A2 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_3 = -f1 * m_A9; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + tmp0 += m_A2 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// cheekyms +static void nl_gcr_150_double_double_e75302e17c866419(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A6 += go[6]; + m_A5 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[8] * *cnV[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A10 += go[9]; + m_A9 += go[10]; + m_A8 += go[11]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A12 += go[14]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[15] * *cnV[15]; + RHS4 -= go[16] * *cnV[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A15 += go[17]; + m_A14 += go[18]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[19] * *cnV[19]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A17 += go[24]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A19 += go[27]; + double RHS7 = Idr[27]; + RHS7 += Idr[28]; + RHS7 -= go[28] * *cnV[28]; + m_A20 += gt[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A21 += go[29]; + m_A23 += go[30]; + m_A22 += go[31]; + double RHS8 = Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A24 += gt[34]; + m_A25 += go[32]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 -= go[33] * *cnV[33]; + RHS9 -= go[34] * *cnV[34]; + m_A26 += gt[35]; + m_A26 += gt[36]; + m_A26 += gt[37]; + m_A26 += gt[38]; + m_A27 += go[35]; + m_A28 += go[36]; + double RHS10 = Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 -= go[37] * *cnV[37]; + RHS10 -= go[38] * *cnV[38]; + m_A29 += gt[39]; + m_A29 += gt[40]; + m_A30 += go[39]; + double RHS11 = Idr[39]; + RHS11 += Idr[40]; + RHS11 -= go[40] * *cnV[40]; + m_A31 += gt[41]; + m_A31 += gt[42]; + m_A31 += gt[43]; + m_A31 += gt[44]; + m_A32 += go[41]; + m_A33 += go[42]; + double RHS12 = Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + RHS12 -= go[43] * *cnV[43]; + RHS12 -= go[44] * *cnV[44]; + m_A34 += gt[45]; + m_A34 += gt[46]; + m_A34 += gt[47]; + m_A36 += go[45]; + m_A35 += go[46]; + double RHS13 = Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 -= go[47] * *cnV[47]; + m_A37 += gt[48]; + m_A37 += gt[49]; + m_A38 += go[48]; + double RHS14 = Idr[48]; + RHS14 += Idr[49]; + RHS14 -= go[49] * *cnV[49]; + m_A39 += gt[50]; + m_A39 += gt[51]; + m_A40 += go[50]; + double RHS15 = Idr[50]; + RHS15 += Idr[51]; + RHS15 -= go[51] * *cnV[51]; + m_A41 += gt[52]; + m_A41 += gt[53]; + m_A42 += go[52]; + double RHS16 = Idr[52]; + RHS16 += Idr[53]; + RHS16 -= go[53] * *cnV[53]; + m_A43 += gt[54]; + m_A43 += gt[55]; + m_A43 += gt[56]; + m_A43 += gt[57]; + m_A43 += gt[58]; + m_A44 += go[54]; + m_A46 += go[55]; + m_A45 += go[56]; + double RHS17 = Idr[54]; + RHS17 += Idr[55]; + RHS17 += Idr[56]; + RHS17 += Idr[57]; + RHS17 += Idr[58]; + RHS17 -= go[57] * *cnV[57]; + RHS17 -= go[58] * *cnV[58]; + m_A47 += gt[59]; + m_A47 += gt[60]; + m_A47 += gt[61]; + m_A47 += gt[62]; + m_A47 += gt[63]; + m_A48 += go[59]; + m_A50 += go[60]; + m_A49 += go[61]; + double RHS18 = Idr[59]; + RHS18 += Idr[60]; + RHS18 += Idr[61]; + RHS18 += Idr[62]; + RHS18 += Idr[63]; + RHS18 -= go[62] * *cnV[62]; + RHS18 -= go[63] * *cnV[63]; + m_A51 += gt[64]; + m_A51 += gt[65]; + m_A52 += go[64]; + double RHS19 = Idr[64]; + RHS19 += Idr[65]; + RHS19 -= go[65] * *cnV[65]; + m_A55 += gt[66]; + m_A55 += gt[67]; + m_A54 += go[66]; + m_A53 += go[67]; + double RHS20 = Idr[66]; + RHS20 += Idr[67]; + m_A60 += gt[68]; + m_A60 += gt[69]; + m_A60 += gt[70]; + m_A58 += go[68]; + m_A57 += go[69]; + double RHS21 = Idr[68]; + RHS21 += Idr[69]; + RHS21 += Idr[70]; + RHS21 -= go[70] * *cnV[70]; + m_A63 += gt[71]; + m_A63 += gt[72]; + m_A64 += go[71]; + double RHS22 = Idr[71]; + RHS22 += Idr[72]; + RHS22 -= go[72] * *cnV[72]; + m_A65 += gt[73]; + m_A65 += gt[74]; + m_A65 += gt[75]; + m_A66 += go[73]; + double RHS23 = Idr[73]; + RHS23 += Idr[74]; + RHS23 += Idr[75]; + RHS23 -= go[74] * *cnV[74]; + RHS23 -= go[75] * *cnV[75]; + m_A69 += gt[76]; + m_A69 += gt[77]; + m_A69 += gt[78]; + m_A67 += go[76]; + m_A68 += go[77]; + double RHS24 = Idr[76]; + RHS24 += Idr[77]; + RHS24 += Idr[78]; + RHS24 -= go[78] * *cnV[78]; + m_A76 += gt[79]; + m_A76 += gt[80]; + m_A73 += go[79]; + m_A72 += go[80]; + double RHS25 = Idr[79]; + RHS25 += Idr[80]; + m_A81 += gt[81]; + m_A81 += gt[82]; + m_A80 += go[81]; + m_A79 += go[82]; + double RHS26 = Idr[81]; + RHS26 += Idr[82]; + m_A84 += gt[83]; + m_A84 += gt[84]; + m_A84 += gt[85]; + m_A85 += go[83]; + m_A83 += go[84]; + double RHS27 = Idr[83]; + RHS27 += Idr[84]; + RHS27 += Idr[85]; + RHS27 -= go[85] * *cnV[85]; + m_A88 += gt[86]; + m_A88 += gt[87]; + m_A87 += go[86]; + m_A86 += go[87]; + double RHS28 = Idr[86]; + RHS28 += Idr[87]; + m_A95 += gt[88]; + m_A95 += gt[89]; + m_A95 += gt[90]; + m_A95 += gt[91]; + m_A95 += gt[92]; + m_A90 += go[88]; + m_A92 += go[89]; + m_A91 += go[90]; + double RHS29 = Idr[88]; + RHS29 += Idr[89]; + RHS29 += Idr[90]; + RHS29 += Idr[91]; + RHS29 += Idr[92]; + RHS29 -= go[91] * *cnV[91]; + RHS29 -= go[92] * *cnV[92]; + m_A100 += gt[93]; + m_A100 += gt[94]; + m_A100 += gt[95]; + m_A100 += gt[96]; + m_A100 += gt[97]; + m_A100 += gt[98]; + m_A100 += gt[99]; + m_A98 += go[93]; + m_A101 += go[94]; + double RHS30 = Idr[93]; + RHS30 += Idr[94]; + RHS30 += Idr[95]; + RHS30 += Idr[96]; + RHS30 += Idr[97]; + RHS30 += Idr[98]; + RHS30 += Idr[99]; + RHS30 -= go[95] * *cnV[95]; + RHS30 -= go[96] * *cnV[96]; + RHS30 -= go[97] * *cnV[97]; + RHS30 -= go[98] * *cnV[98]; + RHS30 -= go[99] * *cnV[99]; + m_A103 += gt[100]; + m_A103 += gt[101]; + m_A103 += gt[102]; + m_A103 += gt[103]; + m_A103 += gt[104]; + m_A103 += gt[105]; + m_A104 += go[100]; + m_A104 += go[101]; + m_A102 += go[102]; + double RHS31 = Idr[100]; + RHS31 += Idr[101]; + RHS31 += Idr[102]; + RHS31 += Idr[103]; + RHS31 += Idr[104]; + RHS31 += Idr[105]; + RHS31 -= go[103] * *cnV[103]; + RHS31 -= go[104] * *cnV[104]; + RHS31 -= go[105] * *cnV[105]; + m_A110 += gt[106]; + m_A110 += gt[107]; + m_A110 += gt[108]; + m_A106 += go[106]; + m_A107 += go[107]; + m_A105 += go[108]; + double RHS32 = Idr[106]; + RHS32 += Idr[107]; + RHS32 += Idr[108]; + m_A114 += gt[109]; + m_A114 += gt[110]; + m_A114 += gt[111]; + m_A114 += gt[112]; + m_A114 += gt[113]; + m_A114 += gt[114]; + m_A114 += gt[115]; + m_A112 += go[109]; + m_A115 += go[110]; + double RHS33 = Idr[109]; + RHS33 += Idr[110]; + RHS33 += Idr[111]; + RHS33 += Idr[112]; + RHS33 += Idr[113]; + RHS33 += Idr[114]; + RHS33 += Idr[115]; + RHS33 -= go[111] * *cnV[111]; + RHS33 -= go[112] * *cnV[112]; + RHS33 -= go[113] * *cnV[113]; + RHS33 -= go[114] * *cnV[114]; + RHS33 -= go[115] * *cnV[115]; + m_A121 += gt[116]; + m_A121 += gt[117]; + m_A121 += gt[118]; + m_A121 += gt[119]; + m_A121 += gt[120]; + m_A121 += gt[121]; + m_A121 += gt[122]; + m_A118 += go[116]; + m_A116 += go[117]; + double RHS34 = Idr[116]; + RHS34 += Idr[117]; + RHS34 += Idr[118]; + RHS34 += Idr[119]; + RHS34 += Idr[120]; + RHS34 += Idr[121]; + RHS34 += Idr[122]; + RHS34 -= go[118] * *cnV[118]; + RHS34 -= go[119] * *cnV[119]; + RHS34 -= go[120] * *cnV[120]; + RHS34 -= go[121] * *cnV[121]; + RHS34 -= go[122] * *cnV[122]; + m_A125 += gt[123]; + m_A125 += gt[124]; + m_A125 += gt[125]; + m_A124 += go[123]; + m_A126 += go[124]; + m_A123 += go[125]; + double RHS35 = Idr[123]; + RHS35 += Idr[124]; + RHS35 += Idr[125]; + m_A132 += gt[126]; + m_A132 += gt[127]; + m_A132 += gt[128]; + m_A127 += go[126]; + m_A128 += go[127]; + m_A130 += go[128]; + double RHS36 = Idr[126]; + RHS36 += Idr[127]; + RHS36 += Idr[128]; + m_A149 += gt[129]; + m_A149 += gt[130]; + m_A149 += gt[131]; + m_A149 += gt[132]; + m_A149 += gt[133]; + m_A149 += gt[134]; + m_A149 += gt[135]; + m_A149 += gt[136]; + m_A149 += gt[137]; + m_A149 += gt[138]; + m_A149 += gt[139]; + m_A140 += go[129]; + m_A147 += go[130]; + m_A139 += go[131]; + m_A138 += go[132]; + m_A137 += go[133]; + m_A136 += go[134]; + m_A135 += go[135]; + m_A134 += go[136]; + m_A143 += go[137]; + m_A143 += go[138]; + double RHS37 = Idr[129]; + RHS37 += Idr[130]; + RHS37 += Idr[131]; + RHS37 += Idr[132]; + RHS37 += Idr[133]; + RHS37 += Idr[134]; + RHS37 += Idr[135]; + RHS37 += Idr[136]; + RHS37 += Idr[137]; + RHS37 += Idr[138]; + RHS37 += Idr[139]; + RHS37 -= go[139] * *cnV[139]; + const double f0 = 1.0 / m_A0; + const double f0_31 = -f0 * m_A102; + m_A103 += m_A1 * f0_31; + RHS31 += f0_31 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_20 = -f1 * m_A53; + m_A55 += m_A3 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_20 = -f2 * m_A54; + m_A55 += m_A5 * f2_20; + m_A56 += m_A6 * f2_20; + RHS20 += f2_20 * RHS2; + const double f2_21 = -f2 * m_A57; + m_A59 += m_A5 * f2_21; + m_A60 += m_A6 * f2_21; + RHS21 += f2_21 * RHS2; + const double f2_34 = -f2 * m_A116; + m_A117 += m_A5 * f2_34; + m_A118 += m_A6 * f2_34; + RHS34 += f2_34 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_21 = -f3 * m_A58; + m_A60 += m_A8 * f3_21; + m_A61 += m_A9 * f3_21; + m_A62 += m_A10 * f3_21; + RHS21 += f3_21 * RHS3; + const double f3_25 = -f3 * m_A72; + m_A74 += m_A8 * f3_25; + m_A76 += m_A9 * f3_25; + m_A78 += m_A10 * f3_25; + RHS25 += f3_25 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_24 = -f4 * m_A67; + m_A69 += m_A12 * f4_24; + RHS24 += f4_24 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_29 = -f5 * m_A90; + m_A91 += m_A14 * f5_29; + m_A93 += m_A15 * f5_29; + RHS29 += f5_29 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_26 = -f6 * m_A79; + m_A81 += m_A17 * f6_26; + RHS26 += f6_26 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_27 = -f7 * m_A83; + m_A84 += m_A19 * f7_27; + RHS27 += f7_27 * RHS7; + const double f8 = 1.0 / m_A20; + const double f8_24 = -f8 * m_A68; + m_A69 += m_A21 * f8_24; + m_A70 += m_A22 * f8_24; + m_A71 += m_A23 * f8_24; + RHS24 += f8_24 * RHS8; + const double f8_25 = -f8 * m_A73; + m_A75 += m_A21 * f8_25; + m_A76 += m_A22 * f8_25; + m_A77 += m_A23 * f8_25; + RHS25 += f8_25 * RHS8; + const double f8_29 = -f8 * m_A91; + m_A93 += m_A21 * f8_29; + m_A94 += m_A22 * f8_29; + m_A95 += m_A23 * f8_29; + RHS29 += f8_29 * RHS8; + const double f9 = 1.0 / m_A24; + const double f9_28 = -f9 * m_A86; + m_A88 += m_A25 * f9_28; + RHS28 += f9_28 * RHS9; + const double f10 = 1.0 / m_A26; + const double f10_26 = -f10 * m_A80; + m_A81 += m_A27 * f10_26; + m_A82 += m_A28 * f10_26; + RHS26 += f10_26 * RHS10; + const double f10_33 = -f10 * m_A112; + m_A113 += m_A27 * f10_33; + m_A115 += m_A28 * f10_33; + RHS33 += f10_33 * RHS10; + const double f10_36 = -f10 * m_A127; + m_A129 += m_A27 * f10_36; + m_A132 += m_A28 * f10_36; + RHS36 += f10_36 * RHS10; + const double f11 = 1.0 / m_A29; + const double f11_32 = -f11 * m_A105; + m_A110 += m_A30 * f11_32; + RHS32 += f11_32 * RHS11; + const double f12 = 1.0 / m_A31; + const double f12_28 = -f12 * m_A87; + m_A88 += m_A32 * f12_28; + m_A89 += m_A33 * f12_28; + RHS28 += f12_28 * RHS12; + const double f12_30 = -f12 * m_A98; + m_A99 += m_A32 * f12_30; + m_A101 += m_A33 * f12_30; + RHS30 += f12_30 * RHS12; + const double f12_32 = -f12 * m_A106; + m_A108 += m_A32 * f12_32; + m_A110 += m_A33 * f12_32; + RHS32 += f12_32 * RHS12; + const double f13 = 1.0 / m_A34; + const double f13_29 = -f13 * m_A92; + m_A95 += m_A35 * f13_29; + m_A97 += m_A36 * f13_29; + RHS29 += f13_29 * RHS13; + const double f13_37 = -f13 * m_A134; + m_A141 += m_A35 * f13_37; + m_A149 += m_A36 * f13_37; + RHS37 += f13_37 * RHS13; + const double f14 = 1.0 / m_A37; + const double f14_35 = -f14 * m_A123; + m_A125 += m_A38 * f14_35; + RHS35 += f14_35 * RHS14; + const double f15 = 1.0 / m_A39; + const double f15_35 = -f15 * m_A124; + m_A125 += m_A40 * f15_35; + RHS35 += f15_35 * RHS15; + const double f16 = 1.0 / m_A41; + const double f16_37 = -f16 * m_A135; + m_A149 += m_A42 * f16_37; + RHS37 += f16_37 * RHS16; + const double f17 = 1.0 / m_A43; + const double f17_36 = -f17 * m_A128; + m_A131 += m_A44 * f17_36; + m_A132 += m_A45 * f17_36; + m_A133 += m_A46 * f17_36; + RHS36 += f17_36 * RHS17; + const double f17_37 = -f17 * m_A136; + m_A145 += m_A44 * f17_37; + m_A148 += m_A45 * f17_37; + m_A149 += m_A46 * f17_37; + RHS37 += f17_37 * RHS17; + const double f18 = 1.0 / m_A47; + const double f18_32 = -f18 * m_A107; + m_A109 += m_A48 * f18_32; + m_A110 += m_A49 * f18_32; + m_A111 += m_A50 * f18_32; + RHS32 += f18_32 * RHS18; + const double f18_37 = -f18 * m_A137; + m_A142 += m_A48 * f18_37; + m_A144 += m_A49 * f18_37; + m_A149 += m_A50 * f18_37; + RHS37 += f18_37 * RHS18; + const double f19 = 1.0 / m_A51; + const double f19_37 = -f19 * m_A138; + m_A149 += m_A52 * f19_37; + RHS37 += f19_37 * RHS19; + const double f20 = 1.0 / m_A55; + const double f20_21 = -f20 * m_A59; + m_A60 += m_A56 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_34 = -f20 * m_A117; + m_A118 += m_A56 * f20_34; + RHS34 += f20_34 * RHS20; + const double f21 = 1.0 / m_A60; + const double f21_25 = -f21 * m_A74; + m_A76 += m_A61 * f21_25; + m_A78 += m_A62 * f21_25; + RHS25 += f21_25 * RHS21; + const double f21_34 = -f21 * m_A118; + m_A119 += m_A61 * f21_34; + m_A121 += m_A62 * f21_34; + RHS34 += f21_34 * RHS21; + const double f22 = 1.0 / m_A63; + const double f22_37 = -f22 * m_A139; + m_A149 += m_A64 * f22_37; + RHS37 += f22_37 * RHS22; + const double f23 = 1.0 / m_A65; + const double f23_37 = -f23 * m_A140; + m_A149 += m_A66 * f23_37; + RHS37 += f23_37 * RHS23; + const double f24 = 1.0 / m_A69; + const double f24_25 = -f24 * m_A75; + m_A76 += m_A70 * f24_25; + m_A77 += m_A71 * f24_25; + RHS25 += f24_25 * RHS24; + const double f24_29 = -f24 * m_A93; + m_A94 += m_A70 * f24_29; + m_A95 += m_A71 * f24_29; + RHS29 += f24_29 * RHS24; + const double f25 = 1.0 / m_A76; + const double f25_29 = -f25 * m_A94; + m_A95 += m_A77 * f25_29; + m_A96 += m_A78 * f25_29; + RHS29 += f25_29 * RHS25; + const double f25_34 = -f25 * m_A119; + m_A120 += m_A77 * f25_34; + m_A121 += m_A78 * f25_34; + RHS34 += f25_34 * RHS25; + const double f26 = 1.0 / m_A81; + const double f26_33 = -f26 * m_A113; + m_A115 += m_A82 * f26_33; + RHS33 += f26_33 * RHS26; + const double f26_36 = -f26 * m_A129; + m_A132 += m_A82 * f26_36; + RHS36 += f26_36 * RHS26; + const double f27 = 1.0 / m_A84; + const double f27_36 = -f27 * m_A130; + m_A132 += m_A85 * f27_36; + RHS36 += f27_36 * RHS27; + const double f28 = 1.0 / m_A88; + const double f28_30 = -f28 * m_A99; + m_A101 += m_A89 * f28_30; + RHS30 += f28_30 * RHS28; + const double f28_32 = -f28 * m_A108; + m_A110 += m_A89 * f28_32; + RHS32 += f28_32 * RHS28; + const double f29 = 1.0 / m_A95; + const double f29_34 = -f29 * m_A120; + m_A121 += m_A96 * f29_34; + m_A122 += m_A97 * f29_34; + RHS34 += f29_34 * RHS29; + const double f29_37 = -f29 * m_A141; + m_A146 += m_A96 * f29_37; + m_A149 += m_A97 * f29_37; + RHS37 += f29_37 * RHS29; + const double f30 = 1.0 / m_A100; + const double f30_32 = -f30 * m_A109; + m_A110 += m_A101 * f30_32; + RHS32 += f30_32 * RHS30; + const double f30_37 = -f30 * m_A142; + m_A144 += m_A101 * f30_37; + RHS37 += f30_37 * RHS30; + const double f31 = 1.0 / m_A103; + const double f31_37 = -f31 * m_A143; + m_A149 += m_A104 * f31_37; + RHS37 += f31_37 * RHS31; + const double f32 = 1.0 / m_A110; + const double f32_37 = -f32 * m_A144; + m_A149 += m_A111 * f32_37; + RHS37 += f32_37 * RHS32; + const double f33 = 1.0 / m_A114; + const double f33_36 = -f33 * m_A131; + m_A132 += m_A115 * f33_36; + RHS36 += f33_36 * RHS33; + const double f33_37 = -f33 * m_A145; + m_A148 += m_A115 * f33_37; + RHS37 += f33_37 * RHS33; + const double f34 = 1.0 / m_A121; + const double f34_37 = -f34 * m_A146; + m_A149 += m_A122 * f34_37; + RHS37 += f34_37 * RHS34; + const double f35 = 1.0 / m_A125; + const double f35_37 = -f35 * m_A147; + m_A149 += m_A126 * f35_37; + RHS37 += f35_37 * RHS35; + const double f36 = 1.0 / m_A132; + const double f36_37 = -f36 * m_A148; + m_A149 += m_A133 * f36_37; + RHS37 += f36_37 * RHS36; + V[37] = RHS37 / m_A149; + double tmp36 = 0.0; + tmp36 += m_A133 * V[37]; + V[36] = (RHS36 - tmp36) / m_A132; + double tmp35 = 0.0; + tmp35 += m_A126 * V[37]; + V[35] = (RHS35 - tmp35) / m_A125; + double tmp34 = 0.0; + tmp34 += m_A122 * V[37]; + V[34] = (RHS34 - tmp34) / m_A121; + double tmp33 = 0.0; + tmp33 += m_A115 * V[36]; + V[33] = (RHS33 - tmp33) / m_A114; + double tmp32 = 0.0; + tmp32 += m_A111 * V[37]; + V[32] = (RHS32 - tmp32) / m_A110; + double tmp31 = 0.0; + tmp31 += m_A104 * V[37]; + V[31] = (RHS31 - tmp31) / m_A103; + double tmp30 = 0.0; + tmp30 += m_A101 * V[32]; + V[30] = (RHS30 - tmp30) / m_A100; + double tmp29 = 0.0; + tmp29 += m_A96 * V[34]; + tmp29 += m_A97 * V[37]; + V[29] = (RHS29 - tmp29) / m_A95; + double tmp28 = 0.0; + tmp28 += m_A89 * V[32]; + V[28] = (RHS28 - tmp28) / m_A88; + double tmp27 = 0.0; + tmp27 += m_A85 * V[36]; + V[27] = (RHS27 - tmp27) / m_A84; + double tmp26 = 0.0; + tmp26 += m_A82 * V[36]; + V[26] = (RHS26 - tmp26) / m_A81; + double tmp25 = 0.0; + tmp25 += m_A77 * V[29]; + tmp25 += m_A78 * V[34]; + V[25] = (RHS25 - tmp25) / m_A76; + double tmp24 = 0.0; + tmp24 += m_A70 * V[25]; + tmp24 += m_A71 * V[29]; + V[24] = (RHS24 - tmp24) / m_A69; + double tmp23 = 0.0; + tmp23 += m_A66 * V[37]; + V[23] = (RHS23 - tmp23) / m_A65; + double tmp22 = 0.0; + tmp22 += m_A64 * V[37]; + V[22] = (RHS22 - tmp22) / m_A63; + double tmp21 = 0.0; + tmp21 += m_A61 * V[25]; + tmp21 += m_A62 * V[34]; + V[21] = (RHS21 - tmp21) / m_A60; + double tmp20 = 0.0; + tmp20 += m_A56 * V[21]; + V[20] = (RHS20 - tmp20) / m_A55; + double tmp19 = 0.0; + tmp19 += m_A52 * V[37]; + V[19] = (RHS19 - tmp19) / m_A51; + double tmp18 = 0.0; + tmp18 += m_A48 * V[30]; + tmp18 += m_A49 * V[32]; + tmp18 += m_A50 * V[37]; + V[18] = (RHS18 - tmp18) / m_A47; + double tmp17 = 0.0; + tmp17 += m_A44 * V[33]; + tmp17 += m_A45 * V[36]; + tmp17 += m_A46 * V[37]; + V[17] = (RHS17 - tmp17) / m_A43; + double tmp16 = 0.0; + tmp16 += m_A42 * V[37]; + V[16] = (RHS16 - tmp16) / m_A41; + double tmp15 = 0.0; + tmp15 += m_A40 * V[35]; + V[15] = (RHS15 - tmp15) / m_A39; + double tmp14 = 0.0; + tmp14 += m_A38 * V[35]; + V[14] = (RHS14 - tmp14) / m_A37; + double tmp13 = 0.0; + tmp13 += m_A35 * V[29]; + tmp13 += m_A36 * V[37]; + V[13] = (RHS13 - tmp13) / m_A34; + double tmp12 = 0.0; + tmp12 += m_A32 * V[28]; + tmp12 += m_A33 * V[32]; + V[12] = (RHS12 - tmp12) / m_A31; + double tmp11 = 0.0; + tmp11 += m_A30 * V[32]; + V[11] = (RHS11 - tmp11) / m_A29; + double tmp10 = 0.0; + tmp10 += m_A27 * V[26]; + tmp10 += m_A28 * V[36]; + V[10] = (RHS10 - tmp10) / m_A26; + double tmp9 = 0.0; + tmp9 += m_A25 * V[28]; + V[9] = (RHS9 - tmp9) / m_A24; + double tmp8 = 0.0; + tmp8 += m_A21 * V[24]; + tmp8 += m_A22 * V[25]; + tmp8 += m_A23 * V[29]; + V[8] = (RHS8 - tmp8) / m_A20; + double tmp7 = 0.0; + tmp7 += m_A19 * V[27]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A17 * V[26]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[8]; + tmp5 += m_A15 * V[24]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A12 * V[24]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[21]; + tmp3 += m_A9 * V[25]; + tmp3 += m_A10 * V[34]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[20]; + tmp2 += m_A6 * V[21]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[20]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[31]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// cheekyms +static void nl_gcr_7_double_double_733c72a820fdbd1f(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A5 += go[6]; + m_A4 += go[7]; + m_A4 += go[8]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// cocoloco +static void nl_gcr_16_double_double_8c0f7f2284333de5(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A8 += go[8]; + m_A10 += go[9]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 += Idr[10]; + RHS4 -= go[10] * *cnV[10]; + m_A15 += gt[11]; + m_A15 += gt[12]; + m_A15 += gt[13]; + m_A15 += gt[14]; + m_A14 += go[11]; + m_A13 += go[12]; + m_A12 += go[13]; + m_A11 += go[14]; + double RHS5 = Idr[11]; + RHS5 += Idr[12]; + RHS5 += Idr[13]; + RHS5 += Idr[14]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A11; + m_A15 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A12; + m_A15 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A8; + m_A9 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_5 = -f3 * m_A13; + m_A15 += m_A7 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_5 = -f4 * m_A14; + m_A15 += m_A10 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A15; + double tmp4 = 0.0; + tmp4 += m_A10 * V[5]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A7 * V[5]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// destroyr +static void nl_gcr_399_double_double_4334c95878d1be92(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + double m_A198(0.0); + double m_A199(0.0); + double m_A200(0.0); + double m_A201(0.0); + double m_A202(0.0); + double m_A203(0.0); + double m_A204(0.0); + double m_A205(0.0); + double m_A206(0.0); + double m_A207(0.0); + double m_A208(0.0); + double m_A209(0.0); + double m_A210(0.0); + double m_A211(0.0); + double m_A212(0.0); + double m_A213(0.0); + double m_A214(0.0); + double m_A215(0.0); + double m_A216(0.0); + double m_A217(0.0); + double m_A218(0.0); + double m_A219(0.0); + double m_A220(0.0); + double m_A221(0.0); + double m_A222(0.0); + double m_A223(0.0); + double m_A224(0.0); + double m_A225(0.0); + double m_A226(0.0); + double m_A227(0.0); + double m_A228(0.0); + double m_A229(0.0); + double m_A230(0.0); + double m_A231(0.0); + double m_A232(0.0); + double m_A233(0.0); + double m_A234(0.0); + double m_A235(0.0); + double m_A236(0.0); + double m_A237(0.0); + double m_A238(0.0); + double m_A239(0.0); + double m_A240(0.0); + double m_A241(0.0); + double m_A242(0.0); + double m_A243(0.0); + double m_A244(0.0); + double m_A245(0.0); + double m_A246(0.0); + double m_A247(0.0); + double m_A248(0.0); + double m_A249(0.0); + double m_A250(0.0); + double m_A251(0.0); + double m_A252(0.0); + double m_A253(0.0); + double m_A254(0.0); + double m_A255(0.0); + double m_A256(0.0); + double m_A257(0.0); + double m_A258(0.0); + double m_A259(0.0); + double m_A260(0.0); + double m_A261(0.0); + double m_A262(0.0); + double m_A263(0.0); + double m_A264(0.0); + double m_A265(0.0); + double m_A266(0.0); + double m_A267(0.0); + double m_A268(0.0); + double m_A269(0.0); + double m_A270(0.0); + double m_A271(0.0); + double m_A272(0.0); + double m_A273(0.0); + double m_A274(0.0); + double m_A275(0.0); + double m_A276(0.0); + double m_A277(0.0); + double m_A278(0.0); + double m_A279(0.0); + double m_A280(0.0); + double m_A281(0.0); + double m_A282(0.0); + double m_A283(0.0); + double m_A284(0.0); + double m_A285(0.0); + double m_A286(0.0); + double m_A287(0.0); + double m_A288(0.0); + double m_A289(0.0); + double m_A290(0.0); + double m_A291(0.0); + double m_A292(0.0); + double m_A293(0.0); + double m_A294(0.0); + double m_A295(0.0); + double m_A296(0.0); + double m_A297(0.0); + double m_A298(0.0); + double m_A299(0.0); + double m_A300(0.0); + double m_A301(0.0); + double m_A302(0.0); + double m_A303(0.0); + double m_A304(0.0); + double m_A305(0.0); + double m_A306(0.0); + double m_A307(0.0); + double m_A308(0.0); + double m_A309(0.0); + double m_A310(0.0); + double m_A311(0.0); + double m_A312(0.0); + double m_A313(0.0); + double m_A314(0.0); + double m_A315(0.0); + double m_A316(0.0); + double m_A317(0.0); + double m_A318(0.0); + double m_A319(0.0); + double m_A320(0.0); + double m_A321(0.0); + double m_A322(0.0); + double m_A323(0.0); + double m_A324(0.0); + double m_A325(0.0); + double m_A326(0.0); + double m_A327(0.0); + double m_A328(0.0); + double m_A329(0.0); + double m_A330(0.0); + double m_A331(0.0); + double m_A332(0.0); + double m_A333(0.0); + double m_A334(0.0); + double m_A335(0.0); + double m_A336(0.0); + double m_A337(0.0); + double m_A338(0.0); + double m_A339(0.0); + double m_A340(0.0); + double m_A341(0.0); + double m_A342(0.0); + double m_A343(0.0); + double m_A344(0.0); + double m_A345(0.0); + double m_A346(0.0); + double m_A347(0.0); + double m_A348(0.0); + double m_A349(0.0); + double m_A350(0.0); + double m_A351(0.0); + double m_A352(0.0); + double m_A353(0.0); + double m_A354(0.0); + double m_A355(0.0); + double m_A356(0.0); + double m_A357(0.0); + double m_A358(0.0); + double m_A359(0.0); + double m_A360(0.0); + double m_A361(0.0); + double m_A362(0.0); + double m_A363(0.0); + double m_A364(0.0); + double m_A365(0.0); + double m_A366(0.0); + double m_A367(0.0); + double m_A368(0.0); + double m_A369(0.0); + double m_A370(0.0); + double m_A371(0.0); + double m_A372(0.0); + double m_A373(0.0); + double m_A374(0.0); + double m_A375(0.0); + double m_A376(0.0); + double m_A377(0.0); + double m_A378(0.0); + double m_A379(0.0); + double m_A380(0.0); + double m_A381(0.0); + double m_A382(0.0); + double m_A383(0.0); + double m_A384(0.0); + double m_A385(0.0); + double m_A386(0.0); + double m_A387(0.0); + double m_A388(0.0); + double m_A389(0.0); + double m_A390(0.0); + double m_A391(0.0); + double m_A392(0.0); + double m_A393(0.0); + double m_A394(0.0); + double m_A395(0.0); + double m_A396(0.0); + double m_A397(0.0); + double m_A398(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A7 += go[4]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A11 += go[10]; + m_A12 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A14 += go[13]; + m_A15 += go[14]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A17 += go[16]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 -= go[17] * *cnV[17]; + RHS6 -= go[18] * *cnV[18]; + RHS6 -= go[19] * *cnV[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A22 += go[20]; + m_A21 += go[21]; + m_A20 += go[22]; + m_A19 += go[23]; + double RHS7 = Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 -= go[24] * *cnV[24]; + RHS7 -= go[25] * *cnV[25]; + RHS7 -= go[26] * *cnV[26]; + m_A23 += gt[27]; + m_A23 += gt[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A23 += gt[31]; + m_A23 += gt[32]; + m_A23 += gt[33]; + m_A27 += go[27]; + m_A26 += go[28]; + m_A25 += go[29]; + m_A24 += go[30]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 -= go[31] * *cnV[31]; + RHS8 -= go[32] * *cnV[32]; + RHS8 -= go[33] * *cnV[33]; + m_A28 += gt[34]; + m_A28 += gt[35]; + m_A28 += gt[36]; + m_A29 += go[34]; + m_A30 += go[35]; + double RHS9 = Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 -= go[36] * *cnV[36]; + m_A31 += gt[37]; + m_A31 += gt[38]; + m_A31 += gt[39]; + m_A31 += gt[40]; + m_A31 += gt[41]; + m_A31 += gt[42]; + m_A31 += gt[43]; + m_A32 += go[37]; + m_A33 += go[38]; + double RHS10 = Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 -= go[39] * *cnV[39]; + RHS10 -= go[40] * *cnV[40]; + RHS10 -= go[41] * *cnV[41]; + RHS10 -= go[42] * *cnV[42]; + RHS10 -= go[43] * *cnV[43]; + m_A34 += gt[44]; + m_A34 += gt[45]; + m_A34 += gt[46]; + m_A36 += go[44]; + m_A35 += go[45]; + m_A37 += go[46]; + double RHS11 = Idr[44]; + RHS11 += Idr[45]; + RHS11 += Idr[46]; + m_A38 += gt[47]; + m_A38 += gt[48]; + m_A38 += gt[49]; + m_A38 += gt[50]; + m_A38 += gt[51]; + m_A38 += gt[52]; + m_A38 += gt[53]; + m_A39 += go[47]; + m_A40 += go[48]; + double RHS12 = Idr[47]; + RHS12 += Idr[48]; + RHS12 += Idr[49]; + RHS12 += Idr[50]; + RHS12 += Idr[51]; + RHS12 += Idr[52]; + RHS12 += Idr[53]; + RHS12 -= go[49] * *cnV[49]; + RHS12 -= go[50] * *cnV[50]; + RHS12 -= go[51] * *cnV[51]; + RHS12 -= go[52] * *cnV[52]; + RHS12 -= go[53] * *cnV[53]; + m_A41 += gt[54]; + m_A41 += gt[55]; + m_A41 += gt[56]; + m_A41 += gt[57]; + m_A44 += go[54]; + m_A42 += go[55]; + m_A43 += go[56]; + double RHS13 = Idr[54]; + RHS13 += Idr[55]; + RHS13 += Idr[56]; + RHS13 += Idr[57]; + RHS13 -= go[57] * *cnV[57]; + m_A45 += gt[58]; + m_A45 += gt[59]; + m_A45 += gt[60]; + m_A45 += gt[61]; + m_A45 += gt[62]; + m_A46 += go[58]; + m_A47 += go[59]; + double RHS14 = Idr[58]; + RHS14 += Idr[59]; + RHS14 += Idr[60]; + RHS14 += Idr[61]; + RHS14 += Idr[62]; + RHS14 -= go[60] * *cnV[60]; + RHS14 -= go[61] * *cnV[61]; + RHS14 -= go[62] * *cnV[62]; + m_A48 += gt[63]; + m_A48 += gt[64]; + m_A48 += gt[65]; + m_A48 += gt[66]; + m_A48 += gt[67]; + m_A48 += gt[68]; + m_A48 += gt[69]; + m_A50 += go[63]; + m_A49 += go[64]; + double RHS15 = Idr[63]; + RHS15 += Idr[64]; + RHS15 += Idr[65]; + RHS15 += Idr[66]; + RHS15 += Idr[67]; + RHS15 += Idr[68]; + RHS15 += Idr[69]; + RHS15 -= go[65] * *cnV[65]; + RHS15 -= go[66] * *cnV[66]; + RHS15 -= go[67] * *cnV[67]; + RHS15 -= go[68] * *cnV[68]; + RHS15 -= go[69] * *cnV[69]; + m_A51 += gt[70]; + m_A51 += gt[71]; + m_A51 += gt[72]; + m_A51 += gt[73]; + m_A51 += gt[74]; + m_A52 += go[70]; + m_A53 += go[71]; + double RHS16 = Idr[70]; + RHS16 += Idr[71]; + RHS16 += Idr[72]; + RHS16 += Idr[73]; + RHS16 += Idr[74]; + RHS16 -= go[72] * *cnV[72]; + RHS16 -= go[73] * *cnV[73]; + RHS16 -= go[74] * *cnV[74]; + m_A54 += gt[75]; + m_A54 += gt[76]; + m_A54 += gt[77]; + m_A55 += go[75]; + double RHS17 = Idr[75]; + RHS17 += Idr[76]; + RHS17 += Idr[77]; + RHS17 -= go[76] * *cnV[76]; + RHS17 -= go[77] * *cnV[77]; + m_A56 += gt[78]; + m_A56 += gt[79]; + m_A57 += go[78]; + m_A58 += go[79]; + double RHS18 = Idr[78]; + RHS18 += Idr[79]; + m_A59 += gt[80]; + m_A59 += gt[81]; + m_A59 += gt[82]; + m_A60 += go[80]; + double RHS19 = Idr[80]; + RHS19 += Idr[81]; + RHS19 += Idr[82]; + RHS19 -= go[81] * *cnV[81]; + RHS19 -= go[82] * *cnV[82]; + m_A61 += gt[83]; + m_A61 += gt[84]; + m_A61 += gt[85]; + m_A62 += go[83]; + double RHS20 = Idr[83]; + RHS20 += Idr[84]; + RHS20 += Idr[85]; + RHS20 -= go[84] * *cnV[84]; + RHS20 -= go[85] * *cnV[85]; + m_A63 += gt[86]; + m_A63 += gt[87]; + m_A64 += go[86]; + double RHS21 = Idr[86]; + RHS21 += Idr[87]; + RHS21 -= go[87] * *cnV[87]; + m_A65 += gt[88]; + m_A65 += gt[89]; + m_A65 += gt[90]; + m_A65 += gt[91]; + m_A67 += go[88]; + m_A66 += go[89]; + double RHS22 = Idr[88]; + RHS22 += Idr[89]; + RHS22 += Idr[90]; + RHS22 += Idr[91]; + RHS22 -= go[90] * *cnV[90]; + RHS22 -= go[91] * *cnV[91]; + m_A68 += gt[92]; + m_A68 += gt[93]; + m_A68 += gt[94]; + m_A68 += gt[95]; + m_A68 += gt[96]; + m_A68 += gt[97]; + m_A68 += gt[98]; + m_A70 += go[92]; + m_A69 += go[93]; + double RHS23 = Idr[92]; + RHS23 += Idr[93]; + RHS23 += Idr[94]; + RHS23 += Idr[95]; + RHS23 += Idr[96]; + RHS23 += Idr[97]; + RHS23 += Idr[98]; + RHS23 -= go[94] * *cnV[94]; + RHS23 -= go[95] * *cnV[95]; + RHS23 -= go[96] * *cnV[96]; + RHS23 -= go[97] * *cnV[97]; + RHS23 -= go[98] * *cnV[98]; + m_A71 += gt[99]; + m_A71 += gt[100]; + m_A72 += go[99]; + double RHS24 = Idr[99]; + RHS24 += Idr[100]; + RHS24 -= go[100] * *cnV[100]; + m_A73 += gt[101]; + m_A73 += gt[102]; + m_A73 += gt[103]; + m_A74 += go[101]; + double RHS25 = Idr[101]; + RHS25 += Idr[102]; + RHS25 += Idr[103]; + RHS25 -= go[102] * *cnV[102]; + RHS25 -= go[103] * *cnV[103]; + m_A75 += gt[104]; + m_A75 += gt[105]; + m_A75 += gt[106]; + m_A75 += gt[107]; + m_A75 += gt[108]; + m_A75 += gt[109]; + m_A75 += gt[110]; + m_A76 += go[104]; + double RHS26 = Idr[104]; + RHS26 += Idr[105]; + RHS26 += Idr[106]; + RHS26 += Idr[107]; + RHS26 += Idr[108]; + RHS26 += Idr[109]; + RHS26 += Idr[110]; + RHS26 -= go[105] * *cnV[105]; + RHS26 -= go[106] * *cnV[106]; + RHS26 -= go[107] * *cnV[107]; + RHS26 -= go[108] * *cnV[108]; + RHS26 -= go[109] * *cnV[109]; + RHS26 -= go[110] * *cnV[110]; + m_A77 += gt[111]; + m_A77 += gt[112]; + m_A77 += gt[113]; + m_A77 += gt[114]; + m_A77 += gt[115]; + m_A79 += go[111]; + m_A78 += go[112]; + m_A80 += go[113]; + double RHS27 = Idr[111]; + RHS27 += Idr[112]; + RHS27 += Idr[113]; + RHS27 += Idr[114]; + RHS27 += Idr[115]; + RHS27 -= go[114] * *cnV[114]; + RHS27 -= go[115] * *cnV[115]; + m_A81 += gt[116]; + m_A81 += gt[117]; + m_A81 += gt[118]; + m_A81 += gt[119]; + m_A81 += gt[120]; + m_A81 += gt[121]; + m_A82 += go[116]; + m_A83 += go[117]; + m_A83 += go[118]; + double RHS28 = Idr[116]; + RHS28 += Idr[117]; + RHS28 += Idr[118]; + RHS28 += Idr[119]; + RHS28 += Idr[120]; + RHS28 += Idr[121]; + RHS28 -= go[119] * *cnV[119]; + RHS28 -= go[120] * *cnV[120]; + RHS28 -= go[121] * *cnV[121]; + m_A84 += gt[122]; + m_A84 += gt[123]; + m_A84 += gt[124]; + m_A84 += gt[125]; + m_A85 += go[122]; + m_A87 += go[123]; + m_A86 += go[124]; + double RHS29 = Idr[122]; + RHS29 += Idr[123]; + RHS29 += Idr[124]; + RHS29 += Idr[125]; + RHS29 -= go[125] * *cnV[125]; + m_A88 += gt[126]; + m_A88 += gt[127]; + m_A88 += gt[128]; + m_A88 += gt[129]; + m_A89 += go[126]; + m_A90 += go[127]; + double RHS30 = Idr[126]; + RHS30 += Idr[127]; + RHS30 += Idr[128]; + RHS30 += Idr[129]; + RHS30 -= go[128] * *cnV[128]; + RHS30 -= go[129] * *cnV[129]; + m_A91 += gt[130]; + m_A91 += gt[131]; + m_A91 += gt[132]; + m_A91 += gt[133]; + m_A91 += gt[134]; + m_A92 += go[130]; + m_A94 += go[131]; + m_A93 += go[132]; + double RHS31 = Idr[130]; + RHS31 += Idr[131]; + RHS31 += Idr[132]; + RHS31 += Idr[133]; + RHS31 += Idr[134]; + RHS31 -= go[133] * *cnV[133]; + RHS31 -= go[134] * *cnV[134]; + m_A95 += gt[135]; + m_A95 += gt[136]; + m_A96 += go[135]; + m_A97 += go[136]; + double RHS32 = Idr[135]; + RHS32 += Idr[136]; + m_A98 += gt[137]; + m_A98 += gt[138]; + m_A98 += gt[139]; + m_A98 += gt[140]; + m_A98 += gt[141]; + m_A100 += go[137]; + m_A100 += go[138]; + m_A99 += go[139]; + double RHS33 = Idr[137]; + RHS33 += Idr[138]; + RHS33 += Idr[139]; + RHS33 += Idr[140]; + RHS33 += Idr[141]; + RHS33 -= go[140] * *cnV[140]; + RHS33 -= go[141] * *cnV[141]; + m_A101 += gt[142]; + m_A101 += gt[143]; + m_A103 += go[142]; + m_A102 += go[143]; + double RHS34 = Idr[142]; + RHS34 += Idr[143]; + m_A104 += gt[144]; + m_A104 += gt[145]; + m_A106 += go[144]; + m_A105 += go[145]; + double RHS35 = Idr[144]; + RHS35 += Idr[145]; + m_A107 += gt[146]; + m_A107 += gt[147]; + m_A108 += go[146]; + double RHS36 = Idr[146]; + RHS36 += Idr[147]; + RHS36 -= go[147] * *cnV[147]; + m_A110 += gt[148]; + m_A110 += gt[149]; + m_A110 += gt[150]; + m_A109 += go[148]; + m_A111 += go[149]; + double RHS37 = Idr[148]; + RHS37 += Idr[149]; + RHS37 += Idr[150]; + RHS37 -= go[150] * *cnV[150]; + m_A114 += gt[151]; + m_A114 += gt[152]; + m_A114 += gt[153]; + m_A114 += gt[154]; + m_A113 += go[151]; + m_A112 += go[152]; + double RHS38 = Idr[151]; + RHS38 += Idr[152]; + RHS38 += Idr[153]; + RHS38 += Idr[154]; + RHS38 -= go[153] * *cnV[153]; + RHS38 -= go[154] * *cnV[154]; + m_A120 += gt[155]; + m_A120 += gt[156]; + m_A120 += gt[157]; + m_A120 += gt[158]; + m_A118 += go[155]; + m_A117 += go[156]; + double RHS39 = Idr[155]; + RHS39 += Idr[156]; + RHS39 += Idr[157]; + RHS39 += Idr[158]; + RHS39 -= go[157] * *cnV[157]; + RHS39 -= go[158] * *cnV[158]; + m_A130 += gt[159]; + m_A130 += gt[160]; + m_A130 += gt[161]; + m_A130 += gt[162]; + m_A127 += go[159]; + m_A126 += go[160]; + m_A125 += go[161]; + double RHS40 = Idr[159]; + RHS40 += Idr[160]; + RHS40 += Idr[161]; + RHS40 += Idr[162]; + RHS40 -= go[162] * *cnV[162]; + m_A137 += gt[163]; + m_A137 += gt[164]; + m_A137 += gt[165]; + m_A136 += go[163]; + m_A135 += go[164]; + double RHS41 = Idr[163]; + RHS41 += Idr[164]; + RHS41 += Idr[165]; + RHS41 -= go[165] * *cnV[165]; + m_A140 += gt[166]; + m_A140 += gt[167]; + m_A140 += gt[168]; + m_A140 += gt[169]; + m_A142 += go[166]; + m_A142 += go[167]; + m_A141 += go[168]; + double RHS42 = Idr[166]; + RHS42 += Idr[167]; + RHS42 += Idr[168]; + RHS42 += Idr[169]; + RHS42 -= go[169] * *cnV[169]; + m_A144 += gt[170]; + m_A144 += gt[171]; + m_A144 += gt[172]; + m_A144 += gt[173]; + m_A144 += gt[174]; + m_A144 += gt[175]; + m_A144 += gt[176]; + m_A145 += go[170]; + m_A143 += go[171]; + double RHS43 = Idr[170]; + RHS43 += Idr[171]; + RHS43 += Idr[172]; + RHS43 += Idr[173]; + RHS43 += Idr[174]; + RHS43 += Idr[175]; + RHS43 += Idr[176]; + RHS43 -= go[172] * *cnV[172]; + RHS43 -= go[173] * *cnV[173]; + RHS43 -= go[174] * *cnV[174]; + RHS43 -= go[175] * *cnV[175]; + RHS43 -= go[176] * *cnV[176]; + m_A149 += gt[177]; + m_A149 += gt[178]; + m_A149 += gt[179]; + m_A149 += gt[180]; + m_A147 += go[177]; + m_A148 += go[178]; + m_A150 += go[179]; + double RHS44 = Idr[177]; + RHS44 += Idr[178]; + RHS44 += Idr[179]; + RHS44 += Idr[180]; + RHS44 -= go[180] * *cnV[180]; + m_A153 += gt[181]; + m_A153 += gt[182]; + m_A153 += gt[183]; + m_A153 += gt[184]; + m_A153 += gt[185]; + m_A151 += go[181]; + m_A156 += go[182]; + m_A152 += go[183]; + double RHS45 = Idr[181]; + RHS45 += Idr[182]; + RHS45 += Idr[183]; + RHS45 += Idr[184]; + RHS45 += Idr[185]; + RHS45 -= go[184] * *cnV[184]; + RHS45 -= go[185] * *cnV[185]; + m_A161 += gt[186]; + m_A161 += gt[187]; + m_A161 += gt[188]; + m_A159 += go[186]; + m_A158 += go[187]; + m_A157 += go[188]; + double RHS46 = Idr[186]; + RHS46 += Idr[187]; + RHS46 += Idr[188]; + m_A166 += gt[189]; + m_A166 += gt[190]; + m_A166 += gt[191]; + m_A167 += go[189]; + m_A165 += go[190]; + double RHS47 = Idr[189]; + RHS47 += Idr[190]; + RHS47 += Idr[191]; + RHS47 -= go[191] * *cnV[191]; + m_A171 += gt[192]; + m_A171 += gt[193]; + m_A171 += gt[194]; + m_A174 += go[192]; + m_A169 += go[193]; + m_A168 += go[194]; + double RHS48 = Idr[192]; + RHS48 += Idr[193]; + RHS48 += Idr[194]; + m_A177 += gt[195]; + m_A177 += gt[196]; + m_A177 += gt[197]; + m_A177 += gt[198]; + m_A176 += go[195]; + m_A175 += go[196]; + double RHS49 = Idr[195]; + RHS49 += Idr[196]; + RHS49 += Idr[197]; + RHS49 += Idr[198]; + RHS49 -= go[197] * *cnV[197]; + RHS49 -= go[198] * *cnV[198]; + m_A185 += gt[199]; + m_A185 += gt[200]; + m_A185 += gt[201]; + m_A185 += gt[202]; + m_A185 += gt[203]; + m_A185 += gt[204]; + m_A189 += go[199]; + m_A182 += go[200]; + m_A181 += go[201]; + m_A180 += go[202]; + m_A187 += go[203]; + double RHS50 = Idr[199]; + RHS50 += Idr[200]; + RHS50 += Idr[201]; + RHS50 += Idr[202]; + RHS50 += Idr[203]; + RHS50 += Idr[204]; + RHS50 -= go[204] * *cnV[204]; + m_A191 += gt[205]; + m_A191 += gt[206]; + m_A193 += go[205]; + m_A190 += go[206]; + double RHS51 = Idr[205]; + RHS51 += Idr[206]; + m_A196 += gt[207]; + m_A196 += gt[208]; + m_A196 += gt[209]; + m_A196 += gt[210]; + m_A196 += gt[211]; + m_A197 += go[207]; + m_A198 += go[208]; + m_A194 += go[209]; + double RHS52 = Idr[207]; + RHS52 += Idr[208]; + RHS52 += Idr[209]; + RHS52 += Idr[210]; + RHS52 += Idr[211]; + RHS52 -= go[210] * *cnV[210]; + RHS52 -= go[211] * *cnV[211]; + m_A202 += gt[212]; + m_A202 += gt[213]; + m_A202 += gt[214]; + m_A202 += gt[215]; + m_A202 += gt[216]; + m_A202 += gt[217]; + m_A202 += gt[218]; + m_A203 += go[212]; + m_A201 += go[213]; + double RHS53 = Idr[212]; + RHS53 += Idr[213]; + RHS53 += Idr[214]; + RHS53 += Idr[215]; + RHS53 += Idr[216]; + RHS53 += Idr[217]; + RHS53 += Idr[218]; + RHS53 -= go[214] * *cnV[214]; + RHS53 -= go[215] * *cnV[215]; + RHS53 -= go[216] * *cnV[216]; + RHS53 -= go[217] * *cnV[217]; + RHS53 -= go[218] * *cnV[218]; + m_A206 += gt[219]; + m_A206 += gt[220]; + m_A206 += gt[221]; + m_A207 += go[219]; + m_A205 += go[220]; + double RHS54 = Idr[219]; + RHS54 += Idr[220]; + RHS54 += Idr[221]; + RHS54 -= go[221] * *cnV[221]; + m_A211 += gt[222]; + m_A211 += gt[223]; + m_A211 += gt[224]; + m_A211 += gt[225]; + m_A209 += go[222]; + m_A209 += go[223]; + m_A208 += go[224]; + double RHS55 = Idr[222]; + RHS55 += Idr[223]; + RHS55 += Idr[224]; + RHS55 += Idr[225]; + RHS55 -= go[225] * *cnV[225]; + m_A218 += gt[226]; + m_A218 += gt[227]; + m_A218 += gt[228]; + m_A218 += gt[229]; + m_A218 += gt[230]; + m_A218 += gt[231]; + m_A218 += gt[232]; + m_A217 += go[226]; + m_A216 += go[227]; + m_A219 += go[228]; + m_A215 += go[229]; + double RHS56 = Idr[226]; + RHS56 += Idr[227]; + RHS56 += Idr[228]; + RHS56 += Idr[229]; + RHS56 += Idr[230]; + RHS56 += Idr[231]; + RHS56 += Idr[232]; + RHS56 -= go[230] * *cnV[230]; + RHS56 -= go[231] * *cnV[231]; + RHS56 -= go[232] * *cnV[232]; + m_A220 += gt[233]; + m_A220 += gt[234]; + m_A222 += go[233]; + m_A221 += go[234]; + double RHS57 = Idr[233]; + RHS57 += Idr[234]; + m_A227 += gt[235]; + m_A227 += gt[236]; + m_A227 += gt[237]; + m_A227 += gt[238]; + m_A227 += gt[239]; + m_A227 += gt[240]; + m_A227 += gt[241]; + m_A223 += go[235]; + m_A225 += go[236]; + m_A229 += go[237]; + m_A231 += go[238]; + m_A230 += go[239]; + double RHS58 = Idr[235]; + RHS58 += Idr[236]; + RHS58 += Idr[237]; + RHS58 += Idr[238]; + RHS58 += Idr[239]; + RHS58 += Idr[240]; + RHS58 += Idr[241]; + RHS58 -= go[240] * *cnV[240]; + RHS58 -= go[241] * *cnV[241]; + m_A237 += gt[242]; + m_A237 += gt[243]; + m_A240 += go[242]; + m_A233 += go[243]; + double RHS59 = Idr[242]; + RHS59 += Idr[243]; + m_A245 += gt[244]; + m_A245 += gt[245]; + m_A242 += go[244]; + m_A241 += go[245]; + double RHS60 = Idr[244]; + RHS60 += Idr[245]; + m_A253 += gt[246]; + m_A253 += gt[247]; + m_A252 += go[246]; + m_A251 += go[247]; + double RHS61 = Idr[246]; + RHS61 += Idr[247]; + m_A258 += gt[248]; + m_A258 += gt[249]; + m_A258 += gt[250]; + m_A258 += gt[251]; + m_A258 += gt[252]; + m_A258 += gt[253]; + m_A258 += gt[254]; + m_A256 += go[248]; + m_A257 += go[249]; + double RHS62 = Idr[248]; + RHS62 += Idr[249]; + RHS62 += Idr[250]; + RHS62 += Idr[251]; + RHS62 += Idr[252]; + RHS62 += Idr[253]; + RHS62 += Idr[254]; + RHS62 -= go[250] * *cnV[250]; + RHS62 -= go[251] * *cnV[251]; + RHS62 -= go[252] * *cnV[252]; + RHS62 -= go[253] * *cnV[253]; + RHS62 -= go[254] * *cnV[254]; + m_A262 += gt[255]; + m_A262 += gt[256]; + m_A261 += go[255]; + m_A260 += go[256]; + double RHS63 = Idr[255]; + RHS63 += Idr[256]; + m_A265 += gt[257]; + m_A265 += gt[258]; + m_A267 += go[257]; + m_A264 += go[258]; + double RHS64 = Idr[257]; + RHS64 += Idr[258]; + m_A276 += gt[259]; + m_A276 += gt[260]; + m_A276 += gt[261]; + m_A276 += gt[262]; + m_A270 += go[259]; + m_A269 += go[260]; + m_A268 += go[261]; + m_A271 += go[262]; + double RHS65 = Idr[259]; + RHS65 += Idr[260]; + RHS65 += Idr[261]; + RHS65 += Idr[262]; + m_A288 += gt[263]; + m_A288 += gt[264]; + m_A288 += gt[265]; + m_A288 += gt[266]; + m_A288 += gt[267]; + m_A288 += gt[268]; + m_A281 += go[263]; + m_A283 += go[264]; + m_A285 += go[265]; + m_A280 += go[266]; + double RHS66 = Idr[263]; + RHS66 += Idr[264]; + RHS66 += Idr[265]; + RHS66 += Idr[266]; + RHS66 += Idr[267]; + RHS66 += Idr[268]; + RHS66 -= go[267] * *cnV[267]; + RHS66 -= go[268] * *cnV[268]; + m_A298 += gt[269]; + m_A298 += gt[270]; + m_A298 += gt[271]; + m_A298 += gt[272]; + m_A298 += gt[273]; + m_A298 += gt[274]; + m_A296 += go[269]; + m_A301 += go[270]; + m_A293 += go[271]; + m_A291 += go[272]; + m_A292 += go[273]; + double RHS67 = Idr[269]; + RHS67 += Idr[270]; + RHS67 += Idr[271]; + RHS67 += Idr[272]; + RHS67 += Idr[273]; + RHS67 += Idr[274]; + RHS67 -= go[274] * *cnV[274]; + m_A309 += gt[275]; + m_A309 += gt[276]; + m_A309 += gt[277]; + m_A309 += gt[278]; + m_A303 += go[275]; + m_A302 += go[276]; + m_A306 += go[277]; + m_A304 += go[278]; + double RHS68 = Idr[275]; + RHS68 += Idr[276]; + RHS68 += Idr[277]; + RHS68 += Idr[278]; + m_A320 += gt[279]; + m_A320 += gt[280]; + m_A320 += gt[281]; + m_A320 += gt[282]; + m_A320 += gt[283]; + m_A320 += gt[284]; + m_A313 += go[279]; + m_A312 += go[280]; + m_A316 += go[281]; + m_A317 += go[282]; + double RHS69 = Idr[279]; + RHS69 += Idr[280]; + RHS69 += Idr[281]; + RHS69 += Idr[282]; + RHS69 += Idr[283]; + RHS69 += Idr[284]; + RHS69 -= go[283] * *cnV[283]; + RHS69 -= go[284] * *cnV[284]; + m_A326 += gt[285]; + m_A326 += gt[286]; + m_A326 += gt[287]; + m_A326 += gt[288]; + m_A326 += gt[289]; + m_A326 += gt[290]; + m_A322 += go[285]; + m_A324 += go[286]; + m_A323 += go[287]; + m_A323 += go[288]; + double RHS70 = Idr[285]; + RHS70 += Idr[286]; + RHS70 += Idr[287]; + RHS70 += Idr[288]; + RHS70 += Idr[289]; + RHS70 += Idr[290]; + RHS70 -= go[289] * *cnV[289]; + RHS70 -= go[290] * *cnV[290]; + m_A333 += gt[291]; + m_A333 += gt[292]; + m_A333 += gt[293]; + m_A329 += go[291]; + m_A328 += go[292]; + m_A331 += go[293]; + double RHS71 = Idr[291]; + RHS71 += Idr[292]; + RHS71 += Idr[293]; + m_A348 += gt[294]; + m_A348 += gt[295]; + m_A348 += gt[296]; + m_A343 += go[294]; + m_A338 += go[295]; + m_A340 += go[296]; + double RHS72 = Idr[294]; + RHS72 += Idr[295]; + RHS72 += Idr[296]; + m_A360 += gt[297]; + m_A360 += gt[298]; + m_A360 += gt[299]; + m_A352 += go[297]; + m_A356 += go[298]; + m_A353 += go[299]; + double RHS73 = Idr[297]; + RHS73 += Idr[298]; + RHS73 += Idr[299]; + m_A377 += gt[300]; + m_A377 += gt[301]; + m_A377 += gt[302]; + m_A377 += gt[303]; + m_A377 += gt[304]; + m_A377 += gt[305]; + m_A365 += go[300]; + m_A364 += go[301]; + m_A366 += go[302]; + m_A363 += go[303]; + m_A370 += go[304]; + m_A367 += go[305]; + double RHS74 = Idr[300]; + RHS74 += Idr[301]; + RHS74 += Idr[302]; + RHS74 += Idr[303]; + RHS74 += Idr[304]; + RHS74 += Idr[305]; + m_A398 += gt[306]; + m_A398 += gt[307]; + m_A398 += gt[308]; + m_A398 += gt[309]; + m_A398 += gt[310]; + m_A398 += gt[311]; + m_A398 += gt[312]; + m_A398 += gt[313]; + m_A398 += gt[314]; + m_A398 += gt[315]; + m_A381 += go[306]; + m_A381 += go[307]; + m_A382 += go[308]; + m_A380 += go[309]; + m_A391 += go[310]; + m_A379 += go[311]; + m_A386 += go[312]; + double RHS75 = Idr[306]; + RHS75 += Idr[307]; + RHS75 += Idr[308]; + RHS75 += Idr[309]; + RHS75 += Idr[310]; + RHS75 += Idr[311]; + RHS75 += Idr[312]; + RHS75 += Idr[313]; + RHS75 += Idr[314]; + RHS75 += Idr[315]; + RHS75 -= go[313] * *cnV[313]; + RHS75 -= go[314] * *cnV[314]; + RHS75 -= go[315] * *cnV[315]; + const double f0 = 1.0 / m_A0; + const double f0_38 = -f0 * m_A112; + m_A114 += m_A1 * f0_38; + RHS38 += f0_38 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_37 = -f1 * m_A109; + m_A110 += m_A3 * f1_37; + RHS37 += f1_37 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_38 = -f2 * m_A113; + m_A114 += m_A5 * f2_38; + m_A115 += m_A6 * f2_38; + m_A116 += m_A7 * f2_38; + RHS38 += f2_38 * RHS2; + const double f2_39 = -f2 * m_A117; + m_A119 += m_A5 * f2_39; + m_A120 += m_A6 * f2_39; + m_A121 += m_A7 * f2_39; + RHS39 += f2_39 * RHS2; + const double f2_40 = -f2 * m_A125; + m_A128 += m_A5 * f2_40; + m_A129 += m_A6 * f2_40; + m_A130 += m_A7 * f2_40; + RHS40 += f2_40 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_44 = -f3 * m_A147; + m_A149 += m_A9 * f3_44; + RHS44 += f3_44 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_50 = -f4 * m_A180; + m_A185 += m_A11 * f4_50; + m_A187 += m_A12 * f4_50; + RHS50 += f4_50 * RHS4; + const double f4_68 = -f4 * m_A302; + m_A306 += m_A11 * f4_68; + m_A309 += m_A12 * f4_68; + RHS68 += f4_68 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_44 = -f5 * m_A148; + m_A149 += m_A14 * f5_44; + m_A150 += m_A15 * f5_44; + RHS44 += f5_44 * RHS5; + const double f5_67 = -f5 * m_A291; + m_A296 += m_A14 * f5_67; + m_A298 += m_A15 * f5_67; + RHS67 += f5_67 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_47 = -f6 * m_A165; + m_A166 += m_A17 * f6_47; + RHS47 += f6_47 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_39 = -f7 * m_A118; + m_A120 += m_A19 * f7_39; + m_A122 += m_A20 * f7_39; + m_A123 += m_A21 * f7_39; + m_A124 += m_A22 * f7_39; + RHS39 += f7_39 * RHS7; + const double f7_50 = -f7 * m_A181; + m_A183 += m_A19 * f7_50; + m_A185 += m_A20 * f7_50; + m_A186 += m_A21 * f7_50; + m_A189 += m_A22 * f7_50; + RHS50 += f7_50 * RHS7; + const double f7_67 = -f7 * m_A292; + m_A294 += m_A19 * f7_67; + m_A297 += m_A20 * f7_67; + m_A298 += m_A21 * f7_67; + m_A301 += m_A22 * f7_67; + RHS67 += f7_67 * RHS7; + const double f7_75 = -f7 * m_A379; + m_A383 += m_A19 * f7_75; + m_A386 += m_A20 * f7_75; + m_A391 += m_A21 * f7_75; + m_A398 += m_A22 * f7_75; + RHS75 += f7_75 * RHS7; + const double f8 = 1.0 / m_A23; + const double f8_40 = -f8 * m_A126; + m_A130 += m_A24 * f8_40; + m_A131 += m_A25 * f8_40; + m_A132 += m_A26 * f8_40; + m_A134 += m_A27 * f8_40; + RHS40 += f8_40 * RHS8; + const double f8_50 = -f8 * m_A182; + m_A184 += m_A24 * f8_50; + m_A185 += m_A25 * f8_50; + m_A186 += m_A26 * f8_50; + m_A189 += m_A27 * f8_50; + RHS50 += f8_50 * RHS8; + const double f8_67 = -f8 * m_A293; + m_A295 += m_A24 * f8_67; + m_A297 += m_A25 * f8_67; + m_A298 += m_A26 * f8_67; + m_A301 += m_A27 * f8_67; + RHS67 += f8_67 * RHS8; + const double f8_75 = -f8 * m_A380; + m_A384 += m_A24 * f8_75; + m_A386 += m_A25 * f8_75; + m_A391 += m_A26 * f8_75; + m_A398 += m_A27 * f8_75; + RHS75 += f8_75 * RHS8; + const double f9 = 1.0 / m_A28; + const double f9_51 = -f9 * m_A190; + m_A191 += m_A29 * f9_51; + m_A192 += m_A30 * f9_51; + RHS51 += f9_51 * RHS9; + const double f9_65 = -f9 * m_A268; + m_A273 += m_A29 * f9_65; + m_A276 += m_A30 * f9_65; + RHS65 += f9_65 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_45 = -f10 * m_A151; + m_A152 += m_A32 * f10_45; + m_A155 += m_A33 * f10_45; + RHS45 += f10_45 * RHS10; + const double f11 = 1.0 / m_A34; + const double f11_45 = -f11 * m_A152; + m_A153 += m_A35 * f11_45; + m_A154 += m_A36 * f11_45; + m_A155 += m_A37 * f11_45; + RHS45 += f11_45 * RHS11; + const double f11_52 = -f11 * m_A194; + m_A195 += m_A35 * f11_52; + m_A196 += m_A36 * f11_52; + m_A199 += m_A37 * f11_52; + RHS52 += f11_52 * RHS11; + const double f11_72 = -f11 * m_A338; + m_A339 += m_A35 * f11_72; + m_A341 += m_A36 * f11_72; + m_A348 += m_A37 * f11_72; + RHS72 += f11_72 * RHS11; + const double f12 = 1.0 / m_A38; + const double f12_58 = -f12 * m_A223; + m_A224 += m_A39 * f12_58; + m_A231 += m_A40 * f12_58; + RHS58 += f12_58 * RHS12; + const double f13 = 1.0 / m_A41; + const double f13_48 = -f13 * m_A168; + m_A171 += m_A42 * f13_48; + m_A173 += m_A43 * f13_48; + m_A174 += m_A44 * f13_48; + RHS48 += f13_48 * RHS13; + const double f13_65 = -f13 * m_A269; + m_A272 += m_A42 * f13_65; + m_A276 += m_A43 * f13_65; + m_A277 += m_A44 * f13_65; + RHS65 += f13_65 * RHS13; + const double f13_66 = -f13 * m_A280; + m_A285 += m_A42 * f13_66; + m_A287 += m_A43 * f13_66; + m_A288 += m_A44 * f13_66; + RHS66 += f13_66 * RHS13; + const double f14 = 1.0 / m_A45; + const double f14_53 = -f14 * m_A201; + m_A203 += m_A46 * f14_53; + m_A204 += m_A47 * f14_53; + RHS53 += f14_53 * RHS14; + const double f14_58 = -f14 * m_A224; + m_A229 += m_A46 * f14_58; + m_A231 += m_A47 * f14_58; + RHS58 += f14_58 * RHS14; + const double f14_71 = -f14 * m_A328; + m_A333 += m_A46 * f14_71; + m_A335 += m_A47 * f14_71; + RHS71 += f14_71 * RHS14; + const double f14_73 = -f14 * m_A352; + m_A358 += m_A46 * f14_73; + m_A360 += m_A47 * f14_73; + RHS73 += f14_73 * RHS14; + const double f15 = 1.0 / m_A48; + const double f15_66 = -f15 * m_A281; + m_A282 += m_A49 * f15_66; + m_A285 += m_A50 * f15_66; + RHS66 += f15_66 * RHS15; + const double f16 = 1.0 / m_A51; + const double f16_43 = -f16 * m_A143; + m_A145 += m_A52 * f16_43; + m_A146 += m_A53 * f16_43; + RHS43 += f16_43 * RHS16; + const double f16_46 = -f16 * m_A157; + m_A161 += m_A52 * f16_46; + m_A162 += m_A53 * f16_46; + RHS46 += f16_46 * RHS16; + const double f16_48 = -f16 * m_A169; + m_A170 += m_A52 * f16_48; + m_A171 += m_A53 * f16_48; + RHS48 += f16_48 * RHS16; + const double f16_66 = -f16 * m_A282; + m_A284 += m_A52 * f16_66; + m_A285 += m_A53 * f16_66; + RHS66 += f16_66 * RHS16; + const double f17 = 1.0 / m_A54; + const double f17_63 = -f17 * m_A260; + m_A262 += m_A55 * f17_63; + RHS63 += f17_63 * RHS17; + const double f18 = 1.0 / m_A56; + const double f18_46 = -f18 * m_A158; + m_A161 += m_A57 * f18_46; + m_A164 += m_A58 * f18_46; + RHS46 += f18_46 * RHS18; + const double f18_66 = -f18 * m_A283; + m_A284 += m_A57 * f18_66; + m_A288 += m_A58 * f18_66; + RHS66 += f18_66 * RHS18; + const double f19 = 1.0 / m_A59; + const double f19_56 = -f19 * m_A215; + m_A218 += m_A60 * f19_56; + RHS56 += f19_56 * RHS19; + const double f20 = 1.0 / m_A61; + const double f20_54 = -f20 * m_A205; + m_A206 += m_A62 * f20_54; + RHS54 += f20_54 * RHS20; + const double f21 = 1.0 / m_A63; + const double f21_56 = -f21 * m_A216; + m_A218 += m_A64 * f21_56; + RHS56 += f21_56 * RHS21; + const double f22 = 1.0 / m_A65; + const double f22_40 = -f22 * m_A127; + m_A130 += m_A66 * f22_40; + m_A133 += m_A67 * f22_40; + RHS40 += f22_40 * RHS22; + const double f22_69 = -f22 * m_A312; + m_A314 += m_A66 * f22_69; + m_A320 += m_A67 * f22_69; + RHS69 += f22_69 * RHS22; + const double f23 = 1.0 / m_A68; + const double f23_69 = -f23 * m_A313; + m_A316 += m_A69 * f23_69; + m_A320 += m_A70 * f23_69; + RHS69 += f23_69 * RHS23; + const double f24 = 1.0 / m_A71; + const double f24_56 = -f24 * m_A217; + m_A218 += m_A72 * f24_56; + RHS56 += f24_56 * RHS24; + const double f25 = 1.0 / m_A73; + const double f25_41 = -f25 * m_A135; + m_A137 += m_A74 * f25_41; + RHS41 += f25_41 * RHS25; + const double f26 = 1.0 / m_A75; + const double f26_70 = -f26 * m_A322; + m_A323 += m_A76 * f26_70; + RHS70 += f26_70 * RHS26; + const double f27 = 1.0 / m_A77; + const double f27_41 = -f27 * m_A136; + m_A137 += m_A78 * f27_41; + m_A138 += m_A79 * f27_41; + m_A139 += m_A80 * f27_41; + RHS41 += f27_41 * RHS27; + const double f27_62 = -f27 * m_A256; + m_A257 += m_A78 * f27_62; + m_A258 += m_A79 * f27_62; + m_A259 += m_A80 * f27_62; + RHS62 += f27_62 * RHS27; + const double f27_68 = -f27 * m_A303; + m_A305 += m_A78 * f27_68; + m_A307 += m_A79 * f27_68; + m_A309 += m_A80 * f27_68; + RHS68 += f27_68 * RHS27; + const double f28 = 1.0 / m_A81; + const double f28_49 = -f28 * m_A175; + m_A177 += m_A82 * f28_49; + m_A179 += m_A83 * f28_49; + RHS49 += f28_49 * RHS28; + const double f28_75 = -f28 * m_A381; + m_A385 += m_A82 * f28_75; + m_A398 += m_A83 * f28_75; + RHS75 += f28_75 * RHS28; + const double f29 = 1.0 / m_A84; + const double f29_55 = -f29 * m_A208; + m_A211 += m_A85 * f29_55; + m_A212 += m_A86 * f29_55; + m_A213 += m_A87 * f29_55; + RHS55 += f29_55 * RHS29; + const double f29_58 = -f29 * m_A225; + m_A226 += m_A85 * f29_58; + m_A227 += m_A86 * f29_58; + m_A228 += m_A87 * f29_58; + RHS58 += f29_58 * RHS29; + const double f29_60 = -f29 * m_A241; + m_A243 += m_A85 * f29_60; + m_A244 += m_A86 * f29_60; + m_A245 += m_A87 * f29_60; + RHS60 += f29_60 * RHS29; + const double f30 = 1.0 / m_A88; + const double f30_61 = -f30 * m_A251; + m_A253 += m_A89 * f30_61; + m_A255 += m_A90 * f30_61; + RHS61 += f30_61 * RHS30; + const double f30_75 = -f30 * m_A382; + m_A390 += m_A89 * f30_75; + m_A398 += m_A90 * f30_75; + RHS75 += f30_75 * RHS30; + const double f31 = 1.0 / m_A91; + const double f31_46 = -f31 * m_A159; + m_A160 += m_A92 * f31_46; + m_A161 += m_A93 * f31_46; + m_A163 += m_A94 * f31_46; + RHS46 += f31_46 * RHS31; + const double f31_59 = -f31 * m_A233; + m_A234 += m_A92 * f31_59; + m_A235 += m_A93 * f31_59; + m_A237 += m_A94 * f31_59; + RHS59 += f31_59 * RHS31; + const double f32 = 1.0 / m_A95; + const double f32_64 = -f32 * m_A264; + m_A265 += m_A96 * f32_64; + m_A266 += m_A97 * f32_64; + RHS64 += f32_64 * RHS32; + const double f32_65 = -f32 * m_A270; + m_A275 += m_A96 * f32_65; + m_A276 += m_A97 * f32_65; + RHS65 += f32_65 * RHS32; + const double f33 = 1.0 / m_A98; + const double f33_49 = -f33 * m_A176; + m_A177 += m_A99 * f33_49; + m_A178 += m_A100 * f33_49; + RHS49 += f33_49 * RHS33; + const double f33_55 = -f33 * m_A209; + m_A210 += m_A99 * f33_55; + m_A211 += m_A100 * f33_55; + RHS55 += f33_55 * RHS33; + const double f34 = 1.0 / m_A101; + const double f34_60 = -f34 * m_A242; + m_A245 += m_A102 * f34_60; + m_A249 += m_A103 * f34_60; + RHS60 += f34_60 * RHS34; + const double f34_74 = -f34 * m_A363; + m_A368 += m_A102 * f34_74; + m_A377 += m_A103 * f34_74; + RHS74 += f34_74 * RHS34; + const double f35 = 1.0 / m_A104; + const double f35_61 = -f35 * m_A252; + m_A253 += m_A105 * f35_61; + m_A254 += m_A106 * f35_61; + RHS61 += f35_61 * RHS35; + const double f35_74 = -f35 * m_A364; + m_A369 += m_A105 * f35_74; + m_A377 += m_A106 * f35_74; + RHS74 += f35_74 * RHS35; + const double f36 = 1.0 / m_A107; + const double f36_74 = -f36 * m_A365; + m_A377 += m_A108 * f36_74; + RHS74 += f36_74 * RHS36; + const double f37 = 1.0 / m_A110; + const double f37_68 = -f37 * m_A304; + m_A309 += m_A111 * f37_68; + RHS68 += f37_68 * RHS37; + const double f38 = 1.0 / m_A114; + const double f38_39 = -f38 * m_A119; + m_A120 += m_A115 * f38_39; + m_A121 += m_A116 * f38_39; + RHS39 += f38_39 * RHS38; + const double f38_40 = -f38 * m_A128; + m_A129 += m_A115 * f38_40; + m_A130 += m_A116 * f38_40; + RHS40 += f38_40 * RHS38; + const double f39 = 1.0 / m_A120; + const double f39_40 = -f39 * m_A129; + m_A130 += m_A121 * f39_40; + m_A131 += m_A122 * f39_40; + m_A132 += m_A123 * f39_40; + m_A134 += m_A124 * f39_40; + RHS40 += f39_40 * RHS39; + const double f39_50 = -f39 * m_A183; + m_A184 += m_A121 * f39_50; + m_A185 += m_A122 * f39_50; + m_A186 += m_A123 * f39_50; + m_A189 += m_A124 * f39_50; + RHS50 += f39_50 * RHS39; + const double f39_67 = -f39 * m_A294; + m_A295 += m_A121 * f39_67; + m_A297 += m_A122 * f39_67; + m_A298 += m_A123 * f39_67; + m_A301 += m_A124 * f39_67; + RHS67 += f39_67 * RHS39; + const double f39_75 = -f39 * m_A383; + m_A384 += m_A121 * f39_75; + m_A386 += m_A122 * f39_75; + m_A391 += m_A123 * f39_75; + m_A398 += m_A124 * f39_75; + RHS75 += f39_75 * RHS39; + const double f40 = 1.0 / m_A130; + const double f40_50 = -f40 * m_A184; + m_A185 += m_A131 * f40_50; + m_A186 += m_A132 * f40_50; + m_A188 += m_A133 * f40_50; + m_A189 += m_A134 * f40_50; + RHS50 += f40_50 * RHS40; + const double f40_67 = -f40 * m_A295; + m_A297 += m_A131 * f40_67; + m_A298 += m_A132 * f40_67; + m_A300 += m_A133 * f40_67; + m_A301 += m_A134 * f40_67; + RHS67 += f40_67 * RHS40; + const double f40_69 = -f40 * m_A314; + m_A315 += m_A131 * f40_69; + m_A318 += m_A132 * f40_69; + m_A320 += m_A133 * f40_69; + m_A321 += m_A134 * f40_69; + RHS69 += f40_69 * RHS40; + const double f40_75 = -f40 * m_A384; + m_A386 += m_A131 * f40_75; + m_A391 += m_A132 * f40_75; + m_A393 += m_A133 * f40_75; + m_A398 += m_A134 * f40_75; + RHS75 += f40_75 * RHS40; + const double f41 = 1.0 / m_A137; + const double f41_62 = -f41 * m_A257; + m_A258 += m_A138 * f41_62; + m_A259 += m_A139 * f41_62; + RHS62 += f41_62 * RHS41; + const double f41_68 = -f41 * m_A305; + m_A307 += m_A138 * f41_68; + m_A309 += m_A139 * f41_68; + RHS68 += f41_68 * RHS41; + const double f42 = 1.0 / m_A140; + const double f42_63 = -f42 * m_A261; + m_A262 += m_A141 * f42_63; + m_A263 += m_A142 * f42_63; + RHS63 += f42_63 * RHS42; + const double f42_70 = -f42 * m_A323; + m_A325 += m_A141 * f42_70; + m_A326 += m_A142 * f42_70; + RHS70 += f42_70 * RHS42; + const double f43 = 1.0 / m_A144; + const double f43_46 = -f43 * m_A160; + m_A161 += m_A145 * f43_46; + m_A162 += m_A146 * f43_46; + RHS46 += f43_46 * RHS43; + const double f43_59 = -f43 * m_A234; + m_A235 += m_A145 * f43_59; + m_A236 += m_A146 * f43_59; + RHS59 += f43_59 * RHS43; + const double f44 = 1.0 / m_A149; + const double f44_67 = -f44 * m_A296; + m_A298 += m_A150 * f44_67; + RHS67 += f44_67 * RHS44; + const double f45 = 1.0 / m_A153; + const double f45_52 = -f45 * m_A195; + m_A196 += m_A154 * f45_52; + m_A199 += m_A155 * f45_52; + m_A200 += m_A156 * f45_52; + RHS52 += f45_52 * RHS45; + const double f45_72 = -f45 * m_A339; + m_A341 += m_A154 * f45_72; + m_A348 += m_A155 * f45_72; + m_A349 += m_A156 * f45_72; + RHS72 += f45_72 * RHS45; + const double f45_73 = -f45 * m_A353; + m_A354 += m_A154 * f45_73; + m_A359 += m_A155 * f45_73; + m_A360 += m_A156 * f45_73; + RHS73 += f45_73 * RHS45; + const double f46 = 1.0 / m_A161; + const double f46_48 = -f46 * m_A170; + m_A171 += m_A162 * f46_48; + m_A172 += m_A163 * f46_48; + m_A174 += m_A164 * f46_48; + RHS48 += f46_48 * RHS46; + const double f46_59 = -f46 * m_A235; + m_A236 += m_A162 * f46_59; + m_A237 += m_A163 * f46_59; + m_A239 += m_A164 * f46_59; + RHS59 += f46_59 * RHS46; + const double f46_66 = -f46 * m_A284; + m_A285 += m_A162 * f46_66; + m_A286 += m_A163 * f46_66; + m_A288 += m_A164 * f46_66; + RHS66 += f46_66 * RHS46; + const double f47 = 1.0 / m_A166; + const double f47_65 = -f47 * m_A271; + m_A276 += m_A167 * f47_65; + RHS65 += f47_65 * RHS47; + const double f48 = 1.0 / m_A171; + const double f48_59 = -f48 * m_A236; + m_A237 += m_A172 * f48_59; + m_A238 += m_A173 * f48_59; + m_A239 += m_A174 * f48_59; + RHS59 += f48_59 * RHS48; + const double f48_65 = -f48 * m_A272; + m_A274 += m_A172 * f48_65; + m_A276 += m_A173 * f48_65; + m_A277 += m_A174 * f48_65; + RHS65 += f48_65 * RHS48; + const double f48_66 = -f48 * m_A285; + m_A286 += m_A172 * f48_66; + m_A287 += m_A173 * f48_66; + m_A288 += m_A174 * f48_66; + RHS66 += f48_66 * RHS48; + const double f49 = 1.0 / m_A177; + const double f49_55 = -f49 * m_A210; + m_A211 += m_A178 * f49_55; + m_A214 += m_A179 * f49_55; + RHS55 += f49_55 * RHS49; + const double f49_75 = -f49 * m_A385; + m_A387 += m_A178 * f49_75; + m_A398 += m_A179 * f49_75; + RHS75 += f49_75 * RHS49; + const double f50 = 1.0 / m_A185; + const double f50_67 = -f50 * m_A297; + m_A298 += m_A186 * f50_67; + m_A299 += m_A187 * f50_67; + m_A300 += m_A188 * f50_67; + m_A301 += m_A189 * f50_67; + RHS67 += f50_67 * RHS50; + const double f50_68 = -f50 * m_A306; + m_A308 += m_A186 * f50_68; + m_A309 += m_A187 * f50_68; + m_A310 += m_A188 * f50_68; + m_A311 += m_A189 * f50_68; + RHS68 += f50_68 * RHS50; + const double f50_69 = -f50 * m_A315; + m_A318 += m_A186 * f50_69; + m_A319 += m_A187 * f50_69; + m_A320 += m_A188 * f50_69; + m_A321 += m_A189 * f50_69; + RHS69 += f50_69 * RHS50; + const double f50_75 = -f50 * m_A386; + m_A391 += m_A186 * f50_75; + m_A392 += m_A187 * f50_75; + m_A393 += m_A188 * f50_75; + m_A398 += m_A189 * f50_75; + RHS75 += f50_75 * RHS50; + const double f51 = 1.0 / m_A191; + const double f51_65 = -f51 * m_A273; + m_A276 += m_A192 * f51_65; + m_A278 += m_A193 * f51_65; + RHS65 += f51_65 * RHS51; + const double f51_72 = -f51 * m_A340; + m_A345 += m_A192 * f51_72; + m_A348 += m_A193 * f51_72; + RHS72 += f51_72 * RHS51; + const double f52 = 1.0 / m_A196; + const double f52_71 = -f52 * m_A329; + m_A330 += m_A197 * f52_71; + m_A333 += m_A198 * f52_71; + m_A334 += m_A199 * f52_71; + m_A335 += m_A200 * f52_71; + RHS71 += f52_71 * RHS52; + const double f52_72 = -f52 * m_A341; + m_A342 += m_A197 * f52_72; + m_A347 += m_A198 * f52_72; + m_A348 += m_A199 * f52_72; + m_A349 += m_A200 * f52_72; + RHS72 += f52_72 * RHS52; + const double f52_73 = -f52 * m_A354; + m_A355 += m_A197 * f52_73; + m_A358 += m_A198 * f52_73; + m_A359 += m_A199 * f52_73; + m_A360 += m_A200 * f52_73; + RHS73 += f52_73 * RHS52; + const double f53 = 1.0 / m_A202; + const double f53_71 = -f53 * m_A330; + m_A333 += m_A203 * f53_71; + m_A335 += m_A204 * f53_71; + RHS71 += f53_71 * RHS53; + const double f53_72 = -f53 * m_A342; + m_A347 += m_A203 * f53_72; + m_A349 += m_A204 * f53_72; + RHS72 += f53_72 * RHS53; + const double f53_73 = -f53 * m_A355; + m_A358 += m_A203 * f53_73; + m_A360 += m_A204 * f53_73; + RHS73 += f53_73 * RHS53; + const double f54 = 1.0 / m_A206; + const double f54_69 = -f54 * m_A316; + m_A320 += m_A207 * f54_69; + RHS69 += f54_69 * RHS54; + const double f55 = 1.0 / m_A211; + const double f55_58 = -f55 * m_A226; + m_A227 += m_A212 * f55_58; + m_A228 += m_A213 * f55_58; + m_A232 += m_A214 * f55_58; + RHS58 += f55_58 * RHS55; + const double f55_60 = -f55 * m_A243; + m_A244 += m_A212 * f55_60; + m_A245 += m_A213 * f55_60; + m_A250 += m_A214 * f55_60; + RHS60 += f55_60 * RHS55; + const double f55_75 = -f55 * m_A387; + m_A388 += m_A212 * f55_75; + m_A389 += m_A213 * f55_75; + m_A398 += m_A214 * f55_75; + RHS75 += f55_75 * RHS55; + const double f56 = 1.0 / m_A218; + const double f56_69 = -f56 * m_A317; + m_A320 += m_A219 * f56_69; + RHS69 += f56_69 * RHS56; + const double f57 = 1.0 / m_A220; + const double f57_70 = -f57 * m_A324; + m_A326 += m_A221 * f57_70; + m_A327 += m_A222 * f57_70; + RHS70 += f57_70 * RHS57; + const double f57_74 = -f57 * m_A366; + m_A373 += m_A221 * f57_74; + m_A377 += m_A222 * f57_74; + RHS74 += f57_74 * RHS57; + const double f58 = 1.0 / m_A227; + const double f58_60 = -f58 * m_A244; + m_A245 += m_A228 * f58_60; + m_A246 += m_A229 * f58_60; + m_A247 += m_A230 * f58_60; + m_A248 += m_A231 * f58_60; + m_A250 += m_A232 * f58_60; + RHS60 += f58_60 * RHS58; + const double f58_71 = -f58 * m_A331; + m_A332 += m_A228 * f58_71; + m_A333 += m_A229 * f58_71; + m_A334 += m_A230 * f58_71; + m_A335 += m_A231 * f58_71; + m_A337 += m_A232 * f58_71; + RHS71 += f58_71 * RHS58; + const double f58_72 = -f58 * m_A343; + m_A344 += m_A228 * f58_72; + m_A347 += m_A229 * f58_72; + m_A348 += m_A230 * f58_72; + m_A349 += m_A231 * f58_72; + m_A351 += m_A232 * f58_72; + RHS72 += f58_72 * RHS58; + const double f58_73 = -f58 * m_A356; + m_A357 += m_A228 * f58_73; + m_A358 += m_A229 * f58_73; + m_A359 += m_A230 * f58_73; + m_A360 += m_A231 * f58_73; + m_A362 += m_A232 * f58_73; + RHS73 += f58_73 * RHS58; + const double f58_75 = -f58 * m_A388; + m_A389 += m_A228 * f58_75; + m_A394 += m_A229 * f58_75; + m_A395 += m_A230 * f58_75; + m_A396 += m_A231 * f58_75; + m_A398 += m_A232 * f58_75; + RHS75 += f58_75 * RHS58; + const double f59 = 1.0 / m_A237; + const double f59_65 = -f59 * m_A274; + m_A276 += m_A238 * f59_65; + m_A277 += m_A239 * f59_65; + m_A279 += m_A240 * f59_65; + RHS65 += f59_65 * RHS59; + const double f59_66 = -f59 * m_A286; + m_A287 += m_A238 * f59_66; + m_A288 += m_A239 * f59_66; + m_A290 += m_A240 * f59_66; + RHS66 += f59_66 * RHS59; + const double f59_74 = -f59 * m_A367; + m_A371 += m_A238 * f59_74; + m_A372 += m_A239 * f59_74; + m_A377 += m_A240 * f59_74; + RHS74 += f59_74 * RHS59; + const double f60 = 1.0 / m_A245; + const double f60_71 = -f60 * m_A332; + m_A333 += m_A246 * f60_71; + m_A334 += m_A247 * f60_71; + m_A335 += m_A248 * f60_71; + m_A336 += m_A249 * f60_71; + m_A337 += m_A250 * f60_71; + RHS71 += f60_71 * RHS60; + const double f60_72 = -f60 * m_A344; + m_A347 += m_A246 * f60_72; + m_A348 += m_A247 * f60_72; + m_A349 += m_A248 * f60_72; + m_A350 += m_A249 * f60_72; + m_A351 += m_A250 * f60_72; + RHS72 += f60_72 * RHS60; + const double f60_73 = -f60 * m_A357; + m_A358 += m_A246 * f60_73; + m_A359 += m_A247 * f60_73; + m_A360 += m_A248 * f60_73; + m_A361 += m_A249 * f60_73; + m_A362 += m_A250 * f60_73; + RHS73 += f60_73 * RHS60; + const double f60_74 = -f60 * m_A368; + m_A374 += m_A246 * f60_74; + m_A375 += m_A247 * f60_74; + m_A376 += m_A248 * f60_74; + m_A377 += m_A249 * f60_74; + m_A378 += m_A250 * f60_74; + RHS74 += f60_74 * RHS60; + const double f60_75 = -f60 * m_A389; + m_A394 += m_A246 * f60_75; + m_A395 += m_A247 * f60_75; + m_A396 += m_A248 * f60_75; + m_A397 += m_A249 * f60_75; + m_A398 += m_A250 * f60_75; + RHS75 += f60_75 * RHS60; + const double f61 = 1.0 / m_A253; + const double f61_74 = -f61 * m_A369; + m_A377 += m_A254 * f61_74; + m_A378 += m_A255 * f61_74; + RHS74 += f61_74 * RHS61; + const double f61_75 = -f61 * m_A390; + m_A397 += m_A254 * f61_75; + m_A398 += m_A255 * f61_75; + RHS75 += f61_75 * RHS61; + const double f62 = 1.0 / m_A258; + const double f62_68 = -f62 * m_A307; + m_A309 += m_A259 * f62_68; + RHS68 += f62_68 * RHS62; + const double f63 = 1.0 / m_A262; + const double f63_70 = -f63 * m_A325; + m_A326 += m_A263 * f63_70; + RHS70 += f63_70 * RHS63; + const double f64 = 1.0 / m_A265; + const double f64_65 = -f64 * m_A275; + m_A276 += m_A266 * f64_65; + m_A279 += m_A267 * f64_65; + RHS65 += f64_65 * RHS64; + const double f64_74 = -f64 * m_A370; + m_A371 += m_A266 * f64_74; + m_A377 += m_A267 * f64_74; + RHS74 += f64_74 * RHS64; + const double f65 = 1.0 / m_A276; + const double f65_66 = -f65 * m_A287; + m_A288 += m_A277 * f65_66; + m_A289 += m_A278 * f65_66; + m_A290 += m_A279 * f65_66; + RHS66 += f65_66 * RHS65; + const double f65_72 = -f65 * m_A345; + m_A346 += m_A277 * f65_72; + m_A348 += m_A278 * f65_72; + m_A350 += m_A279 * f65_72; + RHS72 += f65_72 * RHS65; + const double f65_74 = -f65 * m_A371; + m_A372 += m_A277 * f65_74; + m_A375 += m_A278 * f65_74; + m_A377 += m_A279 * f65_74; + RHS74 += f65_74 * RHS65; + const double f66 = 1.0 / m_A288; + const double f66_72 = -f66 * m_A346; + m_A348 += m_A289 * f66_72; + m_A350 += m_A290 * f66_72; + RHS72 += f66_72 * RHS66; + const double f66_74 = -f66 * m_A372; + m_A375 += m_A289 * f66_74; + m_A377 += m_A290 * f66_74; + RHS74 += f66_74 * RHS66; + const double f67 = 1.0 / m_A298; + const double f67_68 = -f67 * m_A308; + m_A309 += m_A299 * f67_68; + m_A310 += m_A300 * f67_68; + m_A311 += m_A301 * f67_68; + RHS68 += f67_68 * RHS67; + const double f67_69 = -f67 * m_A318; + m_A319 += m_A299 * f67_69; + m_A320 += m_A300 * f67_69; + m_A321 += m_A301 * f67_69; + RHS69 += f67_69 * RHS67; + const double f67_75 = -f67 * m_A391; + m_A392 += m_A299 * f67_75; + m_A393 += m_A300 * f67_75; + m_A398 += m_A301 * f67_75; + RHS75 += f67_75 * RHS67; + const double f68 = 1.0 / m_A309; + const double f68_69 = -f68 * m_A319; + m_A320 += m_A310 * f68_69; + m_A321 += m_A311 * f68_69; + RHS69 += f68_69 * RHS68; + const double f68_75 = -f68 * m_A392; + m_A393 += m_A310 * f68_75; + m_A398 += m_A311 * f68_75; + RHS75 += f68_75 * RHS68; + const double f69 = 1.0 / m_A320; + const double f69_75 = -f69 * m_A393; + m_A398 += m_A321 * f69_75; + RHS75 += f69_75 * RHS69; + const double f70 = 1.0 / m_A326; + const double f70_74 = -f70 * m_A373; + m_A377 += m_A327 * f70_74; + RHS74 += f70_74 * RHS70; + const double f71 = 1.0 / m_A333; + const double f71_72 = -f71 * m_A347; + m_A348 += m_A334 * f71_72; + m_A349 += m_A335 * f71_72; + m_A350 += m_A336 * f71_72; + m_A351 += m_A337 * f71_72; + RHS72 += f71_72 * RHS71; + const double f71_73 = -f71 * m_A358; + m_A359 += m_A334 * f71_73; + m_A360 += m_A335 * f71_73; + m_A361 += m_A336 * f71_73; + m_A362 += m_A337 * f71_73; + RHS73 += f71_73 * RHS71; + const double f71_74 = -f71 * m_A374; + m_A375 += m_A334 * f71_74; + m_A376 += m_A335 * f71_74; + m_A377 += m_A336 * f71_74; + m_A378 += m_A337 * f71_74; + RHS74 += f71_74 * RHS71; + const double f71_75 = -f71 * m_A394; + m_A395 += m_A334 * f71_75; + m_A396 += m_A335 * f71_75; + m_A397 += m_A336 * f71_75; + m_A398 += m_A337 * f71_75; + RHS75 += f71_75 * RHS71; + const double f72 = 1.0 / m_A348; + const double f72_73 = -f72 * m_A359; + m_A360 += m_A349 * f72_73; + m_A361 += m_A350 * f72_73; + m_A362 += m_A351 * f72_73; + RHS73 += f72_73 * RHS72; + const double f72_74 = -f72 * m_A375; + m_A376 += m_A349 * f72_74; + m_A377 += m_A350 * f72_74; + m_A378 += m_A351 * f72_74; + RHS74 += f72_74 * RHS72; + const double f72_75 = -f72 * m_A395; + m_A396 += m_A349 * f72_75; + m_A397 += m_A350 * f72_75; + m_A398 += m_A351 * f72_75; + RHS75 += f72_75 * RHS72; + const double f73 = 1.0 / m_A360; + const double f73_74 = -f73 * m_A376; + m_A377 += m_A361 * f73_74; + m_A378 += m_A362 * f73_74; + RHS74 += f73_74 * RHS73; + const double f73_75 = -f73 * m_A396; + m_A397 += m_A361 * f73_75; + m_A398 += m_A362 * f73_75; + RHS75 += f73_75 * RHS73; + const double f74 = 1.0 / m_A377; + const double f74_75 = -f74 * m_A397; + m_A398 += m_A378 * f74_75; + RHS75 += f74_75 * RHS74; + V[75] = RHS75 / m_A398; + double tmp74 = 0.0; + tmp74 += m_A378 * V[75]; + V[74] = (RHS74 - tmp74) / m_A377; + double tmp73 = 0.0; + tmp73 += m_A361 * V[74]; + tmp73 += m_A362 * V[75]; + V[73] = (RHS73 - tmp73) / m_A360; + double tmp72 = 0.0; + tmp72 += m_A349 * V[73]; + tmp72 += m_A350 * V[74]; + tmp72 += m_A351 * V[75]; + V[72] = (RHS72 - tmp72) / m_A348; + double tmp71 = 0.0; + tmp71 += m_A334 * V[72]; + tmp71 += m_A335 * V[73]; + tmp71 += m_A336 * V[74]; + tmp71 += m_A337 * V[75]; + V[71] = (RHS71 - tmp71) / m_A333; + double tmp70 = 0.0; + tmp70 += m_A327 * V[74]; + V[70] = (RHS70 - tmp70) / m_A326; + double tmp69 = 0.0; + tmp69 += m_A321 * V[75]; + V[69] = (RHS69 - tmp69) / m_A320; + double tmp68 = 0.0; + tmp68 += m_A310 * V[69]; + tmp68 += m_A311 * V[75]; + V[68] = (RHS68 - tmp68) / m_A309; + double tmp67 = 0.0; + tmp67 += m_A299 * V[68]; + tmp67 += m_A300 * V[69]; + tmp67 += m_A301 * V[75]; + V[67] = (RHS67 - tmp67) / m_A298; + double tmp66 = 0.0; + tmp66 += m_A289 * V[72]; + tmp66 += m_A290 * V[74]; + V[66] = (RHS66 - tmp66) / m_A288; + double tmp65 = 0.0; + tmp65 += m_A277 * V[66]; + tmp65 += m_A278 * V[72]; + tmp65 += m_A279 * V[74]; + V[65] = (RHS65 - tmp65) / m_A276; + double tmp64 = 0.0; + tmp64 += m_A266 * V[65]; + tmp64 += m_A267 * V[74]; + V[64] = (RHS64 - tmp64) / m_A265; + double tmp63 = 0.0; + tmp63 += m_A263 * V[70]; + V[63] = (RHS63 - tmp63) / m_A262; + double tmp62 = 0.0; + tmp62 += m_A259 * V[68]; + V[62] = (RHS62 - tmp62) / m_A258; + double tmp61 = 0.0; + tmp61 += m_A254 * V[74]; + tmp61 += m_A255 * V[75]; + V[61] = (RHS61 - tmp61) / m_A253; + double tmp60 = 0.0; + tmp60 += m_A246 * V[71]; + tmp60 += m_A247 * V[72]; + tmp60 += m_A248 * V[73]; + tmp60 += m_A249 * V[74]; + tmp60 += m_A250 * V[75]; + V[60] = (RHS60 - tmp60) / m_A245; + double tmp59 = 0.0; + tmp59 += m_A238 * V[65]; + tmp59 += m_A239 * V[66]; + tmp59 += m_A240 * V[74]; + V[59] = (RHS59 - tmp59) / m_A237; + double tmp58 = 0.0; + tmp58 += m_A228 * V[60]; + tmp58 += m_A229 * V[71]; + tmp58 += m_A230 * V[72]; + tmp58 += m_A231 * V[73]; + tmp58 += m_A232 * V[75]; + V[58] = (RHS58 - tmp58) / m_A227; + double tmp57 = 0.0; + tmp57 += m_A221 * V[70]; + tmp57 += m_A222 * V[74]; + V[57] = (RHS57 - tmp57) / m_A220; + double tmp56 = 0.0; + tmp56 += m_A219 * V[69]; + V[56] = (RHS56 - tmp56) / m_A218; + double tmp55 = 0.0; + tmp55 += m_A212 * V[58]; + tmp55 += m_A213 * V[60]; + tmp55 += m_A214 * V[75]; + V[55] = (RHS55 - tmp55) / m_A211; + double tmp54 = 0.0; + tmp54 += m_A207 * V[69]; + V[54] = (RHS54 - tmp54) / m_A206; + double tmp53 = 0.0; + tmp53 += m_A203 * V[71]; + tmp53 += m_A204 * V[73]; + V[53] = (RHS53 - tmp53) / m_A202; + double tmp52 = 0.0; + tmp52 += m_A197 * V[53]; + tmp52 += m_A198 * V[71]; + tmp52 += m_A199 * V[72]; + tmp52 += m_A200 * V[73]; + V[52] = (RHS52 - tmp52) / m_A196; + double tmp51 = 0.0; + tmp51 += m_A192 * V[65]; + tmp51 += m_A193 * V[72]; + V[51] = (RHS51 - tmp51) / m_A191; + double tmp50 = 0.0; + tmp50 += m_A186 * V[67]; + tmp50 += m_A187 * V[68]; + tmp50 += m_A188 * V[69]; + tmp50 += m_A189 * V[75]; + V[50] = (RHS50 - tmp50) / m_A185; + double tmp49 = 0.0; + tmp49 += m_A178 * V[55]; + tmp49 += m_A179 * V[75]; + V[49] = (RHS49 - tmp49) / m_A177; + double tmp48 = 0.0; + tmp48 += m_A172 * V[59]; + tmp48 += m_A173 * V[65]; + tmp48 += m_A174 * V[66]; + V[48] = (RHS48 - tmp48) / m_A171; + double tmp47 = 0.0; + tmp47 += m_A167 * V[65]; + V[47] = (RHS47 - tmp47) / m_A166; + double tmp46 = 0.0; + tmp46 += m_A162 * V[48]; + tmp46 += m_A163 * V[59]; + tmp46 += m_A164 * V[66]; + V[46] = (RHS46 - tmp46) / m_A161; + double tmp45 = 0.0; + tmp45 += m_A154 * V[52]; + tmp45 += m_A155 * V[72]; + tmp45 += m_A156 * V[73]; + V[45] = (RHS45 - tmp45) / m_A153; + double tmp44 = 0.0; + tmp44 += m_A150 * V[67]; + V[44] = (RHS44 - tmp44) / m_A149; + double tmp43 = 0.0; + tmp43 += m_A145 * V[46]; + tmp43 += m_A146 * V[48]; + V[43] = (RHS43 - tmp43) / m_A144; + double tmp42 = 0.0; + tmp42 += m_A141 * V[63]; + tmp42 += m_A142 * V[70]; + V[42] = (RHS42 - tmp42) / m_A140; + double tmp41 = 0.0; + tmp41 += m_A138 * V[62]; + tmp41 += m_A139 * V[68]; + V[41] = (RHS41 - tmp41) / m_A137; + double tmp40 = 0.0; + tmp40 += m_A131 * V[50]; + tmp40 += m_A132 * V[67]; + tmp40 += m_A133 * V[69]; + tmp40 += m_A134 * V[75]; + V[40] = (RHS40 - tmp40) / m_A130; + double tmp39 = 0.0; + tmp39 += m_A121 * V[40]; + tmp39 += m_A122 * V[50]; + tmp39 += m_A123 * V[67]; + tmp39 += m_A124 * V[75]; + V[39] = (RHS39 - tmp39) / m_A120; + double tmp38 = 0.0; + tmp38 += m_A115 * V[39]; + tmp38 += m_A116 * V[40]; + V[38] = (RHS38 - tmp38) / m_A114; + double tmp37 = 0.0; + tmp37 += m_A111 * V[68]; + V[37] = (RHS37 - tmp37) / m_A110; + double tmp36 = 0.0; + tmp36 += m_A108 * V[74]; + V[36] = (RHS36 - tmp36) / m_A107; + double tmp35 = 0.0; + tmp35 += m_A105 * V[61]; + tmp35 += m_A106 * V[74]; + V[35] = (RHS35 - tmp35) / m_A104; + double tmp34 = 0.0; + tmp34 += m_A102 * V[60]; + tmp34 += m_A103 * V[74]; + V[34] = (RHS34 - tmp34) / m_A101; + double tmp33 = 0.0; + tmp33 += m_A99 * V[49]; + tmp33 += m_A100 * V[55]; + V[33] = (RHS33 - tmp33) / m_A98; + double tmp32 = 0.0; + tmp32 += m_A96 * V[64]; + tmp32 += m_A97 * V[65]; + V[32] = (RHS32 - tmp32) / m_A95; + double tmp31 = 0.0; + tmp31 += m_A92 * V[43]; + tmp31 += m_A93 * V[46]; + tmp31 += m_A94 * V[59]; + V[31] = (RHS31 - tmp31) / m_A91; + double tmp30 = 0.0; + tmp30 += m_A89 * V[61]; + tmp30 += m_A90 * V[75]; + V[30] = (RHS30 - tmp30) / m_A88; + double tmp29 = 0.0; + tmp29 += m_A85 * V[55]; + tmp29 += m_A86 * V[58]; + tmp29 += m_A87 * V[60]; + V[29] = (RHS29 - tmp29) / m_A84; + double tmp28 = 0.0; + tmp28 += m_A82 * V[49]; + tmp28 += m_A83 * V[75]; + V[28] = (RHS28 - tmp28) / m_A81; + double tmp27 = 0.0; + tmp27 += m_A78 * V[41]; + tmp27 += m_A79 * V[62]; + tmp27 += m_A80 * V[68]; + V[27] = (RHS27 - tmp27) / m_A77; + double tmp26 = 0.0; + tmp26 += m_A76 * V[42]; + V[26] = (RHS26 - tmp26) / m_A75; + double tmp25 = 0.0; + tmp25 += m_A74 * V[41]; + V[25] = (RHS25 - tmp25) / m_A73; + double tmp24 = 0.0; + tmp24 += m_A72 * V[56]; + V[24] = (RHS24 - tmp24) / m_A71; + double tmp23 = 0.0; + tmp23 += m_A69 * V[54]; + tmp23 += m_A70 * V[69]; + V[23] = (RHS23 - tmp23) / m_A68; + double tmp22 = 0.0; + tmp22 += m_A66 * V[40]; + tmp22 += m_A67 * V[69]; + V[22] = (RHS22 - tmp22) / m_A65; + double tmp21 = 0.0; + tmp21 += m_A64 * V[56]; + V[21] = (RHS21 - tmp21) / m_A63; + double tmp20 = 0.0; + tmp20 += m_A62 * V[54]; + V[20] = (RHS20 - tmp20) / m_A61; + double tmp19 = 0.0; + tmp19 += m_A60 * V[56]; + V[19] = (RHS19 - tmp19) / m_A59; + double tmp18 = 0.0; + tmp18 += m_A57 * V[46]; + tmp18 += m_A58 * V[66]; + V[18] = (RHS18 - tmp18) / m_A56; + double tmp17 = 0.0; + tmp17 += m_A55 * V[63]; + V[17] = (RHS17 - tmp17) / m_A54; + double tmp16 = 0.0; + tmp16 += m_A52 * V[46]; + tmp16 += m_A53 * V[48]; + V[16] = (RHS16 - tmp16) / m_A51; + double tmp15 = 0.0; + tmp15 += m_A49 * V[16]; + tmp15 += m_A50 * V[48]; + V[15] = (RHS15 - tmp15) / m_A48; + double tmp14 = 0.0; + tmp14 += m_A46 * V[71]; + tmp14 += m_A47 * V[73]; + V[14] = (RHS14 - tmp14) / m_A45; + double tmp13 = 0.0; + tmp13 += m_A42 * V[48]; + tmp13 += m_A43 * V[65]; + tmp13 += m_A44 * V[66]; + V[13] = (RHS13 - tmp13) / m_A41; + double tmp12 = 0.0; + tmp12 += m_A39 * V[14]; + tmp12 += m_A40 * V[73]; + V[12] = (RHS12 - tmp12) / m_A38; + double tmp11 = 0.0; + tmp11 += m_A35 * V[45]; + tmp11 += m_A36 * V[52]; + tmp11 += m_A37 * V[72]; + V[11] = (RHS11 - tmp11) / m_A34; + double tmp10 = 0.0; + tmp10 += m_A32 * V[11]; + tmp10 += m_A33 * V[72]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A29 * V[51]; + tmp9 += m_A30 * V[65]; + V[9] = (RHS9 - tmp9) / m_A28; + double tmp8 = 0.0; + tmp8 += m_A24 * V[40]; + tmp8 += m_A25 * V[50]; + tmp8 += m_A26 * V[67]; + tmp8 += m_A27 * V[75]; + V[8] = (RHS8 - tmp8) / m_A23; + double tmp7 = 0.0; + tmp7 += m_A19 * V[39]; + tmp7 += m_A20 * V[50]; + tmp7 += m_A21 * V[67]; + tmp7 += m_A22 * V[75]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A17 * V[47]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[44]; + tmp5 += m_A15 * V[67]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[50]; + tmp4 += m_A12 * V[68]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[44]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[38]; + tmp2 += m_A6 * V[39]; + tmp2 += m_A7 * V[40]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[37]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[38]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// dribling +static void nl_gcr_21_double_double_c9b5f1625a51d98f(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[3]; + m_A3 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A6 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A8 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A9 += go[15]; + m_A10 += go[16]; + m_A10 += go[17]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A16 += go[20]; + m_A13 += go[21]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A20 += gt[24]; + m_A20 += gt[25]; + m_A20 += gt[26]; + m_A20 += gt[27]; + m_A18 += go[22]; + m_A19 += go[23]; + m_A17 += go[24]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A9; + m_A11 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A10; + m_A11 += m_A3 * f1_4; + m_A12 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A13; + m_A14 += m_A3 * f1_5; + m_A15 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_6 = -f2 * m_A17; + m_A20 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_6 = -f3 * m_A18; + m_A20 += m_A8 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_5 = -f4 * m_A14; + m_A15 += m_A12 * f4_5; + RHS5 += f4_5 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_6 = -f5 * m_A19; + m_A20 += m_A16 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A20; + double tmp5 = 0.0; + tmp5 += m_A16 * V[6]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A12 * V[5]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[6]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[6]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// dribling +static void nl_gcr_28_double_double_99f81817ea8bea2d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A7 += gt[15]; + m_A6 += go[9]; + m_A8 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A9 += gt[16]; + m_A9 += gt[17]; + m_A9 += gt[18]; + m_A10 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A12 += go[19]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 -= go[20] * *cnV[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A13 += go[21]; + m_A15 += go[22]; + m_A16 += go[23]; + double RHS6 = Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A17 += go[24]; + m_A18 += go[25]; + m_A20 += go[26]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 -= go[27] * *cnV[27]; + RHS7 -= go[28] * *cnV[28]; + RHS7 -= go[29] * *cnV[29]; + m_A27 += gt[30]; + m_A27 += gt[31]; + m_A27 += gt[32]; + m_A27 += gt[33]; + m_A27 += gt[34]; + m_A27 += gt[35]; + m_A27 += gt[36]; + m_A24 += go[30]; + m_A25 += go[31]; + m_A26 += go[32]; + m_A23 += go[33]; + m_A22 += go[34]; + m_A21 += go[35]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[36] * *cnV[36]; + const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A21; + m_A27 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A22; + m_A27 += m_A3 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A6; + m_A8 += m_A5 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_6 = -f2 * m_A13; + m_A14 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_7 = -f3 * m_A17; + m_A18 += m_A8 * f3_7; + RHS7 += f3_7 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_8 = -f4 * m_A23; + m_A27 += m_A10 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_8 = -f5 * m_A24; + m_A27 += m_A12 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_7 = -f6 * m_A18; + m_A19 += m_A15 * f6_7; + m_A20 += m_A16 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A25; + m_A26 += m_A15 * f6_8; + m_A27 += m_A16 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_8 = -f7 * m_A26; + m_A27 += m_A20 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A27; + double tmp7 = 0.0; + tmp7 += m_A20 * V[8]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A15 * V[7]; + tmp6 += m_A16 * V[8]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[8]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[8]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[6]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[8]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// dribling +static void nl_gcr_29_double_double_1e732268bc2d78b2(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[3]; + m_A3 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A6 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A7 += gt[15]; + m_A7 += gt[16]; + m_A8 += go[13]; + m_A9 += go[14]; + m_A9 += go[15]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[16] * *cnV[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A11 += go[17]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[18] * *cnV[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A12 += go[19]; + m_A13 += go[20]; + m_A13 += go[21]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + m_A18 += gt[24]; + m_A18 += gt[25]; + m_A19 += go[24]; + m_A16 += go[25]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A21 += go[26]; + m_A20 += go[27]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + m_A28 += gt[28]; + m_A28 += gt[29]; + m_A28 += gt[30]; + m_A28 += gt[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A28 += gt[35]; + m_A28 += gt[36]; + m_A28 += gt[37]; + m_A25 += go[28]; + m_A25 += go[29]; + m_A28 += go[30]; + m_A28 += go[31]; + m_A28 += go[32]; + m_A28 += go[33]; + m_A26 += go[34]; + m_A24 += go[35]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A12; + m_A14 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A13; + m_A14 += m_A3 * f1_5; + m_A15 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_6 = -f1 * m_A16; + m_A17 += m_A3 * f1_6; + m_A18 += m_A4 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_8 = -f2 * m_A24; + m_A28 += m_A6 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_7 = -f3 * m_A20; + m_A22 += m_A8 * f3_7; + m_A23 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_8 = -f3 * m_A25; + m_A27 += m_A8 * f3_8; + m_A28 += m_A9 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_7 = -f4 * m_A21; + m_A22 += m_A11 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_6 = -f5 * m_A17; + m_A18 += m_A15 * f5_6; + RHS6 += f5_6 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_8 = -f6 * m_A26; + m_A28 += m_A19 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_8 = -f7 * m_A27; + m_A28 += m_A23 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A28; + double tmp7 = 0.0; + tmp7 += m_A23 * V[8]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A19 * V[8]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A15 * V[6]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A11 * V[7]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[7]; + tmp3 += m_A9 * V[8]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[8]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + tmp1 += m_A4 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// dribling +static void nl_gcr_54_double_double_a2823a76b83c45a0(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A6 += go[7]; + m_A7 += go[8]; + m_A7 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A10 += go[11]; + m_A9 += go[12]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A13 += go[13]; + m_A12 += go[14]; + m_A12 += go[15]; + double RHS4 = Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A15 += go[18]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[19] * *cnV[19]; + m_A17 += gt[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A19 += go[20]; + m_A18 += go[21]; + m_A16 += go[22]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A22 += gt[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A21 += go[23]; + m_A20 += go[24]; + m_A25 += go[25]; + m_A25 += go[26]; + m_A25 += go[27]; + m_A24 += go[28]; + double RHS7 = Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 -= go[29] * *cnV[29]; + m_A29 += gt[30]; + m_A29 += gt[31]; + m_A29 += gt[32]; + m_A29 += gt[33]; + m_A29 += gt[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A32 += go[30]; + m_A32 += go[31]; + m_A27 += go[32]; + m_A27 += go[33]; + m_A26 += go[34]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + m_A37 += gt[37]; + m_A37 += gt[38]; + m_A37 += gt[39]; + m_A35 += go[37]; + m_A33 += go[38]; + m_A34 += go[39]; + double RHS9 = Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + m_A46 += gt[40]; + m_A46 += gt[41]; + m_A46 += gt[42]; + m_A46 += gt[43]; + m_A46 += gt[44]; + m_A46 += gt[45]; + m_A46 += gt[46]; + m_A41 += go[40]; + m_A41 += go[41]; + m_A43 += go[42]; + m_A43 += go[43]; + m_A43 += go[44]; + m_A40 += go[45]; + m_A42 += go[46]; + double RHS10 = Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + m_A53 += gt[47]; + m_A53 += gt[48]; + m_A53 += gt[49]; + m_A53 += gt[50]; + m_A53 += gt[51]; + m_A49 += go[47]; + m_A48 += go[48]; + m_A50 += go[49]; + m_A50 += go[50]; + double RHS11 = Idr[47]; + RHS11 += Idr[48]; + RHS11 += Idr[49]; + RHS11 += Idr[50]; + RHS11 += Idr[51]; + RHS11 -= go[51] * *cnV[51]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A16; + m_A17 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_9 = -f1 * m_A33; + m_A37 += m_A3 * f1_9; + m_A38 += m_A4 * f1_9; + RHS9 += f1_9 * RHS1; + const double f1_10 = -f1 * m_A40; + m_A45 += m_A3 * f1_10; + m_A46 += m_A4 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_7 = -f2 * m_A20; + m_A22 += m_A6 * f2_7; + m_A25 += m_A7 * f2_7; + RHS7 += f2_7 * RHS2; + const double f2_10 = -f2 * m_A41; + m_A43 += m_A6 * f2_10; + m_A46 += m_A7 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_7 = -f3 * m_A21; + m_A22 += m_A9 * f3_7; + m_A23 += m_A10 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_8 = -f3 * m_A26; + m_A28 += m_A9 * f3_8; + m_A29 += m_A10 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_8 = -f4 * m_A27; + m_A29 += m_A12 * f4_8; + m_A32 += m_A13 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_11 = -f4 * m_A48; + m_A50 += m_A12 * f4_11; + m_A53 += m_A13 * f4_11; + RHS11 += f4_11 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_11 = -f5 * m_A49; + m_A53 += m_A15 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_9 = -f6 * m_A34; + m_A37 += m_A18 * f6_9; + m_A38 += m_A19 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_10 = -f6 * m_A42; + m_A45 += m_A18 * f6_10; + m_A46 += m_A19 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_8 = -f7 * m_A28; + m_A29 += m_A23 * f7_8; + m_A30 += m_A24 * f7_8; + m_A31 += m_A25 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_9 = -f7 * m_A35; + m_A36 += m_A23 * f7_9; + m_A37 += m_A24 * f7_9; + m_A38 += m_A25 * f7_9; + RHS9 += f7_9 * RHS7; + const double f7_10 = -f7 * m_A43; + m_A44 += m_A23 * f7_10; + m_A45 += m_A24 * f7_10; + m_A46 += m_A25 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A29; + const double f8_9 = -f8 * m_A36; + m_A37 += m_A30 * f8_9; + m_A38 += m_A31 * f8_9; + m_A39 += m_A32 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_10 = -f8 * m_A44; + m_A45 += m_A30 * f8_10; + m_A46 += m_A31 * f8_10; + m_A47 += m_A32 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_11 = -f8 * m_A50; + m_A51 += m_A30 * f8_11; + m_A52 += m_A31 * f8_11; + m_A53 += m_A32 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A37; + const double f9_10 = -f9 * m_A45; + m_A46 += m_A38 * f9_10; + m_A47 += m_A39 * f9_10; + RHS10 += f9_10 * RHS9; + const double f9_11 = -f9 * m_A51; + m_A52 += m_A38 * f9_11; + m_A53 += m_A39 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A46; + const double f10_11 = -f10 * m_A52; + m_A53 += m_A47 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A53; + double tmp10 = 0.0; + tmp10 += m_A47 * V[11]; + V[10] = (RHS10 - tmp10) / m_A46; + double tmp9 = 0.0; + tmp9 += m_A38 * V[10]; + tmp9 += m_A39 * V[11]; + V[9] = (RHS9 - tmp9) / m_A37; + double tmp8 = 0.0; + tmp8 += m_A30 * V[9]; + tmp8 += m_A31 * V[10]; + tmp8 += m_A32 * V[11]; + V[8] = (RHS8 - tmp8) / m_A29; + double tmp7 = 0.0; + tmp7 += m_A23 * V[8]; + tmp7 += m_A24 * V[9]; + tmp7 += m_A25 * V[10]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A18 * V[9]; + tmp6 += m_A19 * V[10]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A15 * V[11]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A12 * V[8]; + tmp4 += m_A13 * V[11]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[7]; + tmp3 += m_A10 * V[8]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[7]; + tmp2 += m_A7 * V[10]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[9]; + tmp1 += m_A4 * V[10]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// dribling +static void nl_gcr_7_double_double_a1ecff4d37b54b76(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A5 += go[7]; + m_A4 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[9] * *cnV[9]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// dribling +static void nl_gcr_95_double_double_a0159c41cfc0b644(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A13 += go[12]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 += Idr[14]; + RHS6 -= go[13] * *cnV[13]; + RHS6 -= go[14] * *cnV[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A15 += go[15]; + double RHS7 = Idr[15]; + RHS7 += Idr[16]; + RHS7 += Idr[17]; + RHS7 += Idr[18]; + RHS7 -= go[16] * *cnV[16]; + RHS7 -= go[17] * *cnV[17]; + RHS7 -= go[18] * *cnV[18]; + m_A16 += gt[19]; + m_A16 += gt[20]; + m_A18 += go[19]; + m_A17 += go[20]; + double RHS8 = Idr[19]; + RHS8 += Idr[20]; + m_A19 += gt[21]; + m_A19 += gt[22]; + m_A21 += go[21]; + m_A20 += go[22]; + double RHS9 = Idr[21]; + RHS9 += Idr[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A24 += go[23]; + m_A23 += go[24]; + double RHS10 = Idr[23]; + RHS10 += Idr[24]; + m_A25 += gt[25]; + m_A25 += gt[26]; + m_A27 += go[25]; + m_A26 += go[26]; + double RHS11 = Idr[25]; + RHS11 += Idr[26]; + m_A28 += gt[27]; + m_A28 += gt[28]; + m_A28 += gt[29]; + m_A30 += go[27]; + m_A29 += go[28]; + m_A31 += go[29]; + double RHS12 = Idr[27]; + RHS12 += Idr[28]; + RHS12 += Idr[29]; + m_A32 += gt[30]; + m_A32 += gt[31]; + m_A34 += go[30]; + m_A33 += go[31]; + double RHS13 = Idr[30]; + RHS13 += Idr[31]; + m_A36 += gt[32]; + m_A36 += gt[33]; + m_A37 += go[32]; + m_A35 += go[33]; + double RHS14 = Idr[32]; + RHS14 += Idr[33]; + m_A39 += gt[34]; + m_A39 += gt[35]; + m_A40 += go[34]; + m_A38 += go[35]; + double RHS15 = Idr[34]; + RHS15 += Idr[35]; + m_A43 += gt[36]; + m_A43 += gt[37]; + m_A42 += go[36]; + m_A41 += go[37]; + double RHS16 = Idr[36]; + RHS16 += Idr[37]; + m_A47 += gt[38]; + m_A47 += gt[39]; + m_A46 += go[38]; + m_A45 += go[39]; + double RHS17 = Idr[38]; + RHS17 += Idr[39]; + m_A51 += gt[40]; + m_A51 += gt[41]; + m_A50 += go[40]; + m_A49 += go[41]; + double RHS18 = Idr[40]; + RHS18 += Idr[41]; + m_A55 += gt[42]; + m_A55 += gt[43]; + m_A54 += go[42]; + m_A53 += go[43]; + double RHS19 = Idr[42]; + RHS19 += Idr[43]; + m_A58 += gt[44]; + m_A58 += gt[45]; + m_A58 += gt[46]; + m_A59 += go[44]; + m_A57 += go[45]; + double RHS20 = Idr[44]; + RHS20 += Idr[45]; + RHS20 += Idr[46]; + RHS20 -= go[46] * *cnV[46]; + m_A62 += gt[47]; + m_A62 += gt[48]; + m_A62 += gt[49]; + m_A62 += gt[50]; + m_A62 += gt[51]; + m_A63 += go[47]; + m_A63 += go[48]; + m_A61 += go[49]; + double RHS21 = Idr[47]; + RHS21 += Idr[48]; + RHS21 += Idr[49]; + RHS21 += Idr[50]; + RHS21 += Idr[51]; + RHS21 -= go[50] * *cnV[50]; + RHS21 -= go[51] * *cnV[51]; + m_A66 += gt[52]; + m_A66 += gt[53]; + m_A65 += go[52]; + m_A64 += go[53]; + double RHS22 = Idr[52]; + RHS22 += Idr[53]; + m_A70 += gt[54]; + m_A70 += gt[55]; + m_A70 += gt[56]; + m_A70 += gt[57]; + m_A70 += gt[58]; + m_A70 += go[54]; + m_A69 += go[55]; + m_A69 += go[56]; + m_A68 += go[57]; + double RHS23 = Idr[54]; + RHS23 += Idr[55]; + RHS23 += Idr[56]; + RHS23 += Idr[57]; + RHS23 += Idr[58]; + RHS23 -= go[58] * *cnV[58]; + m_A75 += gt[59]; + m_A75 += gt[60]; + m_A75 += gt[61]; + m_A72 += go[59]; + m_A76 += go[60]; + double RHS24 = Idr[59]; + RHS24 += Idr[60]; + RHS24 += Idr[61]; + RHS24 -= go[61] * *cnV[61]; + m_A78 += gt[62]; + m_A78 += gt[63]; + m_A79 += go[62]; + m_A77 += go[63]; + double RHS25 = Idr[62]; + RHS25 += Idr[63]; + m_A94 += gt[64]; + m_A94 += gt[65]; + m_A94 += gt[66]; + m_A94 += gt[67]; + m_A94 += gt[68]; + m_A94 += gt[69]; + m_A94 += gt[70]; + m_A94 += gt[71]; + m_A94 += gt[72]; + m_A94 += gt[73]; + m_A94 += gt[74]; + m_A92 += go[64]; + m_A90 += go[65]; + m_A90 += go[66]; + m_A93 += go[67]; + m_A84 += go[68]; + m_A83 += go[69]; + m_A82 += go[70]; + m_A81 += go[71]; + m_A80 += go[72]; + m_A85 += go[73]; + double RHS26 = Idr[64]; + RHS26 += Idr[65]; + RHS26 += Idr[66]; + RHS26 += Idr[67]; + RHS26 += Idr[68]; + RHS26 += Idr[69]; + RHS26 += Idr[70]; + RHS26 += Idr[71]; + RHS26 += Idr[72]; + RHS26 += Idr[73]; + RHS26 += Idr[74]; + RHS26 -= go[74] * *cnV[74]; + const double f0 = 1.0 / m_A0; + const double f0_16 = -f0 * m_A41; + m_A43 += m_A1 * f0_16; + RHS16 += f0_16 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_17 = -f1 * m_A45; + m_A47 += m_A3 * f1_17; + RHS17 += f1_17 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_18 = -f2 * m_A49; + m_A51 += m_A5 * f2_18; + RHS18 += f2_18 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_19 = -f3 * m_A53; + m_A55 += m_A7 * f3_19; + RHS19 += f3_19 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_22 = -f4 * m_A64; + m_A66 += m_A9 * f4_22; + RHS22 += f4_22 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_14 = -f5 * m_A35; + m_A36 += m_A11 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_15 = -f6 * m_A38; + m_A39 += m_A13 * f6_15; + RHS15 += f6_15 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_21 = -f7 * m_A61; + m_A62 += m_A15 * f7_21; + RHS21 += f7_21 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_16 = -f8 * m_A42; + m_A43 += m_A17 * f8_16; + m_A44 += m_A18 * f8_16; + RHS16 += f8_16 * RHS8; + const double f8_26 = -f8 * m_A80; + m_A86 += m_A17 * f8_26; + m_A94 += m_A18 * f8_26; + RHS26 += f8_26 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_17 = -f9 * m_A46; + m_A47 += m_A20 * f9_17; + m_A48 += m_A21 * f9_17; + RHS17 += f9_17 * RHS9; + const double f9_26 = -f9 * m_A81; + m_A87 += m_A20 * f9_26; + m_A94 += m_A21 * f9_26; + RHS26 += f9_26 * RHS9; + const double f10 = 1.0 / m_A22; + const double f10_18 = -f10 * m_A50; + m_A51 += m_A23 * f10_18; + m_A52 += m_A24 * f10_18; + RHS18 += f10_18 * RHS10; + const double f10_26 = -f10 * m_A82; + m_A88 += m_A23 * f10_26; + m_A94 += m_A24 * f10_26; + RHS26 += f10_26 * RHS10; + const double f11 = 1.0 / m_A25; + const double f11_19 = -f11 * m_A54; + m_A55 += m_A26 * f11_19; + m_A56 += m_A27 * f11_19; + RHS19 += f11_19 * RHS11; + const double f11_26 = -f11 * m_A83; + m_A89 += m_A26 * f11_26; + m_A94 += m_A27 * f11_26; + RHS26 += f11_26 * RHS11; + const double f12 = 1.0 / m_A28; + const double f12_20 = -f12 * m_A57; + m_A58 += m_A29 * f12_20; + m_A59 += m_A30 * f12_20; + m_A60 += m_A31 * f12_20; + RHS20 += f12_20 * RHS12; + const double f12_23 = -f12 * m_A68; + m_A69 += m_A29 * f12_23; + m_A70 += m_A30 * f12_23; + m_A71 += m_A31 * f12_23; + RHS23 += f12_23 * RHS12; + const double f12_24 = -f12 * m_A72; + m_A73 += m_A29 * f12_24; + m_A74 += m_A30 * f12_24; + m_A75 += m_A31 * f12_24; + RHS24 += f12_24 * RHS12; + const double f13 = 1.0 / m_A32; + const double f13_22 = -f13 * m_A65; + m_A66 += m_A33 * f13_22; + m_A67 += m_A34 * f13_22; + RHS22 += f13_22 * RHS13; + const double f13_26 = -f13 * m_A84; + m_A91 += m_A33 * f13_26; + m_A94 += m_A34 * f13_26; + RHS26 += f13_26 * RHS13; + const double f14 = 1.0 / m_A36; + const double f14_25 = -f14 * m_A77; + m_A78 += m_A37 * f14_25; + RHS25 += f14_25 * RHS14; + const double f15 = 1.0 / m_A39; + const double f15_26 = -f15 * m_A85; + m_A94 += m_A40 * f15_26; + RHS26 += f15_26 * RHS15; + const double f16 = 1.0 / m_A43; + const double f16_26 = -f16 * m_A86; + m_A94 += m_A44 * f16_26; + RHS26 += f16_26 * RHS16; + const double f17 = 1.0 / m_A47; + const double f17_26 = -f17 * m_A87; + m_A94 += m_A48 * f17_26; + RHS26 += f17_26 * RHS17; + const double f18 = 1.0 / m_A51; + const double f18_26 = -f18 * m_A88; + m_A94 += m_A52 * f18_26; + RHS26 += f18_26 * RHS18; + const double f19 = 1.0 / m_A55; + const double f19_26 = -f19 * m_A89; + m_A94 += m_A56 * f19_26; + RHS26 += f19_26 * RHS19; + const double f20 = 1.0 / m_A58; + const double f20_23 = -f20 * m_A69; + m_A70 += m_A59 * f20_23; + m_A71 += m_A60 * f20_23; + RHS23 += f20_23 * RHS20; + const double f20_24 = -f20 * m_A73; + m_A74 += m_A59 * f20_24; + m_A75 += m_A60 * f20_24; + RHS24 += f20_24 * RHS20; + const double f21 = 1.0 / m_A62; + const double f21_26 = -f21 * m_A90; + m_A94 += m_A63 * f21_26; + RHS26 += f21_26 * RHS21; + const double f22 = 1.0 / m_A66; + const double f22_26 = -f22 * m_A91; + m_A94 += m_A67 * f22_26; + RHS26 += f22_26 * RHS22; + const double f23 = 1.0 / m_A70; + const double f23_24 = -f23 * m_A74; + m_A75 += m_A71 * f23_24; + RHS24 += f23_24 * RHS23; + const double f24 = 1.0 / m_A75; + const double f24_26 = -f24 * m_A92; + m_A94 += m_A76 * f24_26; + RHS26 += f24_26 * RHS24; + const double f25 = 1.0 / m_A78; + const double f25_26 = -f25 * m_A93; + m_A94 += m_A79 * f25_26; + RHS26 += f25_26 * RHS25; + V[26] = RHS26 / m_A94; + double tmp25 = 0.0; + tmp25 += m_A79 * V[26]; + V[25] = (RHS25 - tmp25) / m_A78; + double tmp24 = 0.0; + tmp24 += m_A76 * V[26]; + V[24] = (RHS24 - tmp24) / m_A75; + double tmp23 = 0.0; + tmp23 += m_A71 * V[24]; + V[23] = (RHS23 - tmp23) / m_A70; + double tmp22 = 0.0; + tmp22 += m_A67 * V[26]; + V[22] = (RHS22 - tmp22) / m_A66; + double tmp21 = 0.0; + tmp21 += m_A63 * V[26]; + V[21] = (RHS21 - tmp21) / m_A62; + double tmp20 = 0.0; + tmp20 += m_A59 * V[23]; + tmp20 += m_A60 * V[24]; + V[20] = (RHS20 - tmp20) / m_A58; + double tmp19 = 0.0; + tmp19 += m_A56 * V[26]; + V[19] = (RHS19 - tmp19) / m_A55; + double tmp18 = 0.0; + tmp18 += m_A52 * V[26]; + V[18] = (RHS18 - tmp18) / m_A51; + double tmp17 = 0.0; + tmp17 += m_A48 * V[26]; + V[17] = (RHS17 - tmp17) / m_A47; + double tmp16 = 0.0; + tmp16 += m_A44 * V[26]; + V[16] = (RHS16 - tmp16) / m_A43; + double tmp15 = 0.0; + tmp15 += m_A40 * V[26]; + V[15] = (RHS15 - tmp15) / m_A39; + double tmp14 = 0.0; + tmp14 += m_A37 * V[25]; + V[14] = (RHS14 - tmp14) / m_A36; + double tmp13 = 0.0; + tmp13 += m_A33 * V[22]; + tmp13 += m_A34 * V[26]; + V[13] = (RHS13 - tmp13) / m_A32; + double tmp12 = 0.0; + tmp12 += m_A29 * V[20]; + tmp12 += m_A30 * V[23]; + tmp12 += m_A31 * V[24]; + V[12] = (RHS12 - tmp12) / m_A28; + double tmp11 = 0.0; + tmp11 += m_A26 * V[19]; + tmp11 += m_A27 * V[26]; + V[11] = (RHS11 - tmp11) / m_A25; + double tmp10 = 0.0; + tmp10 += m_A23 * V[18]; + tmp10 += m_A24 * V[26]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + tmp9 += m_A20 * V[17]; + tmp9 += m_A21 * V[26]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A17 * V[16]; + tmp8 += m_A18 * V[26]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[21]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[15]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[14]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[22]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[19]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[18]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[17]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[16]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_10_double_double_11c2ae166b240b6e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A6 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A8 += go[9]; + m_A7 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_10_double_double_81f40a54af2ca202(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A6 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A8 += go[9]; + m_A7 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_12_double_double_d224211d1af6811d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A0 += gt[7]; + m_A0 += gt[8]; + m_A0 += gt[9]; + m_A0 += gt[10]; + m_A0 += gt[11]; + m_A0 += gt[12]; + m_A0 += gt[13]; + m_A0 += gt[14]; + m_A0 += gt[15]; + m_A0 += gt[16]; + m_A0 += gt[17]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 += Idr[7]; + RHS0 += Idr[8]; + RHS0 += Idr[9]; + RHS0 += Idr[10]; + RHS0 += Idr[11]; + RHS0 += Idr[12]; + RHS0 += Idr[13]; + RHS0 += Idr[14]; + RHS0 += Idr[15]; + RHS0 += Idr[16]; + RHS0 += Idr[17]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + RHS0 -= go[7] * *cnV[7]; + RHS0 -= go[8] * *cnV[8]; + RHS0 -= go[9] * *cnV[9]; + RHS0 -= go[10] * *cnV[10]; + RHS0 -= go[11] * *cnV[11]; + RHS0 -= go[12] * *cnV[12]; + RHS0 -= go[13] * *cnV[13]; + RHS0 -= go[14] * *cnV[14]; + RHS0 -= go[15] * *cnV[15]; + RHS0 -= go[16] * *cnV[16]; + RHS0 -= go[17] * *cnV[17]; + m_A2 += gt[18]; + m_A2 += gt[19]; + m_A2 += gt[20]; + m_A2 += gt[21]; + m_A2 += gt[22]; + m_A4 += go[18]; + m_A3 += go[19]; + double RHS1 = Idr[18]; + RHS1 += Idr[19]; + RHS1 += Idr[20]; + RHS1 += Idr[21]; + RHS1 += Idr[22]; + RHS1 -= go[20] * *cnV[20]; + RHS1 -= go[21] * *cnV[21]; + RHS1 -= go[22] * *cnV[22]; + m_A7 += gt[23]; + m_A7 += gt[24]; + m_A7 += gt[25]; + m_A6 += go[23]; + m_A5 += go[24]; + double RHS2 = Idr[23]; + RHS2 += Idr[24]; + RHS2 += Idr[25]; + RHS2 -= go[25] * *cnV[25]; + m_A11 += gt[26]; + m_A11 += gt[27]; + m_A11 += gt[28]; + m_A11 += gt[29]; + m_A11 += gt[30]; + m_A11 += gt[31]; + m_A11 += gt[32]; + m_A10 += go[26]; + m_A9 += go[27]; + double RHS3 = Idr[26]; + RHS3 += Idr[27]; + RHS3 += Idr[28]; + RHS3 += Idr[29]; + RHS3 += Idr[30]; + RHS3 += Idr[31]; + RHS3 += Idr[32]; + RHS3 -= go[28] * *cnV[28]; + RHS3 -= go[29] * *cnV[29]; + RHS3 -= go[30] * *cnV[30]; + RHS3 -= go[31] * *cnV[31]; + RHS3 -= go[32] * *cnV[32]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A7 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f0_3 = -f0 * m_A9; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A6; + m_A7 += m_A3 * f1_2; + m_A8 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A8 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A8 * V[3]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_13_double_double_d13f9c6838af6aeb(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A6 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A9 += go[9]; + m_A7 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A11 += go[12]; + m_A10 += go[13]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A8 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A6 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A9 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[4]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_13_double_double_f4f4e2ee05cb584e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A8 += go[10]; + m_A6 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A11 += go[14]; + m_A10 += go[15]; + m_A9 += go[16]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A9; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A6; + m_A7 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A8 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A8 * V[4]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim +static void nl_gcr_150_double_double_be831e5faa508573(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A13 += go[12]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A16 += go[14]; + m_A15 += go[15]; + double RHS7 = Idr[14]; + RHS7 += Idr[15]; + RHS7 += Idr[16]; + RHS7 -= go[16] * *cnV[16]; + m_A17 += gt[17]; + m_A17 += gt[18]; + m_A18 += go[17]; + double RHS8 = Idr[17]; + RHS8 += Idr[18]; + RHS8 -= go[18] * *cnV[18]; + m_A19 += gt[19]; + m_A19 += gt[20]; + m_A19 += gt[21]; + m_A21 += go[19]; + m_A20 += go[20]; + double RHS9 = Idr[19]; + RHS9 += Idr[20]; + RHS9 += Idr[21]; + RHS9 -= go[21] * *cnV[21]; + m_A22 += gt[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A23 += go[22]; + double RHS10 = Idr[22]; + RHS10 += Idr[23]; + RHS10 += Idr[24]; + RHS10 -= go[23] * *cnV[23]; + RHS10 -= go[24] * *cnV[24]; + m_A24 += gt[25]; + m_A24 += gt[26]; + m_A25 += go[25]; + double RHS11 = Idr[25]; + RHS11 += Idr[26]; + RHS11 -= go[26] * *cnV[26]; + m_A26 += gt[27]; + m_A26 += gt[28]; + m_A27 += go[27]; + double RHS12 = Idr[27]; + RHS12 += Idr[28]; + RHS12 -= go[28] * *cnV[28]; + m_A28 += gt[29]; + m_A28 += gt[30]; + m_A28 += gt[31]; + m_A28 += gt[32]; + m_A30 += go[29]; + m_A29 += go[30]; + double RHS13 = Idr[29]; + RHS13 += Idr[30]; + RHS13 += Idr[31]; + RHS13 += Idr[32]; + RHS13 -= go[31] * *cnV[31]; + RHS13 -= go[32] * *cnV[32]; + m_A31 += gt[33]; + m_A31 += gt[34]; + m_A31 += gt[35]; + m_A32 += go[33]; + double RHS14 = Idr[33]; + RHS14 += Idr[34]; + RHS14 += Idr[35]; + RHS14 -= go[34] * *cnV[34]; + RHS14 -= go[35] * *cnV[35]; + m_A33 += gt[36]; + m_A33 += gt[37]; + m_A34 += go[36]; + m_A35 += go[37]; + double RHS15 = Idr[36]; + RHS15 += Idr[37]; + m_A36 += gt[38]; + m_A36 += gt[39]; + m_A37 += go[38]; + m_A38 += go[39]; + double RHS16 = Idr[38]; + RHS16 += Idr[39]; + m_A39 += gt[40]; + m_A39 += gt[41]; + m_A39 += gt[42]; + m_A40 += go[40]; + double RHS17 = Idr[40]; + RHS17 += Idr[41]; + RHS17 += Idr[42]; + RHS17 -= go[41] * *cnV[41]; + RHS17 -= go[42] * *cnV[42]; + m_A41 += gt[43]; + m_A41 += gt[44]; + m_A41 += gt[45]; + m_A43 += go[43]; + m_A42 += go[44]; + double RHS18 = Idr[43]; + RHS18 += Idr[44]; + RHS18 += Idr[45]; + RHS18 -= go[45] * *cnV[45]; + m_A44 += gt[46]; + m_A44 += gt[47]; + m_A44 += gt[48]; + m_A44 += gt[49]; + m_A44 += gt[50]; + m_A44 += gt[51]; + m_A45 += go[46]; + m_A46 += go[47]; + double RHS19 = Idr[46]; + RHS19 += Idr[47]; + RHS19 += Idr[48]; + RHS19 += Idr[49]; + RHS19 += Idr[50]; + RHS19 += Idr[51]; + RHS19 -= go[48] * *cnV[48]; + RHS19 -= go[49] * *cnV[49]; + RHS19 -= go[50] * *cnV[50]; + RHS19 -= go[51] * *cnV[51]; + m_A47 += gt[52]; + m_A47 += gt[53]; + m_A47 += gt[54]; + m_A49 += go[52]; + m_A48 += go[53]; + double RHS20 = Idr[52]; + RHS20 += Idr[53]; + RHS20 += Idr[54]; + RHS20 -= go[54] * *cnV[54]; + m_A50 += gt[55]; + m_A50 += gt[56]; + m_A50 += gt[57]; + m_A50 += gt[58]; + m_A50 += gt[59]; + m_A50 += gt[60]; + m_A50 += gt[61]; + m_A52 += go[55]; + m_A51 += go[56]; + double RHS21 = Idr[55]; + RHS21 += Idr[56]; + RHS21 += Idr[57]; + RHS21 += Idr[58]; + RHS21 += Idr[59]; + RHS21 += Idr[60]; + RHS21 += Idr[61]; + RHS21 -= go[57] * *cnV[57]; + RHS21 -= go[58] * *cnV[58]; + RHS21 -= go[59] * *cnV[59]; + RHS21 -= go[60] * *cnV[60]; + RHS21 -= go[61] * *cnV[61]; + m_A53 += gt[62]; + m_A53 += gt[63]; + m_A53 += gt[64]; + m_A54 += go[62]; + m_A55 += go[63]; + double RHS22 = Idr[62]; + RHS22 += Idr[63]; + RHS22 += Idr[64]; + RHS22 -= go[64] * *cnV[64]; + m_A58 += gt[65]; + m_A58 += gt[66]; + m_A58 += gt[67]; + m_A57 += go[65]; + m_A56 += go[66]; + double RHS23 = Idr[65]; + RHS23 += Idr[66]; + RHS23 += Idr[67]; + RHS23 -= go[67] * *cnV[67]; + m_A61 += gt[68]; + m_A61 += gt[69]; + m_A61 += gt[70]; + m_A62 += go[68]; + m_A60 += go[69]; + double RHS24 = Idr[68]; + RHS24 += Idr[69]; + RHS24 += Idr[70]; + RHS24 -= go[70] * *cnV[70]; + m_A65 += gt[71]; + m_A65 += gt[72]; + m_A65 += gt[73]; + m_A63 += go[71]; + m_A66 += go[72]; + double RHS25 = Idr[71]; + RHS25 += Idr[72]; + RHS25 += Idr[73]; + RHS25 -= go[73] * *cnV[73]; + m_A69 += gt[74]; + m_A69 += gt[75]; + m_A69 += gt[76]; + m_A68 += go[74]; + m_A67 += go[75]; + double RHS26 = Idr[74]; + RHS26 += Idr[75]; + RHS26 += Idr[76]; + RHS26 -= go[76] * *cnV[76]; + m_A74 += gt[77]; + m_A74 += gt[78]; + m_A74 += gt[79]; + m_A74 += gt[80]; + m_A72 += go[77]; + m_A71 += go[78]; + m_A73 += go[79]; + double RHS27 = Idr[77]; + RHS27 += Idr[78]; + RHS27 += Idr[79]; + RHS27 += Idr[80]; + RHS27 -= go[80] * *cnV[80]; + m_A78 += gt[81]; + m_A78 += gt[82]; + m_A78 += gt[83]; + m_A76 += go[81]; + m_A79 += go[82]; + double RHS28 = Idr[81]; + RHS28 += Idr[82]; + RHS28 += Idr[83]; + RHS28 -= go[83] * *cnV[83]; + m_A82 += gt[84]; + m_A82 += gt[85]; + m_A82 += gt[86]; + m_A82 += gt[87]; + m_A82 += gt[88]; + m_A81 += go[84]; + m_A80 += go[85]; + m_A84 += go[86]; + double RHS29 = Idr[84]; + RHS29 += Idr[85]; + RHS29 += Idr[86]; + RHS29 += Idr[87]; + RHS29 += Idr[88]; + RHS29 -= go[87] * *cnV[87]; + RHS29 -= go[88] * *cnV[88]; + m_A88 += gt[89]; + m_A88 += gt[90]; + m_A88 += gt[91]; + m_A87 += go[89]; + m_A86 += go[90]; + double RHS30 = Idr[89]; + RHS30 += Idr[90]; + RHS30 += Idr[91]; + RHS30 -= go[91] * *cnV[91]; + m_A92 += gt[92]; + m_A92 += gt[93]; + m_A92 += gt[94]; + m_A92 += gt[95]; + m_A91 += go[92]; + m_A90 += go[93]; + double RHS31 = Idr[92]; + RHS31 += Idr[93]; + RHS31 += Idr[94]; + RHS31 += Idr[95]; + RHS31 -= go[94] * *cnV[94]; + RHS31 -= go[95] * *cnV[95]; + m_A96 += gt[96]; + m_A96 += gt[97]; + m_A96 += gt[98]; + m_A95 += go[96]; + m_A94 += go[97]; + double RHS32 = Idr[96]; + RHS32 += Idr[97]; + RHS32 += Idr[98]; + RHS32 -= go[98] * *cnV[98]; + m_A99 += gt[99]; + m_A99 += gt[100]; + m_A99 += gt[101]; + m_A100 += go[99]; + m_A98 += go[100]; + double RHS33 = Idr[99]; + RHS33 += Idr[100]; + RHS33 += Idr[101]; + RHS33 -= go[101] * *cnV[101]; + m_A104 += gt[102]; + m_A104 += gt[103]; + m_A104 += gt[104]; + m_A104 += gt[105]; + m_A102 += go[102]; + m_A107 += go[103]; + m_A101 += go[104]; + double RHS34 = Idr[102]; + RHS34 += Idr[103]; + RHS34 += Idr[104]; + RHS34 += Idr[105]; + RHS34 -= go[105] * *cnV[105]; + m_A116 += gt[106]; + m_A116 += gt[107]; + m_A116 += gt[108]; + m_A116 += gt[109]; + m_A116 += gt[110]; + m_A116 += gt[111]; + m_A113 += go[106]; + m_A110 += go[107]; + m_A109 += go[108]; + m_A111 += go[109]; + m_A108 += go[110]; + double RHS35 = Idr[106]; + RHS35 += Idr[107]; + RHS35 += Idr[108]; + RHS35 += Idr[109]; + RHS35 += Idr[110]; + RHS35 += Idr[111]; + RHS35 -= go[111] * *cnV[111]; + m_A124 += gt[112]; + m_A124 += gt[113]; + m_A124 += gt[114]; + m_A124 += gt[115]; + m_A120 += go[112]; + m_A125 += go[113]; + m_A119 += go[114]; + double RHS36 = Idr[112]; + RHS36 += Idr[113]; + RHS36 += Idr[114]; + RHS36 += Idr[115]; + RHS36 -= go[115] * *cnV[115]; + m_A128 += gt[116]; + m_A128 += gt[117]; + m_A128 += gt[118]; + m_A126 += go[116]; + m_A129 += go[117]; + double RHS37 = Idr[116]; + RHS37 += Idr[117]; + RHS37 += Idr[118]; + RHS37 -= go[118] * *cnV[118]; + m_A132 += gt[119]; + m_A132 += gt[120]; + m_A132 += gt[121]; + m_A130 += go[119]; + m_A131 += go[120]; + double RHS38 = Idr[119]; + RHS38 += Idr[120]; + RHS38 += Idr[121]; + RHS38 -= go[121] * *cnV[121]; + m_A136 += gt[122]; + m_A136 += gt[123]; + m_A136 += gt[124]; + m_A134 += go[122]; + m_A137 += go[123]; + double RHS39 = Idr[122]; + RHS39 += Idr[123]; + RHS39 += Idr[124]; + RHS39 -= go[124] * *cnV[124]; + m_A149 += gt[125]; + m_A149 += gt[126]; + m_A149 += gt[127]; + m_A149 += gt[128]; + m_A149 += gt[129]; + m_A149 += gt[130]; + m_A149 += gt[131]; + m_A149 += gt[132]; + m_A149 += gt[133]; + m_A149 += gt[134]; + m_A149 += gt[135]; + m_A149 += gt[136]; + m_A138 += go[125]; + m_A139 += go[126]; + m_A148 += go[127]; + m_A146 += go[128]; + m_A142 += go[129]; + m_A141 += go[130]; + m_A140 += go[131]; + m_A145 += go[132]; + m_A143 += go[133]; + double RHS40 = Idr[125]; + RHS40 += Idr[126]; + RHS40 += Idr[127]; + RHS40 += Idr[128]; + RHS40 += Idr[129]; + RHS40 += Idr[130]; + RHS40 += Idr[131]; + RHS40 += Idr[132]; + RHS40 += Idr[133]; + RHS40 += Idr[134]; + RHS40 += Idr[135]; + RHS40 += Idr[136]; + RHS40 -= go[134] * *cnV[134]; + RHS40 -= go[135] * *cnV[135]; + RHS40 -= go[136] * *cnV[136]; + const double f0 = 1.0 / m_A0; + const double f0_33 = -f0 * m_A98; + m_A99 += m_A1 * f0_33; + RHS33 += f0_33 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_34 = -f1 * m_A101; + m_A104 += m_A3 * f1_34; + RHS34 += f1_34 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_30 = -f2 * m_A86; + m_A88 += m_A5 * f2_30; + RHS30 += f2_30 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_23 = -f3 * m_A56; + m_A58 += m_A7 * f3_23; + RHS23 += f3_23 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_26 = -f4 * m_A67; + m_A69 += m_A9 * f4_26; + RHS26 += f4_26 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_32 = -f5 * m_A94; + m_A96 += m_A11 * f5_32; + RHS32 += f5_32 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_24 = -f6 * m_A60; + m_A61 += m_A13 * f6_24; + RHS24 += f6_24 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_23 = -f7 * m_A57; + m_A58 += m_A15 * f7_23; + m_A59 += m_A16 * f7_23; + RHS23 += f7_23 * RHS7; + const double f7_25 = -f7 * m_A63; + m_A64 += m_A15 * f7_25; + m_A65 += m_A16 * f7_25; + RHS25 += f7_25 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_36 = -f8 * m_A119; + m_A124 += m_A18 * f8_36; + RHS36 += f8_36 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_26 = -f9 * m_A68; + m_A69 += m_A20 * f9_26; + m_A70 += m_A21 * f9_26; + RHS26 += f9_26 * RHS9; + const double f9_28 = -f9 * m_A76; + m_A77 += m_A20 * f9_28; + m_A78 += m_A21 * f9_28; + RHS28 += f9_28 * RHS9; + const double f10 = 1.0 / m_A22; + const double f10_27 = -f10 * m_A71; + m_A74 += m_A23 * f10_27; + RHS27 += f10_27 * RHS10; + const double f11 = 1.0 / m_A24; + const double f11_27 = -f11 * m_A72; + m_A74 += m_A25 * f11_27; + RHS27 += f11_27 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_31 = -f12 * m_A90; + m_A92 += m_A27 * f12_31; + RHS31 += f12_31 * RHS12; + const double f13 = 1.0 / m_A28; + const double f13_27 = -f13 * m_A73; + m_A74 += m_A29 * f13_27; + m_A75 += m_A30 * f13_27; + RHS27 += f13_27 * RHS13; + const double f13_35 = -f13 * m_A108; + m_A112 += m_A29 * f13_35; + m_A116 += m_A30 * f13_35; + RHS35 += f13_35 * RHS13; + const double f14 = 1.0 / m_A31; + const double f14_35 = -f14 * m_A109; + m_A116 += m_A32 * f14_35; + RHS35 += f14_35 * RHS14; + const double f15 = 1.0 / m_A33; + const double f15_29 = -f15 * m_A80; + m_A82 += m_A34 * f15_29; + m_A83 += m_A35 * f15_29; + RHS29 += f15_29 * RHS15; + const double f15_34 = -f15 * m_A102; + m_A103 += m_A34 * f15_34; + m_A104 += m_A35 * f15_34; + RHS34 += f15_34 * RHS15; + const double f16 = 1.0 / m_A36; + const double f16_29 = -f16 * m_A81; + m_A82 += m_A37 * f16_29; + m_A85 += m_A38 * f16_29; + RHS29 += f16_29 * RHS16; + const double f16_36 = -f16 * m_A120; + m_A121 += m_A37 * f16_36; + m_A124 += m_A38 * f16_36; + RHS36 += f16_36 * RHS16; + const double f17 = 1.0 / m_A39; + const double f17_35 = -f17 * m_A110; + m_A116 += m_A40 * f17_35; + RHS35 += f17_35 * RHS17; + const double f18 = 1.0 / m_A41; + const double f18_30 = -f18 * m_A87; + m_A88 += m_A42 * f18_30; + m_A89 += m_A43 * f18_30; + RHS30 += f18_30 * RHS18; + const double f18_37 = -f18 * m_A126; + m_A127 += m_A42 * f18_37; + m_A128 += m_A43 * f18_37; + RHS37 += f18_37 * RHS18; + const double f19 = 1.0 / m_A44; + const double f19_31 = -f19 * m_A91; + m_A92 += m_A45 * f19_31; + m_A93 += m_A46 * f19_31; + RHS31 += f19_31 * RHS19; + const double f19_35 = -f19 * m_A111; + m_A114 += m_A45 * f19_35; + m_A116 += m_A46 * f19_35; + RHS35 += f19_35 * RHS19; + const double f20 = 1.0 / m_A47; + const double f20_32 = -f20 * m_A95; + m_A96 += m_A48 * f20_32; + m_A97 += m_A49 * f20_32; + RHS32 += f20_32 * RHS20; + const double f20_39 = -f20 * m_A134; + m_A135 += m_A48 * f20_39; + m_A136 += m_A49 * f20_39; + RHS39 += f20_39 * RHS20; + const double f21 = 1.0 / m_A50; + const double f21_40 = -f21 * m_A138; + m_A140 += m_A51 * f21_40; + m_A149 += m_A52 * f21_40; + RHS40 += f21_40 * RHS21; + const double f22 = 1.0 / m_A53; + const double f22_38 = -f22 * m_A130; + m_A132 += m_A54 * f22_38; + m_A133 += m_A55 * f22_38; + RHS38 += f22_38 * RHS22; + const double f22_40 = -f22 * m_A139; + m_A147 += m_A54 * f22_40; + m_A149 += m_A55 * f22_40; + RHS40 += f22_40 * RHS22; + const double f23 = 1.0 / m_A58; + const double f23_25 = -f23 * m_A64; + m_A65 += m_A59 * f23_25; + RHS25 += f23_25 * RHS23; + const double f24 = 1.0 / m_A61; + const double f24_40 = -f24 * m_A140; + m_A149 += m_A62 * f24_40; + RHS40 += f24_40 * RHS24; + const double f25 = 1.0 / m_A65; + const double f25_40 = -f25 * m_A141; + m_A149 += m_A66 * f25_40; + RHS40 += f25_40 * RHS25; + const double f26 = 1.0 / m_A69; + const double f26_28 = -f26 * m_A77; + m_A78 += m_A70 * f26_28; + RHS28 += f26_28 * RHS26; + const double f27 = 1.0 / m_A74; + const double f27_35 = -f27 * m_A112; + m_A116 += m_A75 * f27_35; + RHS35 += f27_35 * RHS27; + const double f28 = 1.0 / m_A78; + const double f28_40 = -f28 * m_A142; + m_A149 += m_A79 * f28_40; + RHS40 += f28_40 * RHS28; + const double f29 = 1.0 / m_A82; + const double f29_34 = -f29 * m_A103; + m_A104 += m_A83 * f29_34; + m_A105 += m_A84 * f29_34; + m_A106 += m_A85 * f29_34; + RHS34 += f29_34 * RHS29; + const double f29_35 = -f29 * m_A113; + m_A115 += m_A83 * f29_35; + m_A116 += m_A84 * f29_35; + m_A117 += m_A85 * f29_35; + RHS35 += f29_35 * RHS29; + const double f29_36 = -f29 * m_A121; + m_A122 += m_A83 * f29_36; + m_A123 += m_A84 * f29_36; + m_A124 += m_A85 * f29_36; + RHS36 += f29_36 * RHS29; + const double f30 = 1.0 / m_A88; + const double f30_37 = -f30 * m_A127; + m_A128 += m_A89 * f30_37; + RHS37 += f30_37 * RHS30; + const double f31 = 1.0 / m_A92; + const double f31_35 = -f31 * m_A114; + m_A116 += m_A93 * f31_35; + RHS35 += f31_35 * RHS31; + const double f32 = 1.0 / m_A96; + const double f32_39 = -f32 * m_A135; + m_A136 += m_A97 * f32_39; + RHS39 += f32_39 * RHS32; + const double f33 = 1.0 / m_A99; + const double f33_38 = -f33 * m_A131; + m_A132 += m_A100 * f33_38; + RHS38 += f33_38 * RHS33; + const double f34 = 1.0 / m_A104; + const double f34_35 = -f34 * m_A115; + m_A116 += m_A105 * f34_35; + m_A117 += m_A106 * f34_35; + m_A118 += m_A107 * f34_35; + RHS35 += f34_35 * RHS34; + const double f34_36 = -f34 * m_A122; + m_A123 += m_A105 * f34_36; + m_A124 += m_A106 * f34_36; + m_A125 += m_A107 * f34_36; + RHS36 += f34_36 * RHS34; + const double f34_40 = -f34 * m_A143; + m_A144 += m_A105 * f34_40; + m_A145 += m_A106 * f34_40; + m_A149 += m_A107 * f34_40; + RHS40 += f34_40 * RHS34; + const double f35 = 1.0 / m_A116; + const double f35_36 = -f35 * m_A123; + m_A124 += m_A117 * f35_36; + m_A125 += m_A118 * f35_36; + RHS36 += f35_36 * RHS35; + const double f35_40 = -f35 * m_A144; + m_A145 += m_A117 * f35_40; + m_A149 += m_A118 * f35_40; + RHS40 += f35_40 * RHS35; + const double f36 = 1.0 / m_A124; + const double f36_40 = -f36 * m_A145; + m_A149 += m_A125 * f36_40; + RHS40 += f36_40 * RHS36; + const double f37 = 1.0 / m_A128; + const double f37_40 = -f37 * m_A146; + m_A149 += m_A129 * f37_40; + RHS40 += f37_40 * RHS37; + const double f38 = 1.0 / m_A132; + const double f38_40 = -f38 * m_A147; + m_A149 += m_A133 * f38_40; + RHS40 += f38_40 * RHS38; + const double f39 = 1.0 / m_A136; + const double f39_40 = -f39 * m_A148; + m_A149 += m_A137 * f39_40; + RHS40 += f39_40 * RHS39; + V[40] = RHS40 / m_A149; + double tmp39 = 0.0; + tmp39 += m_A137 * V[40]; + V[39] = (RHS39 - tmp39) / m_A136; + double tmp38 = 0.0; + tmp38 += m_A133 * V[40]; + V[38] = (RHS38 - tmp38) / m_A132; + double tmp37 = 0.0; + tmp37 += m_A129 * V[40]; + V[37] = (RHS37 - tmp37) / m_A128; + double tmp36 = 0.0; + tmp36 += m_A125 * V[40]; + V[36] = (RHS36 - tmp36) / m_A124; + double tmp35 = 0.0; + tmp35 += m_A117 * V[36]; + tmp35 += m_A118 * V[40]; + V[35] = (RHS35 - tmp35) / m_A116; + double tmp34 = 0.0; + tmp34 += m_A105 * V[35]; + tmp34 += m_A106 * V[36]; + tmp34 += m_A107 * V[40]; + V[34] = (RHS34 - tmp34) / m_A104; + double tmp33 = 0.0; + tmp33 += m_A100 * V[38]; + V[33] = (RHS33 - tmp33) / m_A99; + double tmp32 = 0.0; + tmp32 += m_A97 * V[39]; + V[32] = (RHS32 - tmp32) / m_A96; + double tmp31 = 0.0; + tmp31 += m_A93 * V[35]; + V[31] = (RHS31 - tmp31) / m_A92; + double tmp30 = 0.0; + tmp30 += m_A89 * V[37]; + V[30] = (RHS30 - tmp30) / m_A88; + double tmp29 = 0.0; + tmp29 += m_A83 * V[34]; + tmp29 += m_A84 * V[35]; + tmp29 += m_A85 * V[36]; + V[29] = (RHS29 - tmp29) / m_A82; + double tmp28 = 0.0; + tmp28 += m_A79 * V[40]; + V[28] = (RHS28 - tmp28) / m_A78; + double tmp27 = 0.0; + tmp27 += m_A75 * V[35]; + V[27] = (RHS27 - tmp27) / m_A74; + double tmp26 = 0.0; + tmp26 += m_A70 * V[28]; + V[26] = (RHS26 - tmp26) / m_A69; + double tmp25 = 0.0; + tmp25 += m_A66 * V[40]; + V[25] = (RHS25 - tmp25) / m_A65; + double tmp24 = 0.0; + tmp24 += m_A62 * V[40]; + V[24] = (RHS24 - tmp24) / m_A61; + double tmp23 = 0.0; + tmp23 += m_A59 * V[25]; + V[23] = (RHS23 - tmp23) / m_A58; + double tmp22 = 0.0; + tmp22 += m_A54 * V[38]; + tmp22 += m_A55 * V[40]; + V[22] = (RHS22 - tmp22) / m_A53; + double tmp21 = 0.0; + tmp21 += m_A51 * V[24]; + tmp21 += m_A52 * V[40]; + V[21] = (RHS21 - tmp21) / m_A50; + double tmp20 = 0.0; + tmp20 += m_A48 * V[32]; + tmp20 += m_A49 * V[39]; + V[20] = (RHS20 - tmp20) / m_A47; + double tmp19 = 0.0; + tmp19 += m_A45 * V[31]; + tmp19 += m_A46 * V[35]; + V[19] = (RHS19 - tmp19) / m_A44; + double tmp18 = 0.0; + tmp18 += m_A42 * V[30]; + tmp18 += m_A43 * V[37]; + V[18] = (RHS18 - tmp18) / m_A41; + double tmp17 = 0.0; + tmp17 += m_A40 * V[35]; + V[17] = (RHS17 - tmp17) / m_A39; + double tmp16 = 0.0; + tmp16 += m_A37 * V[29]; + tmp16 += m_A38 * V[36]; + V[16] = (RHS16 - tmp16) / m_A36; + double tmp15 = 0.0; + tmp15 += m_A34 * V[29]; + tmp15 += m_A35 * V[34]; + V[15] = (RHS15 - tmp15) / m_A33; + double tmp14 = 0.0; + tmp14 += m_A32 * V[35]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + tmp13 += m_A29 * V[27]; + tmp13 += m_A30 * V[35]; + V[13] = (RHS13 - tmp13) / m_A28; + double tmp12 = 0.0; + tmp12 += m_A27 * V[31]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A25 * V[27]; + V[11] = (RHS11 - tmp11) / m_A24; + double tmp10 = 0.0; + tmp10 += m_A23 * V[27]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + tmp9 += m_A20 * V[26]; + tmp9 += m_A21 * V[28]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[36]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A15 * V[23]; + tmp7 += m_A16 * V[25]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[24]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[32]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[26]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[23]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[30]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[34]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[33]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_15_double_double_bb56fa5325163fc3(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A3 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A6 += go[12]; + m_A6 += go[13]; + m_A5 += go[14]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 -= go[15] * *cnV[15]; + m_A9 += gt[16]; + m_A9 += gt[17]; + m_A8 += go[16]; + m_A7 += go[17]; + double RHS3 = Idr[16]; + RHS3 += Idr[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A11 += go[18]; + m_A12 += go[19]; + m_A12 += go[20]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A11; + m_A12 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A5 * f2_3; + m_A10 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_4 = -f2 * m_A12; + m_A13 += m_A5 * f2_4; + m_A14 += m_A6 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A14; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + tmp2 += m_A6 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor,spacfury +static void nl_gcr_18_double_double_e8aeb165b69427ec(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A6 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A8 += go[8]; + m_A7 += go[9]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + m_A13 += gt[10]; + m_A13 += gt[11]; + m_A13 += gt[12]; + m_A14 += go[10]; + m_A11 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A17 += gt[13]; + m_A17 += gt[14]; + m_A17 += gt[15]; + m_A15 += go[13]; + m_A16 += go[14]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[15] * *cnV[15]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A11; + m_A12 += m_A3 * f1_4; + m_A13 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_5 = -f2 * m_A15; + m_A17 += m_A6 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A12; + m_A13 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_5 = -f4 * m_A16; + m_A17 += m_A14 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A17; + double tmp4 = 0.0; + tmp4 += m_A14 * V[5]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_18_double_double_fcce97532ad2f49d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[5]; + m_A3 += go[6]; + m_A3 += go[7]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A6 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A8 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A10 += go[15]; + m_A10 += go[16]; + m_A9 += go[17]; + m_A9 += go[18]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A17 += gt[26]; + m_A15 += go[23]; + m_A14 += go[24]; + m_A13 += go[25]; + double RHS5 = Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[26] * *cnV[26]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A9; + m_A11 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A10; + m_A11 += m_A3 * f1_4; + m_A12 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A13; + m_A16 += m_A3 * f1_5; + m_A17 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_5 = -f2 * m_A14; + m_A17 += m_A6 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_5 = -f3 * m_A15; + m_A17 += m_A8 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_5 = -f4 * m_A16; + m_A17 += m_A12 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A17; + double tmp4 = 0.0; + tmp4 += m_A12 * V[5]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[5]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_20_double_double_d2ea3f267b959e8b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + m_A2 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[2] * *cnV[2]; + m_A3 += gt[3]; + m_A3 += gt[4]; + m_A4 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A7 += go[5]; + m_A6 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + m_A10 += gt[7]; + m_A10 += gt[8]; + m_A10 += gt[9]; + m_A9 += go[7]; + m_A8 += go[8]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[9] * *cnV[9]; + m_A15 += gt[10]; + m_A15 += gt[11]; + m_A15 += gt[12]; + m_A13 += go[10]; + m_A12 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A19 += gt[13]; + m_A19 += gt[14]; + m_A19 += gt[15]; + m_A17 += go[13]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[14] * *cnV[14]; + RHS5 -= go[15] * *cnV[15]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + m_A11 += m_A2 * f0_3; + RHS3 += f0_3 * RHS0; + const double f0_4 = -f0 * m_A12; + m_A14 += m_A1 * f0_4; + m_A15 += m_A2 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A13; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A17; + m_A18 += m_A6 * f2_5; + m_A19 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + RHS4 += f3_4 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A19; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + tmp0 += m_A2 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_36_double_double_e76692c10e79997e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A4 += gt[14]; + m_A5 += go[8]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A6 += gt[17]; + m_A7 += go[15]; + double RHS3 = Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A8 += gt[22]; + m_A8 += gt[23]; + m_A10 += go[18]; + m_A9 += go[19]; + m_A11 += go[20]; + m_A11 += go[21]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A12 += gt[26]; + m_A13 += go[24]; + double RHS5 = Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A15 += go[27]; + m_A14 += go[28]; + double RHS6 = Idr[27]; + RHS6 += Idr[28]; + m_A21 += gt[29]; + m_A21 += gt[30]; + m_A21 += gt[31]; + m_A21 += gt[32]; + m_A22 += go[29]; + m_A20 += go[30]; + m_A19 += go[31]; + double RHS7 = Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 -= go[32] * *cnV[32]; + m_A24 += gt[33]; + m_A24 += gt[34]; + m_A24 += gt[35]; + m_A24 += gt[36]; + m_A24 += gt[37]; + m_A24 += gt[38]; + m_A24 += gt[39]; + m_A23 += go[33]; + m_A25 += go[34]; + double RHS8 = Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 += Idr[38]; + RHS8 += Idr[39]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + RHS8 -= go[38] * *cnV[38]; + RHS8 -= go[39] * *cnV[39]; + m_A30 += gt[40]; + m_A30 += gt[41]; + m_A30 += gt[42]; + m_A30 += gt[43]; + m_A27 += go[40]; + m_A27 += go[41]; + m_A26 += go[42]; + m_A31 += go[43]; + double RHS9 = Idr[40]; + RHS9 += Idr[41]; + RHS9 += Idr[42]; + RHS9 += Idr[43]; + m_A35 += gt[44]; + m_A35 += gt[45]; + m_A35 += gt[46]; + m_A35 += gt[47]; + m_A35 += gt[48]; + m_A32 += go[44]; + m_A34 += go[45]; + m_A33 += go[46]; + double RHS10 = Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + RHS10 += Idr[47]; + RHS10 += Idr[48]; + RHS10 -= go[47] * *cnV[47]; + RHS10 -= go[48] * *cnV[48]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A19; + m_A21 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A20; + m_A21 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_10 = -f2 * m_A32; + m_A33 += m_A5 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_8 = -f3 * m_A23; + m_A25 += m_A7 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A26; + m_A30 += m_A7 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_6 = -f4 * m_A14; + m_A16 += m_A9 * f4_6; + m_A17 += m_A10 * f4_6; + m_A18 += m_A11 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_9 = -f4 * m_A27; + m_A28 += m_A9 * f4_9; + m_A29 += m_A10 * f4_9; + m_A30 += m_A11 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_6 = -f5 * m_A15; + m_A16 += m_A13 * f5_6; + RHS6 += f5_6 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_9 = -f6 * m_A28; + m_A29 += m_A17 * f6_9; + m_A30 += m_A18 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_10 = -f7 * m_A33; + m_A35 += m_A22 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A24; + const double f8_9 = -f8 * m_A29; + m_A30 += m_A25 * f8_9; + RHS9 += f8_9 * RHS8; + const double f9 = 1.0 / m_A30; + const double f9_10 = -f9 * m_A34; + m_A35 += m_A31 * f9_10; + RHS10 += f9_10 * RHS9; + V[10] = RHS10 / m_A35; + double tmp9 = 0.0; + tmp9 += m_A31 * V[10]; + V[9] = (RHS9 - tmp9) / m_A30; + double tmp8 = 0.0; + tmp8 += m_A25 * V[9]; + V[8] = (RHS8 - tmp8) / m_A24; + double tmp7 = 0.0; + tmp7 += m_A22 * V[10]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A17 * V[8]; + tmp6 += m_A18 * V[9]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A13 * V[6]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A9 * V[6]; + tmp4 += m_A10 * V[8]; + tmp4 += m_A11 * V[9]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// elim,zektor +static void nl_gcr_45_double_double_28b736fe552777a9(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A11 += go[15]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 -= go[16] * *cnV[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A13 += go[17]; + double RHS6 = Idr[17]; + RHS6 += Idr[18]; + RHS6 -= go[18] * *cnV[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A15 += go[19]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 -= go[20] * *cnV[20]; + RHS7 -= go[21] * *cnV[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A17 += go[22]; + double RHS8 = Idr[22]; + RHS8 += Idr[23]; + RHS8 += Idr[24]; + RHS8 -= go[23] * *cnV[23]; + RHS8 -= go[24] * *cnV[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A18 += gt[27]; + m_A19 += go[25]; + double RHS9 = Idr[25]; + RHS9 += Idr[26]; + RHS9 += Idr[27]; + RHS9 -= go[26] * *cnV[26]; + RHS9 -= go[27] * *cnV[27]; + m_A20 += gt[28]; + m_A20 += gt[29]; + m_A22 += go[28]; + m_A21 += go[29]; + double RHS10 = Idr[28]; + RHS10 += Idr[29]; + m_A32 += gt[30]; + m_A32 += gt[31]; + m_A32 += gt[32]; + m_A32 += gt[33]; + m_A32 += gt[34]; + m_A32 += gt[35]; + m_A32 += gt[36]; + m_A32 += gt[37]; + m_A32 += gt[38]; + m_A31 += go[30]; + m_A30 += go[31]; + m_A29 += go[32]; + m_A28 += go[33]; + m_A27 += go[34]; + m_A26 += go[35]; + m_A25 += go[36]; + m_A24 += go[37]; + m_A23 += go[38]; + double RHS11 = Idr[30]; + RHS11 += Idr[31]; + RHS11 += Idr[32]; + RHS11 += Idr[33]; + RHS11 += Idr[34]; + RHS11 += Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + m_A34 += gt[39]; + m_A34 += gt[40]; + m_A35 += go[39]; + double RHS12 = Idr[39]; + RHS12 += Idr[40]; + RHS12 -= go[40] * *cnV[40]; + m_A36 += gt[41]; + m_A36 += gt[42]; + m_A37 += go[41]; + double RHS13 = Idr[41]; + RHS13 += Idr[42]; + RHS13 -= go[42] * *cnV[42]; + m_A44 += gt[43]; + m_A44 += gt[44]; + m_A44 += gt[45]; + m_A44 += gt[46]; + m_A44 += gt[47]; + m_A43 += go[43]; + m_A42 += go[44]; + m_A39 += go[45]; + m_A38 += go[46]; + m_A40 += go[47]; + double RHS14 = Idr[43]; + RHS14 += Idr[44]; + RHS14 += Idr[45]; + RHS14 += Idr[46]; + RHS14 += Idr[47]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A23; + m_A32 += m_A1 * f0_11; + RHS11 += f0_11 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_11 = -f1 * m_A24; + m_A32 += m_A3 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_11 = -f2 * m_A25; + m_A32 += m_A5 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_11 = -f3 * m_A26; + m_A32 += m_A7 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_11 = -f4 * m_A27; + m_A32 += m_A9 * f4_11; + RHS11 += f4_11 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_14 = -f5 * m_A38; + m_A44 += m_A11 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_14 = -f6 * m_A39; + m_A44 += m_A13 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_11 = -f7 * m_A28; + m_A32 += m_A15 * f7_11; + RHS11 += f7_11 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_11 = -f8 * m_A29; + m_A32 += m_A17 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_11 = -f9 * m_A30; + m_A32 += m_A19 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_11 = -f10 * m_A31; + m_A32 += m_A21 * f10_11; + m_A33 += m_A22 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_14 = -f10 * m_A40; + m_A41 += m_A21 * f10_14; + m_A44 += m_A22 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A32; + const double f11_14 = -f11 * m_A41; + m_A44 += m_A33 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A34; + const double f12_14 = -f12 * m_A42; + m_A44 += m_A35 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A36; + const double f13_14 = -f13 * m_A43; + m_A44 += m_A37 * f13_14; + RHS14 += f13_14 * RHS13; + V[14] = RHS14 / m_A44; + double tmp13 = 0.0; + tmp13 += m_A37 * V[14]; + V[13] = (RHS13 - tmp13) / m_A36; + double tmp12 = 0.0; + tmp12 += m_A35 * V[14]; + V[12] = (RHS12 - tmp12) / m_A34; + double tmp11 = 0.0; + tmp11 += m_A33 * V[14]; + V[11] = (RHS11 - tmp11) / m_A32; + double tmp10 = 0.0; + tmp10 += m_A21 * V[11]; + tmp10 += m_A22 * V[14]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[11]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[11]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[11]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[14]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[14]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[11]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[11]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[11]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[11]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_128_double_double_7aee4423e3fdbfda(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A7 += go[4]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A9 += go[8]; + m_A10 += go[9]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 -= go[10] * *cnV[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A12 += go[11]; + double RHS4 = Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A16 += go[13]; + m_A17 += go[14]; + m_A15 += go[15]; + m_A14 += go[16]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[17] * *cnV[17]; + RHS5 -= go[18] * *cnV[18]; + RHS5 -= go[19] * *cnV[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A21 += go[20]; + m_A22 += go[21]; + m_A19 += go[22]; + m_A20 += go[23]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + m_A23 += gt[27]; + m_A23 += gt[28]; + m_A23 += gt[29]; + m_A24 += go[27]; + m_A25 += go[28]; + double RHS7 = Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 -= go[29] * *cnV[29]; + m_A26 += gt[30]; + m_A26 += gt[31]; + m_A27 += go[30]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[31] * *cnV[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A29 += go[32]; + m_A30 += go[33]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 -= go[34] * *cnV[34]; + m_A31 += gt[35]; + m_A31 += gt[36]; + m_A31 += gt[37]; + m_A32 += go[35]; + double RHS10 = Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 -= go[36] * *cnV[36]; + RHS10 -= go[37] * *cnV[37]; + m_A33 += gt[38]; + m_A33 += gt[39]; + m_A33 += gt[40]; + m_A35 += go[38]; + m_A34 += go[39]; + double RHS11 = Idr[38]; + RHS11 += Idr[39]; + RHS11 += Idr[40]; + RHS11 -= go[40] * *cnV[40]; + m_A38 += gt[41]; + m_A38 += gt[42]; + m_A38 += gt[43]; + m_A38 += gt[44]; + m_A37 += go[41]; + m_A36 += go[42]; + double RHS12 = Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + RHS12 -= go[43] * *cnV[43]; + RHS12 -= go[44] * *cnV[44]; + m_A44 += gt[45]; + m_A44 += gt[46]; + m_A44 += gt[47]; + m_A44 += gt[48]; + m_A42 += go[45]; + m_A41 += go[46]; + double RHS13 = Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 += Idr[48]; + RHS13 -= go[47] * *cnV[47]; + RHS13 -= go[48] * *cnV[48]; + m_A50 += gt[49]; + m_A50 += gt[50]; + m_A50 += gt[51]; + m_A49 += go[49]; + m_A51 += go[50]; + double RHS14 = Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 -= go[51] * *cnV[51]; + m_A53 += gt[52]; + m_A53 += gt[53]; + m_A53 += gt[54]; + m_A53 += gt[55]; + m_A52 += go[52]; + m_A54 += go[53]; + double RHS15 = Idr[52]; + RHS15 += Idr[53]; + RHS15 += Idr[54]; + RHS15 += Idr[55]; + RHS15 -= go[54] * *cnV[54]; + RHS15 -= go[55] * *cnV[55]; + m_A59 += gt[56]; + m_A59 += gt[57]; + m_A59 += gt[58]; + m_A59 += gt[59]; + m_A59 += gt[60]; + m_A59 += gt[61]; + m_A62 += go[56]; + m_A57 += go[57]; + m_A56 += go[58]; + m_A55 += go[59]; + m_A61 += go[60]; + double RHS16 = Idr[56]; + RHS16 += Idr[57]; + RHS16 += Idr[58]; + RHS16 += Idr[59]; + RHS16 += Idr[60]; + RHS16 += Idr[61]; + RHS16 -= go[61] * *cnV[61]; + m_A66 += gt[62]; + m_A66 += gt[63]; + m_A66 += gt[64]; + m_A66 += gt[65]; + m_A65 += go[62]; + m_A64 += go[63]; + m_A67 += go[64]; + double RHS17 = Idr[62]; + RHS17 += Idr[63]; + RHS17 += Idr[64]; + RHS17 += Idr[65]; + RHS17 -= go[65] * *cnV[65]; + m_A73 += gt[66]; + m_A73 += gt[67]; + m_A73 += gt[68]; + m_A73 += gt[69]; + m_A76 += go[66]; + m_A69 += go[67]; + m_A68 += go[68]; + double RHS18 = Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 -= go[69] * *cnV[69]; + m_A79 += gt[70]; + m_A79 += gt[71]; + m_A78 += go[70]; + double RHS19 = Idr[70]; + RHS19 += Idr[71]; + RHS19 -= go[71] * *cnV[71]; + m_A83 += gt[72]; + m_A83 += gt[73]; + m_A83 += gt[74]; + m_A82 += go[72]; + m_A81 += go[73]; + double RHS20 = Idr[72]; + RHS20 += Idr[73]; + RHS20 += Idr[74]; + RHS20 -= go[74] * *cnV[74]; + m_A87 += gt[75]; + m_A87 += gt[76]; + m_A87 += gt[77]; + m_A87 += gt[78]; + m_A87 += gt[79]; + m_A87 += gt[80]; + m_A87 += gt[81]; + m_A88 += go[75]; + m_A85 += go[76]; + double RHS21 = Idr[75]; + RHS21 += Idr[76]; + RHS21 += Idr[77]; + RHS21 += Idr[78]; + RHS21 += Idr[79]; + RHS21 += Idr[80]; + RHS21 += Idr[81]; + RHS21 -= go[77] * *cnV[77]; + RHS21 -= go[78] * *cnV[78]; + RHS21 -= go[79] * *cnV[79]; + RHS21 -= go[80] * *cnV[80]; + RHS21 -= go[81] * *cnV[81]; + m_A95 += gt[82]; + m_A95 += gt[83]; + m_A95 += gt[84]; + m_A95 += gt[85]; + m_A90 += go[82]; + m_A89 += go[83]; + m_A92 += go[84]; + m_A91 += go[85]; + double RHS22 = Idr[82]; + RHS22 += Idr[83]; + RHS22 += Idr[84]; + RHS22 += Idr[85]; + m_A106 += gt[86]; + m_A106 += gt[87]; + m_A106 += gt[88]; + m_A106 += gt[89]; + m_A106 += gt[90]; + m_A106 += gt[91]; + m_A106 += gt[92]; + m_A106 += gt[93]; + m_A102 += go[86]; + m_A100 += go[87]; + m_A108 += go[88]; + m_A99 += go[89]; + m_A103 += go[90]; + double RHS23 = Idr[86]; + RHS23 += Idr[87]; + RHS23 += Idr[88]; + RHS23 += Idr[89]; + RHS23 += Idr[90]; + RHS23 += Idr[91]; + RHS23 += Idr[92]; + RHS23 += Idr[93]; + RHS23 -= go[91] * *cnV[91]; + RHS23 -= go[92] * *cnV[92]; + RHS23 -= go[93] * *cnV[93]; + m_A115 += gt[94]; + m_A115 += gt[95]; + m_A115 += gt[96]; + m_A115 += gt[97]; + m_A115 += gt[98]; + m_A112 += go[94]; + m_A109 += go[95]; + m_A110 += go[96]; + double RHS24 = Idr[94]; + RHS24 += Idr[95]; + RHS24 += Idr[96]; + RHS24 += Idr[97]; + RHS24 += Idr[98]; + RHS24 -= go[97] * *cnV[97]; + RHS24 -= go[98] * *cnV[98]; + m_A127 += gt[99]; + m_A127 += gt[100]; + m_A127 += gt[101]; + m_A127 += gt[102]; + m_A127 += gt[103]; + m_A127 += gt[104]; + m_A122 += go[99]; + m_A125 += go[100]; + m_A118 += go[101]; + m_A119 += go[102]; + m_A117 += go[103]; + double RHS25 = Idr[99]; + RHS25 += Idr[100]; + RHS25 += Idr[101]; + RHS25 += Idr[102]; + RHS25 += Idr[103]; + RHS25 += Idr[104]; + RHS25 -= go[104] * *cnV[104]; + const double f0 = 1.0 / m_A0; + const double f0_12 = -f0 * m_A36; + m_A38 += m_A1 * f0_12; + RHS12 += f0_12 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_14 = -f1 * m_A49; + m_A50 += m_A3 * f1_14; + RHS14 += f1_14 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_12 = -f2 * m_A37; + m_A38 += m_A5 * f2_12; + m_A39 += m_A6 * f2_12; + m_A40 += m_A7 * f2_12; + RHS12 += f2_12 * RHS2; + const double f2_13 = -f2 * m_A41; + m_A43 += m_A5 * f2_13; + m_A44 += m_A6 * f2_13; + m_A46 += m_A7 * f2_13; + RHS13 += f2_13 * RHS2; + const double f2_18 = -f2 * m_A68; + m_A70 += m_A5 * f2_18; + m_A71 += m_A6 * f2_18; + m_A73 += m_A7 * f2_18; + RHS18 += f2_18 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_16 = -f3 * m_A55; + m_A59 += m_A9 * f3_16; + m_A61 += m_A10 * f3_16; + RHS16 += f3_16 * RHS3; + const double f3_22 = -f3 * m_A89; + m_A92 += m_A9 * f3_22; + m_A95 += m_A10 * f3_22; + RHS22 += f3_22 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_15 = -f4 * m_A52; + m_A53 += m_A12 * f4_15; + RHS15 += f4_15 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_13 = -f5 * m_A42; + m_A44 += m_A14 * f5_13; + m_A45 += m_A15 * f5_13; + m_A47 += m_A16 * f5_13; + m_A48 += m_A17 * f5_13; + RHS13 += f5_13 * RHS5; + const double f5_16 = -f5 * m_A56; + m_A58 += m_A14 * f5_16; + m_A59 += m_A15 * f5_16; + m_A62 += m_A16 * f5_16; + m_A63 += m_A17 * f5_16; + RHS16 += f5_16 * RHS5; + const double f5_23 = -f5 * m_A99; + m_A101 += m_A14 * f5_23; + m_A103 += m_A15 * f5_23; + m_A106 += m_A16 * f5_23; + m_A108 += m_A17 * f5_23; + RHS23 += f5_23 * RHS5; + const double f5_25 = -f5 * m_A117; + m_A120 += m_A14 * f5_25; + m_A121 += m_A15 * f5_25; + m_A125 += m_A16 * f5_25; + m_A127 += m_A17 * f5_25; + RHS25 += f5_25 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_16 = -f6 * m_A57; + m_A59 += m_A19 * f6_16; + m_A60 += m_A20 * f6_16; + m_A62 += m_A21 * f6_16; + m_A63 += m_A22 * f6_16; + RHS16 += f6_16 * RHS6; + const double f6_18 = -f6 * m_A69; + m_A72 += m_A19 * f6_18; + m_A73 += m_A20 * f6_18; + m_A75 += m_A21 * f6_18; + m_A77 += m_A22 * f6_18; + RHS18 += f6_18 * RHS6; + const double f6_23 = -f6 * m_A100; + m_A103 += m_A19 * f6_23; + m_A104 += m_A20 * f6_23; + m_A106 += m_A21 * f6_23; + m_A108 += m_A22 * f6_23; + RHS23 += f6_23 * RHS6; + const double f6_25 = -f6 * m_A118; + m_A121 += m_A19 * f6_25; + m_A123 += m_A20 * f6_25; + m_A125 += m_A21 * f6_25; + m_A127 += m_A22 * f6_25; + RHS25 += f6_25 * RHS6; + const double f7 = 1.0 / m_A23; + const double f7_17 = -f7 * m_A64; + m_A66 += m_A24 * f7_17; + m_A67 += m_A25 * f7_17; + RHS17 += f7_17 * RHS7; + const double f7_25 = -f7 * m_A119; + m_A122 += m_A24 * f7_25; + m_A127 += m_A25 * f7_25; + RHS25 += f7_25 * RHS7; + const double f8 = 1.0 / m_A26; + const double f8_17 = -f8 * m_A65; + m_A66 += m_A27 * f8_17; + RHS17 += f8_17 * RHS8; + const double f9 = 1.0 / m_A28; + const double f9_19 = -f9 * m_A78; + m_A79 += m_A29 * f9_19; + m_A80 += m_A30 * f9_19; + RHS19 += f9_19 * RHS9; + const double f9_22 = -f9 * m_A90; + m_A94 += m_A29 * f9_22; + m_A95 += m_A30 * f9_22; + RHS22 += f9_22 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_20 = -f10 * m_A81; + m_A83 += m_A32 * f10_20; + RHS20 += f10_20 * RHS10; + const double f11 = 1.0 / m_A33; + const double f11_20 = -f11 * m_A82; + m_A83 += m_A34 * f11_20; + m_A84 += m_A35 * f11_20; + RHS20 += f11_20 * RHS11; + const double f11_21 = -f11 * m_A85; + m_A86 += m_A34 * f11_21; + m_A88 += m_A35 * f11_21; + RHS21 += f11_21 * RHS11; + const double f11_24 = -f11 * m_A109; + m_A111 += m_A34 * f11_24; + m_A115 += m_A35 * f11_24; + RHS24 += f11_24 * RHS11; + const double f12 = 1.0 / m_A38; + const double f12_13 = -f12 * m_A43; + m_A44 += m_A39 * f12_13; + m_A46 += m_A40 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_18 = -f12 * m_A70; + m_A71 += m_A39 * f12_18; + m_A73 += m_A40 * f12_18; + RHS18 += f12_18 * RHS12; + const double f13 = 1.0 / m_A44; + const double f13_16 = -f13 * m_A58; + m_A59 += m_A45 * f13_16; + m_A60 += m_A46 * f13_16; + m_A62 += m_A47 * f13_16; + m_A63 += m_A48 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_18 = -f13 * m_A71; + m_A72 += m_A45 * f13_18; + m_A73 += m_A46 * f13_18; + m_A75 += m_A47 * f13_18; + m_A77 += m_A48 * f13_18; + RHS18 += f13_18 * RHS13; + const double f13_23 = -f13 * m_A101; + m_A103 += m_A45 * f13_23; + m_A104 += m_A46 * f13_23; + m_A106 += m_A47 * f13_23; + m_A108 += m_A48 * f13_23; + RHS23 += f13_23 * RHS13; + const double f13_25 = -f13 * m_A120; + m_A121 += m_A45 * f13_25; + m_A123 += m_A46 * f13_25; + m_A125 += m_A47 * f13_25; + m_A127 += m_A48 * f13_25; + RHS25 += f13_25 * RHS13; + const double f14 = 1.0 / m_A50; + const double f14_22 = -f14 * m_A91; + m_A95 += m_A51 * f14_22; + RHS22 += f14_22 * RHS14; + const double f15 = 1.0 / m_A53; + const double f15_23 = -f15 * m_A102; + m_A106 += m_A54 * f15_23; + RHS23 += f15_23 * RHS15; + const double f16 = 1.0 / m_A59; + const double f16_18 = -f16 * m_A72; + m_A73 += m_A60 * f16_18; + m_A74 += m_A61 * f16_18; + m_A75 += m_A62 * f16_18; + m_A77 += m_A63 * f16_18; + RHS18 += f16_18 * RHS16; + const double f16_22 = -f16 * m_A92; + m_A93 += m_A60 * f16_22; + m_A95 += m_A61 * f16_22; + m_A96 += m_A62 * f16_22; + m_A98 += m_A63 * f16_22; + RHS22 += f16_22 * RHS16; + const double f16_23 = -f16 * m_A103; + m_A104 += m_A60 * f16_23; + m_A105 += m_A61 * f16_23; + m_A106 += m_A62 * f16_23; + m_A108 += m_A63 * f16_23; + RHS23 += f16_23 * RHS16; + const double f16_25 = -f16 * m_A121; + m_A123 += m_A60 * f16_25; + m_A124 += m_A61 * f16_25; + m_A125 += m_A62 * f16_25; + m_A127 += m_A63 * f16_25; + RHS25 += f16_25 * RHS16; + const double f17 = 1.0 / m_A66; + const double f17_25 = -f17 * m_A122; + m_A127 += m_A67 * f17_25; + RHS25 += f17_25 * RHS17; + const double f18 = 1.0 / m_A73; + const double f18_22 = -f18 * m_A93; + m_A95 += m_A74 * f18_22; + m_A96 += m_A75 * f18_22; + m_A97 += m_A76 * f18_22; + m_A98 += m_A77 * f18_22; + RHS22 += f18_22 * RHS18; + const double f18_23 = -f18 * m_A104; + m_A105 += m_A74 * f18_23; + m_A106 += m_A75 * f18_23; + m_A107 += m_A76 * f18_23; + m_A108 += m_A77 * f18_23; + RHS23 += f18_23 * RHS18; + const double f18_24 = -f18 * m_A110; + m_A113 += m_A74 * f18_24; + m_A114 += m_A75 * f18_24; + m_A115 += m_A76 * f18_24; + m_A116 += m_A77 * f18_24; + RHS24 += f18_24 * RHS18; + const double f18_25 = -f18 * m_A123; + m_A124 += m_A74 * f18_25; + m_A125 += m_A75 * f18_25; + m_A126 += m_A76 * f18_25; + m_A127 += m_A77 * f18_25; + RHS25 += f18_25 * RHS18; + const double f19 = 1.0 / m_A79; + const double f19_22 = -f19 * m_A94; + m_A95 += m_A80 * f19_22; + RHS22 += f19_22 * RHS19; + const double f20 = 1.0 / m_A83; + const double f20_21 = -f20 * m_A86; + m_A88 += m_A84 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_24 = -f20 * m_A111; + m_A115 += m_A84 * f20_24; + RHS24 += f20_24 * RHS20; + const double f21 = 1.0 / m_A87; + const double f21_24 = -f21 * m_A112; + m_A115 += m_A88 * f21_24; + RHS24 += f21_24 * RHS21; + const double f22 = 1.0 / m_A95; + const double f22_23 = -f22 * m_A105; + m_A106 += m_A96 * f22_23; + m_A107 += m_A97 * f22_23; + m_A108 += m_A98 * f22_23; + RHS23 += f22_23 * RHS22; + const double f22_24 = -f22 * m_A113; + m_A114 += m_A96 * f22_24; + m_A115 += m_A97 * f22_24; + m_A116 += m_A98 * f22_24; + RHS24 += f22_24 * RHS22; + const double f22_25 = -f22 * m_A124; + m_A125 += m_A96 * f22_25; + m_A126 += m_A97 * f22_25; + m_A127 += m_A98 * f22_25; + RHS25 += f22_25 * RHS22; + const double f23 = 1.0 / m_A106; + const double f23_24 = -f23 * m_A114; + m_A115 += m_A107 * f23_24; + m_A116 += m_A108 * f23_24; + RHS24 += f23_24 * RHS23; + const double f23_25 = -f23 * m_A125; + m_A126 += m_A107 * f23_25; + m_A127 += m_A108 * f23_25; + RHS25 += f23_25 * RHS23; + const double f24 = 1.0 / m_A115; + const double f24_25 = -f24 * m_A126; + m_A127 += m_A116 * f24_25; + RHS25 += f24_25 * RHS24; + V[25] = RHS25 / m_A127; + double tmp24 = 0.0; + tmp24 += m_A116 * V[25]; + V[24] = (RHS24 - tmp24) / m_A115; + double tmp23 = 0.0; + tmp23 += m_A107 * V[24]; + tmp23 += m_A108 * V[25]; + V[23] = (RHS23 - tmp23) / m_A106; + double tmp22 = 0.0; + tmp22 += m_A96 * V[23]; + tmp22 += m_A97 * V[24]; + tmp22 += m_A98 * V[25]; + V[22] = (RHS22 - tmp22) / m_A95; + double tmp21 = 0.0; + tmp21 += m_A88 * V[24]; + V[21] = (RHS21 - tmp21) / m_A87; + double tmp20 = 0.0; + tmp20 += m_A84 * V[24]; + V[20] = (RHS20 - tmp20) / m_A83; + double tmp19 = 0.0; + tmp19 += m_A80 * V[22]; + V[19] = (RHS19 - tmp19) / m_A79; + double tmp18 = 0.0; + tmp18 += m_A74 * V[22]; + tmp18 += m_A75 * V[23]; + tmp18 += m_A76 * V[24]; + tmp18 += m_A77 * V[25]; + V[18] = (RHS18 - tmp18) / m_A73; + double tmp17 = 0.0; + tmp17 += m_A67 * V[25]; + V[17] = (RHS17 - tmp17) / m_A66; + double tmp16 = 0.0; + tmp16 += m_A60 * V[18]; + tmp16 += m_A61 * V[22]; + tmp16 += m_A62 * V[23]; + tmp16 += m_A63 * V[25]; + V[16] = (RHS16 - tmp16) / m_A59; + double tmp15 = 0.0; + tmp15 += m_A54 * V[23]; + V[15] = (RHS15 - tmp15) / m_A53; + double tmp14 = 0.0; + tmp14 += m_A51 * V[22]; + V[14] = (RHS14 - tmp14) / m_A50; + double tmp13 = 0.0; + tmp13 += m_A45 * V[16]; + tmp13 += m_A46 * V[18]; + tmp13 += m_A47 * V[23]; + tmp13 += m_A48 * V[25]; + V[13] = (RHS13 - tmp13) / m_A44; + double tmp12 = 0.0; + tmp12 += m_A39 * V[13]; + tmp12 += m_A40 * V[18]; + V[12] = (RHS12 - tmp12) / m_A38; + double tmp11 = 0.0; + tmp11 += m_A34 * V[20]; + tmp11 += m_A35 * V[24]; + V[11] = (RHS11 - tmp11) / m_A33; + double tmp10 = 0.0; + tmp10 += m_A32 * V[20]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A29 * V[19]; + tmp9 += m_A30 * V[22]; + V[9] = (RHS9 - tmp9) / m_A28; + double tmp8 = 0.0; + tmp8 += m_A27 * V[17]; + V[8] = (RHS8 - tmp8) / m_A26; + double tmp7 = 0.0; + tmp7 += m_A24 * V[17]; + tmp7 += m_A25 * V[25]; + V[7] = (RHS7 - tmp7) / m_A23; + double tmp6 = 0.0; + tmp6 += m_A19 * V[16]; + tmp6 += m_A20 * V[18]; + tmp6 += m_A21 * V[23]; + tmp6 += m_A22 * V[25]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A14 * V[13]; + tmp5 += m_A15 * V[16]; + tmp5 += m_A16 * V[23]; + tmp5 += m_A17 * V[25]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A12 * V[15]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[16]; + tmp3 += m_A10 * V[22]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[12]; + tmp2 += m_A6 * V[13]; + tmp2 += m_A7 * V[18]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[14]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[12]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_153_double_double_cca3d1a4219e2ec0(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A2 += gt[12]; + m_A2 += gt[13]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 += Idr[12]; + RHS1 += Idr[13]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + RHS1 -= go[12] * *cnV[12]; + RHS1 -= go[13] * *cnV[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A4 += gt[16]; + m_A5 += go[14]; + double RHS2 = Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 -= go[15] * *cnV[15]; + RHS2 -= go[16] * *cnV[16]; + m_A6 += gt[17]; + m_A6 += gt[18]; + m_A7 += go[17]; + double RHS3 = Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[18] * *cnV[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A9 += go[19]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[20] * *cnV[20]; + m_A10 += gt[21]; + m_A10 += gt[22]; + m_A11 += go[21]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[22] * *cnV[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A13 += go[23]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[24] * *cnV[24]; + m_A14 += gt[25]; + m_A14 += gt[26]; + m_A15 += go[25]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + RHS7 -= go[26] * *cnV[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A17 += go[27]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + RHS8 -= go[28] * *cnV[28]; + m_A18 += gt[29]; + m_A18 += gt[30]; + m_A19 += go[29]; + double RHS9 = Idr[29]; + RHS9 += Idr[30]; + RHS9 -= go[30] * *cnV[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A20 += gt[34]; + m_A21 += go[31]; + m_A22 += go[32]; + double RHS10 = Idr[31]; + RHS10 += Idr[32]; + RHS10 += Idr[33]; + RHS10 += Idr[34]; + RHS10 -= go[33] * *cnV[33]; + RHS10 -= go[34] * *cnV[34]; + m_A23 += gt[35]; + m_A23 += gt[36]; + m_A23 += gt[37]; + m_A23 += gt[38]; + m_A24 += go[35]; + m_A25 += go[36]; + double RHS11 = Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 -= go[37] * *cnV[37]; + RHS11 -= go[38] * *cnV[38]; + m_A26 += gt[39]; + m_A26 += gt[40]; + m_A26 += gt[41]; + m_A26 += gt[42]; + m_A27 += go[39]; + m_A28 += go[40]; + double RHS12 = Idr[39]; + RHS12 += Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 -= go[41] * *cnV[41]; + RHS12 -= go[42] * *cnV[42]; + m_A29 += gt[43]; + m_A29 += gt[44]; + m_A30 += go[43]; + double RHS13 = Idr[43]; + RHS13 += Idr[44]; + RHS13 -= go[44] * *cnV[44]; + m_A31 += gt[45]; + m_A31 += gt[46]; + m_A32 += go[45]; + double RHS14 = Idr[45]; + RHS14 += Idr[46]; + RHS14 -= go[46] * *cnV[46]; + m_A33 += gt[47]; + m_A33 += gt[48]; + m_A34 += go[47]; + double RHS15 = Idr[47]; + RHS15 += Idr[48]; + RHS15 -= go[48] * *cnV[48]; + m_A35 += gt[49]; + m_A35 += gt[50]; + m_A35 += gt[51]; + m_A36 += go[49]; + double RHS16 = Idr[49]; + RHS16 += Idr[50]; + RHS16 += Idr[51]; + RHS16 -= go[50] * *cnV[50]; + RHS16 -= go[51] * *cnV[51]; + m_A37 += gt[52]; + m_A37 += gt[53]; + m_A37 += gt[54]; + m_A37 += gt[55]; + m_A38 += go[52]; + double RHS17 = Idr[52]; + RHS17 += Idr[53]; + RHS17 += Idr[54]; + RHS17 += Idr[55]; + RHS17 -= go[53] * *cnV[53]; + RHS17 -= go[54] * *cnV[54]; + RHS17 -= go[55] * *cnV[55]; + m_A39 += gt[56]; + m_A39 += gt[57]; + m_A40 += go[56]; + double RHS18 = Idr[56]; + RHS18 += Idr[57]; + RHS18 -= go[57] * *cnV[57]; + m_A41 += gt[58]; + m_A41 += gt[59]; + m_A42 += go[58]; + double RHS19 = Idr[58]; + RHS19 += Idr[59]; + RHS19 -= go[59] * *cnV[59]; + m_A43 += gt[60]; + m_A43 += gt[61]; + m_A44 += go[60]; + double RHS20 = Idr[60]; + RHS20 += Idr[61]; + RHS20 -= go[61] * *cnV[61]; + m_A45 += gt[62]; + m_A45 += gt[63]; + m_A45 += gt[64]; + m_A45 += gt[65]; + m_A46 += go[62]; + double RHS21 = Idr[62]; + RHS21 += Idr[63]; + RHS21 += Idr[64]; + RHS21 += Idr[65]; + RHS21 -= go[63] * *cnV[63]; + RHS21 -= go[64] * *cnV[64]; + RHS21 -= go[65] * *cnV[65]; + m_A47 += gt[66]; + m_A47 += gt[67]; + m_A48 += go[66]; + double RHS22 = Idr[66]; + RHS22 += Idr[67]; + RHS22 -= go[67] * *cnV[67]; + m_A49 += gt[68]; + m_A49 += gt[69]; + m_A50 += go[68]; + double RHS23 = Idr[68]; + RHS23 += Idr[69]; + RHS23 -= go[69] * *cnV[69]; + m_A51 += gt[70]; + m_A51 += gt[71]; + m_A52 += go[70]; + double RHS24 = Idr[70]; + RHS24 += Idr[71]; + RHS24 -= go[71] * *cnV[71]; + m_A53 += gt[72]; + m_A53 += gt[73]; + m_A53 += gt[74]; + m_A54 += go[72]; + double RHS25 = Idr[72]; + RHS25 += Idr[73]; + RHS25 += Idr[74]; + RHS25 -= go[73] * *cnV[73]; + RHS25 -= go[74] * *cnV[74]; + m_A55 += gt[75]; + m_A55 += gt[76]; + m_A56 += go[75]; + m_A57 += go[76]; + double RHS26 = Idr[75]; + RHS26 += Idr[76]; + m_A58 += gt[77]; + m_A58 += gt[78]; + m_A58 += gt[79]; + m_A59 += go[77]; + double RHS27 = Idr[77]; + RHS27 += Idr[78]; + RHS27 += Idr[79]; + RHS27 -= go[78] * *cnV[78]; + RHS27 -= go[79] * *cnV[79]; + m_A60 += gt[80]; + m_A60 += gt[81]; + m_A61 += go[80]; + m_A62 += go[81]; + double RHS28 = Idr[80]; + RHS28 += Idr[81]; + m_A65 += gt[82]; + m_A65 += gt[83]; + m_A64 += go[82]; + m_A63 += go[83]; + double RHS29 = Idr[82]; + RHS29 += Idr[83]; + m_A66 += gt[84]; + m_A66 += gt[85]; + m_A66 += gt[86]; + m_A67 += go[84]; + double RHS30 = Idr[84]; + RHS30 += Idr[85]; + RHS30 += Idr[86]; + RHS30 -= go[85] * *cnV[85]; + RHS30 -= go[86] * *cnV[86]; + m_A70 += gt[87]; + m_A70 += gt[88]; + m_A69 += go[87]; + m_A68 += go[88]; + double RHS31 = Idr[87]; + RHS31 += Idr[88]; + m_A72 += gt[89]; + m_A72 += gt[90]; + m_A72 += gt[91]; + m_A72 += gt[92]; + m_A73 += go[89]; + m_A74 += go[90]; + m_A71 += go[91]; + double RHS32 = Idr[89]; + RHS32 += Idr[90]; + RHS32 += Idr[91]; + RHS32 += Idr[92]; + RHS32 -= go[92] * *cnV[92]; + m_A77 += gt[93]; + m_A77 += gt[94]; + m_A77 += gt[95]; + m_A75 += go[93]; + m_A76 += go[94]; + double RHS33 = Idr[93]; + RHS33 += Idr[94]; + RHS33 += Idr[95]; + RHS33 -= go[95] * *cnV[95]; + m_A81 += gt[96]; + m_A81 += gt[97]; + m_A81 += gt[98]; + m_A79 += go[96]; + m_A80 += go[97]; + double RHS34 = Idr[96]; + RHS34 += Idr[97]; + RHS34 += Idr[98]; + RHS34 -= go[98] * *cnV[98]; + m_A84 += gt[99]; + m_A84 += gt[100]; + m_A84 += gt[101]; + m_A85 += go[99]; + m_A83 += go[100]; + double RHS35 = Idr[99]; + RHS35 += Idr[100]; + RHS35 += Idr[101]; + RHS35 -= go[101] * *cnV[101]; + m_A87 += gt[102]; + m_A87 += gt[103]; + m_A87 += gt[104]; + m_A88 += go[102]; + m_A86 += go[103]; + double RHS36 = Idr[102]; + RHS36 += Idr[103]; + RHS36 += Idr[104]; + RHS36 -= go[104] * *cnV[104]; + m_A92 += gt[105]; + m_A92 += gt[106]; + m_A92 += gt[107]; + m_A92 += gt[108]; + m_A92 += gt[109]; + m_A92 += gt[110]; + m_A89 += go[105]; + m_A90 += go[106]; + m_A94 += go[107]; + m_A94 += go[108]; + double RHS37 = Idr[105]; + RHS37 += Idr[106]; + RHS37 += Idr[107]; + RHS37 += Idr[108]; + RHS37 += Idr[109]; + RHS37 += Idr[110]; + RHS37 -= go[109] * *cnV[109]; + RHS37 -= go[110] * *cnV[110]; + m_A98 += gt[111]; + m_A98 += gt[112]; + m_A98 += gt[113]; + m_A98 += gt[114]; + m_A98 += gt[115]; + m_A98 += gt[116]; + m_A95 += go[111]; + m_A96 += go[112]; + m_A100 += go[113]; + m_A100 += go[114]; + double RHS38 = Idr[111]; + RHS38 += Idr[112]; + RHS38 += Idr[113]; + RHS38 += Idr[114]; + RHS38 += Idr[115]; + RHS38 += Idr[116]; + RHS38 -= go[115] * *cnV[115]; + RHS38 -= go[116] * *cnV[116]; + m_A102 += gt[117]; + m_A102 += gt[118]; + m_A102 += gt[119]; + m_A102 += gt[120]; + m_A103 += go[117]; + m_A101 += go[118]; + double RHS39 = Idr[117]; + RHS39 += Idr[118]; + RHS39 += Idr[119]; + RHS39 += Idr[120]; + RHS39 -= go[119] * *cnV[119]; + RHS39 -= go[120] * *cnV[120]; + m_A105 += gt[121]; + m_A105 += gt[122]; + m_A105 += gt[123]; + m_A105 += gt[124]; + m_A106 += go[121]; + m_A104 += go[122]; + double RHS40 = Idr[121]; + RHS40 += Idr[122]; + RHS40 += Idr[123]; + RHS40 += Idr[124]; + RHS40 -= go[123] * *cnV[123]; + RHS40 -= go[124] * *cnV[124]; + m_A116 += gt[125]; + m_A116 += gt[126]; + m_A116 += gt[127]; + m_A116 += gt[128]; + m_A116 += gt[129]; + m_A116 += gt[130]; + m_A116 += gt[131]; + m_A116 += gt[132]; + m_A116 += gt[133]; + m_A116 += gt[134]; + m_A114 += go[125]; + m_A113 += go[126]; + m_A112 += go[127]; + m_A111 += go[128]; + m_A110 += go[129]; + m_A118 += go[130]; + m_A109 += go[131]; + m_A108 += go[132]; + m_A107 += go[133]; + m_A115 += go[134]; + double RHS41 = Idr[125]; + RHS41 += Idr[126]; + RHS41 += Idr[127]; + RHS41 += Idr[128]; + RHS41 += Idr[129]; + RHS41 += Idr[130]; + RHS41 += Idr[131]; + RHS41 += Idr[132]; + RHS41 += Idr[133]; + RHS41 += Idr[134]; + m_A131 += gt[135]; + m_A131 += gt[136]; + m_A131 += gt[137]; + m_A131 += gt[138]; + m_A131 += gt[139]; + m_A131 += gt[140]; + m_A131 += gt[141]; + m_A131 += gt[142]; + m_A131 += gt[143]; + m_A131 += gt[144]; + m_A131 += gt[145]; + m_A131 += gt[146]; + m_A125 += go[135]; + m_A124 += go[136]; + m_A123 += go[137]; + m_A122 += go[138]; + m_A121 += go[139]; + m_A120 += go[140]; + m_A119 += go[141]; + m_A133 += go[142]; + m_A128 += go[143]; + m_A127 += go[144]; + m_A126 += go[145]; + m_A129 += go[146]; + double RHS42 = Idr[135]; + RHS42 += Idr[136]; + RHS42 += Idr[137]; + RHS42 += Idr[138]; + RHS42 += Idr[139]; + RHS42 += Idr[140]; + RHS42 += Idr[141]; + RHS42 += Idr[142]; + RHS42 += Idr[143]; + RHS42 += Idr[144]; + RHS42 += Idr[145]; + RHS42 += Idr[146]; + m_A142 += gt[147]; + m_A142 += gt[148]; + m_A142 += gt[149]; + m_A142 += gt[150]; + m_A142 += gt[151]; + m_A142 += gt[152]; + m_A142 += gt[153]; + m_A138 += go[147]; + m_A138 += go[148]; + m_A137 += go[149]; + m_A136 += go[150]; + m_A140 += go[151]; + m_A135 += go[152]; + m_A134 += go[153]; + double RHS43 = Idr[147]; + RHS43 += Idr[148]; + RHS43 += Idr[149]; + RHS43 += Idr[150]; + RHS43 += Idr[151]; + RHS43 += Idr[152]; + RHS43 += Idr[153]; + m_A152 += gt[154]; + m_A152 += gt[155]; + m_A152 += gt[156]; + m_A152 += gt[157]; + m_A152 += gt[158]; + m_A152 += gt[159]; + m_A152 += gt[160]; + m_A148 += go[154]; + m_A148 += go[155]; + m_A147 += go[156]; + m_A146 += go[157]; + m_A150 += go[158]; + m_A145 += go[159]; + m_A144 += go[160]; + double RHS44 = Idr[154]; + RHS44 += Idr[155]; + RHS44 += Idr[156]; + RHS44 += Idr[157]; + RHS44 += Idr[158]; + RHS44 += Idr[159]; + RHS44 += Idr[160]; + const double f0 = 1.0 / m_A0; + const double f0_38 = -f0 * m_A95; + m_A99 += m_A1 * f0_38; + RHS38 += f0_38 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_37 = -f1 * m_A89; + m_A93 += m_A3 * f1_37; + RHS37 += f1_37 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_32 = -f2 * m_A71; + m_A72 += m_A5 * f2_32; + RHS32 += f2_32 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_42 = -f3 * m_A119; + m_A131 += m_A7 * f3_42; + RHS42 += f3_42 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_42 = -f4 * m_A120; + m_A131 += m_A9 * f4_42; + RHS42 += f4_42 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_42 = -f5 * m_A121; + m_A131 += m_A11 * f5_42; + RHS42 += f5_42 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_42 = -f6 * m_A122; + m_A131 += m_A13 * f6_42; + RHS42 += f6_42 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_42 = -f7 * m_A123; + m_A131 += m_A15 * f7_42; + RHS42 += f7_42 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_42 = -f8 * m_A124; + m_A131 += m_A17 * f8_42; + RHS42 += f8_42 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_42 = -f9 * m_A125; + m_A131 += m_A19 * f9_42; + RHS42 += f9_42 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_41 = -f10 * m_A107; + m_A116 += m_A21 * f10_41; + m_A117 += m_A22 * f10_41; + RHS41 += f10_41 * RHS10; + const double f10_42 = -f10 * m_A126; + m_A130 += m_A21 * f10_42; + m_A131 += m_A22 * f10_42; + RHS42 += f10_42 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_41 = -f11 * m_A108; + m_A116 += m_A24 * f11_41; + m_A117 += m_A25 * f11_41; + RHS41 += f11_41 * RHS11; + const double f11_42 = -f11 * m_A127; + m_A130 += m_A24 * f11_42; + m_A131 += m_A25 * f11_42; + RHS42 += f11_42 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_41 = -f12 * m_A109; + m_A116 += m_A27 * f12_41; + m_A117 += m_A28 * f12_41; + RHS41 += f12_41 * RHS12; + const double f12_42 = -f12 * m_A128; + m_A130 += m_A27 * f12_42; + m_A131 += m_A28 * f12_42; + RHS42 += f12_42 * RHS12; + const double f13 = 1.0 / m_A29; + const double f13_41 = -f13 * m_A110; + m_A116 += m_A30 * f13_41; + RHS41 += f13_41 * RHS13; + const double f14 = 1.0 / m_A31; + const double f14_41 = -f14 * m_A111; + m_A116 += m_A32 * f14_41; + RHS41 += f14_41 * RHS14; + const double f15 = 1.0 / m_A33; + const double f15_29 = -f15 * m_A63; + m_A65 += m_A34 * f15_29; + RHS29 += f15_29 * RHS15; + const double f15_44 = -f15 * m_A144; + m_A146 += m_A34 * f15_44; + RHS44 += f15_44 * RHS15; + const double f16 = 1.0 / m_A35; + const double f16_35 = -f16 * m_A83; + m_A84 += m_A36 * f16_35; + RHS35 += f16_35 * RHS16; + const double f17 = 1.0 / m_A37; + const double f17_29 = -f17 * m_A64; + m_A65 += m_A38 * f17_29; + RHS29 += f17_29 * RHS17; + const double f18 = 1.0 / m_A39; + const double f18_33 = -f18 * m_A75; + m_A77 += m_A40 * f18_33; + RHS33 += f18_33 * RHS18; + const double f19 = 1.0 / m_A41; + const double f19_41 = -f19 * m_A112; + m_A116 += m_A42 * f19_41; + RHS41 += f19_41 * RHS19; + const double f20 = 1.0 / m_A43; + const double f20_31 = -f20 * m_A68; + m_A70 += m_A44 * f20_31; + RHS31 += f20_31 * RHS20; + const double f20_43 = -f20 * m_A134; + m_A136 += m_A44 * f20_43; + RHS43 += f20_43 * RHS20; + const double f21 = 1.0 / m_A45; + const double f21_31 = -f21 * m_A69; + m_A70 += m_A46 * f21_31; + RHS31 += f21_31 * RHS21; + const double f22 = 1.0 / m_A47; + const double f22_34 = -f22 * m_A79; + m_A81 += m_A48 * f22_34; + RHS34 += f22_34 * RHS22; + const double f23 = 1.0 / m_A49; + const double f23_41 = -f23 * m_A113; + m_A116 += m_A50 * f23_41; + RHS41 += f23_41 * RHS23; + const double f24 = 1.0 / m_A51; + const double f24_41 = -f24 * m_A114; + m_A116 += m_A52 * f24_41; + RHS41 += f24_41 * RHS24; + const double f25 = 1.0 / m_A53; + const double f25_36 = -f25 * m_A86; + m_A87 += m_A54 * f25_36; + RHS36 += f25_36 * RHS25; + const double f26 = 1.0 / m_A55; + const double f26_33 = -f26 * m_A76; + m_A77 += m_A56 * f26_33; + m_A78 += m_A57 * f26_33; + RHS33 += f26_33 * RHS26; + const double f26_38 = -f26 * m_A96; + m_A97 += m_A56 * f26_38; + m_A98 += m_A57 * f26_38; + RHS38 += f26_38 * RHS26; + const double f27 = 1.0 / m_A58; + const double f27_39 = -f27 * m_A101; + m_A103 += m_A59 * f27_39; + RHS39 += f27_39 * RHS27; + const double f27_44 = -f27 * m_A145; + m_A152 += m_A59 * f27_44; + RHS44 += f27_44 * RHS27; + const double f28 = 1.0 / m_A60; + const double f28_34 = -f28 * m_A80; + m_A81 += m_A61 * f28_34; + m_A82 += m_A62 * f28_34; + RHS34 += f28_34 * RHS28; + const double f28_37 = -f28 * m_A90; + m_A91 += m_A61 * f28_37; + m_A92 += m_A62 * f28_37; + RHS37 += f28_37 * RHS28; + const double f29 = 1.0 / m_A65; + const double f29_44 = -f29 * m_A146; + RHS44 += f29_44 * RHS29; + const double f30 = 1.0 / m_A66; + const double f30_40 = -f30 * m_A104; + m_A106 += m_A67 * f30_40; + RHS40 += f30_40 * RHS30; + const double f30_43 = -f30 * m_A135; + m_A142 += m_A67 * f30_43; + RHS43 += f30_43 * RHS30; + const double f31 = 1.0 / m_A70; + const double f31_43 = -f31 * m_A136; + RHS43 += f31_43 * RHS31; + const double f32 = 1.0 / m_A72; + const double f32_41 = -f32 * m_A115; + m_A116 += m_A73 * f32_41; + m_A117 += m_A74 * f32_41; + RHS41 += f32_41 * RHS32; + const double f32_42 = -f32 * m_A129; + m_A130 += m_A73 * f32_42; + m_A131 += m_A74 * f32_42; + RHS42 += f32_42 * RHS32; + const double f33 = 1.0 / m_A77; + const double f33_38 = -f33 * m_A97; + m_A98 += m_A78 * f33_38; + RHS38 += f33_38 * RHS33; + const double f34 = 1.0 / m_A81; + const double f34_37 = -f34 * m_A91; + m_A92 += m_A82 * f34_37; + RHS37 += f34_37 * RHS34; + const double f35 = 1.0 / m_A84; + const double f35_44 = -f35 * m_A147; + m_A152 += m_A85 * f35_44; + RHS44 += f35_44 * RHS35; + const double f36 = 1.0 / m_A87; + const double f36_43 = -f36 * m_A137; + m_A142 += m_A88 * f36_43; + RHS43 += f36_43 * RHS36; + const double f37 = 1.0 / m_A92; + const double f37_43 = -f37 * m_A138; + m_A139 += m_A93 * f37_43; + m_A142 += m_A94 * f37_43; + RHS43 += f37_43 * RHS37; + const double f38 = 1.0 / m_A98; + const double f38_44 = -f38 * m_A148; + m_A149 += m_A99 * f38_44; + m_A152 += m_A100 * f38_44; + RHS44 += f38_44 * RHS38; + const double f39 = 1.0 / m_A102; + const double f39_44 = -f39 * m_A149; + m_A152 += m_A103 * f39_44; + RHS44 += f39_44 * RHS39; + const double f40 = 1.0 / m_A105; + const double f40_43 = -f40 * m_A139; + m_A142 += m_A106 * f40_43; + RHS43 += f40_43 * RHS40; + const double f41 = 1.0 / m_A116; + const double f41_42 = -f41 * m_A130; + m_A131 += m_A117 * f41_42; + m_A132 += m_A118 * f41_42; + RHS42 += f41_42 * RHS41; + const double f41_43 = -f41 * m_A140; + m_A141 += m_A117 * f41_43; + m_A142 += m_A118 * f41_43; + RHS43 += f41_43 * RHS41; + const double f42 = 1.0 / m_A131; + const double f42_43 = -f42 * m_A141; + m_A142 += m_A132 * f42_43; + m_A143 += m_A133 * f42_43; + RHS43 += f42_43 * RHS42; + const double f42_44 = -f42 * m_A150; + m_A151 += m_A132 * f42_44; + m_A152 += m_A133 * f42_44; + RHS44 += f42_44 * RHS42; + const double f43 = 1.0 / m_A142; + const double f43_44 = -f43 * m_A151; + m_A152 += m_A143 * f43_44; + RHS44 += f43_44 * RHS43; + V[44] = RHS44 / m_A152; + double tmp43 = 0.0; + tmp43 += m_A143 * V[44]; + V[43] = (RHS43 - tmp43) / m_A142; + double tmp42 = 0.0; + tmp42 += m_A132 * V[43]; + tmp42 += m_A133 * V[44]; + V[42] = (RHS42 - tmp42) / m_A131; + double tmp41 = 0.0; + tmp41 += m_A117 * V[42]; + tmp41 += m_A118 * V[43]; + V[41] = (RHS41 - tmp41) / m_A116; + double tmp40 = 0.0; + tmp40 += m_A106 * V[43]; + V[40] = (RHS40 - tmp40) / m_A105; + double tmp39 = 0.0; + tmp39 += m_A103 * V[44]; + V[39] = (RHS39 - tmp39) / m_A102; + double tmp38 = 0.0; + tmp38 += m_A99 * V[39]; + tmp38 += m_A100 * V[44]; + V[38] = (RHS38 - tmp38) / m_A98; + double tmp37 = 0.0; + tmp37 += m_A93 * V[40]; + tmp37 += m_A94 * V[43]; + V[37] = (RHS37 - tmp37) / m_A92; + double tmp36 = 0.0; + tmp36 += m_A88 * V[43]; + V[36] = (RHS36 - tmp36) / m_A87; + double tmp35 = 0.0; + tmp35 += m_A85 * V[44]; + V[35] = (RHS35 - tmp35) / m_A84; + double tmp34 = 0.0; + tmp34 += m_A82 * V[37]; + V[34] = (RHS34 - tmp34) / m_A81; + double tmp33 = 0.0; + tmp33 += m_A78 * V[38]; + V[33] = (RHS33 - tmp33) / m_A77; + double tmp32 = 0.0; + tmp32 += m_A73 * V[41]; + tmp32 += m_A74 * V[42]; + V[32] = (RHS32 - tmp32) / m_A72; + double tmp31 = 0.0; + V[31] = (RHS31 - tmp31) / m_A70; + double tmp30 = 0.0; + tmp30 += m_A67 * V[43]; + V[30] = (RHS30 - tmp30) / m_A66; + double tmp29 = 0.0; + V[29] = (RHS29 - tmp29) / m_A65; + double tmp28 = 0.0; + tmp28 += m_A61 * V[34]; + tmp28 += m_A62 * V[37]; + V[28] = (RHS28 - tmp28) / m_A60; + double tmp27 = 0.0; + tmp27 += m_A59 * V[44]; + V[27] = (RHS27 - tmp27) / m_A58; + double tmp26 = 0.0; + tmp26 += m_A56 * V[33]; + tmp26 += m_A57 * V[38]; + V[26] = (RHS26 - tmp26) / m_A55; + double tmp25 = 0.0; + tmp25 += m_A54 * V[36]; + V[25] = (RHS25 - tmp25) / m_A53; + double tmp24 = 0.0; + tmp24 += m_A52 * V[41]; + V[24] = (RHS24 - tmp24) / m_A51; + double tmp23 = 0.0; + tmp23 += m_A50 * V[41]; + V[23] = (RHS23 - tmp23) / m_A49; + double tmp22 = 0.0; + tmp22 += m_A48 * V[34]; + V[22] = (RHS22 - tmp22) / m_A47; + double tmp21 = 0.0; + tmp21 += m_A46 * V[31]; + V[21] = (RHS21 - tmp21) / m_A45; + double tmp20 = 0.0; + tmp20 += m_A44 * V[31]; + V[20] = (RHS20 - tmp20) / m_A43; + double tmp19 = 0.0; + tmp19 += m_A42 * V[41]; + V[19] = (RHS19 - tmp19) / m_A41; + double tmp18 = 0.0; + tmp18 += m_A40 * V[33]; + V[18] = (RHS18 - tmp18) / m_A39; + double tmp17 = 0.0; + tmp17 += m_A38 * V[29]; + V[17] = (RHS17 - tmp17) / m_A37; + double tmp16 = 0.0; + tmp16 += m_A36 * V[35]; + V[16] = (RHS16 - tmp16) / m_A35; + double tmp15 = 0.0; + tmp15 += m_A34 * V[29]; + V[15] = (RHS15 - tmp15) / m_A33; + double tmp14 = 0.0; + tmp14 += m_A32 * V[41]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + tmp13 += m_A30 * V[41]; + V[13] = (RHS13 - tmp13) / m_A29; + double tmp12 = 0.0; + tmp12 += m_A27 * V[41]; + tmp12 += m_A28 * V[42]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A24 * V[41]; + tmp11 += m_A25 * V[42]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A21 * V[41]; + tmp10 += m_A22 * V[42]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[42]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[42]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[42]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[42]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[42]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[42]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[42]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[32]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[40]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[39]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_35_double_double_8c512fd6a6dabc50(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[8] * *cnV[8]; + RHS3 -= go[9] * *cnV[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A9 += go[10]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[11] * *cnV[11]; + RHS4 -= go[12] * *cnV[12]; + RHS4 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A12 += go[14]; + m_A12 += go[15]; + m_A11 += go[16]; + m_A11 += go[17]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[18] * *cnV[18]; + RHS5 -= go[19] * *cnV[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A14 += gt[25]; + m_A13 += go[20]; + m_A16 += go[21]; + m_A15 += go[22]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A19 += gt[30]; + m_A18 += go[26]; + m_A17 += go[27]; + m_A20 += go[28]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 -= go[29] * *cnV[29]; + RHS7 -= go[30] * *cnV[30]; + m_A23 += gt[31]; + m_A23 += gt[32]; + m_A23 += gt[33]; + m_A23 += gt[34]; + m_A23 += gt[35]; + m_A23 += gt[36]; + m_A24 += go[31]; + m_A22 += go[32]; + m_A22 += go[33]; + m_A21 += go[34]; + double RHS8 = Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + m_A30 += gt[37]; + m_A30 += gt[38]; + m_A30 += gt[39]; + m_A30 += gt[40]; + m_A25 += go[37]; + m_A26 += go[38]; + m_A27 += go[39]; + m_A28 += go[40]; + double RHS9 = Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 += Idr[40]; + m_A34 += gt[41]; + m_A34 += gt[42]; + m_A34 += gt[43]; + m_A34 += gt[44]; + m_A32 += go[41]; + m_A32 += go[42]; + m_A33 += go[43]; + double RHS10 = Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 -= go[44] * *cnV[44]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A13; + m_A15 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f0_7 = -f0 * m_A17; + m_A19 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A18; + m_A19 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f1_9 = -f1 * m_A25; + m_A28 += m_A3 * f1_9; + RHS9 += f1_9 * RHS1; + const double f3 = 1.0 / m_A6; + const double f3_9 = -f3 * m_A26; + m_A30 += m_A7 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_8 = -f4 * m_A21; + m_A23 += m_A9 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_8 = -f5 * m_A22; + m_A23 += m_A11 * f5_8; + m_A24 += m_A12 * f5_8; + RHS8 += f5_8 * RHS5; + const double f5_10 = -f5 * m_A32; + m_A33 += m_A11 * f5_10; + m_A34 += m_A12 * f5_10; + RHS10 += f5_10 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_9 = -f6 * m_A27; + m_A28 += m_A15 * f6_9; + m_A30 += m_A16 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_9 = -f7 * m_A28; + m_A29 += m_A20 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A23; + const double f8_9 = -f8 * m_A29; + m_A31 += m_A24 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_10 = -f8 * m_A33; + m_A34 += m_A24 * f8_10; + RHS10 += f8_10 * RHS8; + V[10] = RHS10 / m_A34; + double tmp9 = 0.0; + tmp9 += m_A31 * V[10]; + V[9] = (RHS9 - tmp9) / m_A30; + double tmp8 = 0.0; + tmp8 += m_A24 * V[10]; + V[8] = (RHS8 - tmp8) / m_A23; + double tmp7 = 0.0; + tmp7 += m_A20 * V[8]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A15 * V[7]; + tmp6 += m_A16 * V[9]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A11 * V[8]; + tmp5 += m_A12 * V[10]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[8]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_36_double_double_dcbecbc127c5868f(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A5 += go[11]; + double RHS2 = Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[12] * *cnV[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A9 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A11 += go[19]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 -= go[20] * *cnV[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A14 += go[21]; + m_A12 += go[22]; + double RHS6 = Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 -= go[23] * *cnV[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A15 += go[24]; + m_A17 += go[25]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 -= go[26] * *cnV[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A19 += gt[30]; + m_A20 += go[27]; + m_A18 += go[28]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 -= go[29] * *cnV[29]; + RHS8 -= go[30] * *cnV[30]; + m_A24 += gt[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A24 += gt[34]; + m_A24 += gt[35]; + m_A23 += go[31]; + m_A26 += go[32]; + m_A25 += go[33]; + m_A22 += go[34]; + m_A21 += go[35]; + double RHS9 = Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A28 += go[36]; + m_A27 += go[37]; + double RHS10 = Idr[36]; + RHS10 += Idr[37]; + m_A35 += gt[38]; + m_A35 += gt[39]; + m_A35 += gt[40]; + m_A35 += gt[41]; + m_A35 += gt[42]; + m_A30 += go[38]; + m_A31 += go[39]; + m_A33 += go[40]; + double RHS11 = Idr[38]; + RHS11 += Idr[39]; + RHS11 += Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 -= go[41] * *cnV[41]; + RHS11 -= go[42] * *cnV[42]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A30; + m_A32 += m_A1 * f0_11; + RHS11 += f0_11 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A12; + m_A13 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_9 = -f2 * m_A21; + m_A25 += m_A5 * f2_9; + RHS9 += f2_9 * RHS2; + const double f2_10 = -f2 * m_A27; + m_A29 += m_A5 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_8 = -f3 * m_A18; + m_A20 += m_A7 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A22; + m_A24 += m_A7 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_7 = -f4 * m_A15; + m_A16 += m_A9 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_9 = -f5 * m_A23; + m_A24 += m_A11 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_10 = -f6 * m_A28; + m_A29 += m_A14 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_11 = -f7 * m_A31; + m_A35 += m_A17 * f7_11; + RHS11 += f7_11 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_11 = -f8 * m_A32; + m_A33 += m_A20 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A24; + const double f9_11 = -f9 * m_A33; + m_A34 += m_A25 * f9_11; + m_A35 += m_A26 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A29; + const double f10_11 = -f10 * m_A34; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A35; + double tmp10 = 0.0; + V[10] = (RHS10 - tmp10) / m_A29; + double tmp9 = 0.0; + tmp9 += m_A25 * V[10]; + tmp9 += m_A26 * V[11]; + V[9] = (RHS9 - tmp9) / m_A24; + double tmp8 = 0.0; + tmp8 += m_A20 * V[9]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A17 * V[11]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A14 * V[10]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[9]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[7]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[10]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_36_double_double_fd2796828f1ebd00(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A5 += go[11]; + double RHS2 = Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[12] * *cnV[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A9 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A11 += go[20]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[21] * *cnV[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A13 += gt[24]; + m_A14 += go[22]; + m_A12 += go[23]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[24] * *cnV[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A15 += go[25]; + m_A17 += go[26]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[27] * *cnV[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A19 += gt[30]; + m_A19 += gt[31]; + m_A20 += go[28]; + m_A18 += go[29]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[30] * *cnV[30]; + RHS8 -= go[31] * *cnV[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A24 += gt[34]; + m_A24 += gt[35]; + m_A24 += gt[36]; + m_A23 += go[32]; + m_A26 += go[33]; + m_A25 += go[34]; + m_A22 += go[35]; + m_A21 += go[36]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + m_A29 += gt[37]; + m_A29 += gt[38]; + m_A28 += go[37]; + m_A27 += go[38]; + double RHS10 = Idr[37]; + RHS10 += Idr[38]; + m_A35 += gt[39]; + m_A35 += gt[40]; + m_A35 += gt[41]; + m_A35 += gt[42]; + m_A35 += gt[43]; + m_A30 += go[39]; + m_A31 += go[40]; + m_A33 += go[41]; + double RHS11 = Idr[39]; + RHS11 += Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 -= go[42] * *cnV[42]; + RHS11 -= go[43] * *cnV[43]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A30; + m_A32 += m_A1 * f0_11; + RHS11 += f0_11 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A12; + m_A13 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_9 = -f2 * m_A21; + m_A25 += m_A5 * f2_9; + RHS9 += f2_9 * RHS2; + const double f2_10 = -f2 * m_A27; + m_A29 += m_A5 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_8 = -f3 * m_A18; + m_A20 += m_A7 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A22; + m_A24 += m_A7 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_7 = -f4 * m_A15; + m_A16 += m_A9 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_9 = -f5 * m_A23; + m_A24 += m_A11 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_10 = -f6 * m_A28; + m_A29 += m_A14 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_11 = -f7 * m_A31; + m_A35 += m_A17 * f7_11; + RHS11 += f7_11 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_11 = -f8 * m_A32; + m_A33 += m_A20 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A24; + const double f9_11 = -f9 * m_A33; + m_A34 += m_A25 * f9_11; + m_A35 += m_A26 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A29; + const double f10_11 = -f10 * m_A34; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A35; + double tmp10 = 0.0; + V[10] = (RHS10 - tmp10) / m_A29; + double tmp9 = 0.0; + tmp9 += m_A25 * V[10]; + tmp9 += m_A26 * V[11]; + V[9] = (RHS9 - tmp9) / m_A24; + double tmp8 = 0.0; + tmp8 += m_A20 * V[9]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A17 * V[11]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A14 * V[10]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[9]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[7]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[10]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_41_double_double_4f2b2f3cdc384f75(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A5 += gt[14]; + m_A5 += gt[15]; + m_A6 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + RHS2 -= go[15] * *cnV[15]; + m_A7 += gt[16]; + m_A7 += gt[17]; + m_A7 += gt[18]; + m_A8 += go[16]; + m_A9 += go[17]; + double RHS3 = Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[18] * *cnV[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A10 += gt[24]; + m_A10 += gt[25]; + m_A11 += go[19]; + m_A12 += go[20]; + m_A13 += go[21]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A16 += gt[29]; + m_A16 += gt[30]; + m_A15 += go[26]; + m_A14 += go[27]; + double RHS5 = Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 += Idr[30]; + RHS5 -= go[28] * *cnV[28]; + RHS5 -= go[29] * *cnV[29]; + RHS5 -= go[30] * *cnV[30]; + m_A19 += gt[31]; + m_A19 += gt[32]; + m_A19 += gt[33]; + m_A19 += gt[34]; + m_A19 += gt[35]; + m_A19 += gt[36]; + m_A19 += gt[37]; + m_A20 += go[31]; + m_A18 += go[32]; + double RHS6 = Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 += Idr[36]; + RHS6 += Idr[37]; + RHS6 -= go[33] * *cnV[33]; + RHS6 -= go[34] * *cnV[34]; + RHS6 -= go[35] * *cnV[35]; + RHS6 -= go[36] * *cnV[36]; + RHS6 -= go[37] * *cnV[37]; + m_A24 += gt[38]; + m_A24 += gt[39]; + m_A24 += gt[40]; + m_A25 += go[38]; + m_A22 += go[39]; + double RHS7 = Idr[38]; + RHS7 += Idr[39]; + RHS7 += Idr[40]; + RHS7 -= go[40] * *cnV[40]; + m_A29 += gt[41]; + m_A29 += gt[42]; + m_A29 += gt[43]; + m_A27 += go[41]; + m_A26 += go[42]; + double RHS8 = Idr[41]; + RHS8 += Idr[42]; + RHS8 += Idr[43]; + RHS8 -= go[43] * *cnV[43]; + m_A35 += gt[44]; + m_A35 += gt[45]; + m_A35 += gt[46]; + m_A32 += go[44]; + m_A31 += go[45]; + m_A36 += go[46]; + double RHS9 = Idr[44]; + RHS9 += Idr[45]; + RHS9 += Idr[46]; + m_A40 += gt[47]; + m_A40 += gt[48]; + m_A40 += gt[49]; + m_A40 += gt[50]; + m_A40 += gt[51]; + m_A37 += go[47]; + m_A39 += go[48]; + m_A38 += go[49]; + double RHS10 = Idr[47]; + RHS10 += Idr[48]; + RHS10 += Idr[49]; + RHS10 += Idr[50]; + RHS10 += Idr[51]; + RHS10 -= go[50] * *cnV[50]; + RHS10 -= go[51] * *cnV[51]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A14; + m_A16 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A15; + m_A16 += m_A3 * f1_5; + m_A17 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_7 = -f1 * m_A22; + m_A23 += m_A3 * f1_7; + m_A24 += m_A4 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_10 = -f2 * m_A37; + m_A38 += m_A6 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_6 = -f3 * m_A18; + m_A20 += m_A8 * f3_6; + m_A21 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_8 = -f3 * m_A26; + m_A29 += m_A8 * f3_8; + m_A30 += m_A9 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A31; + m_A34 += m_A8 * f3_9; + m_A35 += m_A9 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_8 = -f4 * m_A27; + m_A28 += m_A11 * f4_8; + m_A29 += m_A12 * f4_8; + m_A30 += m_A13 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_9 = -f4 * m_A32; + m_A33 += m_A11 * f4_9; + m_A34 += m_A12 * f4_9; + m_A35 += m_A13 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A16; + const double f5_7 = -f5 * m_A23; + m_A24 += m_A17 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_8 = -f6 * m_A28; + m_A29 += m_A20 * f6_8; + m_A30 += m_A21 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A33; + m_A34 += m_A20 * f6_9; + m_A35 += m_A21 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A24; + const double f7_10 = -f7 * m_A38; + m_A40 += m_A25 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A29; + const double f8_9 = -f8 * m_A34; + m_A35 += m_A30 * f8_9; + RHS9 += f8_9 * RHS8; + const double f9 = 1.0 / m_A35; + const double f9_10 = -f9 * m_A39; + m_A40 += m_A36 * f9_10; + RHS10 += f9_10 * RHS9; + V[10] = RHS10 / m_A40; + double tmp9 = 0.0; + tmp9 += m_A36 * V[10]; + V[9] = (RHS9 - tmp9) / m_A35; + double tmp8 = 0.0; + tmp8 += m_A30 * V[9]; + V[8] = (RHS8 - tmp8) / m_A29; + double tmp7 = 0.0; + tmp7 += m_A25 * V[10]; + V[7] = (RHS7 - tmp7) / m_A24; + double tmp6 = 0.0; + tmp6 += m_A20 * V[8]; + tmp6 += m_A21 * V[9]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A17 * V[7]; + V[5] = (RHS5 - tmp5) / m_A16; + double tmp4 = 0.0; + tmp4 += m_A11 * V[6]; + tmp4 += m_A12 * V[8]; + tmp4 += m_A13 * V[9]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[8]; + tmp3 += m_A9 * V[9]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[7]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + tmp1 += m_A4 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_70_double_double_9aa159329f86ca8b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[8] * *cnV[8]; + RHS3 -= go[9] * *cnV[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A9 += go[10]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[11] * *cnV[11]; + RHS4 -= go[12] * *cnV[12]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + RHS4 -= go[16] * *cnV[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A11 += go[17]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[18] * *cnV[18]; + RHS5 -= go[19] * *cnV[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A12 += gt[22]; + m_A13 += go[20]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 -= go[21] * *cnV[21]; + RHS6 -= go[22] * *cnV[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A14 += gt[25]; + m_A15 += go[23]; + double RHS7 = Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 -= go[24] * *cnV[24]; + RHS7 -= go[25] * *cnV[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A17 += go[26]; + double RHS8 = Idr[26]; + RHS8 += Idr[27]; + RHS8 -= go[27] * *cnV[27]; + m_A18 += gt[28]; + m_A18 += gt[29]; + m_A18 += gt[30]; + m_A18 += gt[31]; + m_A18 += gt[32]; + m_A18 += gt[33]; + m_A18 += gt[34]; + m_A20 += go[28]; + m_A19 += go[29]; + double RHS9 = Idr[28]; + RHS9 += Idr[29]; + RHS9 += Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 -= go[30] * *cnV[30]; + RHS9 -= go[31] * *cnV[31]; + RHS9 -= go[32] * *cnV[32]; + RHS9 -= go[33] * *cnV[33]; + RHS9 -= go[34] * *cnV[34]; + m_A21 += gt[35]; + m_A21 += gt[36]; + m_A21 += gt[37]; + m_A21 += gt[38]; + m_A21 += gt[39]; + m_A21 += gt[40]; + m_A23 += go[35]; + m_A22 += go[36]; + m_A22 += go[37]; + double RHS10 = Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 -= go[38] * *cnV[38]; + RHS10 -= go[39] * *cnV[39]; + RHS10 -= go[40] * *cnV[40]; + m_A25 += gt[41]; + m_A25 += gt[42]; + m_A25 += gt[43]; + m_A24 += go[41]; + m_A26 += go[42]; + double RHS11 = Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 -= go[43] * *cnV[43]; + m_A34 += gt[44]; + m_A34 += gt[45]; + m_A34 += gt[46]; + m_A34 += gt[47]; + m_A34 += gt[48]; + m_A34 += gt[49]; + m_A34 += gt[50]; + m_A34 += gt[51]; + m_A34 += gt[52]; + m_A34 += gt[53]; + m_A33 += go[44]; + m_A33 += go[45]; + m_A36 += go[46]; + m_A32 += go[47]; + m_A31 += go[48]; + m_A30 += go[49]; + m_A29 += go[50]; + m_A28 += go[51]; + m_A27 += go[52]; + double RHS12 = Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 += Idr[49]; + RHS12 += Idr[50]; + RHS12 += Idr[51]; + RHS12 += Idr[52]; + RHS12 += Idr[53]; + RHS12 -= go[53] * *cnV[53]; + m_A37 += gt[54]; + m_A37 += gt[55]; + m_A37 += gt[56]; + m_A39 += go[54]; + m_A38 += go[55]; + double RHS13 = Idr[54]; + RHS13 += Idr[55]; + RHS13 += Idr[56]; + RHS13 -= go[56] * *cnV[56]; + m_A40 += gt[57]; + m_A40 += gt[58]; + m_A40 += gt[59]; + m_A40 += gt[60]; + m_A41 += go[57]; + m_A42 += go[58]; + double RHS14 = Idr[57]; + RHS14 += Idr[58]; + RHS14 += Idr[59]; + RHS14 += Idr[60]; + RHS14 -= go[59] * *cnV[59]; + RHS14 -= go[60] * *cnV[60]; + m_A47 += gt[61]; + m_A47 += gt[62]; + m_A47 += gt[63]; + m_A47 += gt[64]; + m_A47 += gt[65]; + m_A43 += go[61]; + m_A44 += go[62]; + m_A48 += go[63]; + double RHS15 = Idr[61]; + RHS15 += Idr[62]; + RHS15 += Idr[63]; + RHS15 += Idr[64]; + RHS15 += Idr[65]; + RHS15 -= go[64] * *cnV[64]; + RHS15 -= go[65] * *cnV[65]; + m_A54 += gt[66]; + m_A54 += gt[67]; + m_A54 += gt[68]; + m_A53 += go[66]; + m_A51 += go[67]; + m_A52 += go[68]; + double RHS16 = Idr[66]; + RHS16 += Idr[67]; + RHS16 += Idr[68]; + m_A62 += gt[69]; + m_A62 += gt[70]; + m_A62 += gt[71]; + m_A62 += gt[72]; + m_A62 += gt[73]; + m_A63 += go[69]; + m_A59 += go[70]; + m_A57 += go[71]; + m_A58 += go[72]; + double RHS17 = Idr[69]; + RHS17 += Idr[70]; + RHS17 += Idr[71]; + RHS17 += Idr[72]; + RHS17 += Idr[73]; + RHS17 -= go[73] * *cnV[73]; + m_A69 += gt[74]; + m_A69 += gt[75]; + m_A69 += gt[76]; + m_A69 += gt[77]; + m_A69 += gt[78]; + m_A69 += gt[79]; + m_A69 += gt[80]; + m_A69 += gt[81]; + m_A64 += go[74]; + m_A66 += go[75]; + m_A65 += go[76]; + m_A68 += go[77]; + double RHS18 = Idr[74]; + RHS18 += Idr[75]; + RHS18 += Idr[76]; + RHS18 += Idr[77]; + RHS18 += Idr[78]; + RHS18 += Idr[79]; + RHS18 += Idr[80]; + RHS18 += Idr[81]; + RHS18 -= go[78] * *cnV[78]; + RHS18 -= go[79] * *cnV[79]; + RHS18 -= go[80] * *cnV[80]; + RHS18 -= go[81] * *cnV[81]; + const double f0 = 1.0 / m_A0; + const double f0_12 = -f0 * m_A27; + m_A34 += m_A1 * f0_12; + RHS12 += f0_12 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_11 = -f1 * m_A24; + m_A25 += m_A3 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_12 = -f2 * m_A28; + m_A34 += m_A5 * f2_12; + RHS12 += f2_12 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_12 = -f3 * m_A29; + m_A34 += m_A7 * f3_12; + RHS12 += f3_12 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_18 = -f4 * m_A64; + m_A65 += m_A9 * f4_18; + RHS18 += f4_18 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_12 = -f5 * m_A30; + m_A34 += m_A11 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_12 = -f6 * m_A31; + m_A34 += m_A13 * f6_12; + RHS12 += f6_12 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_12 = -f7 * m_A32; + m_A34 += m_A15 * f7_12; + RHS12 += f7_12 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_16 = -f8 * m_A51; + m_A54 += m_A17 * f8_16; + RHS16 += f8_16 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_15 = -f9 * m_A43; + m_A46 += m_A19 * f9_15; + m_A48 += m_A20 * f9_15; + RHS15 += f9_15 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_12 = -f10 * m_A33; + m_A34 += m_A22 * f10_12; + m_A35 += m_A23 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_15 = -f10 * m_A44; + m_A45 += m_A22 * f10_15; + m_A47 += m_A23 * f10_15; + RHS15 += f10_15 * RHS10; + const double f11 = 1.0 / m_A25; + const double f11_17 = -f11 * m_A57; + m_A62 += m_A26 * f11_17; + RHS17 += f11_17 * RHS11; + const double f12 = 1.0 / m_A34; + const double f12_15 = -f12 * m_A45; + m_A47 += m_A35 * f12_15; + m_A49 += m_A36 * f12_15; + RHS15 += f12_15 * RHS12; + const double f12_17 = -f12 * m_A58; + m_A60 += m_A35 * f12_17; + m_A62 += m_A36 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A37; + const double f13_17 = -f13 * m_A59; + m_A62 += m_A38 * f13_17; + m_A63 += m_A39 * f13_17; + RHS17 += f13_17 * RHS13; + const double f13_18 = -f13 * m_A65; + m_A68 += m_A38 * f13_18; + m_A69 += m_A39 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A40; + const double f14_15 = -f14 * m_A46; + m_A48 += m_A41 * f14_15; + m_A50 += m_A42 * f14_15; + RHS15 += f14_15 * RHS14; + const double f14_16 = -f14 * m_A52; + m_A54 += m_A41 * f14_16; + m_A56 += m_A42 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_18 = -f14 * m_A66; + m_A67 += m_A41 * f14_18; + m_A69 += m_A42 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A47; + const double f15_16 = -f15 * m_A53; + m_A54 += m_A48 * f15_16; + m_A55 += m_A49 * f15_16; + m_A56 += m_A50 * f15_16; + RHS16 += f15_16 * RHS15; + const double f15_17 = -f15 * m_A60; + m_A61 += m_A48 * f15_17; + m_A62 += m_A49 * f15_17; + m_A63 += m_A50 * f15_17; + RHS17 += f15_17 * RHS15; + const double f16 = 1.0 / m_A54; + const double f16_17 = -f16 * m_A61; + m_A62 += m_A55 * f16_17; + m_A63 += m_A56 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_18 = -f16 * m_A67; + m_A68 += m_A55 * f16_18; + m_A69 += m_A56 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A62; + const double f17_18 = -f17 * m_A68; + m_A69 += m_A63 * f17_18; + RHS18 += f17_18 * RHS17; + V[18] = RHS18 / m_A69; + double tmp17 = 0.0; + tmp17 += m_A63 * V[18]; + V[17] = (RHS17 - tmp17) / m_A62; + double tmp16 = 0.0; + tmp16 += m_A55 * V[17]; + tmp16 += m_A56 * V[18]; + V[16] = (RHS16 - tmp16) / m_A54; + double tmp15 = 0.0; + tmp15 += m_A48 * V[16]; + tmp15 += m_A49 * V[17]; + tmp15 += m_A50 * V[18]; + V[15] = (RHS15 - tmp15) / m_A47; + double tmp14 = 0.0; + tmp14 += m_A41 * V[16]; + tmp14 += m_A42 * V[18]; + V[14] = (RHS14 - tmp14) / m_A40; + double tmp13 = 0.0; + tmp13 += m_A38 * V[17]; + tmp13 += m_A39 * V[18]; + V[13] = (RHS13 - tmp13) / m_A37; + double tmp12 = 0.0; + tmp12 += m_A35 * V[15]; + tmp12 += m_A36 * V[17]; + V[12] = (RHS12 - tmp12) / m_A34; + double tmp11 = 0.0; + tmp11 += m_A26 * V[17]; + V[11] = (RHS11 - tmp11) / m_A25; + double tmp10 = 0.0; + tmp10 += m_A22 * V[12]; + tmp10 += m_A23 * V[15]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + tmp9 += m_A19 * V[14]; + tmp9 += m_A20 * V[16]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[16]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[12]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[12]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[12]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[13]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[12]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[12]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[11]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[12]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_73_double_double_643133e86b2b1628(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A2 += gt[12]; + m_A2 += gt[13]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 += Idr[12]; + RHS1 += Idr[13]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + RHS1 -= go[12] * *cnV[12]; + RHS1 -= go[13] * *cnV[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A4 += gt[16]; + m_A4 += gt[17]; + m_A4 += gt[18]; + m_A5 += go[14]; + m_A6 += go[15]; + double RHS2 = Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 += Idr[17]; + RHS2 += Idr[18]; + RHS2 -= go[16] * *cnV[16]; + RHS2 -= go[17] * *cnV[17]; + RHS2 -= go[18] * *cnV[18]; + m_A7 += gt[19]; + m_A7 += gt[20]; + m_A8 += go[19]; + double RHS3 = Idr[19]; + RHS3 += Idr[20]; + RHS3 -= go[20] * *cnV[20]; + m_A9 += gt[21]; + m_A9 += gt[22]; + m_A10 += go[21]; + double RHS4 = Idr[21]; + RHS4 += Idr[22]; + RHS4 -= go[22] * *cnV[22]; + m_A11 += gt[23]; + m_A11 += gt[24]; + m_A11 += gt[25]; + m_A12 += go[23]; + double RHS5 = Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + m_A13 += gt[26]; + m_A13 += gt[27]; + m_A13 += gt[28]; + m_A14 += go[26]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 -= go[27] * *cnV[27]; + RHS6 -= go[28] * *cnV[28]; + m_A16 += gt[29]; + m_A16 += gt[30]; + m_A16 += gt[31]; + m_A16 += gt[32]; + m_A16 += gt[33]; + m_A16 += gt[34]; + m_A15 += go[29]; + m_A18 += go[30]; + m_A19 += go[31]; + m_A19 += go[32]; + double RHS7 = Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 -= go[33] * *cnV[33]; + RHS7 -= go[34] * *cnV[34]; + m_A20 += gt[35]; + m_A20 += gt[36]; + m_A20 += gt[37]; + m_A21 += go[35]; + double RHS8 = Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + m_A22 += gt[38]; + m_A22 += gt[39]; + m_A23 += go[38]; + double RHS9 = Idr[38]; + RHS9 += Idr[39]; + RHS9 -= go[39] * *cnV[39]; + m_A25 += gt[40]; + m_A25 += gt[41]; + m_A25 += gt[42]; + m_A27 += go[40]; + m_A24 += go[41]; + double RHS10 = Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 -= go[42] * *cnV[42]; + m_A30 += gt[43]; + m_A30 += gt[44]; + m_A30 += gt[45]; + m_A32 += go[43]; + m_A28 += go[44]; + double RHS11 = Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 -= go[45] * *cnV[45]; + m_A34 += gt[46]; + m_A34 += gt[47]; + m_A34 += gt[48]; + m_A33 += go[46]; + m_A35 += go[47]; + double RHS12 = Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 -= go[48] * *cnV[48]; + m_A37 += gt[49]; + m_A37 += gt[50]; + m_A37 += gt[51]; + m_A37 += gt[52]; + m_A38 += go[49]; + m_A36 += go[50]; + double RHS13 = Idr[49]; + RHS13 += Idr[50]; + RHS13 += Idr[51]; + RHS13 += Idr[52]; + RHS13 -= go[51] * *cnV[51]; + RHS13 -= go[52] * *cnV[52]; + m_A42 += gt[53]; + m_A42 += gt[54]; + m_A40 += go[53]; + m_A39 += go[54]; + double RHS14 = Idr[53]; + RHS14 += Idr[54]; + m_A45 += gt[55]; + m_A45 += gt[56]; + m_A45 += gt[57]; + m_A45 += gt[58]; + m_A46 += go[55]; + m_A44 += go[56]; + double RHS15 = Idr[55]; + RHS15 += Idr[56]; + RHS15 += Idr[57]; + RHS15 += Idr[58]; + RHS15 -= go[57] * *cnV[57]; + RHS15 -= go[58] * *cnV[58]; + m_A52 += gt[59]; + m_A52 += gt[60]; + m_A52 += gt[61]; + m_A48 += go[59]; + m_A49 += go[60]; + m_A47 += go[61]; + double RHS16 = Idr[59]; + RHS16 += Idr[60]; + RHS16 += Idr[61]; + m_A57 += gt[62]; + m_A57 += gt[63]; + m_A57 += gt[64]; + m_A57 += gt[65]; + m_A57 += gt[66]; + m_A54 += go[62]; + m_A55 += go[63]; + m_A58 += go[64]; + double RHS17 = Idr[62]; + RHS17 += Idr[63]; + RHS17 += Idr[64]; + RHS17 += Idr[65]; + RHS17 += Idr[66]; + RHS17 -= go[65] * *cnV[65]; + RHS17 -= go[66] * *cnV[66]; + m_A65 += gt[67]; + m_A65 += gt[68]; + m_A65 += gt[69]; + m_A65 += gt[70]; + m_A65 += gt[71]; + m_A65 += gt[72]; + m_A61 += go[67]; + m_A61 += go[68]; + m_A63 += go[69]; + m_A60 += go[70]; + m_A59 += go[71]; + double RHS18 = Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + RHS18 += Idr[72]; + RHS18 -= go[72] * *cnV[72]; + m_A72 += gt[73]; + m_A72 += gt[74]; + m_A72 += gt[75]; + m_A72 += gt[76]; + m_A72 += gt[77]; + m_A68 += go[73]; + m_A70 += go[74]; + m_A69 += go[75]; + m_A67 += go[76]; + m_A66 += go[77]; + double RHS19 = Idr[73]; + RHS19 += Idr[74]; + RHS19 += Idr[75]; + RHS19 += Idr[76]; + RHS19 += Idr[77]; + const double f0 = 1.0 / m_A0; + const double f0_17 = -f0 * m_A54; + m_A56 += m_A1 * f0_17; + RHS17 += f0_17 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A15; + m_A17 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_10 = -f2 * m_A24; + m_A25 += m_A5 * f2_10; + m_A26 += m_A6 * f2_10; + RHS10 += f2_10 * RHS2; + const double f2_11 = -f2 * m_A28; + m_A29 += m_A5 * f2_11; + m_A30 += m_A6 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_14 = -f3 * m_A39; + m_A42 += m_A8 * f3_14; + RHS14 += f3_14 * RHS3; + const double f3_18 = -f3 * m_A59; + m_A63 += m_A8 * f3_18; + RHS18 += f3_18 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_16 = -f4 * m_A47; + m_A52 += m_A10 * f4_16; + RHS16 += f4_16 * RHS4; + const double f4_19 = -f4 * m_A66; + m_A69 += m_A10 * f4_19; + RHS19 += f4_19 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_13 = -f5 * m_A36; + m_A38 += m_A12 * f5_13; + RHS13 += f5_13 * RHS5; + const double f5_18 = -f5 * m_A60; + m_A65 += m_A12 * f5_18; + RHS18 += f5_18 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_12 = -f6 * m_A33; + m_A34 += m_A14 * f6_12; + RHS12 += f6_12 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_16 = -f7 * m_A48; + m_A50 += m_A17 * f7_16; + m_A52 += m_A18 * f7_16; + m_A53 += m_A19 * f7_16; + RHS16 += f7_16 * RHS7; + const double f7_18 = -f7 * m_A61; + m_A62 += m_A17 * f7_18; + m_A64 += m_A18 * f7_18; + m_A65 += m_A19 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A20; + const double f8_15 = -f8 * m_A44; + m_A46 += m_A21 * f8_15; + RHS15 += f8_15 * RHS8; + const double f8_19 = -f8 * m_A67; + m_A72 += m_A21 * f8_19; + RHS19 += f8_19 * RHS8; + const double f9 = 1.0 / m_A22; + const double f9_19 = -f9 * m_A68; + m_A72 += m_A23 * f9_19; + RHS19 += f9_19 * RHS9; + const double f10 = 1.0 / m_A25; + const double f10_11 = -f10 * m_A29; + m_A30 += m_A26 * f10_11; + m_A31 += m_A27 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_14 = -f10 * m_A40; + m_A41 += m_A26 * f10_14; + m_A42 += m_A27 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A30; + const double f11_14 = -f11 * m_A41; + m_A42 += m_A31 * f11_14; + m_A43 += m_A32 * f11_14; + RHS14 += f11_14 * RHS11; + const double f11_16 = -f11 * m_A49; + m_A51 += m_A31 * f11_16; + m_A52 += m_A32 * f11_16; + RHS16 += f11_16 * RHS11; + const double f12 = 1.0 / m_A34; + const double f12_17 = -f12 * m_A55; + m_A57 += m_A35 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A37; + const double f13_16 = -f13 * m_A50; + m_A53 += m_A38 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_18 = -f13 * m_A62; + m_A65 += m_A38 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A42; + const double f14_16 = -f14 * m_A51; + m_A52 += m_A43 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_18 = -f14 * m_A63; + m_A64 += m_A43 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A45; + const double f15_17 = -f15 * m_A56; + m_A58 += m_A46 * f15_17; + RHS17 += f15_17 * RHS15; + const double f16 = 1.0 / m_A52; + const double f16_18 = -f16 * m_A64; + m_A65 += m_A53 * f16_18; + RHS18 += f16_18 * RHS16; + const double f16_19 = -f16 * m_A69; + m_A71 += m_A53 * f16_19; + RHS19 += f16_19 * RHS16; + const double f17 = 1.0 / m_A57; + const double f17_19 = -f17 * m_A70; + m_A72 += m_A58 * f17_19; + RHS19 += f17_19 * RHS17; + const double f18 = 1.0 / m_A65; + const double f18_19 = -f18 * m_A71; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A72; + double tmp18 = 0.0; + V[18] = (RHS18 - tmp18) / m_A65; + double tmp17 = 0.0; + tmp17 += m_A58 * V[19]; + V[17] = (RHS17 - tmp17) / m_A57; + double tmp16 = 0.0; + tmp16 += m_A53 * V[18]; + V[16] = (RHS16 - tmp16) / m_A52; + double tmp15 = 0.0; + tmp15 += m_A46 * V[19]; + V[15] = (RHS15 - tmp15) / m_A45; + double tmp14 = 0.0; + tmp14 += m_A43 * V[16]; + V[14] = (RHS14 - tmp14) / m_A42; + double tmp13 = 0.0; + tmp13 += m_A38 * V[18]; + V[13] = (RHS13 - tmp13) / m_A37; + double tmp12 = 0.0; + tmp12 += m_A35 * V[17]; + V[12] = (RHS12 - tmp12) / m_A34; + double tmp11 = 0.0; + tmp11 += m_A31 * V[14]; + tmp11 += m_A32 * V[16]; + V[11] = (RHS11 - tmp11) / m_A30; + double tmp10 = 0.0; + tmp10 += m_A26 * V[11]; + tmp10 += m_A27 * V[14]; + V[10] = (RHS10 - tmp10) / m_A25; + double tmp9 = 0.0; + tmp9 += m_A23 * V[19]; + V[9] = (RHS9 - tmp9) / m_A22; + double tmp8 = 0.0; + tmp8 += m_A21 * V[19]; + V[8] = (RHS8 - tmp8) / m_A20; + double tmp7 = 0.0; + tmp7 += m_A17 * V[13]; + tmp7 += m_A18 * V[16]; + tmp7 += m_A19 * V[18]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A14 * V[12]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A12 * V[18]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[16]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[14]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[10]; + tmp2 += m_A6 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[13]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[15]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_79_double_double_c1d22fe6e895255d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A2 += gt[12]; + m_A2 += gt[13]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 += Idr[12]; + RHS1 += Idr[13]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + RHS1 -= go[12] * *cnV[12]; + RHS1 -= go[13] * *cnV[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A4 += gt[16]; + m_A4 += gt[17]; + m_A4 += gt[18]; + m_A5 += go[14]; + m_A6 += go[15]; + double RHS2 = Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 += Idr[17]; + RHS2 += Idr[18]; + RHS2 -= go[16] * *cnV[16]; + RHS2 -= go[17] * *cnV[17]; + RHS2 -= go[18] * *cnV[18]; + m_A7 += gt[19]; + m_A7 += gt[20]; + m_A8 += go[19]; + double RHS3 = Idr[19]; + RHS3 += Idr[20]; + RHS3 -= go[20] * *cnV[20]; + m_A9 += gt[21]; + m_A9 += gt[22]; + m_A10 += go[21]; + double RHS4 = Idr[21]; + RHS4 += Idr[22]; + RHS4 -= go[22] * *cnV[22]; + m_A11 += gt[23]; + m_A11 += gt[24]; + m_A11 += gt[25]; + m_A12 += go[23]; + double RHS5 = Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + m_A14 += gt[26]; + m_A14 += gt[27]; + m_A14 += gt[28]; + m_A14 += gt[29]; + m_A14 += gt[30]; + m_A14 += gt[31]; + m_A13 += go[26]; + m_A16 += go[27]; + m_A15 += go[28]; + m_A15 += go[29]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 -= go[30] * *cnV[30]; + RHS6 -= go[31] * *cnV[31]; + m_A18 += gt[32]; + m_A18 += gt[33]; + m_A18 += gt[34]; + m_A19 += go[32]; + double RHS7 = Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 -= go[33] * *cnV[33]; + RHS7 -= go[34] * *cnV[34]; + m_A20 += gt[35]; + m_A20 += gt[36]; + m_A20 += gt[37]; + m_A21 += go[35]; + double RHS8 = Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + m_A22 += gt[38]; + m_A22 += gt[39]; + m_A23 += go[38]; + double RHS9 = Idr[38]; + RHS9 += Idr[39]; + RHS9 -= go[39] * *cnV[39]; + m_A25 += gt[40]; + m_A25 += gt[41]; + m_A25 += gt[42]; + m_A27 += go[40]; + m_A24 += go[41]; + double RHS10 = Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 -= go[42] * *cnV[42]; + m_A30 += gt[43]; + m_A30 += gt[44]; + m_A30 += gt[45]; + m_A32 += go[43]; + m_A28 += go[44]; + double RHS11 = Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 -= go[45] * *cnV[45]; + m_A36 += gt[46]; + m_A36 += gt[47]; + m_A36 += gt[48]; + m_A36 += gt[49]; + m_A36 += gt[50]; + m_A36 += gt[51]; + m_A35 += go[46]; + m_A35 += go[47]; + m_A37 += go[48]; + m_A34 += go[49]; + m_A33 += go[50]; + double RHS12 = Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 += Idr[49]; + RHS12 += Idr[50]; + RHS12 += Idr[51]; + RHS12 -= go[51] * *cnV[51]; + m_A41 += gt[52]; + m_A41 += gt[53]; + m_A41 += gt[54]; + m_A41 += gt[55]; + m_A41 += gt[56]; + m_A40 += go[52]; + m_A43 += go[53]; + m_A44 += go[54]; + double RHS13 = Idr[52]; + RHS13 += Idr[53]; + RHS13 += Idr[54]; + RHS13 += Idr[55]; + RHS13 += Idr[56]; + RHS13 -= go[55] * *cnV[55]; + RHS13 -= go[56] * *cnV[56]; + m_A48 += gt[57]; + m_A48 += gt[58]; + m_A46 += go[57]; + m_A45 += go[58]; + double RHS14 = Idr[57]; + RHS14 += Idr[58]; + m_A51 += gt[59]; + m_A51 += gt[60]; + m_A51 += gt[61]; + m_A51 += gt[62]; + m_A52 += go[59]; + m_A50 += go[60]; + double RHS15 = Idr[59]; + RHS15 += Idr[60]; + RHS15 += Idr[61]; + RHS15 += Idr[62]; + RHS15 -= go[61] * *cnV[61]; + RHS15 -= go[62] * *cnV[62]; + m_A58 += gt[63]; + m_A58 += gt[64]; + m_A58 += gt[65]; + m_A54 += go[63]; + m_A55 += go[64]; + m_A53 += go[65]; + double RHS16 = Idr[63]; + RHS16 += Idr[64]; + RHS16 += Idr[65]; + m_A64 += gt[66]; + m_A64 += gt[67]; + m_A64 += gt[68]; + m_A64 += gt[69]; + m_A61 += go[66]; + m_A60 += go[67]; + double RHS17 = Idr[66]; + RHS17 += Idr[67]; + RHS17 += Idr[68]; + RHS17 += Idr[69]; + RHS17 -= go[68] * *cnV[68]; + RHS17 -= go[69] * *cnV[69]; + m_A68 += gt[70]; + m_A68 += gt[71]; + m_A68 += gt[72]; + m_A65 += go[70]; + m_A66 += go[71]; + double RHS18 = Idr[70]; + RHS18 += Idr[71]; + RHS18 += Idr[72]; + RHS18 -= go[72] * *cnV[72]; + m_A78 += gt[73]; + m_A78 += gt[74]; + m_A78 += gt[75]; + m_A78 += gt[76]; + m_A78 += gt[77]; + m_A72 += go[73]; + m_A73 += go[74]; + m_A75 += go[75]; + m_A71 += go[76]; + m_A70 += go[77]; + double RHS19 = Idr[73]; + RHS19 += Idr[74]; + RHS19 += Idr[75]; + RHS19 += Idr[76]; + RHS19 += Idr[77]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A13; + m_A17 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_13 = -f1 * m_A40; + m_A42 += m_A3 * f1_13; + RHS13 += f1_13 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_10 = -f2 * m_A24; + m_A25 += m_A5 * f2_10; + m_A26 += m_A6 * f2_10; + RHS10 += f2_10 * RHS2; + const double f2_11 = -f2 * m_A28; + m_A29 += m_A5 * f2_11; + m_A30 += m_A6 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_12 = -f3 * m_A33; + m_A37 += m_A8 * f3_12; + RHS12 += f3_12 * RHS3; + const double f3_14 = -f3 * m_A45; + m_A48 += m_A8 * f3_14; + RHS14 += f3_14 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_16 = -f4 * m_A53; + m_A58 += m_A10 * f4_16; + RHS16 += f4_16 * RHS4; + const double f4_19 = -f4 * m_A70; + m_A75 += m_A10 * f4_19; + RHS19 += f4_19 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_12 = -f5 * m_A34; + m_A36 += m_A12 * f5_12; + RHS12 += f5_12 * RHS5; + const double f5_17 = -f5 * m_A60; + m_A61 += m_A12 * f5_17; + RHS17 += f5_17 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_12 = -f6 * m_A35; + m_A36 += m_A15 * f6_12; + m_A38 += m_A16 * f6_12; + m_A39 += m_A17 * f6_12; + RHS12 += f6_12 * RHS6; + const double f6_16 = -f6 * m_A54; + m_A56 += m_A15 * f6_16; + m_A58 += m_A16 * f6_16; + m_A59 += m_A17 * f6_16; + RHS16 += f6_16 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_18 = -f7 * m_A65; + m_A68 += m_A19 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A20; + const double f8_15 = -f8 * m_A50; + m_A52 += m_A21 * f8_15; + RHS15 += f8_15 * RHS8; + const double f8_19 = -f8 * m_A71; + m_A78 += m_A21 * f8_19; + RHS19 += f8_19 * RHS8; + const double f9 = 1.0 / m_A22; + const double f9_19 = -f9 * m_A72; + m_A78 += m_A23 * f9_19; + RHS19 += f9_19 * RHS9; + const double f10 = 1.0 / m_A25; + const double f10_11 = -f10 * m_A29; + m_A30 += m_A26 * f10_11; + m_A31 += m_A27 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_14 = -f10 * m_A46; + m_A47 += m_A26 * f10_14; + m_A48 += m_A27 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A30; + const double f11_14 = -f11 * m_A47; + m_A48 += m_A31 * f11_14; + m_A49 += m_A32 * f11_14; + RHS14 += f11_14 * RHS11; + const double f11_16 = -f11 * m_A55; + m_A57 += m_A31 * f11_16; + m_A58 += m_A32 * f11_16; + RHS16 += f11_16 * RHS11; + const double f12 = 1.0 / m_A36; + const double f12_16 = -f12 * m_A56; + m_A57 += m_A37 * f12_16; + m_A58 += m_A38 * f12_16; + m_A59 += m_A39 * f12_16; + RHS16 += f12_16 * RHS12; + const double f12_17 = -f12 * m_A61; + m_A62 += m_A37 * f12_17; + m_A63 += m_A38 * f12_17; + m_A64 += m_A39 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A41; + const double f13_18 = -f13 * m_A66; + m_A67 += m_A42 * f13_18; + m_A68 += m_A43 * f13_18; + m_A69 += m_A44 * f13_18; + RHS18 += f13_18 * RHS13; + const double f13_19 = -f13 * m_A73; + m_A74 += m_A42 * f13_19; + m_A77 += m_A43 * f13_19; + m_A78 += m_A44 * f13_19; + RHS19 += f13_19 * RHS13; + const double f14 = 1.0 / m_A48; + const double f14_16 = -f14 * m_A57; + m_A58 += m_A49 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_17 = -f14 * m_A62; + m_A63 += m_A49 * f14_17; + RHS17 += f14_17 * RHS14; + const double f15 = 1.0 / m_A51; + const double f15_18 = -f15 * m_A67; + m_A69 += m_A52 * f15_18; + RHS18 += f15_18 * RHS15; + const double f15_19 = -f15 * m_A74; + m_A78 += m_A52 * f15_19; + RHS19 += f15_19 * RHS15; + const double f16 = 1.0 / m_A58; + const double f16_17 = -f16 * m_A63; + m_A64 += m_A59 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_19 = -f16 * m_A75; + m_A76 += m_A59 * f16_19; + RHS19 += f16_19 * RHS16; + const double f17 = 1.0 / m_A64; + const double f17_19 = -f17 * m_A76; + RHS19 += f17_19 * RHS17; + const double f18 = 1.0 / m_A68; + const double f18_19 = -f18 * m_A77; + m_A78 += m_A69 * f18_19; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A78; + double tmp18 = 0.0; + tmp18 += m_A69 * V[19]; + V[18] = (RHS18 - tmp18) / m_A68; + double tmp17 = 0.0; + V[17] = (RHS17 - tmp17) / m_A64; + double tmp16 = 0.0; + tmp16 += m_A59 * V[17]; + V[16] = (RHS16 - tmp16) / m_A58; + double tmp15 = 0.0; + tmp15 += m_A52 * V[19]; + V[15] = (RHS15 - tmp15) / m_A51; + double tmp14 = 0.0; + tmp14 += m_A49 * V[16]; + V[14] = (RHS14 - tmp14) / m_A48; + double tmp13 = 0.0; + tmp13 += m_A42 * V[15]; + tmp13 += m_A43 * V[18]; + tmp13 += m_A44 * V[19]; + V[13] = (RHS13 - tmp13) / m_A41; + double tmp12 = 0.0; + tmp12 += m_A37 * V[14]; + tmp12 += m_A38 * V[16]; + tmp12 += m_A39 * V[17]; + V[12] = (RHS12 - tmp12) / m_A36; + double tmp11 = 0.0; + tmp11 += m_A31 * V[14]; + tmp11 += m_A32 * V[16]; + V[11] = (RHS11 - tmp11) / m_A30; + double tmp10 = 0.0; + tmp10 += m_A26 * V[11]; + tmp10 += m_A27 * V[14]; + V[10] = (RHS10 - tmp10) / m_A25; + double tmp9 = 0.0; + tmp9 += m_A23 * V[19]; + V[9] = (RHS9 - tmp9) / m_A22; + double tmp8 = 0.0; + tmp8 += m_A21 * V[19]; + V[8] = (RHS8 - tmp8) / m_A20; + double tmp7 = 0.0; + tmp7 += m_A19 * V[18]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A15 * V[12]; + tmp6 += m_A16 * V[16]; + tmp6 += m_A17 * V[17]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[12]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[16]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[14]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[10]; + tmp2 += m_A6 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[17]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_7_double_double_e7fb484f621b3ab9(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A2 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A4 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + const double f0 = 1.0 / m_A0; + const double f0_1 = -f0 * m_A2; + m_A3 += m_A1 * f0_1; + RHS1 += f0_1 * RHS0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_2 = -f1 * m_A5; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// fireone +static void nl_gcr_7_double_double_f8f6a951fd1af6bc(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A5 += go[6]; + m_A4 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[8] * *cnV[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// flyball +static void nl_gcr_291_double_double_6622b53554e3776(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + double m_A198(0.0); + double m_A199(0.0); + double m_A200(0.0); + double m_A201(0.0); + double m_A202(0.0); + double m_A203(0.0); + double m_A204(0.0); + double m_A205(0.0); + double m_A206(0.0); + double m_A207(0.0); + double m_A208(0.0); + double m_A209(0.0); + double m_A210(0.0); + double m_A211(0.0); + double m_A212(0.0); + double m_A213(0.0); + double m_A214(0.0); + double m_A215(0.0); + double m_A216(0.0); + double m_A217(0.0); + double m_A218(0.0); + double m_A219(0.0); + double m_A220(0.0); + double m_A221(0.0); + double m_A222(0.0); + double m_A223(0.0); + double m_A224(0.0); + double m_A225(0.0); + double m_A226(0.0); + double m_A227(0.0); + double m_A228(0.0); + double m_A229(0.0); + double m_A230(0.0); + double m_A231(0.0); + double m_A232(0.0); + double m_A233(0.0); + double m_A234(0.0); + double m_A235(0.0); + double m_A236(0.0); + double m_A237(0.0); + double m_A238(0.0); + double m_A239(0.0); + double m_A240(0.0); + double m_A241(0.0); + double m_A242(0.0); + double m_A243(0.0); + double m_A244(0.0); + double m_A245(0.0); + double m_A246(0.0); + double m_A247(0.0); + double m_A248(0.0); + double m_A249(0.0); + double m_A250(0.0); + double m_A251(0.0); + double m_A252(0.0); + double m_A253(0.0); + double m_A254(0.0); + double m_A255(0.0); + double m_A256(0.0); + double m_A257(0.0); + double m_A258(0.0); + double m_A259(0.0); + double m_A260(0.0); + double m_A261(0.0); + double m_A262(0.0); + double m_A263(0.0); + double m_A264(0.0); + double m_A265(0.0); + double m_A266(0.0); + double m_A267(0.0); + double m_A268(0.0); + double m_A269(0.0); + double m_A270(0.0); + double m_A271(0.0); + double m_A272(0.0); + double m_A273(0.0); + double m_A274(0.0); + double m_A275(0.0); + double m_A276(0.0); + double m_A277(0.0); + double m_A278(0.0); + double m_A279(0.0); + double m_A280(0.0); + double m_A281(0.0); + double m_A282(0.0); + double m_A283(0.0); + double m_A284(0.0); + double m_A285(0.0); + double m_A286(0.0); + double m_A287(0.0); + double m_A288(0.0); + double m_A289(0.0); + double m_A290(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A7 += go[4]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A11 += go[10]; + m_A12 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A14 += go[13]; + m_A15 += go[14]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A16 += gt[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A20 += go[16]; + m_A19 += go[17]; + m_A18 += go[18]; + m_A17 += go[19]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 -= go[20] * *cnV[20]; + RHS6 -= go[21] * *cnV[21]; + RHS6 -= go[22] * *cnV[22]; + m_A21 += gt[23]; + m_A21 += gt[24]; + m_A22 += go[23]; + double RHS7 = Idr[23]; + RHS7 += Idr[24]; + RHS7 -= go[24] * *cnV[24]; + m_A23 += gt[25]; + m_A23 += gt[26]; + m_A24 += go[25]; + double RHS8 = Idr[25]; + RHS8 += Idr[26]; + RHS8 -= go[26] * *cnV[26]; + m_A25 += gt[27]; + m_A25 += gt[28]; + m_A25 += gt[29]; + m_A25 += gt[30]; + m_A25 += gt[31]; + m_A25 += gt[32]; + m_A25 += gt[33]; + m_A29 += go[27]; + m_A28 += go[28]; + m_A27 += go[29]; + m_A26 += go[30]; + double RHS9 = Idr[27]; + RHS9 += Idr[28]; + RHS9 += Idr[29]; + RHS9 += Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 -= go[31] * *cnV[31]; + RHS9 -= go[32] * *cnV[32]; + RHS9 -= go[33] * *cnV[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A31 += go[34]; + m_A32 += go[35]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + m_A33 += gt[36]; + m_A33 += gt[37]; + m_A34 += go[36]; + double RHS11 = Idr[36]; + RHS11 += Idr[37]; + RHS11 -= go[37] * *cnV[37]; + m_A35 += gt[38]; + m_A35 += gt[39]; + m_A35 += gt[40]; + m_A35 += gt[41]; + m_A35 += gt[42]; + m_A35 += gt[43]; + m_A35 += gt[44]; + m_A36 += go[38]; + double RHS12 = Idr[38]; + RHS12 += Idr[39]; + RHS12 += Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + RHS12 -= go[39] * *cnV[39]; + RHS12 -= go[40] * *cnV[40]; + RHS12 -= go[41] * *cnV[41]; + RHS12 -= go[42] * *cnV[42]; + RHS12 -= go[43] * *cnV[43]; + RHS12 -= go[44] * *cnV[44]; + m_A37 += gt[45]; + m_A37 += gt[46]; + m_A37 += gt[47]; + m_A37 += gt[48]; + m_A39 += go[45]; + m_A40 += go[46]; + m_A38 += go[47]; + double RHS13 = Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 += Idr[48]; + RHS13 -= go[48] * *cnV[48]; + m_A41 += gt[49]; + m_A41 += gt[50]; + m_A42 += go[49]; + m_A43 += go[50]; + double RHS14 = Idr[49]; + RHS14 += Idr[50]; + m_A44 += gt[51]; + m_A44 += gt[52]; + m_A44 += gt[53]; + m_A45 += go[51]; + double RHS15 = Idr[51]; + RHS15 += Idr[52]; + RHS15 += Idr[53]; + RHS15 -= go[52] * *cnV[52]; + RHS15 -= go[53] * *cnV[53]; + m_A46 += gt[54]; + m_A46 += gt[55]; + m_A46 += gt[56]; + m_A46 += gt[57]; + m_A49 += go[54]; + m_A48 += go[55]; + m_A47 += go[56]; + double RHS16 = Idr[54]; + RHS16 += Idr[55]; + RHS16 += Idr[56]; + RHS16 += Idr[57]; + RHS16 -= go[57] * *cnV[57]; + m_A50 += gt[58]; + m_A50 += gt[59]; + m_A50 += gt[60]; + m_A52 += go[58]; + m_A51 += go[59]; + double RHS17 = Idr[58]; + RHS17 += Idr[59]; + RHS17 += Idr[60]; + RHS17 -= go[60] * *cnV[60]; + m_A53 += gt[61]; + m_A53 += gt[62]; + m_A53 += gt[63]; + m_A54 += go[61]; + m_A55 += go[62]; + double RHS18 = Idr[61]; + RHS18 += Idr[62]; + RHS18 += Idr[63]; + RHS18 -= go[63] * *cnV[63]; + m_A56 += gt[64]; + m_A56 += gt[65]; + m_A56 += gt[66]; + m_A56 += gt[67]; + m_A57 += go[64]; + m_A57 += go[65]; + double RHS19 = Idr[64]; + RHS19 += Idr[65]; + RHS19 += Idr[66]; + RHS19 += Idr[67]; + RHS19 -= go[66] * *cnV[66]; + RHS19 -= go[67] * *cnV[67]; + m_A58 += gt[68]; + m_A58 += gt[69]; + m_A58 += gt[70]; + m_A58 += gt[71]; + m_A58 += gt[72]; + m_A58 += gt[73]; + m_A58 += gt[74]; + m_A60 += go[68]; + m_A61 += go[69]; + m_A62 += go[70]; + m_A59 += go[71]; + double RHS20 = Idr[68]; + RHS20 += Idr[69]; + RHS20 += Idr[70]; + RHS20 += Idr[71]; + RHS20 += Idr[72]; + RHS20 += Idr[73]; + RHS20 += Idr[74]; + RHS20 -= go[72] * *cnV[72]; + RHS20 -= go[73] * *cnV[73]; + RHS20 -= go[74] * *cnV[74]; + m_A63 += gt[75]; + m_A63 += gt[76]; + m_A63 += gt[77]; + m_A63 += gt[78]; + m_A63 += gt[79]; + m_A63 += gt[80]; + m_A63 += gt[81]; + m_A64 += go[75]; + m_A66 += go[76]; + m_A67 += go[77]; + m_A65 += go[78]; + double RHS21 = Idr[75]; + RHS21 += Idr[76]; + RHS21 += Idr[77]; + RHS21 += Idr[78]; + RHS21 += Idr[79]; + RHS21 += Idr[80]; + RHS21 += Idr[81]; + RHS21 -= go[79] * *cnV[79]; + RHS21 -= go[80] * *cnV[80]; + RHS21 -= go[81] * *cnV[81]; + m_A68 += gt[82]; + m_A68 += gt[83]; + m_A68 += gt[84]; + m_A69 += go[82]; + double RHS22 = Idr[82]; + RHS22 += Idr[83]; + RHS22 += Idr[84]; + RHS22 -= go[83] * *cnV[83]; + RHS22 -= go[84] * *cnV[84]; + m_A70 += gt[85]; + m_A70 += gt[86]; + m_A70 += gt[87]; + m_A71 += go[85]; + double RHS23 = Idr[85]; + RHS23 += Idr[86]; + RHS23 += Idr[87]; + RHS23 -= go[86] * *cnV[86]; + RHS23 -= go[87] * *cnV[87]; + m_A72 += gt[88]; + m_A72 += gt[89]; + m_A72 += gt[90]; + m_A72 += gt[91]; + m_A74 += go[88]; + m_A73 += go[89]; + double RHS24 = Idr[88]; + RHS24 += Idr[89]; + RHS24 += Idr[90]; + RHS24 += Idr[91]; + RHS24 -= go[90] * *cnV[90]; + RHS24 -= go[91] * *cnV[91]; + m_A75 += gt[92]; + m_A75 += gt[93]; + m_A75 += gt[94]; + m_A75 += gt[95]; + m_A76 += go[92]; + m_A77 += go[93]; + double RHS25 = Idr[92]; + RHS25 += Idr[93]; + RHS25 += Idr[94]; + RHS25 += Idr[95]; + RHS25 -= go[94] * *cnV[94]; + RHS25 -= go[95] * *cnV[95]; + m_A78 += gt[96]; + m_A78 += gt[97]; + m_A79 += go[96]; + double RHS26 = Idr[96]; + RHS26 += Idr[97]; + RHS26 -= go[97] * *cnV[97]; + m_A80 += gt[98]; + m_A80 += gt[99]; + m_A81 += go[98]; + double RHS27 = Idr[98]; + RHS27 += Idr[99]; + RHS27 -= go[99] * *cnV[99]; + m_A82 += gt[100]; + m_A82 += gt[101]; + m_A83 += go[100]; + double RHS28 = Idr[100]; + RHS28 += Idr[101]; + RHS28 -= go[101] * *cnV[101]; + m_A86 += gt[102]; + m_A86 += gt[103]; + m_A86 += gt[104]; + m_A86 += gt[105]; + m_A85 += go[102]; + m_A84 += go[103]; + double RHS29 = Idr[102]; + RHS29 += Idr[103]; + RHS29 += Idr[104]; + RHS29 += Idr[105]; + RHS29 -= go[104] * *cnV[104]; + RHS29 -= go[105] * *cnV[105]; + m_A92 += gt[106]; + m_A92 += gt[107]; + m_A92 += gt[108]; + m_A92 += gt[109]; + m_A90 += go[106]; + m_A89 += go[107]; + double RHS30 = Idr[106]; + RHS30 += Idr[107]; + RHS30 += Idr[108]; + RHS30 += Idr[109]; + RHS30 -= go[108] * *cnV[108]; + RHS30 -= go[109] * *cnV[109]; + m_A99 += gt[110]; + m_A99 += gt[111]; + m_A99 += gt[112]; + m_A99 += gt[113]; + m_A97 += go[110]; + m_A98 += go[111]; + double RHS31 = Idr[110]; + RHS31 += Idr[111]; + RHS31 += Idr[112]; + RHS31 += Idr[113]; + RHS31 -= go[112] * *cnV[112]; + RHS31 -= go[113] * *cnV[113]; + m_A104 += gt[114]; + m_A104 += gt[115]; + m_A104 += gt[116]; + m_A103 += go[114]; + m_A105 += go[115]; + double RHS32 = Idr[114]; + RHS32 += Idr[115]; + RHS32 += Idr[116]; + RHS32 -= go[116] * *cnV[116]; + m_A108 += gt[117]; + m_A108 += gt[118]; + m_A108 += gt[119]; + m_A108 += gt[120]; + m_A107 += go[117]; + m_A106 += go[118]; + double RHS33 = Idr[117]; + RHS33 += Idr[118]; + RHS33 += Idr[119]; + RHS33 += Idr[120]; + RHS33 -= go[119] * *cnV[119]; + RHS33 -= go[120] * *cnV[120]; + m_A113 += gt[121]; + m_A113 += gt[122]; + m_A113 += gt[123]; + m_A113 += gt[124]; + m_A111 += go[121]; + m_A112 += go[122]; + m_A114 += go[123]; + double RHS34 = Idr[121]; + RHS34 += Idr[122]; + RHS34 += Idr[123]; + RHS34 += Idr[124]; + RHS34 -= go[124] * *cnV[124]; + m_A116 += gt[125]; + m_A116 += gt[126]; + m_A116 += gt[127]; + m_A115 += go[125]; + m_A117 += go[126]; + double RHS35 = Idr[125]; + RHS35 += Idr[126]; + RHS35 += Idr[127]; + RHS35 -= go[127] * *cnV[127]; + m_A120 += gt[128]; + m_A120 += gt[129]; + m_A120 += gt[130]; + m_A121 += go[128]; + m_A118 += go[129]; + double RHS36 = Idr[128]; + RHS36 += Idr[129]; + RHS36 += Idr[130]; + RHS36 -= go[130] * *cnV[130]; + m_A127 += gt[131]; + m_A127 += gt[132]; + m_A127 += gt[133]; + m_A127 += gt[134]; + m_A129 += go[131]; + m_A124 += go[132]; + m_A123 += go[133]; + double RHS37 = Idr[131]; + RHS37 += Idr[132]; + RHS37 += Idr[133]; + RHS37 += Idr[134]; + RHS37 -= go[134] * *cnV[134]; + m_A135 += gt[135]; + m_A135 += gt[136]; + m_A135 += gt[137]; + m_A135 += gt[138]; + m_A133 += go[135]; + m_A132 += go[136]; + double RHS38 = Idr[135]; + RHS38 += Idr[136]; + RHS38 += Idr[137]; + RHS38 += Idr[138]; + RHS38 -= go[137] * *cnV[137]; + RHS38 -= go[138] * *cnV[138]; + m_A140 += gt[139]; + m_A140 += gt[140]; + m_A140 += gt[141]; + m_A141 += go[139]; + double RHS39 = Idr[139]; + RHS39 += Idr[140]; + RHS39 += Idr[141]; + RHS39 -= go[140] * *cnV[140]; + RHS39 -= go[141] * *cnV[141]; + m_A143 += gt[142]; + m_A143 += gt[143]; + m_A143 += gt[144]; + m_A142 += go[142]; + m_A144 += go[143]; + double RHS40 = Idr[142]; + RHS40 += Idr[143]; + RHS40 += Idr[144]; + RHS40 -= go[144] * *cnV[144]; + m_A147 += gt[145]; + m_A147 += gt[146]; + m_A147 += gt[147]; + m_A147 += gt[148]; + m_A145 += go[145]; + m_A146 += go[146]; + m_A148 += go[147]; + double RHS41 = Idr[145]; + RHS41 += Idr[146]; + RHS41 += Idr[147]; + RHS41 += Idr[148]; + RHS41 -= go[148] * *cnV[148]; + m_A153 += gt[149]; + m_A153 += gt[150]; + m_A153 += gt[151]; + m_A153 += gt[152]; + m_A153 += gt[153]; + m_A153 += gt[154]; + m_A153 += gt[155]; + m_A151 += go[149]; + m_A150 += go[150]; + m_A156 += go[151]; + m_A149 += go[152]; + m_A157 += go[153]; + double RHS42 = Idr[149]; + RHS42 += Idr[150]; + RHS42 += Idr[151]; + RHS42 += Idr[152]; + RHS42 += Idr[153]; + RHS42 += Idr[154]; + RHS42 += Idr[155]; + RHS42 -= go[154] * *cnV[154]; + RHS42 -= go[155] * *cnV[155]; + m_A163 += gt[156]; + m_A163 += gt[157]; + m_A163 += gt[158]; + m_A163 += gt[159]; + m_A163 += gt[160]; + m_A163 += gt[161]; + m_A167 += go[156]; + m_A160 += go[157]; + m_A159 += go[158]; + m_A158 += go[159]; + m_A165 += go[160]; + double RHS43 = Idr[156]; + RHS43 += Idr[157]; + RHS43 += Idr[158]; + RHS43 += Idr[159]; + RHS43 += Idr[160]; + RHS43 += Idr[161]; + RHS43 -= go[161] * *cnV[161]; + m_A170 += gt[162]; + m_A170 += gt[163]; + m_A174 += go[162]; + m_A168 += go[163]; + double RHS44 = Idr[162]; + RHS44 += Idr[163]; + m_A180 += gt[164]; + m_A180 += gt[165]; + m_A180 += gt[166]; + m_A180 += gt[167]; + m_A180 += gt[168]; + m_A180 += gt[169]; + m_A175 += go[164]; + m_A177 += go[165]; + m_A179 += go[166]; + m_A176 += go[167]; + double RHS45 = Idr[164]; + RHS45 += Idr[165]; + RHS45 += Idr[166]; + RHS45 += Idr[167]; + RHS45 += Idr[168]; + RHS45 += Idr[169]; + RHS45 -= go[168] * *cnV[168]; + RHS45 -= go[169] * *cnV[169]; + m_A184 += gt[170]; + m_A184 += gt[171]; + m_A185 += go[170]; + m_A183 += go[171]; + double RHS46 = Idr[170]; + RHS46 += Idr[171]; + m_A192 += gt[172]; + m_A192 += gt[173]; + m_A192 += gt[174]; + m_A192 += gt[175]; + m_A192 += gt[176]; + m_A192 += gt[177]; + m_A189 += go[172]; + m_A188 += go[173]; + m_A187 += go[174]; + m_A187 += go[175]; + m_A190 += go[176]; + double RHS47 = Idr[172]; + RHS47 += Idr[173]; + RHS47 += Idr[174]; + RHS47 += Idr[175]; + RHS47 += Idr[176]; + RHS47 += Idr[177]; + RHS47 -= go[177] * *cnV[177]; + m_A202 += gt[178]; + m_A202 += gt[179]; + m_A202 += gt[180]; + m_A202 += gt[181]; + m_A196 += go[178]; + m_A197 += go[179]; + m_A204 += go[180]; + m_A199 += go[181]; + double RHS48 = Idr[178]; + RHS48 += Idr[179]; + RHS48 += Idr[180]; + RHS48 += Idr[181]; + m_A206 += gt[182]; + m_A206 += gt[183]; + m_A206 += gt[184]; + m_A205 += go[182]; + m_A207 += go[183]; + double RHS49 = Idr[182]; + RHS49 += Idr[183]; + RHS49 += Idr[184]; + RHS49 -= go[184] * *cnV[184]; + m_A215 += gt[185]; + m_A215 += gt[186]; + m_A215 += gt[187]; + m_A215 += gt[188]; + m_A212 += go[185]; + m_A209 += go[186]; + m_A208 += go[187]; + double RHS50 = Idr[185]; + RHS50 += Idr[186]; + RHS50 += Idr[187]; + RHS50 += Idr[188]; + RHS50 -= go[188] * *cnV[188]; + m_A227 += gt[189]; + m_A227 += gt[190]; + m_A227 += gt[191]; + m_A227 += gt[192]; + m_A227 += gt[193]; + m_A227 += gt[194]; + m_A223 += go[189]; + m_A224 += go[190]; + m_A221 += go[191]; + m_A219 += go[192]; + m_A220 += go[193]; + double RHS51 = Idr[189]; + RHS51 += Idr[190]; + RHS51 += Idr[191]; + RHS51 += Idr[192]; + RHS51 += Idr[193]; + RHS51 += Idr[194]; + RHS51 -= go[194] * *cnV[194]; + m_A237 += gt[195]; + m_A237 += gt[196]; + m_A237 += gt[197]; + m_A237 += gt[198]; + m_A231 += go[195]; + m_A230 += go[196]; + m_A233 += go[197]; + m_A232 += go[198]; + double RHS52 = Idr[195]; + RHS52 += Idr[196]; + RHS52 += Idr[197]; + RHS52 += Idr[198]; + m_A250 += gt[199]; + m_A250 += gt[200]; + m_A250 += gt[201]; + m_A250 += gt[202]; + m_A250 += gt[203]; + m_A250 += gt[204]; + m_A245 += go[199]; + m_A252 += go[200]; + m_A243 += go[201]; + m_A241 += go[202]; + m_A242 += go[203]; + double RHS53 = Idr[199]; + RHS53 += Idr[200]; + RHS53 += Idr[201]; + RHS53 += Idr[202]; + RHS53 += Idr[203]; + RHS53 += Idr[204]; + RHS53 -= go[204] * *cnV[204]; + m_A264 += gt[205]; + m_A264 += gt[206]; + m_A264 += gt[207]; + m_A264 += gt[208]; + m_A264 += gt[209]; + m_A264 += gt[210]; + m_A257 += go[205]; + m_A255 += go[206]; + m_A254 += go[207]; + m_A253 += go[208]; + m_A259 += go[209]; + double RHS54 = Idr[205]; + RHS54 += Idr[206]; + RHS54 += Idr[207]; + RHS54 += Idr[208]; + RHS54 += Idr[209]; + RHS54 += Idr[210]; + RHS54 -= go[210] * *cnV[210]; + m_A276 += gt[211]; + m_A276 += gt[212]; + m_A276 += gt[213]; + m_A276 += gt[214]; + m_A276 += gt[215]; + m_A276 += gt[216]; + m_A276 += gt[217]; + m_A272 += go[211]; + m_A271 += go[212]; + m_A270 += go[213]; + m_A269 += go[214]; + m_A268 += go[215]; + m_A267 += go[216]; + double RHS55 = Idr[211]; + RHS55 += Idr[212]; + RHS55 += Idr[213]; + RHS55 += Idr[214]; + RHS55 += Idr[215]; + RHS55 += Idr[216]; + RHS55 += Idr[217]; + RHS55 -= go[217] * *cnV[217]; + m_A290 += gt[218]; + m_A290 += gt[219]; + m_A290 += gt[220]; + m_A290 += gt[221]; + m_A290 += gt[222]; + m_A290 += gt[223]; + m_A290 += gt[224]; + m_A280 += go[218]; + m_A279 += go[219]; + m_A287 += go[220]; + m_A278 += go[221]; + m_A283 += go[222]; + double RHS56 = Idr[218]; + RHS56 += Idr[219]; + RHS56 += Idr[220]; + RHS56 += Idr[221]; + RHS56 += Idr[222]; + RHS56 += Idr[223]; + RHS56 += Idr[224]; + RHS56 -= go[223] * *cnV[223]; + RHS56 -= go[224] * *cnV[224]; + const double f0 = 1.0 / m_A0; + const double f0_29 = -f0 * m_A84; + m_A86 += m_A1 * f0_29; + RHS29 += f0_29 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_32 = -f1 * m_A103; + m_A104 += m_A3 * f1_32; + RHS32 += f1_32 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_29 = -f2 * m_A85; + m_A86 += m_A5 * f2_29; + m_A87 += m_A6 * f2_29; + m_A88 += m_A7 * f2_29; + RHS29 += f2_29 * RHS2; + const double f2_30 = -f2 * m_A89; + m_A91 += m_A5 * f2_30; + m_A92 += m_A6 * f2_30; + m_A93 += m_A7 * f2_30; + RHS30 += f2_30 * RHS2; + const double f2_37 = -f2 * m_A123; + m_A125 += m_A5 * f2_37; + m_A126 += m_A6 * f2_37; + m_A127 += m_A7 * f2_37; + RHS37 += f2_37 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_34 = -f3 * m_A111; + m_A113 += m_A9 * f3_34; + RHS34 += f3_34 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_43 = -f4 * m_A158; + m_A163 += m_A11 * f4_43; + m_A165 += m_A12 * f4_43; + RHS43 += f4_43 * RHS4; + const double f4_52 = -f4 * m_A230; + m_A233 += m_A11 * f4_52; + m_A237 += m_A12 * f4_52; + RHS52 += f4_52 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_34 = -f5 * m_A112; + m_A113 += m_A14 * f5_34; + m_A114 += m_A15 * f5_34; + RHS34 += f5_34 * RHS5; + const double f5_53 = -f5 * m_A241; + m_A245 += m_A14 * f5_53; + m_A250 += m_A15 * f5_53; + RHS53 += f5_53 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_30 = -f6 * m_A90; + m_A92 += m_A17 * f6_30; + m_A94 += m_A18 * f6_30; + m_A95 += m_A19 * f6_30; + m_A96 += m_A20 * f6_30; + RHS30 += f6_30 * RHS6; + const double f6_43 = -f6 * m_A159; + m_A161 += m_A17 * f6_43; + m_A163 += m_A18 * f6_43; + m_A166 += m_A19 * f6_43; + m_A167 += m_A20 * f6_43; + RHS43 += f6_43 * RHS6; + const double f6_53 = -f6 * m_A242; + m_A244 += m_A17 * f6_53; + m_A247 += m_A18 * f6_53; + m_A250 += m_A19 * f6_53; + m_A252 += m_A20 * f6_53; + RHS53 += f6_53 * RHS6; + const double f6_56 = -f6 * m_A278; + m_A281 += m_A17 * f6_56; + m_A283 += m_A18 * f6_56; + m_A287 += m_A19 * f6_56; + m_A290 += m_A20 * f6_56; + RHS56 += f6_56 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_33 = -f7 * m_A106; + m_A108 += m_A22 * f7_33; + RHS33 += f7_33 * RHS7; + const double f8 = 1.0 / m_A23; + const double f8_35 = -f8 * m_A115; + m_A116 += m_A24 * f8_35; + RHS35 += f8_35 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_37 = -f9 * m_A124; + m_A127 += m_A26 * f9_37; + m_A128 += m_A27 * f9_37; + m_A130 += m_A28 * f9_37; + m_A131 += m_A29 * f9_37; + RHS37 += f9_37 * RHS9; + const double f9_43 = -f9 * m_A160; + m_A162 += m_A26 * f9_43; + m_A163 += m_A27 * f9_43; + m_A166 += m_A28 * f9_43; + m_A167 += m_A29 * f9_43; + RHS43 += f9_43 * RHS9; + const double f9_53 = -f9 * m_A243; + m_A246 += m_A26 * f9_53; + m_A247 += m_A27 * f9_53; + m_A250 += m_A28 * f9_53; + m_A252 += m_A29 * f9_53; + RHS53 += f9_53 * RHS9; + const double f9_56 = -f9 * m_A279; + m_A282 += m_A26 * f9_56; + m_A283 += m_A27 * f9_56; + m_A287 += m_A28 * f9_56; + m_A290 += m_A29 * f9_56; + RHS56 += f9_56 * RHS9; + const double f10 = 1.0 / m_A30; + const double f10_31 = -f10 * m_A97; + m_A99 += m_A31 * f10_31; + m_A102 += m_A32 * f10_31; + RHS31 += f10_31 * RHS10; + const double f10_48 = -f10 * m_A196; + m_A198 += m_A31 * f10_48; + m_A202 += m_A32 * f10_48; + RHS48 += f10_48 * RHS10; + const double f11 = 1.0 / m_A33; + const double f11_41 = -f11 * m_A145; + m_A147 += m_A34 * f11_41; + RHS41 += f11_41 * RHS11; + const double f12 = 1.0 / m_A35; + const double f12_45 = -f12 * m_A175; + m_A179 += m_A36 * f12_45; + RHS45 += f12_45 * RHS12; + const double f13 = 1.0 / m_A37; + const double f13_31 = -f13 * m_A98; + m_A99 += m_A38 * f13_31; + m_A100 += m_A39 * f13_31; + m_A101 += m_A40 * f13_31; + RHS31 += f13_31 * RHS13; + const double f13_36 = -f13 * m_A118; + m_A119 += m_A38 * f13_36; + m_A120 += m_A39 * f13_36; + m_A121 += m_A40 * f13_36; + RHS36 += f13_36 * RHS13; + const double f13_45 = -f13 * m_A176; + m_A178 += m_A38 * f13_45; + m_A179 += m_A39 * f13_45; + m_A180 += m_A40 * f13_45; + RHS45 += f13_45 * RHS13; + const double f14 = 1.0 / m_A41; + const double f14_45 = -f14 * m_A177; + m_A180 += m_A42 * f14_45; + m_A182 += m_A43 * f14_45; + RHS45 += f14_45 * RHS14; + const double f14_52 = -f14 * m_A231; + m_A234 += m_A42 * f14_52; + m_A237 += m_A43 * f14_52; + RHS52 += f14_52 * RHS14; + const double f15 = 1.0 / m_A44; + const double f15_40 = -f15 * m_A142; + m_A143 += m_A45 * f15_40; + RHS40 += f15_40 * RHS15; + const double f16 = 1.0 / m_A46; + const double f16_33 = -f16 * m_A107; + m_A108 += m_A47 * f16_33; + m_A109 += m_A48 * f16_33; + m_A110 += m_A49 * f16_33; + RHS33 += f16_33 * RHS16; + const double f16_38 = -f16 * m_A132; + m_A134 += m_A47 * f16_38; + m_A135 += m_A48 * f16_38; + m_A137 += m_A49 * f16_38; + RHS38 += f16_38 * RHS16; + const double f16_50 = -f16 * m_A208; + m_A210 += m_A47 * f16_50; + m_A211 += m_A48 * f16_50; + m_A215 += m_A49 * f16_50; + RHS50 += f16_50 * RHS16; + const double f17 = 1.0 / m_A50; + const double f17_48 = -f17 * m_A197; + m_A202 += m_A51 * f17_48; + m_A204 += m_A52 * f17_48; + RHS48 += f17_48 * RHS17; + const double f17_54 = -f17 * m_A253; + m_A259 += m_A51 * f17_54; + m_A264 += m_A52 * f17_54; + RHS54 += f17_54 * RHS17; + const double f18 = 1.0 / m_A53; + const double f18_41 = -f18 * m_A146; + m_A147 += m_A54 * f18_41; + m_A148 += m_A55 * f18_41; + RHS41 += f18_41 * RHS18; + const double f18_51 = -f18 * m_A219; + m_A223 += m_A54 * f18_51; + m_A227 += m_A55 * f18_51; + RHS51 += f18_51 * RHS18; + const double f19 = 1.0 / m_A56; + const double f19_47 = -f19 * m_A187; + m_A192 += m_A57 * f19_47; + RHS47 += f19_47 * RHS19; + const double f20 = 1.0 / m_A58; + const double f20_38 = -f20 * m_A133; + m_A135 += m_A59 * f20_38; + m_A136 += m_A60 * f20_38; + m_A138 += m_A61 * f20_38; + m_A139 += m_A62 * f20_38; + RHS38 += f20_38 * RHS20; + const double f20_42 = -f20 * m_A149; + m_A152 += m_A59 * f20_42; + m_A153 += m_A60 * f20_42; + m_A156 += m_A61 * f20_42; + m_A157 += m_A62 * f20_42; + RHS42 += f20_42 * RHS20; + const double f20_51 = -f20 * m_A220; + m_A222 += m_A59 * f20_51; + m_A224 += m_A60 * f20_51; + m_A227 += m_A61 * f20_51; + m_A228 += m_A62 * f20_51; + RHS51 += f20_51 * RHS20; + const double f20_54 = -f20 * m_A254; + m_A256 += m_A59 * f20_54; + m_A257 += m_A60 * f20_54; + m_A261 += m_A61 * f20_54; + m_A264 += m_A62 * f20_54; + RHS54 += f20_54 * RHS20; + const double f21 = 1.0 / m_A63; + const double f21_42 = -f21 * m_A150; + m_A153 += m_A64 * f21_42; + m_A155 += m_A65 * f21_42; + m_A156 += m_A66 * f21_42; + m_A157 += m_A67 * f21_42; + RHS42 += f21_42 * RHS21; + const double f21_50 = -f21 * m_A209; + m_A213 += m_A64 * f21_50; + m_A215 += m_A65 * f21_50; + m_A216 += m_A66 * f21_50; + m_A217 += m_A67 * f21_50; + RHS50 += f21_50 * RHS21; + const double f21_51 = -f21 * m_A221; + m_A224 += m_A64 * f21_51; + m_A226 += m_A65 * f21_51; + m_A227 += m_A66 * f21_51; + m_A228 += m_A67 * f21_51; + RHS51 += f21_51 * RHS21; + const double f21_54 = -f21 * m_A255; + m_A257 += m_A64 * f21_54; + m_A260 += m_A65 * f21_54; + m_A261 += m_A66 * f21_54; + m_A264 += m_A67 * f21_54; + RHS54 += f21_54 * RHS21; + const double f22 = 1.0 / m_A68; + const double f22_47 = -f22 * m_A188; + m_A192 += m_A69 * f22_47; + RHS47 += f22_47 * RHS22; + const double f23 = 1.0 / m_A70; + const double f23_47 = -f23 * m_A189; + m_A192 += m_A71 * f23_47; + RHS47 += f23_47 * RHS23; + const double f24 = 1.0 / m_A72; + const double f24_42 = -f24 * m_A151; + m_A153 += m_A73 * f24_42; + m_A154 += m_A74 * f24_42; + RHS42 += f24_42 * RHS24; + const double f24_44 = -f24 * m_A168; + m_A169 += m_A73 * f24_44; + m_A170 += m_A74 * f24_44; + RHS44 += f24_44 * RHS24; + const double f25 = 1.0 / m_A75; + const double f25_46 = -f25 * m_A183; + m_A184 += m_A76 * f25_46; + m_A186 += m_A77 * f25_46; + RHS46 += f25_46 * RHS25; + const double f25_56 = -f25 * m_A280; + m_A284 += m_A76 * f25_56; + m_A290 += m_A77 * f25_56; + RHS56 += f25_56 * RHS25; + const double f26 = 1.0 / m_A78; + const double f26_55 = -f26 * m_A267; + m_A276 += m_A79 * f26_55; + RHS55 += f26_55 * RHS26; + const double f27 = 1.0 / m_A80; + const double f27_55 = -f27 * m_A268; + m_A276 += m_A81 * f27_55; + RHS55 += f27_55 * RHS27; + const double f28 = 1.0 / m_A82; + const double f28_49 = -f28 * m_A205; + m_A206 += m_A83 * f28_49; + RHS49 += f28_49 * RHS28; + const double f29 = 1.0 / m_A86; + const double f29_30 = -f29 * m_A91; + m_A92 += m_A87 * f29_30; + m_A93 += m_A88 * f29_30; + RHS30 += f29_30 * RHS29; + const double f29_37 = -f29 * m_A125; + m_A126 += m_A87 * f29_37; + m_A127 += m_A88 * f29_37; + RHS37 += f29_37 * RHS29; + const double f30 = 1.0 / m_A92; + const double f30_37 = -f30 * m_A126; + m_A127 += m_A93 * f30_37; + m_A128 += m_A94 * f30_37; + m_A130 += m_A95 * f30_37; + m_A131 += m_A96 * f30_37; + RHS37 += f30_37 * RHS30; + const double f30_43 = -f30 * m_A161; + m_A162 += m_A93 * f30_43; + m_A163 += m_A94 * f30_43; + m_A166 += m_A95 * f30_43; + m_A167 += m_A96 * f30_43; + RHS43 += f30_43 * RHS30; + const double f30_53 = -f30 * m_A244; + m_A246 += m_A93 * f30_53; + m_A247 += m_A94 * f30_53; + m_A250 += m_A95 * f30_53; + m_A252 += m_A96 * f30_53; + RHS53 += f30_53 * RHS30; + const double f30_56 = -f30 * m_A281; + m_A282 += m_A93 * f30_56; + m_A283 += m_A94 * f30_56; + m_A287 += m_A95 * f30_56; + m_A290 += m_A96 * f30_56; + RHS56 += f30_56 * RHS30; + const double f31 = 1.0 / m_A99; + const double f31_36 = -f31 * m_A119; + m_A120 += m_A100 * f31_36; + m_A121 += m_A101 * f31_36; + m_A122 += m_A102 * f31_36; + RHS36 += f31_36 * RHS31; + const double f31_45 = -f31 * m_A178; + m_A179 += m_A100 * f31_45; + m_A180 += m_A101 * f31_45; + m_A181 += m_A102 * f31_45; + RHS45 += f31_45 * RHS31; + const double f31_48 = -f31 * m_A198; + m_A200 += m_A100 * f31_48; + m_A201 += m_A101 * f31_48; + m_A202 += m_A102 * f31_48; + RHS48 += f31_48 * RHS31; + const double f32 = 1.0 / m_A104; + const double f32_52 = -f32 * m_A232; + m_A237 += m_A105 * f32_52; + RHS52 += f32_52 * RHS32; + const double f33 = 1.0 / m_A108; + const double f33_38 = -f33 * m_A134; + m_A135 += m_A109 * f33_38; + m_A137 += m_A110 * f33_38; + RHS38 += f33_38 * RHS33; + const double f33_50 = -f33 * m_A210; + m_A211 += m_A109 * f33_50; + m_A215 += m_A110 * f33_50; + RHS50 += f33_50 * RHS33; + const double f34 = 1.0 / m_A113; + const double f34_53 = -f34 * m_A245; + m_A250 += m_A114 * f34_53; + RHS53 += f34_53 * RHS34; + const double f35 = 1.0 / m_A116; + const double f35_48 = -f35 * m_A199; + m_A202 += m_A117 * f35_48; + RHS48 += f35_48 * RHS35; + const double f36 = 1.0 / m_A120; + const double f36_45 = -f36 * m_A179; + m_A180 += m_A121 * f36_45; + m_A181 += m_A122 * f36_45; + RHS45 += f36_45 * RHS36; + const double f36_48 = -f36 * m_A200; + m_A201 += m_A121 * f36_48; + m_A202 += m_A122 * f36_48; + RHS48 += f36_48 * RHS36; + const double f37 = 1.0 / m_A127; + const double f37_43 = -f37 * m_A162; + m_A163 += m_A128 * f37_43; + m_A164 += m_A129 * f37_43; + m_A166 += m_A130 * f37_43; + m_A167 += m_A131 * f37_43; + RHS43 += f37_43 * RHS37; + const double f37_47 = -f37 * m_A190; + m_A191 += m_A128 * f37_47; + m_A192 += m_A129 * f37_47; + m_A194 += m_A130 * f37_47; + m_A195 += m_A131 * f37_47; + RHS47 += f37_47 * RHS37; + const double f37_53 = -f37 * m_A246; + m_A247 += m_A128 * f37_53; + m_A248 += m_A129 * f37_53; + m_A250 += m_A130 * f37_53; + m_A252 += m_A131 * f37_53; + RHS53 += f37_53 * RHS37; + const double f37_56 = -f37 * m_A282; + m_A283 += m_A128 * f37_56; + m_A285 += m_A129 * f37_56; + m_A287 += m_A130 * f37_56; + m_A290 += m_A131 * f37_56; + RHS56 += f37_56 * RHS37; + const double f38 = 1.0 / m_A135; + const double f38_42 = -f38 * m_A152; + m_A153 += m_A136 * f38_42; + m_A155 += m_A137 * f38_42; + m_A156 += m_A138 * f38_42; + m_A157 += m_A139 * f38_42; + RHS42 += f38_42 * RHS38; + const double f38_50 = -f38 * m_A211; + m_A213 += m_A136 * f38_50; + m_A215 += m_A137 * f38_50; + m_A216 += m_A138 * f38_50; + m_A217 += m_A139 * f38_50; + RHS50 += f38_50 * RHS38; + const double f38_51 = -f38 * m_A222; + m_A224 += m_A136 * f38_51; + m_A226 += m_A137 * f38_51; + m_A227 += m_A138 * f38_51; + m_A228 += m_A139 * f38_51; + RHS51 += f38_51 * RHS38; + const double f38_54 = -f38 * m_A256; + m_A257 += m_A136 * f38_54; + m_A260 += m_A137 * f38_54; + m_A261 += m_A138 * f38_54; + m_A264 += m_A139 * f38_54; + RHS54 += f38_54 * RHS38; + const double f39 = 1.0 / m_A140; + const double f39_55 = -f39 * m_A269; + m_A276 += m_A141 * f39_55; + RHS55 += f39_55 * RHS39; + const double f40 = 1.0 / m_A143; + const double f40_50 = -f40 * m_A212; + m_A215 += m_A144 * f40_50; + RHS50 += f40_50 * RHS40; + const double f41 = 1.0 / m_A147; + const double f41_51 = -f41 * m_A223; + m_A227 += m_A148 * f41_51; + RHS51 += f41_51 * RHS41; + const double f42 = 1.0 / m_A153; + const double f42_44 = -f42 * m_A169; + m_A170 += m_A154 * f42_44; + m_A171 += m_A155 * f42_44; + m_A172 += m_A156 * f42_44; + m_A173 += m_A157 * f42_44; + RHS44 += f42_44 * RHS42; + const double f42_50 = -f42 * m_A213; + m_A214 += m_A154 * f42_50; + m_A215 += m_A155 * f42_50; + m_A216 += m_A156 * f42_50; + m_A217 += m_A157 * f42_50; + RHS50 += f42_50 * RHS42; + const double f42_51 = -f42 * m_A224; + m_A225 += m_A154 * f42_51; + m_A226 += m_A155 * f42_51; + m_A227 += m_A156 * f42_51; + m_A228 += m_A157 * f42_51; + RHS51 += f42_51 * RHS42; + const double f42_54 = -f42 * m_A257; + m_A258 += m_A154 * f42_54; + m_A260 += m_A155 * f42_54; + m_A261 += m_A156 * f42_54; + m_A264 += m_A157 * f42_54; + RHS54 += f42_54 * RHS42; + const double f43 = 1.0 / m_A163; + const double f43_47 = -f43 * m_A191; + m_A192 += m_A164 * f43_47; + m_A193 += m_A165 * f43_47; + m_A194 += m_A166 * f43_47; + m_A195 += m_A167 * f43_47; + RHS47 += f43_47 * RHS43; + const double f43_52 = -f43 * m_A233; + m_A235 += m_A164 * f43_52; + m_A237 += m_A165 * f43_52; + m_A238 += m_A166 * f43_52; + m_A240 += m_A167 * f43_52; + RHS52 += f43_52 * RHS43; + const double f43_53 = -f43 * m_A247; + m_A248 += m_A164 * f43_53; + m_A249 += m_A165 * f43_53; + m_A250 += m_A166 * f43_53; + m_A252 += m_A167 * f43_53; + RHS53 += f43_53 * RHS43; + const double f43_56 = -f43 * m_A283; + m_A285 += m_A164 * f43_56; + m_A286 += m_A165 * f43_56; + m_A287 += m_A166 * f43_56; + m_A290 += m_A167 * f43_56; + RHS56 += f43_56 * RHS43; + const double f44 = 1.0 / m_A170; + const double f44_50 = -f44 * m_A214; + m_A215 += m_A171 * f44_50; + m_A216 += m_A172 * f44_50; + m_A217 += m_A173 * f44_50; + m_A218 += m_A174 * f44_50; + RHS50 += f44_50 * RHS44; + const double f44_51 = -f44 * m_A225; + m_A226 += m_A171 * f44_51; + m_A227 += m_A172 * f44_51; + m_A228 += m_A173 * f44_51; + m_A229 += m_A174 * f44_51; + RHS51 += f44_51 * RHS44; + const double f44_54 = -f44 * m_A258; + m_A260 += m_A171 * f44_54; + m_A261 += m_A172 * f44_54; + m_A264 += m_A173 * f44_54; + m_A265 += m_A174 * f44_54; + RHS54 += f44_54 * RHS44; + const double f44_55 = -f44 * m_A270; + m_A273 += m_A171 * f44_55; + m_A274 += m_A172 * f44_55; + m_A275 += m_A173 * f44_55; + m_A276 += m_A174 * f44_55; + RHS55 += f44_55 * RHS44; + const double f45 = 1.0 / m_A180; + const double f45_48 = -f45 * m_A201; + m_A202 += m_A181 * f45_48; + m_A203 += m_A182 * f45_48; + RHS48 += f45_48 * RHS45; + const double f45_52 = -f45 * m_A234; + m_A236 += m_A181 * f45_52; + m_A237 += m_A182 * f45_52; + RHS52 += f45_52 * RHS45; + const double f46 = 1.0 / m_A184; + const double f46_55 = -f46 * m_A271; + m_A276 += m_A185 * f46_55; + m_A277 += m_A186 * f46_55; + RHS55 += f46_55 * RHS46; + const double f46_56 = -f46 * m_A284; + m_A289 += m_A185 * f46_56; + m_A290 += m_A186 * f46_56; + RHS56 += f46_56 * RHS46; + const double f47 = 1.0 / m_A192; + const double f47_52 = -f47 * m_A235; + m_A237 += m_A193 * f47_52; + m_A238 += m_A194 * f47_52; + m_A240 += m_A195 * f47_52; + RHS52 += f47_52 * RHS47; + const double f47_53 = -f47 * m_A248; + m_A249 += m_A193 * f47_53; + m_A250 += m_A194 * f47_53; + m_A252 += m_A195 * f47_53; + RHS53 += f47_53 * RHS47; + const double f47_56 = -f47 * m_A285; + m_A286 += m_A193 * f47_56; + m_A287 += m_A194 * f47_56; + m_A290 += m_A195 * f47_56; + RHS56 += f47_56 * RHS47; + const double f48 = 1.0 / m_A202; + const double f48_52 = -f48 * m_A236; + m_A237 += m_A203 * f48_52; + m_A239 += m_A204 * f48_52; + RHS52 += f48_52 * RHS48; + const double f48_54 = -f48 * m_A259; + m_A262 += m_A203 * f48_54; + m_A264 += m_A204 * f48_54; + RHS54 += f48_54 * RHS48; + const double f49 = 1.0 / m_A206; + const double f49_55 = -f49 * m_A272; + m_A276 += m_A207 * f49_55; + RHS55 += f49_55 * RHS49; + const double f50 = 1.0 / m_A215; + const double f50_51 = -f50 * m_A226; + m_A227 += m_A216 * f50_51; + m_A228 += m_A217 * f50_51; + m_A229 += m_A218 * f50_51; + RHS51 += f50_51 * RHS50; + const double f50_54 = -f50 * m_A260; + m_A261 += m_A216 * f50_54; + m_A264 += m_A217 * f50_54; + m_A265 += m_A218 * f50_54; + RHS54 += f50_54 * RHS50; + const double f50_55 = -f50 * m_A273; + m_A274 += m_A216 * f50_55; + m_A275 += m_A217 * f50_55; + m_A276 += m_A218 * f50_55; + RHS55 += f50_55 * RHS50; + const double f51 = 1.0 / m_A227; + const double f51_54 = -f51 * m_A261; + m_A264 += m_A228 * f51_54; + m_A265 += m_A229 * f51_54; + RHS54 += f51_54 * RHS51; + const double f51_55 = -f51 * m_A274; + m_A275 += m_A228 * f51_55; + m_A276 += m_A229 * f51_55; + RHS55 += f51_55 * RHS51; + const double f52 = 1.0 / m_A237; + const double f52_53 = -f52 * m_A249; + m_A250 += m_A238 * f52_53; + m_A251 += m_A239 * f52_53; + m_A252 += m_A240 * f52_53; + RHS53 += f52_53 * RHS52; + const double f52_54 = -f52 * m_A262; + m_A263 += m_A238 * f52_54; + m_A264 += m_A239 * f52_54; + m_A266 += m_A240 * f52_54; + RHS54 += f52_54 * RHS52; + const double f52_56 = -f52 * m_A286; + m_A287 += m_A238 * f52_56; + m_A288 += m_A239 * f52_56; + m_A290 += m_A240 * f52_56; + RHS56 += f52_56 * RHS52; + const double f53 = 1.0 / m_A250; + const double f53_54 = -f53 * m_A263; + m_A264 += m_A251 * f53_54; + m_A266 += m_A252 * f53_54; + RHS54 += f53_54 * RHS53; + const double f53_56 = -f53 * m_A287; + m_A288 += m_A251 * f53_56; + m_A290 += m_A252 * f53_56; + RHS56 += f53_56 * RHS53; + const double f54 = 1.0 / m_A264; + const double f54_55 = -f54 * m_A275; + m_A276 += m_A265 * f54_55; + m_A277 += m_A266 * f54_55; + RHS55 += f54_55 * RHS54; + const double f54_56 = -f54 * m_A288; + m_A289 += m_A265 * f54_56; + m_A290 += m_A266 * f54_56; + RHS56 += f54_56 * RHS54; + const double f55 = 1.0 / m_A276; + const double f55_56 = -f55 * m_A289; + m_A290 += m_A277 * f55_56; + RHS56 += f55_56 * RHS55; + V[56] = RHS56 / m_A290; + double tmp55 = 0.0; + tmp55 += m_A277 * V[56]; + V[55] = (RHS55 - tmp55) / m_A276; + double tmp54 = 0.0; + tmp54 += m_A265 * V[55]; + tmp54 += m_A266 * V[56]; + V[54] = (RHS54 - tmp54) / m_A264; + double tmp53 = 0.0; + tmp53 += m_A251 * V[54]; + tmp53 += m_A252 * V[56]; + V[53] = (RHS53 - tmp53) / m_A250; + double tmp52 = 0.0; + tmp52 += m_A238 * V[53]; + tmp52 += m_A239 * V[54]; + tmp52 += m_A240 * V[56]; + V[52] = (RHS52 - tmp52) / m_A237; + double tmp51 = 0.0; + tmp51 += m_A228 * V[54]; + tmp51 += m_A229 * V[55]; + V[51] = (RHS51 - tmp51) / m_A227; + double tmp50 = 0.0; + tmp50 += m_A216 * V[51]; + tmp50 += m_A217 * V[54]; + tmp50 += m_A218 * V[55]; + V[50] = (RHS50 - tmp50) / m_A215; + double tmp49 = 0.0; + tmp49 += m_A207 * V[55]; + V[49] = (RHS49 - tmp49) / m_A206; + double tmp48 = 0.0; + tmp48 += m_A203 * V[52]; + tmp48 += m_A204 * V[54]; + V[48] = (RHS48 - tmp48) / m_A202; + double tmp47 = 0.0; + tmp47 += m_A193 * V[52]; + tmp47 += m_A194 * V[53]; + tmp47 += m_A195 * V[56]; + V[47] = (RHS47 - tmp47) / m_A192; + double tmp46 = 0.0; + tmp46 += m_A185 * V[55]; + tmp46 += m_A186 * V[56]; + V[46] = (RHS46 - tmp46) / m_A184; + double tmp45 = 0.0; + tmp45 += m_A181 * V[48]; + tmp45 += m_A182 * V[52]; + V[45] = (RHS45 - tmp45) / m_A180; + double tmp44 = 0.0; + tmp44 += m_A171 * V[50]; + tmp44 += m_A172 * V[51]; + tmp44 += m_A173 * V[54]; + tmp44 += m_A174 * V[55]; + V[44] = (RHS44 - tmp44) / m_A170; + double tmp43 = 0.0; + tmp43 += m_A164 * V[47]; + tmp43 += m_A165 * V[52]; + tmp43 += m_A166 * V[53]; + tmp43 += m_A167 * V[56]; + V[43] = (RHS43 - tmp43) / m_A163; + double tmp42 = 0.0; + tmp42 += m_A154 * V[44]; + tmp42 += m_A155 * V[50]; + tmp42 += m_A156 * V[51]; + tmp42 += m_A157 * V[54]; + V[42] = (RHS42 - tmp42) / m_A153; + double tmp41 = 0.0; + tmp41 += m_A148 * V[51]; + V[41] = (RHS41 - tmp41) / m_A147; + double tmp40 = 0.0; + tmp40 += m_A144 * V[50]; + V[40] = (RHS40 - tmp40) / m_A143; + double tmp39 = 0.0; + tmp39 += m_A141 * V[55]; + V[39] = (RHS39 - tmp39) / m_A140; + double tmp38 = 0.0; + tmp38 += m_A136 * V[42]; + tmp38 += m_A137 * V[50]; + tmp38 += m_A138 * V[51]; + tmp38 += m_A139 * V[54]; + V[38] = (RHS38 - tmp38) / m_A135; + double tmp37 = 0.0; + tmp37 += m_A128 * V[43]; + tmp37 += m_A129 * V[47]; + tmp37 += m_A130 * V[53]; + tmp37 += m_A131 * V[56]; + V[37] = (RHS37 - tmp37) / m_A127; + double tmp36 = 0.0; + tmp36 += m_A121 * V[45]; + tmp36 += m_A122 * V[48]; + V[36] = (RHS36 - tmp36) / m_A120; + double tmp35 = 0.0; + tmp35 += m_A117 * V[48]; + V[35] = (RHS35 - tmp35) / m_A116; + double tmp34 = 0.0; + tmp34 += m_A114 * V[53]; + V[34] = (RHS34 - tmp34) / m_A113; + double tmp33 = 0.0; + tmp33 += m_A109 * V[38]; + tmp33 += m_A110 * V[50]; + V[33] = (RHS33 - tmp33) / m_A108; + double tmp32 = 0.0; + tmp32 += m_A105 * V[52]; + V[32] = (RHS32 - tmp32) / m_A104; + double tmp31 = 0.0; + tmp31 += m_A100 * V[36]; + tmp31 += m_A101 * V[45]; + tmp31 += m_A102 * V[48]; + V[31] = (RHS31 - tmp31) / m_A99; + double tmp30 = 0.0; + tmp30 += m_A93 * V[37]; + tmp30 += m_A94 * V[43]; + tmp30 += m_A95 * V[53]; + tmp30 += m_A96 * V[56]; + V[30] = (RHS30 - tmp30) / m_A92; + double tmp29 = 0.0; + tmp29 += m_A87 * V[30]; + tmp29 += m_A88 * V[37]; + V[29] = (RHS29 - tmp29) / m_A86; + double tmp28 = 0.0; + tmp28 += m_A83 * V[49]; + V[28] = (RHS28 - tmp28) / m_A82; + double tmp27 = 0.0; + tmp27 += m_A81 * V[55]; + V[27] = (RHS27 - tmp27) / m_A80; + double tmp26 = 0.0; + tmp26 += m_A79 * V[55]; + V[26] = (RHS26 - tmp26) / m_A78; + double tmp25 = 0.0; + tmp25 += m_A76 * V[46]; + tmp25 += m_A77 * V[56]; + V[25] = (RHS25 - tmp25) / m_A75; + double tmp24 = 0.0; + tmp24 += m_A73 * V[42]; + tmp24 += m_A74 * V[44]; + V[24] = (RHS24 - tmp24) / m_A72; + double tmp23 = 0.0; + tmp23 += m_A71 * V[47]; + V[23] = (RHS23 - tmp23) / m_A70; + double tmp22 = 0.0; + tmp22 += m_A69 * V[47]; + V[22] = (RHS22 - tmp22) / m_A68; + double tmp21 = 0.0; + tmp21 += m_A64 * V[42]; + tmp21 += m_A65 * V[50]; + tmp21 += m_A66 * V[51]; + tmp21 += m_A67 * V[54]; + V[21] = (RHS21 - tmp21) / m_A63; + double tmp20 = 0.0; + tmp20 += m_A59 * V[38]; + tmp20 += m_A60 * V[42]; + tmp20 += m_A61 * V[51]; + tmp20 += m_A62 * V[54]; + V[20] = (RHS20 - tmp20) / m_A58; + double tmp19 = 0.0; + tmp19 += m_A57 * V[47]; + V[19] = (RHS19 - tmp19) / m_A56; + double tmp18 = 0.0; + tmp18 += m_A54 * V[41]; + tmp18 += m_A55 * V[51]; + V[18] = (RHS18 - tmp18) / m_A53; + double tmp17 = 0.0; + tmp17 += m_A51 * V[48]; + tmp17 += m_A52 * V[54]; + V[17] = (RHS17 - tmp17) / m_A50; + double tmp16 = 0.0; + tmp16 += m_A47 * V[33]; + tmp16 += m_A48 * V[38]; + tmp16 += m_A49 * V[50]; + V[16] = (RHS16 - tmp16) / m_A46; + double tmp15 = 0.0; + tmp15 += m_A45 * V[40]; + V[15] = (RHS15 - tmp15) / m_A44; + double tmp14 = 0.0; + tmp14 += m_A42 * V[45]; + tmp14 += m_A43 * V[52]; + V[14] = (RHS14 - tmp14) / m_A41; + double tmp13 = 0.0; + tmp13 += m_A38 * V[31]; + tmp13 += m_A39 * V[36]; + tmp13 += m_A40 * V[45]; + V[13] = (RHS13 - tmp13) / m_A37; + double tmp12 = 0.0; + tmp12 += m_A36 * V[36]; + V[12] = (RHS12 - tmp12) / m_A35; + double tmp11 = 0.0; + tmp11 += m_A34 * V[41]; + V[11] = (RHS11 - tmp11) / m_A33; + double tmp10 = 0.0; + tmp10 += m_A31 * V[31]; + tmp10 += m_A32 * V[48]; + V[10] = (RHS10 - tmp10) / m_A30; + double tmp9 = 0.0; + tmp9 += m_A26 * V[37]; + tmp9 += m_A27 * V[43]; + tmp9 += m_A28 * V[53]; + tmp9 += m_A29 * V[56]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A24 * V[35]; + V[8] = (RHS8 - tmp8) / m_A23; + double tmp7 = 0.0; + tmp7 += m_A22 * V[33]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A17 * V[30]; + tmp6 += m_A18 * V[43]; + tmp6 += m_A19 * V[53]; + tmp6 += m_A20 * V[56]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[34]; + tmp5 += m_A15 * V[53]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[43]; + tmp4 += m_A12 * V[52]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[34]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[29]; + tmp2 += m_A6 * V[30]; + tmp2 += m_A7 * V[37]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[32]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[29]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// flyball +static void nl_gcr_7_double_double_c74b1a65978d7121(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A6 += gt[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A5 += go[4]; + m_A4 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// flyball +static void nl_gcr_7_double_double_e15d9316d59cdad9(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + m_A0 += go[1]; + m_A0 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A5 += go[7]; + m_A4 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_119_double_double_ab8d1ff6aa7499d8(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A2 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A4 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A6 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A7 += gt[15]; + m_A7 += gt[16]; + m_A10 += go[13]; + m_A9 += go[14]; + m_A8 += go[15]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[16] * *cnV[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A14 += go[17]; + m_A14 += go[18]; + m_A13 += go[19]; + m_A13 += go[20]; + m_A12 += go[21]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 -= go[22] * *cnV[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A15 += gt[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A15 += gt[28]; + m_A18 += go[23]; + m_A18 += go[24]; + m_A17 += go[25]; + m_A17 += go[26]; + m_A16 += go[27]; + double RHS5 = Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 -= go[28] * *cnV[28]; + m_A19 += gt[29]; + m_A19 += gt[30]; + m_A20 += go[29]; + m_A21 += go[30]; + double RHS6 = Idr[29]; + RHS6 += Idr[30]; + m_A22 += gt[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A22 += gt[37]; + m_A23 += go[31]; + m_A24 += go[32]; + double RHS7 = Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 -= go[33] * *cnV[33]; + RHS7 -= go[34] * *cnV[34]; + RHS7 -= go[35] * *cnV[35]; + RHS7 -= go[36] * *cnV[36]; + RHS7 -= go[37] * *cnV[37]; + m_A25 += gt[38]; + m_A25 += gt[39]; + m_A25 += gt[40]; + m_A25 += gt[41]; + m_A25 += gt[42]; + m_A25 += gt[43]; + m_A26 += go[38]; + m_A26 += go[39]; + m_A27 += go[40]; + m_A28 += go[41]; + double RHS8 = Idr[38]; + RHS8 += Idr[39]; + RHS8 += Idr[40]; + RHS8 += Idr[41]; + RHS8 += Idr[42]; + RHS8 += Idr[43]; + RHS8 -= go[42] * *cnV[42]; + RHS8 -= go[43] * *cnV[43]; + m_A29 += gt[44]; + m_A29 += gt[45]; + m_A29 += gt[46]; + m_A29 += gt[47]; + m_A29 += gt[48]; + m_A29 += gt[49]; + m_A29 += gt[50]; + m_A30 += go[44]; + double RHS9 = Idr[44]; + RHS9 += Idr[45]; + RHS9 += Idr[46]; + RHS9 += Idr[47]; + RHS9 += Idr[48]; + RHS9 += Idr[49]; + RHS9 += Idr[50]; + RHS9 -= go[45] * *cnV[45]; + RHS9 -= go[46] * *cnV[46]; + RHS9 -= go[47] * *cnV[47]; + RHS9 -= go[48] * *cnV[48]; + RHS9 -= go[49] * *cnV[49]; + RHS9 -= go[50] * *cnV[50]; + m_A31 += gt[51]; + m_A31 += gt[52]; + m_A31 += gt[53]; + m_A31 += gt[54]; + m_A34 += go[51]; + m_A32 += go[52]; + m_A33 += go[53]; + double RHS10 = Idr[51]; + RHS10 += Idr[52]; + RHS10 += Idr[53]; + RHS10 += Idr[54]; + RHS10 -= go[54] * *cnV[54]; + m_A37 += gt[55]; + m_A37 += gt[56]; + m_A37 += gt[57]; + m_A36 += go[55]; + m_A35 += go[56]; + double RHS11 = Idr[55]; + RHS11 += Idr[56]; + RHS11 += Idr[57]; + RHS11 -= go[57] * *cnV[57]; + m_A43 += gt[58]; + m_A43 += gt[59]; + m_A43 += gt[60]; + m_A45 += go[58]; + m_A41 += go[59]; + double RHS12 = Idr[58]; + RHS12 += Idr[59]; + RHS12 += Idr[60]; + RHS12 -= go[60] * *cnV[60]; + m_A51 += gt[61]; + m_A51 += gt[62]; + m_A51 += gt[63]; + m_A51 += gt[64]; + m_A51 += gt[65]; + m_A48 += go[61]; + m_A47 += go[62]; + m_A46 += go[63]; + double RHS13 = Idr[61]; + RHS13 += Idr[62]; + RHS13 += Idr[63]; + RHS13 += Idr[64]; + RHS13 += Idr[65]; + RHS13 -= go[64] * *cnV[64]; + RHS13 -= go[65] * *cnV[65]; + m_A57 += gt[66]; + m_A57 += gt[67]; + m_A57 += gt[68]; + m_A57 += gt[69]; + m_A59 += go[66]; + m_A55 += go[67]; + m_A55 += go[68]; + double RHS14 = Idr[66]; + RHS14 += Idr[67]; + RHS14 += Idr[68]; + RHS14 += Idr[69]; + RHS14 -= go[69] * *cnV[69]; + m_A61 += gt[70]; + m_A61 += gt[71]; + m_A60 += go[70]; + double RHS15 = Idr[70]; + RHS15 += Idr[71]; + RHS15 -= go[71] * *cnV[71]; + m_A66 += gt[72]; + m_A66 += gt[73]; + m_A66 += gt[74]; + m_A66 += gt[75]; + m_A66 += gt[76]; + m_A66 += gt[77]; + m_A63 += go[72]; + m_A64 += go[73]; + m_A64 += go[74]; + m_A68 += go[75]; + m_A68 += go[76]; + double RHS16 = Idr[72]; + RHS16 += Idr[73]; + RHS16 += Idr[74]; + RHS16 += Idr[75]; + RHS16 += Idr[76]; + RHS16 += Idr[77]; + RHS16 -= go[77] * *cnV[77]; + m_A71 += gt[78]; + m_A71 += gt[79]; + m_A71 += gt[80]; + m_A71 += gt[81]; + m_A71 += gt[82]; + m_A71 += gt[83]; + m_A72 += go[78]; + m_A69 += go[79]; + m_A73 += go[80]; + double RHS17 = Idr[78]; + RHS17 += Idr[79]; + RHS17 += Idr[80]; + RHS17 += Idr[81]; + RHS17 += Idr[82]; + RHS17 += Idr[83]; + RHS17 -= go[81] * *cnV[81]; + RHS17 -= go[82] * *cnV[82]; + RHS17 -= go[83] * *cnV[83]; + m_A75 += gt[84]; + m_A75 += gt[85]; + m_A75 += gt[86]; + m_A77 += go[84]; + m_A74 += go[85]; + double RHS18 = Idr[84]; + RHS18 += Idr[85]; + RHS18 += Idr[86]; + RHS18 -= go[86] * *cnV[86]; + m_A85 += gt[87]; + m_A85 += gt[88]; + m_A85 += gt[89]; + m_A85 += gt[90]; + m_A85 += gt[91]; + m_A85 += gt[92]; + m_A78 += go[87]; + m_A80 += go[88]; + m_A82 += go[89]; + m_A79 += go[90]; + double RHS19 = Idr[87]; + RHS19 += Idr[88]; + RHS19 += Idr[89]; + RHS19 += Idr[90]; + RHS19 += Idr[91]; + RHS19 += Idr[92]; + RHS19 -= go[91] * *cnV[91]; + RHS19 -= go[92] * *cnV[92]; + m_A94 += gt[93]; + m_A94 += gt[94]; + m_A94 += gt[95]; + m_A94 += gt[96]; + m_A94 += gt[97]; + m_A88 += go[93]; + m_A90 += go[94]; + m_A92 += go[95]; + double RHS20 = Idr[93]; + RHS20 += Idr[94]; + RHS20 += Idr[95]; + RHS20 += Idr[96]; + RHS20 += Idr[97]; + RHS20 -= go[96] * *cnV[96]; + RHS20 -= go[97] * *cnV[97]; + m_A102 += gt[98]; + m_A102 += gt[99]; + m_A102 += gt[100]; + m_A102 += gt[101]; + m_A102 += gt[102]; + m_A102 += gt[103]; + m_A102 += gt[104]; + m_A103 += go[98]; + m_A98 += go[99]; + m_A98 += go[100]; + m_A100 += go[101]; + m_A97 += go[102]; + m_A97 += go[103]; + double RHS21 = Idr[98]; + RHS21 += Idr[99]; + RHS21 += Idr[100]; + RHS21 += Idr[101]; + RHS21 += Idr[102]; + RHS21 += Idr[103]; + RHS21 += Idr[104]; + RHS21 -= go[104] * *cnV[104]; + m_A108 += gt[105]; + m_A108 += gt[106]; + m_A108 += gt[107]; + m_A108 += gt[108]; + m_A108 += gt[109]; + m_A108 += gt[110]; + m_A104 += go[105]; + m_A106 += go[106]; + m_A105 += go[107]; + double RHS22 = Idr[105]; + RHS22 += Idr[106]; + RHS22 += Idr[107]; + RHS22 += Idr[108]; + RHS22 += Idr[109]; + RHS22 += Idr[110]; + RHS22 -= go[108] * *cnV[108]; + RHS22 -= go[109] * *cnV[109]; + RHS22 -= go[110] * *cnV[110]; + m_A118 += gt[111]; + m_A118 += gt[112]; + m_A118 += gt[113]; + m_A118 += gt[114]; + m_A118 += gt[115]; + m_A118 += gt[116]; + m_A118 += gt[117]; + m_A118 += gt[118]; + m_A118 += gt[119]; + m_A112 += go[111]; + m_A112 += go[112]; + m_A111 += go[113]; + m_A113 += go[114]; + m_A116 += go[115]; + m_A110 += go[116]; + m_A110 += go[117]; + double RHS23 = Idr[111]; + RHS23 += Idr[112]; + RHS23 += Idr[113]; + RHS23 += Idr[114]; + RHS23 += Idr[115]; + RHS23 += Idr[116]; + RHS23 += Idr[117]; + RHS23 += Idr[118]; + RHS23 += Idr[119]; + RHS23 -= go[118] * *cnV[118]; + RHS23 -= go[119] * *cnV[119]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A35; + m_A37 += m_A1 * f0_11; + m_A39 += m_A2 * f0_11; + RHS11 += f0_11 * RHS0; + const double f0_13 = -f0 * m_A46; + m_A49 += m_A1 * f0_13; + m_A51 += m_A2 * f0_13; + RHS13 += f0_13 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_13 = -f1 * m_A47; + m_A51 += m_A4 * f1_13; + RHS13 += f1_13 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_19 = -f2 * m_A78; + m_A82 += m_A6 * f2_19; + RHS19 += f2_19 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_11 = -f3 * m_A36; + m_A37 += m_A8 * f3_11; + m_A38 += m_A9 * f3_11; + m_A40 += m_A10 * f3_11; + RHS11 += f3_11 * RHS3; + const double f3_12 = -f3 * m_A41; + m_A42 += m_A8 * f3_12; + m_A43 += m_A9 * f3_12; + m_A45 += m_A10 * f3_12; + RHS12 += f3_12 * RHS3; + const double f3_19 = -f3 * m_A79; + m_A81 += m_A8 * f3_19; + m_A82 += m_A9 * f3_19; + m_A85 += m_A10 * f3_19; + RHS19 += f3_19 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_13 = -f4 * m_A48; + m_A51 += m_A12 * f4_13; + m_A52 += m_A13 * f4_13; + m_A54 += m_A14 * f4_13; + RHS13 += f4_13 * RHS4; + const double f4_14 = -f4 * m_A55; + m_A56 += m_A12 * f4_14; + m_A57 += m_A13 * f4_14; + m_A59 += m_A14 * f4_14; + RHS14 += f4_14 * RHS4; + const double f4_21 = -f4 * m_A97; + m_A99 += m_A12 * f4_21; + m_A100 += m_A13 * f4_21; + m_A102 += m_A14 * f4_21; + RHS21 += f4_21 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_19 = -f5 * m_A80; + m_A85 += m_A16 * f5_19; + m_A86 += m_A17 * f5_19; + m_A87 += m_A18 * f5_19; + RHS19 += f5_19 * RHS5; + const double f5_21 = -f5 * m_A98; + m_A101 += m_A16 * f5_21; + m_A102 += m_A17 * f5_21; + m_A103 += m_A18 * f5_21; + RHS21 += f5_21 * RHS5; + const double f5_23 = -f5 * m_A110; + m_A114 += m_A16 * f5_23; + m_A116 += m_A17 * f5_23; + m_A118 += m_A18 * f5_23; + RHS23 += f5_23 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_15 = -f6 * m_A60; + m_A61 += m_A20 * f6_15; + m_A62 += m_A21 * f6_15; + RHS15 += f6_15 * RHS6; + const double f6_16 = -f6 * m_A63; + m_A65 += m_A20 * f6_16; + m_A66 += m_A21 * f6_16; + RHS16 += f6_16 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_20 = -f7 * m_A88; + m_A89 += m_A23 * f7_20; + m_A92 += m_A24 * f7_20; + RHS20 += f7_20 * RHS7; + const double f8 = 1.0 / m_A25; + const double f8_16 = -f8 * m_A64; + m_A66 += m_A26 * f8_16; + m_A67 += m_A27 * f8_16; + m_A68 += m_A28 * f8_16; + RHS16 += f8_16 * RHS8; + const double f8_17 = -f8 * m_A69; + m_A70 += m_A26 * f8_17; + m_A71 += m_A27 * f8_17; + m_A73 += m_A28 * f8_17; + RHS17 += f8_17 * RHS8; + const double f8_20 = -f8 * m_A89; + m_A91 += m_A26 * f8_20; + m_A92 += m_A27 * f8_20; + m_A96 += m_A28 * f8_20; + RHS20 += f8_20 * RHS8; + const double f8_23 = -f8 * m_A111; + m_A112 += m_A26 * f8_23; + m_A113 += m_A27 * f8_23; + m_A118 += m_A28 * f8_23; + RHS23 += f8_23 * RHS8; + const double f9 = 1.0 / m_A29; + const double f9_22 = -f9 * m_A104; + m_A106 += m_A30 * f9_22; + RHS22 += f9_22 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_18 = -f10 * m_A74; + m_A75 += m_A32 * f10_18; + m_A76 += m_A33 * f10_18; + m_A77 += m_A34 * f10_18; + RHS18 += f10_18 * RHS10; + const double f10_20 = -f10 * m_A90; + m_A93 += m_A32 * f10_20; + m_A94 += m_A33 * f10_20; + m_A95 += m_A34 * f10_20; + RHS20 += f10_20 * RHS10; + const double f10_22 = -f10 * m_A105; + m_A106 += m_A32 * f10_22; + m_A107 += m_A33 * f10_22; + m_A108 += m_A34 * f10_22; + RHS22 += f10_22 * RHS10; + const double f11 = 1.0 / m_A37; + const double f11_12 = -f11 * m_A42; + m_A43 += m_A38 * f11_12; + m_A44 += m_A39 * f11_12; + m_A45 += m_A40 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_13 = -f11 * m_A49; + m_A50 += m_A38 * f11_13; + m_A51 += m_A39 * f11_13; + m_A53 += m_A40 * f11_13; + RHS13 += f11_13 * RHS11; + const double f11_19 = -f11 * m_A81; + m_A82 += m_A38 * f11_19; + m_A83 += m_A39 * f11_19; + m_A85 += m_A40 * f11_19; + RHS19 += f11_19 * RHS11; + const double f12 = 1.0 / m_A43; + const double f12_13 = -f12 * m_A50; + m_A51 += m_A44 * f12_13; + m_A53 += m_A45 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_19 = -f12 * m_A82; + m_A83 += m_A44 * f12_19; + m_A85 += m_A45 * f12_19; + RHS19 += f12_19 * RHS12; + const double f13 = 1.0 / m_A51; + const double f13_14 = -f13 * m_A56; + m_A57 += m_A52 * f13_14; + m_A58 += m_A53 * f13_14; + m_A59 += m_A54 * f13_14; + RHS14 += f13_14 * RHS13; + const double f13_19 = -f13 * m_A83; + m_A84 += m_A52 * f13_19; + m_A85 += m_A53 * f13_19; + m_A86 += m_A54 * f13_19; + RHS19 += f13_19 * RHS13; + const double f13_21 = -f13 * m_A99; + m_A100 += m_A52 * f13_21; + m_A101 += m_A53 * f13_21; + m_A102 += m_A54 * f13_21; + RHS21 += f13_21 * RHS13; + const double f14 = 1.0 / m_A57; + const double f14_19 = -f14 * m_A84; + m_A85 += m_A58 * f14_19; + m_A86 += m_A59 * f14_19; + RHS19 += f14_19 * RHS14; + const double f14_21 = -f14 * m_A100; + m_A101 += m_A58 * f14_21; + m_A102 += m_A59 * f14_21; + RHS21 += f14_21 * RHS14; + const double f15 = 1.0 / m_A61; + const double f15_16 = -f15 * m_A65; + m_A66 += m_A62 * f15_16; + RHS16 += f15_16 * RHS15; + const double f16 = 1.0 / m_A66; + const double f16_17 = -f16 * m_A70; + m_A71 += m_A67 * f16_17; + m_A73 += m_A68 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_20 = -f16 * m_A91; + m_A92 += m_A67 * f16_20; + m_A96 += m_A68 * f16_20; + RHS20 += f16_20 * RHS16; + const double f16_23 = -f16 * m_A112; + m_A113 += m_A67 * f16_23; + m_A118 += m_A68 * f16_23; + RHS23 += f16_23 * RHS16; + const double f17 = 1.0 / m_A71; + const double f17_20 = -f17 * m_A92; + m_A94 += m_A72 * f17_20; + m_A96 += m_A73 * f17_20; + RHS20 += f17_20 * RHS17; + const double f17_23 = -f17 * m_A113; + m_A115 += m_A72 * f17_23; + m_A118 += m_A73 * f17_23; + RHS23 += f17_23 * RHS17; + const double f18 = 1.0 / m_A75; + const double f18_20 = -f18 * m_A93; + m_A94 += m_A76 * f18_20; + m_A95 += m_A77 * f18_20; + RHS20 += f18_20 * RHS18; + const double f18_22 = -f18 * m_A106; + m_A107 += m_A76 * f18_22; + m_A108 += m_A77 * f18_22; + RHS22 += f18_22 * RHS18; + const double f19 = 1.0 / m_A85; + const double f19_21 = -f19 * m_A101; + m_A102 += m_A86 * f19_21; + m_A103 += m_A87 * f19_21; + RHS21 += f19_21 * RHS19; + const double f19_23 = -f19 * m_A114; + m_A116 += m_A86 * f19_23; + m_A118 += m_A87 * f19_23; + RHS23 += f19_23 * RHS19; + const double f20 = 1.0 / m_A94; + const double f20_22 = -f20 * m_A107; + m_A108 += m_A95 * f20_22; + m_A109 += m_A96 * f20_22; + RHS22 += f20_22 * RHS20; + const double f20_23 = -f20 * m_A115; + m_A117 += m_A95 * f20_23; + m_A118 += m_A96 * f20_23; + RHS23 += f20_23 * RHS20; + const double f21 = 1.0 / m_A102; + const double f21_23 = -f21 * m_A116; + m_A118 += m_A103 * f21_23; + RHS23 += f21_23 * RHS21; + const double f22 = 1.0 / m_A108; + const double f22_23 = -f22 * m_A117; + m_A118 += m_A109 * f22_23; + RHS23 += f22_23 * RHS22; + V[23] = RHS23 / m_A118; + double tmp22 = 0.0; + tmp22 += m_A109 * V[23]; + V[22] = (RHS22 - tmp22) / m_A108; + double tmp21 = 0.0; + tmp21 += m_A103 * V[23]; + V[21] = (RHS21 - tmp21) / m_A102; + double tmp20 = 0.0; + tmp20 += m_A95 * V[22]; + tmp20 += m_A96 * V[23]; + V[20] = (RHS20 - tmp20) / m_A94; + double tmp19 = 0.0; + tmp19 += m_A86 * V[21]; + tmp19 += m_A87 * V[23]; + V[19] = (RHS19 - tmp19) / m_A85; + double tmp18 = 0.0; + tmp18 += m_A76 * V[20]; + tmp18 += m_A77 * V[22]; + V[18] = (RHS18 - tmp18) / m_A75; + double tmp17 = 0.0; + tmp17 += m_A72 * V[20]; + tmp17 += m_A73 * V[23]; + V[17] = (RHS17 - tmp17) / m_A71; + double tmp16 = 0.0; + tmp16 += m_A67 * V[17]; + tmp16 += m_A68 * V[23]; + V[16] = (RHS16 - tmp16) / m_A66; + double tmp15 = 0.0; + tmp15 += m_A62 * V[16]; + V[15] = (RHS15 - tmp15) / m_A61; + double tmp14 = 0.0; + tmp14 += m_A58 * V[19]; + tmp14 += m_A59 * V[21]; + V[14] = (RHS14 - tmp14) / m_A57; + double tmp13 = 0.0; + tmp13 += m_A52 * V[14]; + tmp13 += m_A53 * V[19]; + tmp13 += m_A54 * V[21]; + V[13] = (RHS13 - tmp13) / m_A51; + double tmp12 = 0.0; + tmp12 += m_A44 * V[13]; + tmp12 += m_A45 * V[19]; + V[12] = (RHS12 - tmp12) / m_A43; + double tmp11 = 0.0; + tmp11 += m_A38 * V[12]; + tmp11 += m_A39 * V[13]; + tmp11 += m_A40 * V[19]; + V[11] = (RHS11 - tmp11) / m_A37; + double tmp10 = 0.0; + tmp10 += m_A32 * V[18]; + tmp10 += m_A33 * V[20]; + tmp10 += m_A34 * V[22]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A30 * V[18]; + V[9] = (RHS9 - tmp9) / m_A29; + double tmp8 = 0.0; + tmp8 += m_A26 * V[16]; + tmp8 += m_A27 * V[17]; + tmp8 += m_A28 * V[23]; + V[8] = (RHS8 - tmp8) / m_A25; + double tmp7 = 0.0; + tmp7 += m_A23 * V[8]; + tmp7 += m_A24 * V[17]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A20 * V[15]; + tmp6 += m_A21 * V[16]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A16 * V[19]; + tmp5 += m_A17 * V[21]; + tmp5 += m_A18 * V[23]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A12 * V[13]; + tmp4 += m_A13 * V[14]; + tmp4 += m_A14 * V[21]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[11]; + tmp3 += m_A9 * V[12]; + tmp3 += m_A10 * V[19]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[12]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A4 * V[13]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[11]; + tmp0 += m_A2 * V[13]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_19_double_double_d97fd7ecc1ebba3d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A18 += gt[12]; + m_A18 += gt[13]; + m_A18 += gt[14]; + m_A18 += gt[15]; + m_A18 += gt[16]; + m_A18 += gt[17]; + m_A18 += gt[18]; + m_A17 += go[12]; + m_A16 += go[13]; + m_A15 += go[14]; + m_A14 += go[15]; + m_A13 += go[16]; + m_A12 += go[17]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 += Idr[14]; + RHS6 += Idr[15]; + RHS6 += Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 -= go[18] * *cnV[18]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A12; + m_A18 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A13; + m_A18 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A14; + m_A18 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A15; + m_A18 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_6 = -f4 * m_A16; + m_A18 += m_A9 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_6 = -f5 * m_A17; + m_A18 += m_A11 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A18; + double tmp5 = 0.0; + tmp5 += m_A11 * V[6]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[6]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_30_double_double_f153eda877c6e8ed(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A5 += go[4]; + m_A5 += go[5]; + m_A4 += go[6]; + m_A4 += go[7]; + m_A3 += go[8]; + m_A3 += go[9]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A7 += go[11]; + m_A8 += go[12]; + m_A8 += go[13]; + double RHS2 = Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 -= go[14] * *cnV[14]; + m_A9 += gt[15]; + m_A10 += go[15]; + double RHS3 = Idr[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A12 += go[16]; + m_A12 += go[17]; + m_A11 += go[18]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A19 += go[21]; + m_A16 += go[22]; + m_A16 += go[23]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 -= go[24] * *cnV[24]; + m_A22 += gt[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A21 += go[25]; + m_A20 += go[26]; + m_A23 += go[27]; + m_A23 += go[28]; + double RHS6 = Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + m_A29 += gt[31]; + m_A29 += gt[32]; + m_A29 += gt[33]; + m_A29 += gt[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A29 += gt[38]; + m_A28 += go[31]; + m_A28 += go[32]; + m_A25 += go[33]; + m_A25 += go[34]; + m_A27 += go[35]; + m_A24 += go[36]; + m_A24 += go[37]; + double RHS7 = Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 += Idr[38]; + RHS7 -= go[38] * *cnV[38]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A11; + m_A13 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A12; + m_A13 += m_A3 * f1_4; + m_A14 += m_A4 * f1_4; + m_A15 += m_A5 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A16; + m_A17 += m_A3 * f1_5; + m_A18 += m_A4 * f1_5; + m_A19 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_7 = -f1 * m_A24; + m_A26 += m_A3 * f1_7; + m_A27 += m_A4 * f1_7; + m_A29 += m_A5 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_6 = -f2 * m_A20; + m_A22 += m_A7 * f2_6; + m_A23 += m_A8 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_7 = -f2 * m_A25; + m_A28 += m_A7 * f2_7; + m_A29 += m_A8 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_6 = -f3 * m_A21; + m_A22 += m_A10 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_5 = -f4 * m_A17; + m_A18 += m_A14 * f4_5; + m_A19 += m_A15 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_7 = -f4 * m_A26; + m_A27 += m_A14 * f4_7; + m_A29 += m_A15 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A18; + const double f5_7 = -f5 * m_A27; + m_A29 += m_A19 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A22; + const double f6_7 = -f6 * m_A28; + m_A29 += m_A23 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A29; + double tmp6 = 0.0; + tmp6 += m_A23 * V[7]; + V[6] = (RHS6 - tmp6) / m_A22; + double tmp5 = 0.0; + tmp5 += m_A19 * V[7]; + V[5] = (RHS5 - tmp5) / m_A18; + double tmp4 = 0.0; + tmp4 += m_A14 * V[5]; + tmp4 += m_A15 * V[7]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A10 * V[6]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[6]; + tmp2 += m_A8 * V[7]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + tmp1 += m_A5 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_33_double_double_75852e71cc632a65(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[2]; + m_A3 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A7 += go[6]; + m_A6 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[8] * *cnV[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A11 += go[16]; + m_A12 += go[17]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[18] * *cnV[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A16 += go[19]; + m_A13 += go[20]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[21] * *cnV[21]; + m_A21 += gt[22]; + m_A21 += gt[23]; + m_A21 += gt[24]; + m_A21 += gt[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A19 += go[22]; + m_A22 += go[23]; + m_A18 += go[24]; + m_A17 += go[25]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + RHS6 -= go[28] * *cnV[28]; + RHS6 -= go[29] * *cnV[29]; + m_A25 += gt[30]; + m_A25 += gt[31]; + m_A25 += gt[32]; + m_A25 += gt[33]; + m_A25 += gt[34]; + m_A23 += go[30]; + m_A24 += go[31]; + m_A26 += go[32]; + double RHS7 = Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 -= go[33] * *cnV[33]; + RHS7 -= go[34] * *cnV[34]; + m_A32 += gt[35]; + m_A32 += gt[36]; + m_A32 += gt[37]; + m_A32 += gt[38]; + m_A32 += gt[39]; + m_A31 += go[35]; + m_A28 += go[36]; + m_A27 += go[37]; + m_A30 += go[38]; + m_A29 += go[39]; + double RHS8 = Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 += Idr[38]; + RHS8 += Idr[39]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A17; + m_A21 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A13; + m_A14 += m_A3 * f1_5; + m_A15 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_6 = -f1 * m_A18; + m_A20 += m_A3 * f1_6; + m_A21 += m_A4 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_6 = -f2 * m_A19; + m_A21 += m_A6 * f2_6; + m_A22 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_8 = -f2 * m_A27; + m_A30 += m_A6 * f2_8; + m_A32 += m_A7 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_7 = -f3 * m_A23; + m_A24 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_7 = -f4 * m_A24; + m_A25 += m_A11 * f4_7; + m_A26 += m_A12 * f4_7; + RHS7 += f4_7 * RHS4; + const double f4_8 = -f4 * m_A28; + m_A31 += m_A11 * f4_8; + m_A32 += m_A12 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_6 = -f5 * m_A20; + m_A21 += m_A15 * f5_6; + m_A22 += m_A16 * f5_6; + RHS6 += f5_6 * RHS5; + const double f5_8 = -f5 * m_A29; + m_A30 += m_A15 * f5_8; + m_A32 += m_A16 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A21; + const double f6_8 = -f6 * m_A30; + m_A32 += m_A22 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A25; + const double f7_8 = -f7 * m_A31; + m_A32 += m_A26 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A32; + double tmp7 = 0.0; + tmp7 += m_A26 * V[8]; + V[7] = (RHS7 - tmp7) / m_A25; + double tmp6 = 0.0; + tmp6 += m_A22 * V[8]; + V[6] = (RHS6 - tmp6) / m_A21; + double tmp5 = 0.0; + tmp5 += m_A15 * V[6]; + tmp5 += m_A16 * V[8]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A11 * V[7]; + tmp4 += m_A12 * V[8]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[4]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[6]; + tmp2 += m_A7 * V[8]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + tmp1 += m_A4 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_38_double_double_263b618097fad01(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + m_A2 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[2] * *cnV[2]; + m_A3 += gt[3]; + m_A3 += gt[4]; + m_A4 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A7 += go[5]; + m_A6 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[9] * *cnV[9]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[15]; + m_A12 += go[16]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[17] * *cnV[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A16 += go[18]; + m_A13 += go[19]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + m_A19 += gt[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A21 += go[22]; + m_A17 += go[23]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[24] * *cnV[24]; + m_A24 += gt[25]; + m_A24 += gt[26]; + m_A24 += gt[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A22 += go[25]; + m_A23 += go[26]; + m_A25 += go[27]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 -= go[28] * *cnV[28]; + RHS7 -= go[29] * *cnV[29]; + m_A30 += gt[30]; + m_A30 += gt[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A27 += go[30]; + m_A31 += go[31]; + m_A26 += go[32]; + m_A28 += go[33]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[34] * *cnV[34]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + m_A37 += gt[37]; + m_A37 += gt[38]; + m_A37 += gt[39]; + m_A37 += gt[40]; + m_A37 += gt[41]; + m_A35 += go[37]; + m_A33 += go[38]; + m_A32 += go[39]; + m_A36 += go[40]; + m_A34 += go[41]; + double RHS9 = Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A13; + m_A14 += m_A1 * f0_5; + m_A15 += m_A2 * f0_5; + RHS5 += f0_5 * RHS0; + const double f0_6 = -f0 * m_A17; + m_A18 += m_A1 * f0_6; + m_A19 += m_A2 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_8 = -f1 * m_A26; + m_A30 += m_A4 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_8 = -f2 * m_A27; + m_A30 += m_A6 * f2_8; + m_A31 += m_A7 * f2_8; + RHS8 += f2_8 * RHS2; + const double f2_9 = -f2 * m_A32; + m_A36 += m_A6 * f2_9; + m_A37 += m_A7 * f2_9; + RHS9 += f2_9 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_7 = -f3 * m_A22; + m_A23 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_7 = -f4 * m_A23; + m_A24 += m_A11 * f4_7; + m_A25 += m_A12 * f4_7; + RHS7 += f4_7 * RHS4; + const double f4_9 = -f4 * m_A33; + m_A35 += m_A11 * f4_9; + m_A37 += m_A12 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_6 = -f5 * m_A18; + m_A19 += m_A15 * f5_6; + m_A20 += m_A16 * f5_6; + RHS6 += f5_6 * RHS5; + const double f5_8 = -f5 * m_A28; + m_A29 += m_A15 * f5_8; + m_A30 += m_A16 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_8 = -f6 * m_A29; + m_A30 += m_A20 * f6_8; + m_A31 += m_A21 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A34; + m_A36 += m_A20 * f6_9; + m_A37 += m_A21 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A24; + const double f7_9 = -f7 * m_A35; + m_A37 += m_A25 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A30; + const double f8_9 = -f8 * m_A36; + m_A37 += m_A31 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A37; + double tmp8 = 0.0; + tmp8 += m_A31 * V[9]; + V[8] = (RHS8 - tmp8) / m_A30; + double tmp7 = 0.0; + tmp7 += m_A25 * V[9]; + V[7] = (RHS7 - tmp7) / m_A24; + double tmp6 = 0.0; + tmp6 += m_A20 * V[8]; + tmp6 += m_A21 * V[9]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A15 * V[6]; + tmp5 += m_A16 * V[8]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A11 * V[7]; + tmp4 += m_A12 * V[9]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[4]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[8]; + tmp2 += m_A7 * V[9]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A4 * V[8]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + tmp0 += m_A2 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_53_double_double_f2de20e827252602(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A6 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A8 += go[8]; + m_A8 += go[9]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A10 += go[12]; + m_A11 += go[13]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A13 += go[14]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[15] * *cnV[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A15 += go[16]; + m_A16 += go[17]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 -= go[18] * *cnV[18]; + m_A17 += gt[19]; + m_A17 += gt[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A19 += go[19]; + m_A18 += go[20]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 -= go[21] * *cnV[21]; + RHS7 -= go[22] * *cnV[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A22 += gt[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A21 += go[23]; + m_A21 += go[24]; + m_A20 += go[25]; + double RHS8 = Idr[23]; + RHS8 += Idr[24]; + RHS8 += Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 -= go[26] * *cnV[26]; + RHS8 -= go[27] * *cnV[27]; + RHS8 -= go[28] * *cnV[28]; + m_A27 += gt[29]; + m_A27 += gt[30]; + m_A27 += gt[31]; + m_A27 += gt[32]; + m_A25 += go[29]; + m_A28 += go[30]; + m_A24 += go[31]; + double RHS9 = Idr[29]; + RHS9 += Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 -= go[32] * *cnV[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A29 += go[33]; + m_A29 += go[34]; + m_A31 += go[35]; + double RHS10 = Idr[33]; + RHS10 += Idr[34]; + RHS10 += Idr[35]; + RHS10 += Idr[36]; + RHS10 -= go[36] * *cnV[36]; + m_A34 += gt[37]; + m_A34 += gt[38]; + m_A33 += go[37]; + m_A32 += go[38]; + double RHS11 = Idr[37]; + RHS11 += Idr[38]; + m_A38 += gt[39]; + m_A38 += gt[40]; + m_A38 += gt[41]; + m_A37 += go[39]; + m_A36 += go[40]; + double RHS12 = Idr[39]; + RHS12 += Idr[40]; + RHS12 += Idr[41]; + RHS12 -= go[41] * *cnV[41]; + m_A47 += gt[42]; + m_A47 += gt[43]; + m_A47 += gt[44]; + m_A47 += gt[45]; + m_A42 += go[42]; + m_A41 += go[43]; + m_A44 += go[44]; + m_A43 += go[45]; + double RHS13 = Idr[42]; + RHS13 += Idr[43]; + RHS13 += Idr[44]; + RHS13 += Idr[45]; + m_A52 += gt[46]; + m_A52 += gt[47]; + m_A52 += gt[48]; + m_A52 += gt[49]; + m_A52 += gt[50]; + m_A52 += gt[51]; + m_A52 += gt[52]; + m_A50 += go[46]; + m_A49 += go[47]; + double RHS14 = Idr[46]; + RHS14 += Idr[47]; + RHS14 += Idr[48]; + RHS14 += Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 += Idr[52]; + RHS14 -= go[48] * *cnV[48]; + RHS14 -= go[49] * *cnV[49]; + RHS14 -= go[50] * *cnV[50]; + RHS14 -= go[51] * *cnV[51]; + RHS14 -= go[52] * *cnV[52]; + const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A20; + m_A22 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A21; + m_A22 += m_A3 * f1_8; + m_A23 += m_A4 * f1_8; + RHS8 += f1_8 * RHS1; + const double f1_9 = -f1 * m_A24; + m_A26 += m_A3 * f1_9; + m_A27 += m_A4 * f1_9; + RHS9 += f1_9 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_9 = -f2 * m_A25; + m_A27 += m_A6 * f2_9; + RHS9 += f2_9 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_10 = -f3 * m_A29; + m_A30 += m_A8 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_11 = -f4 * m_A32; + m_A34 += m_A10 * f4_11; + m_A35 += m_A11 * f4_11; + RHS11 += f4_11 * RHS4; + const double f4_13 = -f4 * m_A41; + m_A45 += m_A10 * f4_13; + m_A47 += m_A11 * f4_13; + RHS13 += f4_13 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_11 = -f5 * m_A33; + m_A34 += m_A13 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_12 = -f6 * m_A36; + m_A38 += m_A15 * f6_12; + m_A39 += m_A16 * f6_12; + RHS12 += f6_12 * RHS6; + const double f6_13 = -f6 * m_A42; + m_A46 += m_A15 * f6_13; + m_A47 += m_A16 * f6_13; + RHS13 += f6_13 * RHS6; + const double f6_14 = -f6 * m_A49; + m_A50 += m_A15 * f6_14; + m_A51 += m_A16 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A17; + const double f7_12 = -f7 * m_A37; + m_A38 += m_A18 * f7_12; + m_A40 += m_A19 * f7_12; + RHS12 += f7_12 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_9 = -f8 * m_A26; + m_A27 += m_A23 * f8_9; + RHS9 += f8_9 * RHS8; + const double f9 = 1.0 / m_A27; + const double f9_13 = -f9 * m_A43; + m_A47 += m_A28 * f9_13; + RHS13 += f9_13 * RHS9; + const double f10 = 1.0 / m_A30; + const double f10_13 = -f10 * m_A44; + m_A47 += m_A31 * f10_13; + RHS13 += f10_13 * RHS10; + const double f11 = 1.0 / m_A34; + const double f11_13 = -f11 * m_A45; + m_A47 += m_A35 * f11_13; + RHS13 += f11_13 * RHS11; + const double f12 = 1.0 / m_A38; + const double f12_13 = -f12 * m_A46; + m_A47 += m_A39 * f12_13; + m_A48 += m_A40 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_14 = -f12 * m_A50; + m_A51 += m_A39 * f12_14; + m_A52 += m_A40 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A47; + const double f13_14 = -f13 * m_A51; + m_A52 += m_A48 * f13_14; + RHS14 += f13_14 * RHS13; + V[14] = RHS14 / m_A52; + double tmp13 = 0.0; + tmp13 += m_A48 * V[14]; + V[13] = (RHS13 - tmp13) / m_A47; + double tmp12 = 0.0; + tmp12 += m_A39 * V[13]; + tmp12 += m_A40 * V[14]; + V[12] = (RHS12 - tmp12) / m_A38; + double tmp11 = 0.0; + tmp11 += m_A35 * V[13]; + V[11] = (RHS11 - tmp11) / m_A34; + double tmp10 = 0.0; + tmp10 += m_A31 * V[13]; + V[10] = (RHS10 - tmp10) / m_A30; + double tmp9 = 0.0; + tmp9 += m_A28 * V[13]; + V[9] = (RHS9 - tmp9) / m_A27; + double tmp8 = 0.0; + tmp8 += m_A23 * V[9]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A18 * V[12]; + tmp7 += m_A19 * V[14]; + V[7] = (RHS7 - tmp7) / m_A17; + double tmp6 = 0.0; + tmp6 += m_A15 * V[12]; + tmp6 += m_A16 * V[13]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A13 * V[11]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A10 * V[11]; + tmp4 += m_A11 * V[13]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[10]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[9]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[8]; + tmp1 += m_A4 * V[9]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_7_double_double_84425fea9033e75d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A5 += go[7]; + m_A5 += go[8]; + m_A4 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_88_double_double_494f233b1a947be1(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + m_A1 += go[1]; + m_A2 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A3 += gt[7]; + m_A3 += gt[8]; + m_A5 += go[5]; + m_A4 += go[6]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A10 += go[11]; + m_A9 += go[12]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A13 += go[14]; + m_A12 += go[15]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A15 += go[16]; + m_A16 += go[17]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + m_A17 += gt[18]; + m_A17 += gt[19]; + m_A17 += gt[20]; + m_A20 += go[18]; + m_A18 += go[19]; + m_A19 += go[20]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + m_A21 += gt[21]; + m_A21 += gt[22]; + m_A23 += go[21]; + m_A22 += go[22]; + double RHS7 = Idr[21]; + RHS7 += Idr[22]; + m_A24 += gt[23]; + m_A24 += gt[24]; + m_A24 += gt[25]; + m_A24 += gt[26]; + m_A24 += gt[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A25 += go[23]; + double RHS8 = Idr[23]; + RHS8 += Idr[24]; + RHS8 += Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 -= go[24] * *cnV[24]; + RHS8 -= go[25] * *cnV[25]; + RHS8 -= go[26] * *cnV[26]; + RHS8 -= go[27] * *cnV[27]; + RHS8 -= go[28] * *cnV[28]; + RHS8 -= go[29] * *cnV[29]; + m_A28 += gt[30]; + m_A28 += gt[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A27 += go[30]; + m_A26 += go[31]; + m_A26 += go[32]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 -= go[33] * *cnV[33]; + m_A33 += gt[34]; + m_A33 += gt[35]; + m_A31 += go[34]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + RHS10 -= go[35] * *cnV[35]; + m_A39 += gt[36]; + m_A39 += gt[37]; + m_A39 += gt[38]; + m_A36 += go[36]; + m_A35 += go[37]; + double RHS11 = Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 -= go[38] * *cnV[38]; + m_A43 += gt[39]; + m_A43 += gt[40]; + m_A43 += gt[41]; + m_A44 += go[39]; + m_A42 += go[40]; + m_A41 += go[41]; + double RHS12 = Idr[39]; + RHS12 += Idr[40]; + RHS12 += Idr[41]; + m_A47 += gt[42]; + m_A47 += gt[43]; + m_A47 += gt[44]; + m_A47 += gt[45]; + m_A47 += gt[46]; + m_A47 += gt[47]; + m_A47 += gt[48]; + m_A48 += go[42]; + m_A45 += go[43]; + double RHS13 = Idr[42]; + RHS13 += Idr[43]; + RHS13 += Idr[44]; + RHS13 += Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 += Idr[48]; + RHS13 -= go[44] * *cnV[44]; + RHS13 -= go[45] * *cnV[45]; + RHS13 -= go[46] * *cnV[46]; + RHS13 -= go[47] * *cnV[47]; + RHS13 -= go[48] * *cnV[48]; + m_A51 += gt[49]; + m_A51 += gt[50]; + m_A51 += gt[51]; + m_A50 += go[49]; + m_A49 += go[50]; + double RHS14 = Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 -= go[51] * *cnV[51]; + m_A59 += gt[52]; + m_A59 += gt[53]; + m_A59 += gt[54]; + m_A59 += gt[55]; + m_A59 += gt[56]; + m_A56 += go[52]; + m_A55 += go[53]; + double RHS15 = Idr[52]; + RHS15 += Idr[53]; + RHS15 += Idr[54]; + RHS15 += Idr[55]; + RHS15 += Idr[56]; + RHS15 -= go[54] * *cnV[54]; + RHS15 -= go[55] * *cnV[55]; + RHS15 -= go[56] * *cnV[56]; + m_A66 += gt[57]; + m_A66 += gt[58]; + m_A66 += gt[59]; + m_A63 += go[57]; + m_A62 += go[58]; + double RHS16 = Idr[57]; + RHS16 += Idr[58]; + RHS16 += Idr[59]; + RHS16 -= go[59] * *cnV[59]; + m_A71 += gt[60]; + m_A71 += gt[61]; + m_A71 += gt[62]; + m_A73 += go[60]; + m_A69 += go[61]; + double RHS17 = Idr[60]; + RHS17 += Idr[61]; + RHS17 += Idr[62]; + RHS17 -= go[62] * *cnV[62]; + m_A82 += gt[63]; + m_A82 += gt[64]; + m_A82 += gt[65]; + m_A82 += gt[66]; + m_A82 += gt[67]; + m_A82 += gt[68]; + m_A77 += go[63]; + m_A75 += go[64]; + m_A74 += go[65]; + m_A76 += go[66]; + double RHS18 = Idr[63]; + RHS18 += Idr[64]; + RHS18 += Idr[65]; + RHS18 += Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 -= go[67] * *cnV[67]; + RHS18 -= go[68] * *cnV[68]; + m_A87 += gt[69]; + m_A87 += gt[70]; + m_A87 += gt[71]; + m_A87 += gt[72]; + m_A84 += go[69]; + m_A85 += go[70]; + double RHS19 = Idr[69]; + RHS19 += Idr[70]; + RHS19 += Idr[71]; + RHS19 += Idr[72]; + RHS19 -= go[71] * *cnV[71]; + RHS19 -= go[72] * *cnV[72]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A26; + m_A28 += m_A1 * f0_9; + m_A30 += m_A2 * f0_9; + RHS9 += f0_9 * RHS0; + const double f0_11 = -f0 * m_A35; + m_A37 += m_A1 * f0_11; + m_A39 += m_A2 * f0_11; + RHS11 += f0_11 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_9 = -f1 * m_A27; + m_A28 += m_A4 * f1_9; + m_A29 += m_A5 * f1_9; + RHS9 += f1_9 * RHS1; + const double f1_10 = -f1 * m_A31; + m_A32 += m_A4 * f1_10; + m_A33 += m_A5 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_12 = -f2 * m_A41; + m_A43 += m_A7 * f2_12; + RHS12 += f2_12 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_12 = -f3 * m_A42; + m_A43 += m_A9 * f3_12; + m_A44 += m_A10 * f3_12; + RHS12 += f3_12 * RHS3; + const double f3_13 = -f3 * m_A45; + m_A46 += m_A9 * f3_13; + m_A48 += m_A10 * f3_13; + RHS13 += f3_13 * RHS3; + const double f3_18 = -f3 * m_A74; + m_A76 += m_A9 * f3_18; + m_A82 += m_A10 * f3_18; + RHS18 += f3_18 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_11 = -f4 * m_A36; + m_A39 += m_A12 * f4_11; + m_A40 += m_A13 * f4_11; + RHS11 += f4_11 * RHS4; + const double f4_15 = -f4 * m_A55; + m_A57 += m_A12 * f4_15; + m_A59 += m_A13 * f4_15; + RHS15 += f4_15 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_14 = -f5 * m_A49; + m_A51 += m_A15 * f5_14; + m_A54 += m_A16 * f5_14; + RHS14 += f5_14 * RHS5; + const double f5_18 = -f5 * m_A75; + m_A78 += m_A15 * f5_18; + m_A82 += m_A16 * f5_18; + RHS18 += f5_18 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_14 = -f6 * m_A50; + m_A51 += m_A18 * f6_14; + m_A52 += m_A19 * f6_14; + m_A53 += m_A20 * f6_14; + RHS14 += f6_14 * RHS6; + const double f6_15 = -f6 * m_A56; + m_A58 += m_A18 * f6_15; + m_A59 += m_A19 * f6_15; + m_A60 += m_A20 * f6_15; + RHS15 += f6_15 * RHS6; + const double f6_16 = -f6 * m_A62; + m_A64 += m_A18 * f6_16; + m_A65 += m_A19 * f6_16; + m_A66 += m_A20 * f6_16; + RHS16 += f6_16 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_16 = -f7 * m_A63; + m_A66 += m_A22 * f7_16; + m_A67 += m_A23 * f7_16; + RHS16 += f7_16 * RHS7; + const double f7_17 = -f7 * m_A69; + m_A70 += m_A22 * f7_17; + m_A71 += m_A23 * f7_17; + RHS17 += f7_17 * RHS7; + const double f8 = 1.0 / m_A24; + const double f8_19 = -f8 * m_A84; + m_A85 += m_A25 * f8_19; + RHS19 += f8_19 * RHS8; + const double f9 = 1.0 / m_A28; + const double f9_10 = -f9 * m_A32; + m_A33 += m_A29 * f9_10; + m_A34 += m_A30 * f9_10; + RHS10 += f9_10 * RHS9; + const double f9_11 = -f9 * m_A37; + m_A38 += m_A29 * f9_11; + m_A39 += m_A30 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A33; + const double f10_11 = -f10 * m_A38; + m_A39 += m_A34 * f10_11; + RHS11 += f10_11 * RHS10; + const double f11 = 1.0 / m_A39; + const double f11_15 = -f11 * m_A57; + m_A59 += m_A40 * f11_15; + RHS15 += f11_15 * RHS11; + const double f12 = 1.0 / m_A43; + const double f12_13 = -f12 * m_A46; + m_A48 += m_A44 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_18 = -f12 * m_A76; + m_A82 += m_A44 * f12_18; + RHS18 += f12_18 * RHS12; + const double f13 = 1.0 / m_A47; + const double f13_18 = -f13 * m_A77; + m_A82 += m_A48 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A51; + const double f14_15 = -f14 * m_A58; + m_A59 += m_A52 * f14_15; + m_A60 += m_A53 * f14_15; + m_A61 += m_A54 * f14_15; + RHS15 += f14_15 * RHS14; + const double f14_16 = -f14 * m_A64; + m_A65 += m_A52 * f14_16; + m_A66 += m_A53 * f14_16; + m_A68 += m_A54 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_18 = -f14 * m_A78; + m_A79 += m_A52 * f14_18; + m_A80 += m_A53 * f14_18; + m_A82 += m_A54 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A59; + const double f15_16 = -f15 * m_A65; + m_A66 += m_A60 * f15_16; + m_A68 += m_A61 * f15_16; + RHS16 += f15_16 * RHS15; + const double f15_18 = -f15 * m_A79; + m_A80 += m_A60 * f15_18; + m_A82 += m_A61 * f15_18; + RHS18 += f15_18 * RHS15; + const double f16 = 1.0 / m_A66; + const double f16_17 = -f16 * m_A70; + m_A71 += m_A67 * f16_17; + m_A72 += m_A68 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_18 = -f16 * m_A80; + m_A81 += m_A67 * f16_18; + m_A82 += m_A68 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A71; + const double f17_18 = -f17 * m_A81; + m_A82 += m_A72 * f17_18; + m_A83 += m_A73 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_19 = -f17 * m_A85; + m_A86 += m_A72 * f17_19; + m_A87 += m_A73 * f17_19; + RHS19 += f17_19 * RHS17; + const double f18 = 1.0 / m_A82; + const double f18_19 = -f18 * m_A86; + m_A87 += m_A83 * f18_19; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A87; + double tmp18 = 0.0; + tmp18 += m_A83 * V[19]; + V[18] = (RHS18 - tmp18) / m_A82; + double tmp17 = 0.0; + tmp17 += m_A72 * V[18]; + tmp17 += m_A73 * V[19]; + V[17] = (RHS17 - tmp17) / m_A71; + double tmp16 = 0.0; + tmp16 += m_A67 * V[17]; + tmp16 += m_A68 * V[18]; + V[16] = (RHS16 - tmp16) / m_A66; + double tmp15 = 0.0; + tmp15 += m_A60 * V[16]; + tmp15 += m_A61 * V[18]; + V[15] = (RHS15 - tmp15) / m_A59; + double tmp14 = 0.0; + tmp14 += m_A52 * V[15]; + tmp14 += m_A53 * V[16]; + tmp14 += m_A54 * V[18]; + V[14] = (RHS14 - tmp14) / m_A51; + double tmp13 = 0.0; + tmp13 += m_A48 * V[18]; + V[13] = (RHS13 - tmp13) / m_A47; + double tmp12 = 0.0; + tmp12 += m_A44 * V[18]; + V[12] = (RHS12 - tmp12) / m_A43; + double tmp11 = 0.0; + tmp11 += m_A40 * V[15]; + V[11] = (RHS11 - tmp11) / m_A39; + double tmp10 = 0.0; + tmp10 += m_A34 * V[11]; + V[10] = (RHS10 - tmp10) / m_A33; + double tmp9 = 0.0; + tmp9 += m_A29 * V[10]; + tmp9 += m_A30 * V[11]; + V[9] = (RHS9 - tmp9) / m_A28; + double tmp8 = 0.0; + tmp8 += m_A25 * V[17]; + V[8] = (RHS8 - tmp8) / m_A24; + double tmp7 = 0.0; + tmp7 += m_A22 * V[16]; + tmp7 += m_A23 * V[17]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A18 * V[14]; + tmp6 += m_A19 * V[15]; + tmp6 += m_A20 * V[16]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A15 * V[14]; + tmp5 += m_A16 * V[18]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A12 * V[11]; + tmp4 += m_A13 * V[15]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[12]; + tmp3 += m_A10 * V[18]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[12]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[9]; + tmp1 += m_A5 * V[10]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + tmp0 += m_A2 * V[11]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// frogs +static void nl_gcr_9_double_double_815733e3f2e05029(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A2 += go[0]; + m_A1 += go[1]; + m_A1 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[5]; + m_A5 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A7 += go[11]; + m_A7 += go[12]; + m_A6 += go[13]; + double RHS2 = Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 -= go[14] * *cnV[14]; + const double f0 = 1.0 / m_A0; + const double f0_1 = -f0 * m_A3; + m_A4 += m_A1 * f0_1; + m_A5 += m_A2 * f0_1; + RHS1 += f0_1 * RHS0; + const double f0_2 = -f0 * m_A6; + m_A7 += m_A1 * f0_2; + m_A8 += m_A2 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A4; + const double f1_2 = -f1 * m_A7; + m_A8 += m_A5 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A8; + double tmp1 = 0.0; + tmp1 += m_A5 * V[2]; + V[1] = (RHS1 - tmp1) / m_A4; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + tmp0 += m_A2 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gamemachine +static void nl_gcr_10_double_double_934712b55bb3b2b2(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A8 += go[8]; + m_A7 += go[9]; + m_A6 += go[10]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A6; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A5 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gamemachine +static void nl_gcr_7_double_double_782d79b5cbe953b1(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A5 += go[7]; + m_A5 += go[8]; + m_A4 += go[9]; + m_A4 += go[10]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gi6809 +static void nl_gcr_13_double_double_9eda6de0d275a3e5(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A7 += go[11]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[12] * *cnV[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A11 += go[13]; + m_A10 += go[14]; + m_A9 += go[15]; + m_A8 += go[16]; + double RHS4 = Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A8; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A9; + m_A12 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A7 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A7 * V[4]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gi6809 +static void nl_gcr_7_double_double_8a409a18e77784cb(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A6 += gt[4]; + m_A6 += gt[5]; + m_A5 += go[4]; + m_A4 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gtrak10 +static void nl_gcr_22_double_double_1f38df4919cdddae(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + m_A6 += gt[7]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 += Idr[10]; + RHS4 -= go[9] * *cnV[9]; + RHS4 -= go[10] * *cnV[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A11 += go[11]; + double RHS5 = Idr[11]; + RHS5 += Idr[12]; + RHS5 += Idr[13]; + RHS5 -= go[12] * *cnV[12]; + RHS5 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A13 += go[14]; + m_A12 += go[15]; + m_A15 += go[16]; + double RHS6 = Idr[14]; + RHS6 += Idr[15]; + RHS6 += Idr[16]; + m_A21 += gt[17]; + m_A21 += gt[18]; + m_A21 += gt[19]; + m_A21 += gt[20]; + m_A21 += gt[21]; + m_A21 += gt[22]; + m_A21 += gt[23]; + m_A20 += go[17]; + m_A19 += go[18]; + m_A18 += go[19]; + m_A17 += go[20]; + m_A16 += go[21]; + double RHS7 = Idr[17]; + RHS7 += Idr[18]; + RHS7 += Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 -= go[22] * *cnV[22]; + RHS7 -= go[23] * *cnV[23]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A16; + m_A21 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A17; + m_A21 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A12; + m_A14 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A13; + m_A14 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_7 = -f4 * m_A18; + m_A21 += m_A9 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_7 = -f5 * m_A19; + m_A21 += m_A11 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_7 = -f6 * m_A20; + m_A21 += m_A15 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A21; + double tmp6 = 0.0; + tmp6 += m_A15 * V[7]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A11 * V[7]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[7]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gtrak10,elim,zektor +static void nl_gcr_7_double_double_d190a0e3b8e1f4a7(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A6 += gt[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A5 += go[4]; + m_A4 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[6] * *cnV[6]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gunfight +static void nl_gcr_112_double_double_743595e64cee0a5e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A12 += go[10]; + m_A11 += go[11]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + m_A13 += gt[12]; + m_A13 += gt[13]; + m_A15 += go[12]; + m_A14 += go[13]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + m_A17 += gt[14]; + m_A17 += gt[15]; + m_A17 += gt[16]; + m_A16 += go[14]; + m_A18 += go[15]; + double RHS7 = Idr[14]; + RHS7 += Idr[15]; + RHS7 += Idr[16]; + RHS7 -= go[16] * *cnV[16]; + m_A21 += gt[17]; + m_A21 += gt[18]; + m_A21 += gt[19]; + m_A20 += go[17]; + m_A22 += go[18]; + double RHS8 = Idr[17]; + RHS8 += Idr[18]; + RHS8 += Idr[19]; + RHS8 -= go[19] * *cnV[19]; + m_A25 += gt[20]; + m_A25 += gt[21]; + m_A25 += gt[22]; + m_A24 += go[20]; + m_A26 += go[21]; + double RHS9 = Idr[20]; + RHS9 += Idr[21]; + RHS9 += Idr[22]; + RHS9 -= go[22] * *cnV[22]; + m_A29 += gt[23]; + m_A29 += gt[24]; + m_A29 += gt[25]; + m_A28 += go[23]; + m_A30 += go[24]; + double RHS10 = Idr[23]; + RHS10 += Idr[24]; + RHS10 += Idr[25]; + RHS10 -= go[25] * *cnV[25]; + m_A32 += gt[26]; + m_A32 += gt[27]; + m_A32 += gt[28]; + m_A34 += go[26]; + m_A33 += go[27]; + double RHS11 = Idr[26]; + RHS11 += Idr[27]; + RHS11 += Idr[28]; + RHS11 -= go[28] * *cnV[28]; + m_A35 += gt[29]; + m_A35 += gt[30]; + m_A35 += gt[31]; + m_A37 += go[29]; + m_A36 += go[30]; + double RHS12 = Idr[29]; + RHS12 += Idr[30]; + RHS12 += Idr[31]; + RHS12 -= go[31] * *cnV[31]; + m_A40 += gt[32]; + m_A40 += gt[33]; + m_A38 += go[32]; + m_A39 += go[33]; + double RHS13 = Idr[32]; + RHS13 += Idr[33]; + m_A44 += gt[34]; + m_A44 += gt[35]; + m_A42 += go[34]; + m_A43 += go[35]; + double RHS14 = Idr[34]; + RHS14 += Idr[35]; + m_A47 += gt[36]; + m_A47 += gt[37]; + m_A47 += gt[38]; + m_A46 += go[36]; + m_A48 += go[37]; + double RHS15 = Idr[36]; + RHS15 += Idr[37]; + RHS15 += Idr[38]; + RHS15 -= go[38] * *cnV[38]; + m_A50 += gt[39]; + m_A50 += gt[40]; + m_A49 += go[39]; + m_A51 += go[40]; + double RHS16 = Idr[39]; + RHS16 += Idr[40]; + m_A52 += gt[41]; + m_A52 += gt[42]; + m_A52 += gt[43]; + m_A52 += gt[44]; + m_A52 += gt[45]; + m_A53 += go[41]; + m_A54 += go[42]; + m_A54 += go[43]; + double RHS17 = Idr[41]; + RHS17 += Idr[42]; + RHS17 += Idr[43]; + RHS17 += Idr[44]; + RHS17 += Idr[45]; + RHS17 -= go[44] * *cnV[44]; + RHS17 -= go[45] * *cnV[45]; + m_A56 += gt[46]; + m_A56 += gt[47]; + m_A56 += gt[48]; + m_A56 += gt[49]; + m_A57 += go[46]; + m_A58 += go[47]; + m_A55 += go[48]; + double RHS18 = Idr[46]; + RHS18 += Idr[47]; + RHS18 += Idr[48]; + RHS18 += Idr[49]; + RHS18 -= go[49] * *cnV[49]; + m_A60 += gt[50]; + m_A60 += gt[51]; + m_A60 += gt[52]; + m_A60 += gt[53]; + m_A61 += go[50]; + m_A62 += go[51]; + m_A59 += go[52]; + double RHS19 = Idr[50]; + RHS19 += Idr[51]; + RHS19 += Idr[52]; + RHS19 += Idr[53]; + RHS19 -= go[53] * *cnV[53]; + m_A63 += gt[54]; + m_A63 += gt[55]; + m_A63 += gt[56]; + m_A63 += gt[57]; + m_A63 += gt[58]; + m_A64 += go[54]; + m_A65 += go[55]; + m_A65 += go[56]; + double RHS20 = Idr[54]; + RHS20 += Idr[55]; + RHS20 += Idr[56]; + RHS20 += Idr[57]; + RHS20 += Idr[58]; + RHS20 -= go[57] * *cnV[57]; + RHS20 -= go[58] * *cnV[58]; + m_A66 += gt[59]; + m_A66 += gt[60]; + m_A66 += gt[61]; + m_A66 += gt[62]; + m_A67 += go[59]; + m_A68 += go[60]; + m_A68 += go[61]; + double RHS21 = Idr[59]; + RHS21 += Idr[60]; + RHS21 += Idr[61]; + RHS21 += Idr[62]; + RHS21 -= go[62] * *cnV[62]; + m_A71 += gt[63]; + m_A71 += gt[64]; + m_A71 += gt[65]; + m_A71 += gt[66]; + m_A71 += gt[67]; + m_A69 += go[63]; + m_A70 += go[64]; + m_A72 += go[65]; + m_A72 += go[66]; + double RHS22 = Idr[63]; + RHS22 += Idr[64]; + RHS22 += Idr[65]; + RHS22 += Idr[66]; + RHS22 += Idr[67]; + RHS22 -= go[67] * *cnV[67]; + m_A76 += gt[68]; + m_A76 += gt[69]; + m_A76 += gt[70]; + m_A76 += gt[71]; + m_A76 += gt[72]; + m_A73 += go[68]; + m_A75 += go[69]; + m_A78 += go[70]; + m_A78 += go[71]; + m_A74 += go[72]; + double RHS23 = Idr[68]; + RHS23 += Idr[69]; + RHS23 += Idr[70]; + RHS23 += Idr[71]; + RHS23 += Idr[72]; + m_A82 += gt[73]; + m_A82 += gt[74]; + m_A82 += gt[75]; + m_A82 += gt[76]; + m_A82 += gt[77]; + m_A79 += go[73]; + m_A81 += go[74]; + m_A83 += go[75]; + m_A83 += go[76]; + m_A80 += go[77]; + double RHS24 = Idr[73]; + RHS24 += Idr[74]; + RHS24 += Idr[75]; + RHS24 += Idr[76]; + RHS24 += Idr[77]; + m_A90 += gt[78]; + m_A90 += gt[79]; + m_A90 += gt[80]; + m_A90 += gt[81]; + m_A90 += gt[82]; + m_A90 += gt[83]; + m_A90 += gt[84]; + m_A90 += gt[85]; + m_A89 += go[78]; + m_A89 += go[79]; + m_A88 += go[80]; + m_A88 += go[81]; + m_A85 += go[82]; + m_A87 += go[83]; + double RHS25 = Idr[78]; + RHS25 += Idr[79]; + RHS25 += Idr[80]; + RHS25 += Idr[81]; + RHS25 += Idr[82]; + RHS25 += Idr[83]; + RHS25 += Idr[84]; + RHS25 += Idr[85]; + RHS25 -= go[84] * *cnV[84]; + RHS25 -= go[85] * *cnV[85]; + m_A103 += gt[86]; + m_A103 += gt[87]; + m_A103 += gt[88]; + m_A103 += gt[89]; + m_A103 += gt[90]; + m_A103 += gt[91]; + m_A103 += gt[92]; + m_A103 += gt[93]; + m_A99 += go[86]; + m_A99 += go[87]; + m_A98 += go[88]; + m_A98 += go[89]; + m_A92 += go[90]; + m_A93 += go[91]; + double RHS26 = Idr[86]; + RHS26 += Idr[87]; + RHS26 += Idr[88]; + RHS26 += Idr[89]; + RHS26 += Idr[90]; + RHS26 += Idr[91]; + RHS26 += Idr[92]; + RHS26 += Idr[93]; + RHS26 -= go[92] * *cnV[92]; + RHS26 -= go[93] * *cnV[93]; + m_A111 += gt[94]; + m_A111 += gt[95]; + m_A111 += gt[96]; + m_A111 += gt[97]; + m_A111 += gt[98]; + m_A111 += gt[99]; + m_A111 += gt[100]; + m_A111 += gt[101]; + m_A109 += go[94]; + m_A109 += go[95]; + m_A108 += go[96]; + m_A108 += go[97]; + m_A105 += go[98]; + m_A107 += go[99]; + double RHS27 = Idr[94]; + RHS27 += Idr[95]; + RHS27 += Idr[96]; + RHS27 += Idr[97]; + RHS27 += Idr[98]; + RHS27 += Idr[99]; + RHS27 += Idr[100]; + RHS27 += Idr[101]; + RHS27 -= go[100] * *cnV[100]; + RHS27 -= go[101] * *cnV[101]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A46; + m_A47 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_13 = -f1 * m_A38; + m_A40 += m_A3 * f1_13; + RHS13 += f1_13 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_14 = -f2 * m_A42; + m_A44 += m_A5 * f2_14; + RHS14 += f2_14 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_18 = -f3 * m_A55; + m_A56 += m_A7 * f3_18; + RHS18 += f3_18 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_19 = -f4 * m_A59; + m_A60 += m_A9 * f4_19; + RHS19 += f4_19 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_7 = -f5 * m_A16; + m_A17 += m_A11 * f5_7; + m_A19 += m_A12 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_26 = -f5 * m_A92; + m_A94 += m_A11 * f5_26; + m_A103 += m_A12 * f5_26; + RHS26 += f5_26 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_8 = -f6 * m_A20; + m_A21 += m_A14 * f6_8; + m_A23 += m_A15 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_26 = -f6 * m_A93; + m_A95 += m_A14 * f6_26; + m_A103 += m_A15 * f6_26; + RHS26 += f6_26 * RHS6; + const double f7 = 1.0 / m_A17; + const double f7_9 = -f7 * m_A24; + m_A25 += m_A18 * f7_9; + m_A27 += m_A19 * f7_9; + RHS9 += f7_9 * RHS7; + const double f7_26 = -f7 * m_A94; + m_A96 += m_A18 * f7_26; + m_A103 += m_A19 * f7_26; + RHS26 += f7_26 * RHS7; + const double f8 = 1.0 / m_A21; + const double f8_10 = -f8 * m_A28; + m_A29 += m_A22 * f8_10; + m_A31 += m_A23 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_26 = -f8 * m_A95; + m_A97 += m_A22 * f8_26; + m_A103 += m_A23 * f8_26; + RHS26 += f8_26 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_23 = -f9 * m_A73; + m_A76 += m_A26 * f9_23; + m_A77 += m_A27 * f9_23; + RHS23 += f9_23 * RHS9; + const double f9_26 = -f9 * m_A96; + m_A100 += m_A26 * f9_26; + m_A103 += m_A27 * f9_26; + RHS26 += f9_26 * RHS9; + const double f10 = 1.0 / m_A29; + const double f10_24 = -f10 * m_A79; + m_A82 += m_A30 * f10_24; + m_A84 += m_A31 * f10_24; + RHS24 += f10_24 * RHS10; + const double f10_26 = -f10 * m_A97; + m_A101 += m_A30 * f10_26; + m_A103 += m_A31 * f10_26; + RHS26 += f10_26 * RHS10; + const double f11 = 1.0 / m_A32; + const double f11_13 = -f11 * m_A39; + m_A40 += m_A33 * f11_13; + m_A41 += m_A34 * f11_13; + RHS13 += f11_13 * RHS11; + const double f11_27 = -f11 * m_A105; + m_A106 += m_A33 * f11_27; + m_A111 += m_A34 * f11_27; + RHS27 += f11_27 * RHS11; + const double f12 = 1.0 / m_A35; + const double f12_14 = -f12 * m_A43; + m_A44 += m_A36 * f12_14; + m_A45 += m_A37 * f12_14; + RHS14 += f12_14 * RHS12; + const double f12_25 = -f12 * m_A85; + m_A86 += m_A36 * f12_25; + m_A90 += m_A37 * f12_25; + RHS25 += f12_25 * RHS12; + const double f13 = 1.0 / m_A40; + const double f13_27 = -f13 * m_A106; + m_A111 += m_A41 * f13_27; + RHS27 += f13_27 * RHS13; + const double f14 = 1.0 / m_A44; + const double f14_25 = -f14 * m_A86; + m_A90 += m_A45 * f14_25; + RHS25 += f14_25 * RHS14; + const double f15 = 1.0 / m_A47; + const double f15_16 = -f15 * m_A49; + m_A50 += m_A48 * f15_16; + RHS16 += f15_16 * RHS15; + const double f16 = 1.0 / m_A50; + const double f16_22 = -f16 * m_A69; + m_A71 += m_A51 * f16_22; + RHS22 += f16_22 * RHS16; + const double f17 = 1.0 / m_A52; + const double f17_22 = -f17 * m_A70; + m_A71 += m_A53 * f17_22; + m_A72 += m_A54 * f17_22; + RHS22 += f17_22 * RHS17; + const double f17_26 = -f17 * m_A98; + m_A99 += m_A53 * f17_26; + m_A103 += m_A54 * f17_26; + RHS26 += f17_26 * RHS17; + const double f18 = 1.0 / m_A56; + const double f18_23 = -f18 * m_A74; + m_A76 += m_A57 * f18_23; + m_A78 += m_A58 * f18_23; + RHS23 += f18_23 * RHS18; + const double f18_27 = -f18 * m_A107; + m_A109 += m_A57 * f18_27; + m_A111 += m_A58 * f18_27; + RHS27 += f18_27 * RHS18; + const double f19 = 1.0 / m_A60; + const double f19_24 = -f19 * m_A80; + m_A82 += m_A61 * f19_24; + m_A83 += m_A62 * f19_24; + RHS24 += f19_24 * RHS19; + const double f19_25 = -f19 * m_A87; + m_A89 += m_A61 * f19_25; + m_A90 += m_A62 * f19_25; + RHS25 += f19_25 * RHS19; + const double f20 = 1.0 / m_A63; + const double f20_23 = -f20 * m_A75; + m_A76 += m_A64 * f20_23; + m_A78 += m_A65 * f20_23; + RHS23 += f20_23 * RHS20; + const double f20_27 = -f20 * m_A108; + m_A109 += m_A64 * f20_27; + m_A111 += m_A65 * f20_27; + RHS27 += f20_27 * RHS20; + const double f21 = 1.0 / m_A66; + const double f21_24 = -f21 * m_A81; + m_A82 += m_A67 * f21_24; + m_A83 += m_A68 * f21_24; + RHS24 += f21_24 * RHS21; + const double f21_25 = -f21 * m_A88; + m_A89 += m_A67 * f21_25; + m_A90 += m_A68 * f21_25; + RHS25 += f21_25 * RHS21; + const double f22 = 1.0 / m_A71; + const double f22_26 = -f22 * m_A99; + m_A103 += m_A72 * f22_26; + RHS26 += f22_26 * RHS22; + const double f23 = 1.0 / m_A76; + const double f23_26 = -f23 * m_A100; + m_A103 += m_A77 * f23_26; + m_A104 += m_A78 * f23_26; + RHS26 += f23_26 * RHS23; + const double f23_27 = -f23 * m_A109; + m_A110 += m_A77 * f23_27; + m_A111 += m_A78 * f23_27; + RHS27 += f23_27 * RHS23; + const double f24 = 1.0 / m_A82; + const double f24_25 = -f24 * m_A89; + m_A90 += m_A83 * f24_25; + m_A91 += m_A84 * f24_25; + RHS25 += f24_25 * RHS24; + const double f24_26 = -f24 * m_A101; + m_A102 += m_A83 * f24_26; + m_A103 += m_A84 * f24_26; + RHS26 += f24_26 * RHS24; + const double f25 = 1.0 / m_A90; + const double f25_26 = -f25 * m_A102; + m_A103 += m_A91 * f25_26; + RHS26 += f25_26 * RHS25; + const double f26 = 1.0 / m_A103; + const double f26_27 = -f26 * m_A110; + m_A111 += m_A104 * f26_27; + RHS27 += f26_27 * RHS26; + V[27] = RHS27 / m_A111; + double tmp26 = 0.0; + tmp26 += m_A104 * V[27]; + V[26] = (RHS26 - tmp26) / m_A103; + double tmp25 = 0.0; + tmp25 += m_A91 * V[26]; + V[25] = (RHS25 - tmp25) / m_A90; + double tmp24 = 0.0; + tmp24 += m_A83 * V[25]; + tmp24 += m_A84 * V[26]; + V[24] = (RHS24 - tmp24) / m_A82; + double tmp23 = 0.0; + tmp23 += m_A77 * V[26]; + tmp23 += m_A78 * V[27]; + V[23] = (RHS23 - tmp23) / m_A76; + double tmp22 = 0.0; + tmp22 += m_A72 * V[26]; + V[22] = (RHS22 - tmp22) / m_A71; + double tmp21 = 0.0; + tmp21 += m_A67 * V[24]; + tmp21 += m_A68 * V[25]; + V[21] = (RHS21 - tmp21) / m_A66; + double tmp20 = 0.0; + tmp20 += m_A64 * V[23]; + tmp20 += m_A65 * V[27]; + V[20] = (RHS20 - tmp20) / m_A63; + double tmp19 = 0.0; + tmp19 += m_A61 * V[24]; + tmp19 += m_A62 * V[25]; + V[19] = (RHS19 - tmp19) / m_A60; + double tmp18 = 0.0; + tmp18 += m_A57 * V[23]; + tmp18 += m_A58 * V[27]; + V[18] = (RHS18 - tmp18) / m_A56; + double tmp17 = 0.0; + tmp17 += m_A53 * V[22]; + tmp17 += m_A54 * V[26]; + V[17] = (RHS17 - tmp17) / m_A52; + double tmp16 = 0.0; + tmp16 += m_A51 * V[22]; + V[16] = (RHS16 - tmp16) / m_A50; + double tmp15 = 0.0; + tmp15 += m_A48 * V[16]; + V[15] = (RHS15 - tmp15) / m_A47; + double tmp14 = 0.0; + tmp14 += m_A45 * V[25]; + V[14] = (RHS14 - tmp14) / m_A44; + double tmp13 = 0.0; + tmp13 += m_A41 * V[27]; + V[13] = (RHS13 - tmp13) / m_A40; + double tmp12 = 0.0; + tmp12 += m_A36 * V[14]; + tmp12 += m_A37 * V[25]; + V[12] = (RHS12 - tmp12) / m_A35; + double tmp11 = 0.0; + tmp11 += m_A33 * V[13]; + tmp11 += m_A34 * V[27]; + V[11] = (RHS11 - tmp11) / m_A32; + double tmp10 = 0.0; + tmp10 += m_A30 * V[24]; + tmp10 += m_A31 * V[26]; + V[10] = (RHS10 - tmp10) / m_A29; + double tmp9 = 0.0; + tmp9 += m_A26 * V[23]; + tmp9 += m_A27 * V[26]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A22 * V[10]; + tmp8 += m_A23 * V[26]; + V[8] = (RHS8 - tmp8) / m_A21; + double tmp7 = 0.0; + tmp7 += m_A18 * V[9]; + tmp7 += m_A19 * V[26]; + V[7] = (RHS7 - tmp7) / m_A17; + double tmp6 = 0.0; + tmp6 += m_A14 * V[8]; + tmp6 += m_A15 * V[26]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[7]; + tmp5 += m_A12 * V[26]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[19]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[18]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[14]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[13]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[15]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// gunfight +static void nl_gcr_14_double_double_d05b3dbe370c7904(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A2 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[2] * *cnV[2]; + m_A4 += gt[3]; + m_A4 += gt[4]; + m_A3 += go[3]; + m_A6 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + m_A9 += gt[5]; + m_A9 += gt[6]; + m_A9 += gt[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A7 += go[5]; + m_A10 += go[6]; + m_A10 += go[7]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A12 += go[14]; + m_A12 += go[15]; + m_A11 += go[16]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + const double f0 = 1.0 / m_A0; + const double f0_1 = -f0 * m_A3; + m_A4 += m_A1 * f0_1; + m_A5 += m_A2 * f0_1; + RHS1 += f0_1 * RHS0; + const double f0_2 = -f0 * m_A7; + m_A8 += m_A1 * f0_2; + m_A9 += m_A2 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A4; + const double f1_2 = -f1 * m_A8; + m_A9 += m_A5 * f1_2; + m_A10 += m_A6 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A11; + m_A12 += m_A5 * f1_3; + m_A13 += m_A6 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A9; + const double f2_3 = -f2 * m_A12; + m_A13 += m_A10 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A13; + double tmp2 = 0.0; + tmp2 += m_A10 * V[3]; + V[2] = (RHS2 - tmp2) / m_A9; + double tmp1 = 0.0; + tmp1 += m_A5 * V[2]; + tmp1 += m_A6 * V[3]; + V[1] = (RHS1 - tmp1) / m_A4; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + tmp0 += m_A2 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// jpmsru +static void nl_gcr_55_double_double_4963a2f104e4c797(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A5 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A7 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A9 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 -= go[10] * *cnV[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A11 += go[11]; + double RHS4 = Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A13 += go[13]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 -= go[14] * *cnV[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A15 += go[15]; + double RHS6 = Idr[15]; + RHS6 += Idr[16]; + RHS6 -= go[16] * *cnV[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A18 += go[17]; + m_A17 += go[18]; + double RHS7 = Idr[17]; + RHS7 += Idr[18]; + m_A19 += gt[19]; + m_A19 += gt[20]; + m_A20 += go[19]; + double RHS8 = Idr[19]; + RHS8 += Idr[20]; + RHS8 -= go[20] * *cnV[20]; + m_A21 += gt[21]; + m_A21 += gt[22]; + m_A21 += gt[23]; + m_A22 += go[21]; + double RHS9 = Idr[21]; + RHS9 += Idr[22]; + RHS9 += Idr[23]; + RHS9 -= go[22] * *cnV[22]; + RHS9 -= go[23] * *cnV[23]; + m_A25 += gt[24]; + m_A25 += gt[25]; + m_A25 += gt[26]; + m_A25 += gt[27]; + m_A25 += gt[28]; + m_A23 += go[24]; + m_A27 += go[25]; + double RHS10 = Idr[24]; + RHS10 += Idr[25]; + RHS10 += Idr[26]; + RHS10 += Idr[27]; + RHS10 += Idr[28]; + RHS10 -= go[26] * *cnV[26]; + RHS10 -= go[27] * *cnV[27]; + RHS10 -= go[28] * *cnV[28]; + m_A29 += gt[29]; + m_A29 += gt[30]; + m_A30 += go[29]; + double RHS11 = Idr[29]; + RHS11 += Idr[30]; + RHS11 -= go[30] * *cnV[30]; + m_A33 += gt[31]; + m_A33 += gt[32]; + m_A33 += gt[33]; + m_A33 += gt[34]; + m_A33 += gt[35]; + m_A35 += go[31]; + m_A31 += go[32]; + m_A32 += go[33]; + double RHS12 = Idr[31]; + RHS12 += Idr[32]; + RHS12 += Idr[33]; + RHS12 += Idr[34]; + RHS12 += Idr[35]; + RHS12 -= go[34] * *cnV[34]; + RHS12 -= go[35] * *cnV[35]; + m_A39 += gt[36]; + m_A39 += gt[37]; + m_A39 += gt[38]; + m_A39 += gt[39]; + m_A40 += go[36]; + m_A37 += go[37]; + m_A36 += go[38]; + double RHS13 = Idr[36]; + RHS13 += Idr[37]; + RHS13 += Idr[38]; + RHS13 += Idr[39]; + RHS13 -= go[39] * *cnV[39]; + m_A45 += gt[40]; + m_A45 += gt[41]; + m_A45 += gt[42]; + m_A43 += go[40]; + m_A46 += go[41]; + m_A42 += go[42]; + double RHS14 = Idr[40]; + RHS14 += Idr[41]; + RHS14 += Idr[42]; + m_A54 += gt[43]; + m_A54 += gt[44]; + m_A54 += gt[45]; + m_A54 += gt[46]; + m_A54 += gt[47]; + m_A54 += gt[48]; + m_A54 += gt[49]; + m_A54 += gt[50]; + m_A54 += gt[51]; + m_A52 += go[43]; + m_A51 += go[44]; + m_A50 += go[45]; + m_A49 += go[46]; + m_A48 += go[47]; + m_A47 += go[48]; + m_A53 += go[49]; + double RHS15 = Idr[43]; + RHS15 += Idr[44]; + RHS15 += Idr[45]; + RHS15 += Idr[46]; + RHS15 += Idr[47]; + RHS15 += Idr[48]; + RHS15 += Idr[49]; + RHS15 += Idr[50]; + RHS15 += Idr[51]; + RHS15 -= go[50] * *cnV[50]; + RHS15 -= go[51] * *cnV[51]; + const double f0 = 1.0 / m_A0; + const double f0_12 = -f0 * m_A31; + m_A33 += m_A1 * f0_12; + RHS12 += f0_12 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A23; + m_A24 += m_A3 * f1_10; + m_A25 += m_A4 * f1_10; + m_A26 += m_A5 * f1_10; + RHS10 += f1_10 * RHS1; + const double f3 = 1.0 / m_A8; + const double f3_15 = -f3 * m_A47; + m_A54 += m_A9 * f3_15; + RHS15 += f3_15 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_15 = -f4 * m_A48; + m_A54 += m_A11 * f4_15; + RHS15 += f4_15 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_15 = -f5 * m_A49; + m_A54 += m_A13 * f5_15; + RHS15 += f5_15 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_15 = -f6 * m_A50; + m_A54 += m_A15 * f6_15; + RHS15 += f6_15 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_10 = -f7 * m_A24; + m_A26 += m_A17 * f7_10; + m_A28 += m_A18 * f7_10; + RHS10 += f7_10 * RHS7; + const double f7_12 = -f7 * m_A32; + m_A33 += m_A17 * f7_12; + m_A34 += m_A18 * f7_12; + RHS12 += f7_12 * RHS7; + const double f7_13 = -f7 * m_A36; + m_A38 += m_A17 * f7_13; + m_A40 += m_A18 * f7_13; + RHS13 += f7_13 * RHS7; + const double f7_14 = -f7 * m_A42; + m_A44 += m_A17 * f7_14; + m_A45 += m_A18 * f7_14; + RHS14 += f7_14 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_15 = -f8 * m_A51; + m_A54 += m_A20 * f8_15; + RHS15 += f8_15 * RHS8; + const double f9 = 1.0 / m_A21; + const double f9_14 = -f9 * m_A43; + m_A45 += m_A22 * f9_14; + RHS14 += f9_14 * RHS9; + const double f10 = 1.0 / m_A25; + const double f10_13 = -f10 * m_A37; + m_A38 += m_A26 * f10_13; + m_A39 += m_A27 * f10_13; + m_A40 += m_A28 * f10_13; + RHS13 += f10_13 * RHS10; + const double f11 = 1.0 / m_A29; + const double f11_15 = -f11 * m_A52; + m_A54 += m_A30 * f11_15; + RHS15 += f11_15 * RHS11; + const double f12 = 1.0 / m_A33; + const double f12_13 = -f12 * m_A38; + m_A40 += m_A34 * f12_13; + m_A41 += m_A35 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_14 = -f12 * m_A44; + m_A45 += m_A34 * f12_14; + m_A46 += m_A35 * f12_14; + RHS14 += f12_14 * RHS12; + const double f14 = 1.0 / m_A45; + const double f14_15 = -f14 * m_A53; + m_A54 += m_A46 * f14_15; + RHS15 += f14_15 * RHS14; + V[15] = RHS15 / m_A54; + double tmp14 = 0.0; + tmp14 += m_A46 * V[15]; + V[14] = (RHS14 - tmp14) / m_A45; + double tmp13 = 0.0; + tmp13 += m_A40 * V[14]; + tmp13 += m_A41 * V[15]; + V[13] = (RHS13 - tmp13) / m_A39; + double tmp12 = 0.0; + tmp12 += m_A34 * V[14]; + tmp12 += m_A35 * V[15]; + V[12] = (RHS12 - tmp12) / m_A33; + double tmp11 = 0.0; + tmp11 += m_A30 * V[15]; + V[11] = (RHS11 - tmp11) / m_A29; + double tmp10 = 0.0; + tmp10 += m_A26 * V[12]; + tmp10 += m_A27 * V[13]; + tmp10 += m_A28 * V[14]; + V[10] = (RHS10 - tmp10) / m_A25; + double tmp9 = 0.0; + tmp9 += m_A22 * V[14]; + V[9] = (RHS9 - tmp9) / m_A21; + double tmp8 = 0.0; + tmp8 += m_A20 * V[15]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A17 * V[12]; + tmp7 += m_A18 * V[14]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A15 * V[15]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A13 * V[15]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A11 * V[15]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[15]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[10]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + tmp1 += m_A4 * V[10]; + tmp1 += m_A5 * V[12]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[12]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki +static void nl_gcr_198_double_double_43f7ff9bc651cc7a(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A6 += go[4]; + m_A5 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[6] * *cnV[6]; + m_A7 += gt[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A8 += go[7]; + m_A9 += go[8]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[9] * *cnV[9]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A12 += go[14]; + m_A11 += go[15]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A14 += go[16]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + m_A15 += gt[18]; + m_A15 += gt[19]; + m_A15 += gt[20]; + m_A16 += go[18]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A17 += gt[26]; + m_A17 += gt[27]; + m_A19 += go[21]; + m_A18 += go[22]; + double RHS7 = Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[23] * *cnV[23]; + RHS7 -= go[24] * *cnV[24]; + RHS7 -= go[25] * *cnV[25]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + m_A20 += gt[28]; + m_A20 += gt[29]; + m_A21 += go[28]; + m_A22 += go[29]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + m_A23 += gt[30]; + m_A23 += gt[31]; + m_A23 += gt[32]; + m_A24 += go[30]; + m_A25 += go[31]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 -= go[32] * *cnV[32]; + m_A26 += gt[33]; + m_A26 += gt[34]; + m_A27 += go[33]; + double RHS10 = Idr[33]; + RHS10 += Idr[34]; + RHS10 -= go[34] * *cnV[34]; + m_A28 += gt[35]; + m_A28 += gt[36]; + m_A28 += gt[37]; + m_A28 += gt[38]; + m_A30 += go[35]; + m_A29 += go[36]; + m_A29 += go[37]; + double RHS11 = Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 -= go[38] * *cnV[38]; + m_A31 += gt[39]; + m_A31 += gt[40]; + m_A33 += go[39]; + m_A32 += go[40]; + double RHS12 = Idr[39]; + RHS12 += Idr[40]; + m_A34 += gt[41]; + m_A34 += gt[42]; + m_A34 += gt[43]; + m_A36 += go[41]; + m_A35 += go[42]; + double RHS13 = Idr[41]; + RHS13 += Idr[42]; + RHS13 += Idr[43]; + RHS13 -= go[43] * *cnV[43]; + m_A37 += gt[44]; + m_A37 += gt[45]; + m_A37 += gt[46]; + m_A38 += go[44]; + m_A39 += go[45]; + double RHS14 = Idr[44]; + RHS14 += Idr[45]; + RHS14 += Idr[46]; + RHS14 -= go[46] * *cnV[46]; + m_A40 += gt[47]; + m_A40 += gt[48]; + m_A40 += gt[49]; + m_A40 += gt[50]; + m_A40 += gt[51]; + m_A42 += go[47]; + m_A41 += go[48]; + m_A41 += go[49]; + double RHS15 = Idr[47]; + RHS15 += Idr[48]; + RHS15 += Idr[49]; + RHS15 += Idr[50]; + RHS15 += Idr[51]; + RHS15 -= go[50] * *cnV[50]; + RHS15 -= go[51] * *cnV[51]; + m_A43 += gt[52]; + m_A43 += gt[53]; + m_A43 += gt[54]; + m_A43 += gt[55]; + m_A44 += go[52]; + double RHS16 = Idr[52]; + RHS16 += Idr[53]; + RHS16 += Idr[54]; + RHS16 += Idr[55]; + RHS16 -= go[53] * *cnV[53]; + RHS16 -= go[54] * *cnV[54]; + RHS16 -= go[55] * *cnV[55]; + m_A45 += gt[56]; + m_A45 += gt[57]; + m_A45 += gt[58]; + m_A45 += gt[59]; + m_A46 += go[56]; + double RHS17 = Idr[56]; + RHS17 += Idr[57]; + RHS17 += Idr[58]; + RHS17 += Idr[59]; + RHS17 -= go[57] * *cnV[57]; + RHS17 -= go[58] * *cnV[58]; + RHS17 -= go[59] * *cnV[59]; + m_A47 += gt[60]; + m_A47 += gt[61]; + m_A47 += gt[62]; + m_A47 += gt[63]; + m_A47 += gt[64]; + m_A49 += go[60]; + m_A49 += go[61]; + m_A48 += go[62]; + double RHS18 = Idr[60]; + RHS18 += Idr[61]; + RHS18 += Idr[62]; + RHS18 += Idr[63]; + RHS18 += Idr[64]; + RHS18 -= go[63] * *cnV[63]; + RHS18 -= go[64] * *cnV[64]; + m_A50 += gt[65]; + m_A50 += gt[66]; + m_A50 += gt[67]; + m_A50 += gt[68]; + m_A50 += gt[69]; + m_A53 += go[65]; + m_A52 += go[66]; + m_A51 += go[67]; + m_A51 += go[68]; + double RHS19 = Idr[65]; + RHS19 += Idr[66]; + RHS19 += Idr[67]; + RHS19 += Idr[68]; + RHS19 += Idr[69]; + RHS19 -= go[69] * *cnV[69]; + m_A54 += gt[70]; + m_A54 += gt[71]; + m_A54 += gt[72]; + m_A54 += gt[73]; + m_A57 += go[70]; + m_A56 += go[71]; + m_A55 += go[72]; + double RHS20 = Idr[70]; + RHS20 += Idr[71]; + RHS20 += Idr[72]; + RHS20 += Idr[73]; + RHS20 -= go[73] * *cnV[73]; + m_A58 += gt[74]; + m_A58 += gt[75]; + m_A58 += gt[76]; + m_A59 += go[74]; + m_A60 += go[75]; + double RHS21 = Idr[74]; + RHS21 += Idr[75]; + RHS21 += Idr[76]; + RHS21 -= go[76] * *cnV[76]; + m_A61 += gt[77]; + m_A61 += gt[78]; + m_A62 += go[77]; + m_A63 += go[78]; + double RHS22 = Idr[77]; + RHS22 += Idr[78]; + m_A64 += gt[79]; + m_A64 += gt[80]; + m_A65 += go[79]; + m_A66 += go[80]; + double RHS23 = Idr[79]; + RHS23 += Idr[80]; + m_A69 += gt[81]; + m_A69 += gt[82]; + m_A69 += gt[83]; + m_A69 += gt[84]; + m_A68 += go[81]; + m_A68 += go[82]; + m_A67 += go[83]; + double RHS24 = Idr[81]; + RHS24 += Idr[82]; + RHS24 += Idr[83]; + RHS24 += Idr[84]; + RHS24 -= go[84] * *cnV[84]; + m_A75 += gt[85]; + m_A75 += gt[86]; + m_A75 += gt[87]; + m_A73 += go[85]; + m_A72 += go[86]; + double RHS25 = Idr[85]; + RHS25 += Idr[86]; + RHS25 += Idr[87]; + RHS25 -= go[87] * *cnV[87]; + m_A79 += gt[88]; + m_A79 += gt[89]; + m_A79 += gt[90]; + m_A78 += go[88]; + m_A77 += go[89]; + double RHS26 = Idr[88]; + RHS26 += Idr[89]; + RHS26 += Idr[90]; + RHS26 -= go[90] * *cnV[90]; + m_A83 += gt[91]; + m_A83 += gt[92]; + m_A83 += gt[93]; + m_A83 += gt[94]; + m_A83 += gt[95]; + m_A83 += gt[96]; + m_A82 += go[91]; + m_A82 += go[92]; + m_A81 += go[93]; + double RHS27 = Idr[91]; + RHS27 += Idr[92]; + RHS27 += Idr[93]; + RHS27 += Idr[94]; + RHS27 += Idr[95]; + RHS27 += Idr[96]; + RHS27 -= go[94] * *cnV[94]; + RHS27 -= go[95] * *cnV[95]; + RHS27 -= go[96] * *cnV[96]; + m_A93 += gt[97]; + m_A93 += gt[98]; + m_A93 += gt[99]; + m_A87 += go[97]; + m_A89 += go[98]; + m_A88 += go[99]; + double RHS28 = Idr[97]; + RHS28 += Idr[98]; + RHS28 += Idr[99]; + m_A102 += gt[100]; + m_A102 += gt[101]; + m_A102 += gt[102]; + m_A99 += go[100]; + m_A98 += go[101]; + m_A97 += go[102]; + double RHS29 = Idr[100]; + RHS29 += Idr[101]; + RHS29 += Idr[102]; + m_A110 += gt[103]; + m_A110 += gt[104]; + m_A110 += gt[105]; + m_A110 += gt[106]; + m_A107 += go[103]; + m_A106 += go[104]; + m_A106 += go[105]; + double RHS30 = Idr[103]; + RHS30 += Idr[104]; + RHS30 += Idr[105]; + RHS30 += Idr[106]; + RHS30 -= go[106] * *cnV[106]; + m_A116 += gt[107]; + m_A116 += gt[108]; + m_A116 += gt[109]; + m_A116 += gt[110]; + m_A116 += gt[111]; + m_A116 += gt[112]; + m_A114 += go[107]; + m_A115 += go[108]; + m_A115 += go[109]; + m_A117 += go[110]; + m_A117 += go[111]; + m_A113 += go[112]; + double RHS31 = Idr[107]; + RHS31 += Idr[108]; + RHS31 += Idr[109]; + RHS31 += Idr[110]; + RHS31 += Idr[111]; + RHS31 += Idr[112]; + m_A120 += gt[113]; + m_A120 += gt[114]; + m_A119 += go[113]; + double RHS32 = Idr[113]; + RHS32 += Idr[114]; + RHS32 -= go[114] * *cnV[114]; + m_A123 += gt[115]; + m_A123 += gt[116]; + m_A122 += go[115]; + m_A124 += go[116]; + double RHS33 = Idr[115]; + RHS33 += Idr[116]; + m_A126 += gt[117]; + m_A126 += gt[118]; + m_A126 += gt[119]; + m_A126 += gt[120]; + m_A126 += gt[121]; + m_A126 += gt[122]; + m_A126 += gt[123]; + m_A125 += go[117]; + m_A127 += go[118]; + double RHS34 = Idr[117]; + RHS34 += Idr[118]; + RHS34 += Idr[119]; + RHS34 += Idr[120]; + RHS34 += Idr[121]; + RHS34 += Idr[122]; + RHS34 += Idr[123]; + RHS34 -= go[119] * *cnV[119]; + RHS34 -= go[120] * *cnV[120]; + RHS34 -= go[121] * *cnV[121]; + RHS34 -= go[122] * *cnV[122]; + RHS34 -= go[123] * *cnV[123]; + m_A129 += gt[124]; + m_A129 += gt[125]; + m_A128 += go[124]; + double RHS35 = Idr[124]; + RHS35 += Idr[125]; + RHS35 -= go[125] * *cnV[125]; + m_A133 += gt[126]; + m_A133 += gt[127]; + m_A133 += gt[128]; + m_A133 += gt[129]; + m_A133 += gt[130]; + m_A133 += gt[131]; + m_A132 += go[126]; + m_A135 += go[127]; + m_A131 += go[128]; + double RHS36 = Idr[126]; + RHS36 += Idr[127]; + RHS36 += Idr[128]; + RHS36 += Idr[129]; + RHS36 += Idr[130]; + RHS36 += Idr[131]; + RHS36 -= go[129] * *cnV[129]; + RHS36 -= go[130] * *cnV[130]; + RHS36 -= go[131] * *cnV[131]; + m_A139 += gt[132]; + m_A139 += gt[133]; + m_A139 += gt[134]; + m_A139 += gt[135]; + m_A139 += gt[136]; + m_A139 += gt[137]; + m_A136 += go[132]; + m_A137 += go[133]; + m_A141 += go[134]; + m_A138 += go[135]; + double RHS37 = Idr[132]; + RHS37 += Idr[133]; + RHS37 += Idr[134]; + RHS37 += Idr[135]; + RHS37 += Idr[136]; + RHS37 += Idr[137]; + RHS37 -= go[136] * *cnV[136]; + RHS37 -= go[137] * *cnV[137]; + m_A149 += gt[138]; + m_A149 += gt[139]; + m_A149 += gt[140]; + m_A149 += gt[141]; + m_A149 += gt[142]; + m_A149 += gt[143]; + m_A145 += go[138]; + m_A144 += go[139]; + m_A142 += go[140]; + m_A143 += go[141]; + m_A152 += go[142]; + double RHS38 = Idr[138]; + RHS38 += Idr[139]; + RHS38 += Idr[140]; + RHS38 += Idr[141]; + RHS38 += Idr[142]; + RHS38 += Idr[143]; + RHS38 -= go[143] * *cnV[143]; + m_A157 += gt[144]; + m_A157 += gt[145]; + m_A157 += gt[146]; + m_A157 += gt[147]; + m_A157 += gt[148]; + m_A154 += go[144]; + m_A153 += go[145]; + m_A155 += go[146]; + m_A155 += go[147]; + double RHS39 = Idr[144]; + RHS39 += Idr[145]; + RHS39 += Idr[146]; + RHS39 += Idr[147]; + RHS39 += Idr[148]; + RHS39 -= go[148] * *cnV[148]; + m_A164 += gt[149]; + m_A164 += gt[150]; + m_A164 += gt[151]; + m_A164 += gt[152]; + m_A164 += gt[153]; + m_A162 += go[149]; + m_A165 += go[150]; + m_A165 += go[151]; + m_A161 += go[152]; + m_A163 += go[153]; + double RHS40 = Idr[149]; + RHS40 += Idr[150]; + RHS40 += Idr[151]; + RHS40 += Idr[152]; + RHS40 += Idr[153]; + m_A174 += gt[154]; + m_A174 += gt[155]; + m_A174 += gt[156]; + m_A167 += go[154]; + m_A166 += go[155]; + m_A171 += go[156]; + double RHS41 = Idr[154]; + RHS41 += Idr[155]; + RHS41 += Idr[156]; + m_A182 += gt[157]; + m_A182 += gt[158]; + m_A182 += gt[159]; + m_A177 += go[157]; + m_A178 += go[158]; + m_A179 += go[159]; + double RHS42 = Idr[157]; + RHS42 += Idr[158]; + RHS42 += Idr[159]; + m_A197 += gt[160]; + m_A197 += gt[161]; + m_A197 += gt[162]; + m_A197 += gt[163]; + m_A197 += gt[164]; + m_A197 += gt[165]; + m_A197 += gt[166]; + m_A197 += gt[167]; + m_A192 += go[160]; + m_A185 += go[161]; + m_A186 += go[162]; + m_A184 += go[163]; + m_A194 += go[164]; + m_A194 += go[165]; + double RHS43 = Idr[160]; + RHS43 += Idr[161]; + RHS43 += Idr[162]; + RHS43 += Idr[163]; + RHS43 += Idr[164]; + RHS43 += Idr[165]; + RHS43 += Idr[166]; + RHS43 += Idr[167]; + RHS43 -= go[166] * *cnV[166]; + RHS43 -= go[167] * *cnV[167]; + const double f0 = 1.0 / m_A0; + const double f0_33 = -f0 * m_A122; + m_A123 += m_A1 * f0_33; + RHS33 += f0_33 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_34 = -f1 * m_A125; + m_A127 += m_A3 * f1_34; + RHS34 += f1_34 * RHS1; + const double f1_40 = -f1 * m_A161; + m_A164 += m_A3 * f1_40; + RHS40 += f1_40 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_40 = -f2 * m_A162; + m_A164 += m_A5 * f2_40; + m_A165 += m_A6 * f2_40; + RHS40 += f2_40 * RHS2; + const double f2_43 = -f2 * m_A184; + m_A194 += m_A5 * f2_43; + m_A197 += m_A6 * f2_43; + RHS43 += f2_43 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_37 = -f3 * m_A136; + m_A138 += m_A8 * f3_37; + m_A139 += m_A9 * f3_37; + RHS37 += f3_37 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_37 = -f4 * m_A137; + m_A139 += m_A11 * f4_37; + m_A140 += m_A12 * f4_37; + RHS37 += f4_37 * RHS4; + const double f4_38 = -f4 * m_A142; + m_A148 += m_A11 * f4_38; + m_A149 += m_A12 * f4_38; + RHS38 += f4_38 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_42 = -f5 * m_A177; + m_A182 += m_A14 * f5_42; + RHS42 += f5_42 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_36 = -f6 * m_A131; + m_A133 += m_A16 * f6_36; + RHS36 += f6_36 * RHS6; + const double f7 = 1.0 / m_A17; + const double f7_36 = -f7 * m_A132; + m_A134 += m_A18 * f7_36; + m_A135 += m_A19 * f7_36; + RHS36 += f7_36 * RHS7; + const double f8 = 1.0 / m_A20; + const double f8_27 = -f8 * m_A81; + m_A83 += m_A21 * f8_27; + m_A86 += m_A22 * f8_27; + RHS27 += f8_27 * RHS8; + const double f8_43 = -f8 * m_A185; + m_A187 += m_A21 * f8_43; + m_A197 += m_A22 * f8_43; + RHS43 += f8_43 * RHS8; + const double f9 = 1.0 / m_A23; + const double f9_31 = -f9 * m_A113; + m_A116 += m_A24 * f9_31; + m_A118 += m_A25 * f9_31; + RHS31 += f9_31 * RHS9; + const double f9_43 = -f9 * m_A186; + m_A191 += m_A24 * f9_43; + m_A197 += m_A25 * f9_43; + RHS43 += f9_43 * RHS9; + const double f10 = 1.0 / m_A26; + const double f10_31 = -f10 * m_A114; + m_A116 += m_A27 * f10_31; + RHS31 += f10_31 * RHS10; + const double f11 = 1.0 / m_A28; + const double f11_31 = -f11 * m_A115; + m_A116 += m_A29 * f11_31; + m_A117 += m_A30 * f11_31; + RHS31 += f11_31 * RHS11; + const double f11_39 = -f11 * m_A153; + m_A155 += m_A29 * f11_39; + m_A157 += m_A30 * f11_39; + RHS39 += f11_39 * RHS11; + const double f12 = 1.0 / m_A31; + const double f12_38 = -f12 * m_A143; + m_A149 += m_A32 * f12_38; + m_A150 += m_A33 * f12_38; + RHS38 += f12_38 * RHS12; + const double f12_39 = -f12 * m_A154; + m_A156 += m_A32 * f12_39; + m_A157 += m_A33 * f12_39; + RHS39 += f12_39 * RHS12; + const double f13 = 1.0 / m_A34; + const double f13_37 = -f13 * m_A138; + m_A139 += m_A35 * f13_37; + m_A141 += m_A36 * f13_37; + RHS37 += f13_37 * RHS13; + const double f13_41 = -f13 * m_A166; + m_A171 += m_A35 * f13_41; + m_A174 += m_A36 * f13_41; + RHS41 += f13_41 * RHS13; + const double f14 = 1.0 / m_A37; + const double f14_24 = -f14 * m_A67; + m_A69 += m_A38 * f14_24; + m_A71 += m_A39 * f14_24; + RHS24 += f14_24 * RHS14; + const double f14_28 = -f14 * m_A87; + m_A90 += m_A38 * f14_28; + m_A93 += m_A39 * f14_28; + RHS28 += f14_28 * RHS14; + const double f15 = 1.0 / m_A40; + const double f15_24 = -f15 * m_A68; + m_A69 += m_A41 * f15_24; + m_A70 += m_A42 * f15_24; + RHS24 += f15_24 * RHS15; + const double f15_25 = -f15 * m_A72; + m_A74 += m_A41 * f15_25; + m_A75 += m_A42 * f15_25; + RHS25 += f15_25 * RHS15; + const double f16 = 1.0 / m_A43; + const double f16_25 = -f16 * m_A73; + m_A75 += m_A44 * f16_25; + RHS25 += f16_25 * RHS16; + const double f17 = 1.0 / m_A45; + const double f17_26 = -f17 * m_A77; + m_A79 += m_A46 * f17_26; + RHS26 += f17_26 * RHS17; + const double f18 = 1.0 / m_A47; + const double f18_26 = -f18 * m_A78; + m_A79 += m_A48 * f18_26; + m_A80 += m_A49 * f18_26; + RHS26 += f18_26 * RHS18; + const double f18_30 = -f18 * m_A106; + m_A108 += m_A48 * f18_30; + m_A110 += m_A49 * f18_30; + RHS30 += f18_30 * RHS18; + const double f19 = 1.0 / m_A50; + const double f19_27 = -f19 * m_A82; + m_A83 += m_A51 * f19_27; + m_A84 += m_A52 * f19_27; + m_A85 += m_A53 * f19_27; + RHS27 += f19_27 * RHS19; + const double f19_28 = -f19 * m_A88; + m_A92 += m_A51 * f19_28; + m_A93 += m_A52 * f19_28; + m_A94 += m_A53 * f19_28; + RHS28 += f19_28 * RHS19; + const double f19_29 = -f19 * m_A97; + m_A100 += m_A51 * f19_29; + m_A101 += m_A52 * f19_29; + m_A102 += m_A53 * f19_29; + RHS29 += f19_29 * RHS19; + const double f20 = 1.0 / m_A54; + const double f20_28 = -f20 * m_A89; + m_A93 += m_A55 * f20_28; + m_A94 += m_A56 * f20_28; + m_A95 += m_A57 * f20_28; + RHS28 += f20_28 * RHS20; + const double f20_29 = -f20 * m_A98; + m_A101 += m_A55 * f20_29; + m_A102 += m_A56 * f20_29; + m_A104 += m_A57 * f20_29; + RHS29 += f20_29 * RHS20; + const double f20_41 = -f20 * m_A167; + m_A168 += m_A55 * f20_41; + m_A169 += m_A56 * f20_41; + m_A174 += m_A57 * f20_41; + RHS41 += f20_41 * RHS20; + const double f21 = 1.0 / m_A58; + const double f21_29 = -f21 * m_A99; + m_A102 += m_A59 * f21_29; + m_A103 += m_A60 * f21_29; + RHS29 += f21_29 * RHS21; + const double f21_30 = -f21 * m_A107; + m_A109 += m_A59 * f21_30; + m_A110 += m_A60 * f21_30; + RHS30 += f21_30 * RHS21; + const double f22 = 1.0 / m_A61; + const double f22_32 = -f22 * m_A119; + m_A120 += m_A62 * f22_32; + m_A121 += m_A63 * f22_32; + RHS32 += f22_32 * RHS22; + const double f22_38 = -f22 * m_A144; + m_A146 += m_A62 * f22_38; + m_A149 += m_A63 * f22_38; + RHS38 += f22_38 * RHS22; + const double f23 = 1.0 / m_A64; + const double f23_35 = -f23 * m_A128; + m_A129 += m_A65 * f23_35; + m_A130 += m_A66 * f23_35; + RHS35 += f23_35 * RHS23; + const double f23_38 = -f23 * m_A145; + m_A147 += m_A65 * f23_38; + m_A149 += m_A66 * f23_38; + RHS38 += f23_38 * RHS23; + const double f24 = 1.0 / m_A69; + const double f24_25 = -f24 * m_A74; + m_A75 += m_A70 * f24_25; + m_A76 += m_A71 * f24_25; + RHS25 += f24_25 * RHS24; + const double f24_28 = -f24 * m_A90; + m_A91 += m_A70 * f24_28; + m_A93 += m_A71 * f24_28; + RHS28 += f24_28 * RHS24; + const double f25 = 1.0 / m_A75; + const double f25_28 = -f25 * m_A91; + m_A93 += m_A76 * f25_28; + RHS28 += f25_28 * RHS25; + const double f26 = 1.0 / m_A79; + const double f26_30 = -f26 * m_A108; + m_A110 += m_A80 * f26_30; + RHS30 += f26_30 * RHS26; + const double f27 = 1.0 / m_A83; + const double f27_28 = -f27 * m_A92; + m_A93 += m_A84 * f27_28; + m_A94 += m_A85 * f27_28; + m_A96 += m_A86 * f27_28; + RHS28 += f27_28 * RHS27; + const double f27_29 = -f27 * m_A100; + m_A101 += m_A84 * f27_29; + m_A102 += m_A85 * f27_29; + m_A105 += m_A86 * f27_29; + RHS29 += f27_29 * RHS27; + const double f27_43 = -f27 * m_A187; + m_A188 += m_A84 * f27_43; + m_A189 += m_A85 * f27_43; + m_A197 += m_A86 * f27_43; + RHS43 += f27_43 * RHS27; + const double f28 = 1.0 / m_A93; + const double f28_29 = -f28 * m_A101; + m_A102 += m_A94 * f28_29; + m_A104 += m_A95 * f28_29; + m_A105 += m_A96 * f28_29; + RHS29 += f28_29 * RHS28; + const double f28_41 = -f28 * m_A168; + m_A169 += m_A94 * f28_41; + m_A174 += m_A95 * f28_41; + m_A176 += m_A96 * f28_41; + RHS41 += f28_41 * RHS28; + const double f28_43 = -f28 * m_A188; + m_A189 += m_A94 * f28_43; + m_A195 += m_A95 * f28_43; + m_A197 += m_A96 * f28_43; + RHS43 += f28_43 * RHS28; + const double f29 = 1.0 / m_A102; + const double f29_30 = -f29 * m_A109; + m_A110 += m_A103 * f29_30; + m_A111 += m_A104 * f29_30; + m_A112 += m_A105 * f29_30; + RHS30 += f29_30 * RHS29; + const double f29_41 = -f29 * m_A169; + m_A170 += m_A103 * f29_41; + m_A174 += m_A104 * f29_41; + m_A176 += m_A105 * f29_41; + RHS41 += f29_41 * RHS29; + const double f29_43 = -f29 * m_A189; + m_A190 += m_A103 * f29_43; + m_A195 += m_A104 * f29_43; + m_A197 += m_A105 * f29_43; + RHS43 += f29_43 * RHS29; + const double f30 = 1.0 / m_A110; + const double f30_41 = -f30 * m_A170; + m_A174 += m_A111 * f30_41; + m_A176 += m_A112 * f30_41; + RHS41 += f30_41 * RHS30; + const double f30_43 = -f30 * m_A190; + m_A195 += m_A111 * f30_43; + m_A197 += m_A112 * f30_43; + RHS43 += f30_43 * RHS30; + const double f31 = 1.0 / m_A116; + const double f31_39 = -f31 * m_A155; + m_A157 += m_A117 * f31_39; + m_A160 += m_A118 * f31_39; + RHS39 += f31_39 * RHS31; + const double f31_43 = -f31 * m_A191; + m_A193 += m_A117 * f31_43; + m_A197 += m_A118 * f31_43; + RHS43 += f31_43 * RHS31; + const double f32 = 1.0 / m_A120; + const double f32_38 = -f32 * m_A146; + m_A149 += m_A121 * f32_38; + RHS38 += f32_38 * RHS32; + const double f33 = 1.0 / m_A123; + const double f33_40 = -f33 * m_A163; + m_A164 += m_A124 * f33_40; + RHS40 += f33_40 * RHS33; + const double f34 = 1.0 / m_A126; + const double f34_43 = -f34 * m_A192; + m_A194 += m_A127 * f34_43; + RHS43 += f34_43 * RHS34; + const double f35 = 1.0 / m_A129; + const double f35_38 = -f35 * m_A147; + m_A149 += m_A130 * f35_38; + RHS38 += f35_38 * RHS35; + const double f36 = 1.0 / m_A133; + const double f36_42 = -f36 * m_A178; + m_A179 += m_A134 * f36_42; + m_A182 += m_A135 * f36_42; + RHS42 += f36_42 * RHS36; + const double f37 = 1.0 / m_A139; + const double f37_38 = -f37 * m_A148; + m_A149 += m_A140 * f37_38; + m_A151 += m_A141 * f37_38; + RHS38 += f37_38 * RHS37; + const double f37_41 = -f37 * m_A171; + m_A172 += m_A140 * f37_41; + m_A174 += m_A141 * f37_41; + RHS41 += f37_41 * RHS37; + const double f38 = 1.0 / m_A149; + const double f38_39 = -f38 * m_A156; + m_A157 += m_A150 * f38_39; + m_A158 += m_A151 * f38_39; + m_A159 += m_A152 * f38_39; + RHS39 += f38_39 * RHS38; + const double f38_41 = -f38 * m_A172; + m_A173 += m_A150 * f38_41; + m_A174 += m_A151 * f38_41; + m_A175 += m_A152 * f38_41; + RHS41 += f38_41 * RHS38; + const double f38_42 = -f38 * m_A179; + m_A180 += m_A150 * f38_42; + m_A181 += m_A151 * f38_42; + m_A182 += m_A152 * f38_42; + RHS42 += f38_42 * RHS38; + const double f39 = 1.0 / m_A157; + const double f39_41 = -f39 * m_A173; + m_A174 += m_A158 * f39_41; + m_A175 += m_A159 * f39_41; + m_A176 += m_A160 * f39_41; + RHS41 += f39_41 * RHS39; + const double f39_42 = -f39 * m_A180; + m_A181 += m_A158 * f39_42; + m_A182 += m_A159 * f39_42; + m_A183 += m_A160 * f39_42; + RHS42 += f39_42 * RHS39; + const double f39_43 = -f39 * m_A193; + m_A195 += m_A158 * f39_43; + m_A196 += m_A159 * f39_43; + m_A197 += m_A160 * f39_43; + RHS43 += f39_43 * RHS39; + const double f40 = 1.0 / m_A164; + const double f40_43 = -f40 * m_A194; + m_A197 += m_A165 * f40_43; + RHS43 += f40_43 * RHS40; + const double f41 = 1.0 / m_A174; + const double f41_42 = -f41 * m_A181; + m_A182 += m_A175 * f41_42; + m_A183 += m_A176 * f41_42; + RHS42 += f41_42 * RHS41; + const double f41_43 = -f41 * m_A195; + m_A196 += m_A175 * f41_43; + m_A197 += m_A176 * f41_43; + RHS43 += f41_43 * RHS41; + const double f42 = 1.0 / m_A182; + const double f42_43 = -f42 * m_A196; + m_A197 += m_A183 * f42_43; + RHS43 += f42_43 * RHS42; + V[43] = RHS43 / m_A197; + double tmp42 = 0.0; + tmp42 += m_A183 * V[43]; + V[42] = (RHS42 - tmp42) / m_A182; + double tmp41 = 0.0; + tmp41 += m_A175 * V[42]; + tmp41 += m_A176 * V[43]; + V[41] = (RHS41 - tmp41) / m_A174; + double tmp40 = 0.0; + tmp40 += m_A165 * V[43]; + V[40] = (RHS40 - tmp40) / m_A164; + double tmp39 = 0.0; + tmp39 += m_A158 * V[41]; + tmp39 += m_A159 * V[42]; + tmp39 += m_A160 * V[43]; + V[39] = (RHS39 - tmp39) / m_A157; + double tmp38 = 0.0; + tmp38 += m_A150 * V[39]; + tmp38 += m_A151 * V[41]; + tmp38 += m_A152 * V[42]; + V[38] = (RHS38 - tmp38) / m_A149; + double tmp37 = 0.0; + tmp37 += m_A140 * V[38]; + tmp37 += m_A141 * V[41]; + V[37] = (RHS37 - tmp37) / m_A139; + double tmp36 = 0.0; + tmp36 += m_A134 * V[38]; + tmp36 += m_A135 * V[42]; + V[36] = (RHS36 - tmp36) / m_A133; + double tmp35 = 0.0; + tmp35 += m_A130 * V[38]; + V[35] = (RHS35 - tmp35) / m_A129; + double tmp34 = 0.0; + tmp34 += m_A127 * V[40]; + V[34] = (RHS34 - tmp34) / m_A126; + double tmp33 = 0.0; + tmp33 += m_A124 * V[40]; + V[33] = (RHS33 - tmp33) / m_A123; + double tmp32 = 0.0; + tmp32 += m_A121 * V[38]; + V[32] = (RHS32 - tmp32) / m_A120; + double tmp31 = 0.0; + tmp31 += m_A117 * V[39]; + tmp31 += m_A118 * V[43]; + V[31] = (RHS31 - tmp31) / m_A116; + double tmp30 = 0.0; + tmp30 += m_A111 * V[41]; + tmp30 += m_A112 * V[43]; + V[30] = (RHS30 - tmp30) / m_A110; + double tmp29 = 0.0; + tmp29 += m_A103 * V[30]; + tmp29 += m_A104 * V[41]; + tmp29 += m_A105 * V[43]; + V[29] = (RHS29 - tmp29) / m_A102; + double tmp28 = 0.0; + tmp28 += m_A94 * V[29]; + tmp28 += m_A95 * V[41]; + tmp28 += m_A96 * V[43]; + V[28] = (RHS28 - tmp28) / m_A93; + double tmp27 = 0.0; + tmp27 += m_A84 * V[28]; + tmp27 += m_A85 * V[29]; + tmp27 += m_A86 * V[43]; + V[27] = (RHS27 - tmp27) / m_A83; + double tmp26 = 0.0; + tmp26 += m_A80 * V[30]; + V[26] = (RHS26 - tmp26) / m_A79; + double tmp25 = 0.0; + tmp25 += m_A76 * V[28]; + V[25] = (RHS25 - tmp25) / m_A75; + double tmp24 = 0.0; + tmp24 += m_A70 * V[25]; + tmp24 += m_A71 * V[28]; + V[24] = (RHS24 - tmp24) / m_A69; + double tmp23 = 0.0; + tmp23 += m_A65 * V[35]; + tmp23 += m_A66 * V[38]; + V[23] = (RHS23 - tmp23) / m_A64; + double tmp22 = 0.0; + tmp22 += m_A62 * V[32]; + tmp22 += m_A63 * V[38]; + V[22] = (RHS22 - tmp22) / m_A61; + double tmp21 = 0.0; + tmp21 += m_A59 * V[29]; + tmp21 += m_A60 * V[30]; + V[21] = (RHS21 - tmp21) / m_A58; + double tmp20 = 0.0; + tmp20 += m_A55 * V[28]; + tmp20 += m_A56 * V[29]; + tmp20 += m_A57 * V[41]; + V[20] = (RHS20 - tmp20) / m_A54; + double tmp19 = 0.0; + tmp19 += m_A51 * V[27]; + tmp19 += m_A52 * V[28]; + tmp19 += m_A53 * V[29]; + V[19] = (RHS19 - tmp19) / m_A50; + double tmp18 = 0.0; + tmp18 += m_A48 * V[26]; + tmp18 += m_A49 * V[30]; + V[18] = (RHS18 - tmp18) / m_A47; + double tmp17 = 0.0; + tmp17 += m_A46 * V[26]; + V[17] = (RHS17 - tmp17) / m_A45; + double tmp16 = 0.0; + tmp16 += m_A44 * V[25]; + V[16] = (RHS16 - tmp16) / m_A43; + double tmp15 = 0.0; + tmp15 += m_A41 * V[24]; + tmp15 += m_A42 * V[25]; + V[15] = (RHS15 - tmp15) / m_A40; + double tmp14 = 0.0; + tmp14 += m_A38 * V[24]; + tmp14 += m_A39 * V[28]; + V[14] = (RHS14 - tmp14) / m_A37; + double tmp13 = 0.0; + tmp13 += m_A35 * V[37]; + tmp13 += m_A36 * V[41]; + V[13] = (RHS13 - tmp13) / m_A34; + double tmp12 = 0.0; + tmp12 += m_A32 * V[38]; + tmp12 += m_A33 * V[39]; + V[12] = (RHS12 - tmp12) / m_A31; + double tmp11 = 0.0; + tmp11 += m_A29 * V[31]; + tmp11 += m_A30 * V[39]; + V[11] = (RHS11 - tmp11) / m_A28; + double tmp10 = 0.0; + tmp10 += m_A27 * V[31]; + V[10] = (RHS10 - tmp10) / m_A26; + double tmp9 = 0.0; + tmp9 += m_A24 * V[31]; + tmp9 += m_A25 * V[43]; + V[9] = (RHS9 - tmp9) / m_A23; + double tmp8 = 0.0; + tmp8 += m_A21 * V[27]; + tmp8 += m_A22 * V[43]; + V[8] = (RHS8 - tmp8) / m_A20; + double tmp7 = 0.0; + tmp7 += m_A18 * V[38]; + tmp7 += m_A19 * V[42]; + V[7] = (RHS7 - tmp7) / m_A17; + double tmp6 = 0.0; + tmp6 += m_A16 * V[36]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A14 * V[42]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[37]; + tmp4 += m_A12 * V[38]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[13]; + tmp3 += m_A9 * V[37]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[40]; + tmp2 += m_A6 * V[43]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[40]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[33]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki +static void nl_gcr_21_double_double_8046625a0fe0959(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + m_A2 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A3 += gt[7]; + m_A3 += gt[8]; + m_A3 += gt[9]; + m_A5 += go[7]; + m_A4 += go[8]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[9] * *cnV[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[10]; + m_A8 += go[11]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A10 += gt[14]; + m_A9 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A12 += go[15]; + m_A15 += go[16]; + m_A13 += go[17]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + m_A20 += gt[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A17 += go[21]; + m_A16 += go[22]; + m_A19 += go[23]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A12; + m_A13 += m_A1 * f0_4; + m_A14 += m_A2 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_4 = -f1 * m_A13; + m_A14 += m_A4 * f1_4; + m_A15 += m_A5 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A16; + m_A19 += m_A4 * f1_5; + m_A20 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A9; + m_A10 += m_A7 * f2_3; + m_A11 += m_A8 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_5 = -f2 * m_A17; + m_A18 += m_A7 * f2_5; + m_A20 += m_A8 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_5 = -f3 * m_A18; + m_A20 += m_A11 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A14; + const double f4_5 = -f4 * m_A19; + m_A20 += m_A15 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A20; + double tmp4 = 0.0; + tmp4 += m_A15 * V[5]; + V[4] = (RHS4 - tmp4) / m_A14; + double tmp3 = 0.0; + tmp3 += m_A11 * V[5]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + tmp2 += m_A8 * V[5]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[4]; + tmp1 += m_A5 * V[5]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + tmp0 += m_A2 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki +static void nl_gcr_24_double_double_9f141889c2091efc(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[8] * *cnV[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A7 += go[11]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A10 += go[13]; + m_A9 += go[14]; + double RHS4 = Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[15] * *cnV[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A12 += go[16]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 -= go[17] * *cnV[17]; + RHS5 -= go[18] * *cnV[18]; + m_A18 += gt[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A16 += go[19]; + m_A15 += go[20]; + m_A14 += go[21]; + m_A17 += go[22]; + m_A13 += go[23]; + double RHS6 = Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + m_A23 += gt[24]; + m_A23 += gt[25]; + m_A21 += go[24]; + m_A20 += go[25]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A13; + m_A18 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A14; + m_A18 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A15; + m_A18 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A16; + m_A18 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_6 = -f4 * m_A17; + m_A18 += m_A9 * f4_6; + m_A19 += m_A10 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_7 = -f4 * m_A20; + m_A22 += m_A9 * f4_7; + m_A23 += m_A10 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_7 = -f5 * m_A21; + m_A23 += m_A12 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_7 = -f6 * m_A22; + m_A23 += m_A19 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A23; + double tmp6 = 0.0; + tmp6 += m_A19 * V[7]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A12 * V[7]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[6]; + tmp4 += m_A10 * V[7]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki +static void nl_gcr_34_double_double_d8c511d38cef5f6f(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + m_A2 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[2] * *cnV[2]; + m_A3 += gt[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A3 += gt[7]; + m_A3 += gt[8]; + m_A3 += gt[9]; + m_A5 += go[3]; + m_A4 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A6 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A11 += go[13]; + m_A10 += go[14]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[15] * *cnV[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A14 += go[16]; + m_A13 += go[17]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[18] * *cnV[18]; + m_A17 += gt[19]; + m_A17 += gt[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A15 += go[19]; + m_A18 += go[20]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A21 += gt[30]; + m_A21 += gt[31]; + m_A19 += go[26]; + m_A22 += go[27]; + m_A20 += go[28]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + RHS6 -= go[31] * *cnV[31]; + m_A27 += gt[32]; + m_A27 += gt[33]; + m_A27 += gt[34]; + m_A27 += gt[35]; + m_A27 += gt[36]; + m_A26 += go[32]; + m_A25 += go[33]; + m_A23 += go[34]; + double RHS7 = Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 -= go[35] * *cnV[35]; + RHS7 -= go[36] * *cnV[36]; + m_A33 += gt[37]; + m_A33 += gt[38]; + m_A33 += gt[39]; + m_A30 += go[37]; + m_A31 += go[38]; + m_A29 += go[39]; + double RHS8 = Idr[37]; + RHS8 += Idr[38]; + RHS8 += Idr[39]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A6; + m_A7 += m_A1 * f0_2; + m_A8 += m_A2 * f0_2; + RHS2 += f0_2 * RHS0; + const double f0_5 = -f0 * m_A15; + m_A16 += m_A1 * f0_5; + m_A18 += m_A2 * f0_5; + RHS5 += f0_5 * RHS0; + const double f0_7 = -f0 * m_A23; + m_A24 += m_A1 * f0_7; + m_A27 += m_A2 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_6 = -f1 * m_A19; + m_A20 += m_A4 * f1_6; + m_A21 += m_A5 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_5 = -f2 * m_A16; + m_A18 += m_A8 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_7 = -f2 * m_A24; + m_A27 += m_A8 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_6 = -f3 * m_A20; + m_A21 += m_A10 * f3_6; + m_A22 += m_A11 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_8 = -f3 * m_A29; + m_A31 += m_A10 * f3_8; + m_A33 += m_A11 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_7 = -f4 * m_A25; + m_A27 += m_A13 * f4_7; + m_A28 += m_A14 * f4_7; + RHS7 += f4_7 * RHS4; + const double f4_8 = -f4 * m_A30; + m_A32 += m_A13 * f4_8; + m_A33 += m_A14 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_7 = -f5 * m_A26; + m_A27 += m_A18 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A21; + const double f6_8 = -f6 * m_A31; + m_A33 += m_A22 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A27; + const double f7_8 = -f7 * m_A32; + m_A33 += m_A28 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A33; + double tmp7 = 0.0; + tmp7 += m_A28 * V[8]; + V[7] = (RHS7 - tmp7) / m_A27; + double tmp6 = 0.0; + tmp6 += m_A22 * V[8]; + V[6] = (RHS6 - tmp6) / m_A21; + double tmp5 = 0.0; + tmp5 += m_A18 * V[7]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A13 * V[7]; + tmp4 += m_A14 * V[8]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A10 * V[6]; + tmp3 += m_A11 * V[8]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A8 * V[7]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A4 * V[3]; + tmp1 += m_A5 * V[6]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + tmp0 += m_A2 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki +static void nl_gcr_37_double_double_294dde1e0ecca6d0(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A2 += go[0]; + m_A2 += go[1]; + m_A1 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[3] * *cnV[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A5 += go[4]; + m_A4 += go[5]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A11 += go[11]; + m_A9 += go[12]; + m_A10 += go[13]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A13 += go[15]; + m_A16 += go[16]; + m_A16 += go[17]; + m_A16 += go[18]; + m_A12 += go[19]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A20 += gt[24]; + m_A17 += go[22]; + m_A18 += go[23]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 -= go[24] * *cnV[24]; + m_A24 += gt[25]; + m_A24 += gt[26]; + m_A24 += gt[27]; + m_A25 += go[25]; + m_A23 += go[26]; + double RHS6 = Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[27] * *cnV[27]; + m_A30 += gt[28]; + m_A30 += gt[29]; + m_A30 += gt[30]; + m_A30 += gt[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A27 += go[28]; + m_A28 += go[29]; + m_A28 += go[30]; + m_A28 += go[31]; + m_A26 += go[32]; + m_A26 += go[33]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + m_A36 += gt[34]; + m_A36 += gt[35]; + m_A34 += go[34]; + m_A32 += go[35]; + double RHS8 = Idr[34]; + RHS8 += Idr[35]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A12; + m_A14 += m_A1 * f0_4; + m_A16 += m_A2 * f0_4; + RHS4 += f0_4 * RHS0; + const double f0_7 = -f0 * m_A26; + m_A28 += m_A1 * f0_7; + m_A30 += m_A2 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_4 = -f1 * m_A13; + m_A14 += m_A4 * f1_4; + m_A15 += m_A5 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A17; + m_A19 += m_A4 * f1_5; + m_A20 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_6 = -f2 * m_A23; + m_A24 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_5 = -f3 * m_A18; + m_A20 += m_A9 * f3_5; + m_A21 += m_A10 * f3_5; + m_A22 += m_A11 * f3_5; + RHS5 += f3_5 * RHS3; + const double f3_7 = -f3 * m_A27; + m_A29 += m_A9 * f3_7; + m_A30 += m_A10 * f3_7; + m_A31 += m_A11 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_8 = -f3 * m_A32; + m_A33 += m_A9 * f3_8; + m_A35 += m_A10 * f3_8; + m_A36 += m_A11 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A14; + const double f4_5 = -f4 * m_A19; + m_A20 += m_A15 * f4_5; + m_A21 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_7 = -f4 * m_A28; + m_A29 += m_A15 * f4_7; + m_A30 += m_A16 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A20; + const double f5_7 = -f5 * m_A29; + m_A30 += m_A21 * f5_7; + m_A31 += m_A22 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_8 = -f5 * m_A33; + m_A35 += m_A21 * f5_8; + m_A36 += m_A22 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A24; + const double f6_8 = -f6 * m_A34; + m_A36 += m_A25 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A30; + const double f7_8 = -f7 * m_A35; + m_A36 += m_A31 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A36; + double tmp7 = 0.0; + tmp7 += m_A31 * V[8]; + V[7] = (RHS7 - tmp7) / m_A30; + double tmp6 = 0.0; + tmp6 += m_A25 * V[8]; + V[6] = (RHS6 - tmp6) / m_A24; + double tmp5 = 0.0; + tmp5 += m_A21 * V[7]; + tmp5 += m_A22 * V[8]; + V[5] = (RHS5 - tmp5) / m_A20; + double tmp4 = 0.0; + tmp4 += m_A15 * V[5]; + tmp4 += m_A16 * V[7]; + V[4] = (RHS4 - tmp4) / m_A14; + double tmp3 = 0.0; + tmp3 += m_A9 * V[5]; + tmp3 += m_A10 * V[7]; + tmp3 += m_A11 * V[8]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[6]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[4]; + tmp1 += m_A5 * V[5]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + tmp0 += m_A2 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki +static void nl_gcr_37_double_double_9a5874c8e2da79d2(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A2 += go[0]; + m_A2 += go[1]; + m_A1 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[3] * *cnV[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A5 += go[4]; + m_A4 += go[5]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[7]; + m_A7 += go[8]; + m_A8 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A11 += go[14]; + m_A10 += go[15]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[16] * *cnV[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A13 += go[17]; + m_A12 += go[18]; + m_A12 += go[19]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A20 += go[22]; + m_A19 += go[23]; + m_A19 += go[24]; + m_A19 += go[25]; + m_A17 += go[26]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 -= go[27] * *cnV[27]; + RHS5 -= go[28] * *cnV[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A23 += gt[31]; + m_A23 += gt[32]; + m_A21 += go[29]; + double RHS6 = Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 -= go[30] * *cnV[30]; + RHS6 -= go[31] * *cnV[31]; + RHS6 -= go[32] * *cnV[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A28 += gt[35]; + m_A28 += gt[36]; + m_A28 += gt[37]; + m_A28 += gt[38]; + m_A26 += go[33]; + m_A27 += go[34]; + m_A27 += go[35]; + m_A27 += go[36]; + m_A25 += go[37]; + m_A25 += go[38]; + double RHS7 = Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 += Idr[38]; + m_A36 += gt[39]; + m_A36 += gt[40]; + m_A36 += gt[41]; + m_A36 += gt[42]; + m_A30 += go[39]; + m_A33 += go[40]; + m_A31 += go[41]; + double RHS8 = Idr[39]; + RHS8 += Idr[40]; + RHS8 += Idr[41]; + RHS8 += Idr[42]; + RHS8 -= go[42] * *cnV[42]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A17; + m_A18 += m_A1 * f0_5; + m_A19 += m_A2 * f0_5; + RHS5 += f0_5 * RHS0; + const double f0_7 = -f0 * m_A25; + m_A27 += m_A1 * f0_7; + m_A28 += m_A2 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_7 = -f1 * m_A26; + m_A28 += m_A4 * f1_7; + m_A29 += m_A5 * f1_7; + RHS7 += f1_7 * RHS1; + const double f1_8 = -f1 * m_A30; + m_A35 += m_A4 * f1_8; + m_A36 += m_A5 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_4 = -f2 * m_A12; + m_A14 += m_A7 * f2_4; + m_A16 += m_A8 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_8 = -f2 * m_A31; + m_A32 += m_A7 * f2_8; + m_A36 += m_A8 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A10 * f3_4; + m_A15 += m_A11 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_6 = -f3 * m_A21; + m_A22 += m_A10 * f3_6; + m_A23 += m_A11 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A14; + const double f4_6 = -f4 * m_A22; + m_A23 += m_A15 * f4_6; + m_A24 += m_A16 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_8 = -f4 * m_A32; + m_A34 += m_A15 * f4_8; + m_A36 += m_A16 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A18; + const double f5_7 = -f5 * m_A27; + m_A28 += m_A19 * f5_7; + m_A29 += m_A20 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_8 = -f5 * m_A33; + m_A35 += m_A19 * f5_8; + m_A36 += m_A20 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A23; + const double f6_8 = -f6 * m_A34; + m_A36 += m_A24 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A28; + const double f7_8 = -f7 * m_A35; + m_A36 += m_A29 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A36; + double tmp7 = 0.0; + tmp7 += m_A29 * V[8]; + V[7] = (RHS7 - tmp7) / m_A28; + double tmp6 = 0.0; + tmp6 += m_A24 * V[8]; + V[6] = (RHS6 - tmp6) / m_A23; + double tmp5 = 0.0; + tmp5 += m_A19 * V[7]; + tmp5 += m_A20 * V[8]; + V[5] = (RHS5 - tmp5) / m_A18; + double tmp4 = 0.0; + tmp4 += m_A15 * V[6]; + tmp4 += m_A16 * V[8]; + V[4] = (RHS4 - tmp4) / m_A14; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + tmp3 += m_A11 * V[6]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[4]; + tmp2 += m_A8 * V[8]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[7]; + tmp1 += m_A5 * V[8]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + tmp0 += m_A2 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// kidniki +static void nl_gcr_67_double_double_fc02559fdbfb0e10(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A14 += go[12]; + m_A15 += go[13]; + m_A17 += go[14]; + m_A18 += go[15]; + m_A16 += go[16]; + m_A13 += go[17]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 += Idr[14]; + RHS6 += Idr[15]; + RHS6 += Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 -= go[18] * *cnV[18]; + RHS6 -= go[19] * *cnV[19]; + m_A21 += gt[20]; + m_A21 += gt[21]; + m_A21 += gt[22]; + m_A21 += gt[23]; + m_A20 += go[20]; + m_A19 += go[21]; + double RHS7 = Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 -= go[22] * *cnV[22]; + RHS7 -= go[23] * *cnV[23]; + m_A30 += gt[24]; + m_A30 += gt[25]; + m_A30 += gt[26]; + m_A30 += gt[27]; + m_A28 += go[24]; + m_A27 += go[25]; + double RHS8 = Idr[24]; + RHS8 += Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 -= go[26] * *cnV[26]; + RHS8 -= go[27] * *cnV[27]; + m_A39 += gt[28]; + m_A39 += gt[29]; + m_A39 += gt[30]; + m_A39 += gt[31]; + m_A36 += go[28]; + m_A35 += go[29]; + double RHS9 = Idr[28]; + RHS9 += Idr[29]; + RHS9 += Idr[30]; + RHS9 += Idr[31]; + RHS9 -= go[30] * *cnV[30]; + RHS9 -= go[31] * *cnV[31]; + m_A48 += gt[32]; + m_A48 += gt[33]; + m_A48 += gt[34]; + m_A48 += gt[35]; + m_A44 += go[32]; + m_A43 += go[33]; + double RHS10 = Idr[32]; + RHS10 += Idr[33]; + RHS10 += Idr[34]; + RHS10 += Idr[35]; + RHS10 -= go[34] * *cnV[34]; + RHS10 -= go[35] * *cnV[35]; + m_A57 += gt[36]; + m_A57 += gt[37]; + m_A57 += gt[38]; + m_A57 += gt[39]; + m_A52 += go[36]; + m_A51 += go[37]; + double RHS11 = Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + m_A66 += gt[40]; + m_A66 += gt[41]; + m_A66 += gt[42]; + m_A66 += gt[43]; + m_A60 += go[40]; + m_A59 += go[41]; + double RHS12 = Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 -= go[42] * *cnV[42]; + RHS12 -= go[43] * *cnV[43]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A19; + m_A21 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A43; + m_A48 += m_A3 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_12 = -f2 * m_A59; + m_A66 += m_A5 * f2_12; + RHS12 += f2_12 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_11 = -f3 * m_A51; + m_A57 += m_A7 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_9 = -f4 * m_A35; + m_A39 += m_A9 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_8 = -f5 * m_A27; + m_A30 += m_A11 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_7 = -f6 * m_A20; + m_A21 += m_A13 * f6_7; + m_A22 += m_A14 * f6_7; + m_A23 += m_A15 * f6_7; + m_A24 += m_A16 * f6_7; + m_A25 += m_A17 * f6_7; + m_A26 += m_A18 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A28; + m_A29 += m_A13 * f6_8; + m_A30 += m_A14 * f6_8; + m_A31 += m_A15 * f6_8; + m_A32 += m_A16 * f6_8; + m_A33 += m_A17 * f6_8; + m_A34 += m_A18 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A36; + m_A37 += m_A13 * f6_9; + m_A38 += m_A14 * f6_9; + m_A39 += m_A15 * f6_9; + m_A40 += m_A16 * f6_9; + m_A41 += m_A17 * f6_9; + m_A42 += m_A18 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_10 = -f6 * m_A44; + m_A45 += m_A13 * f6_10; + m_A46 += m_A14 * f6_10; + m_A47 += m_A15 * f6_10; + m_A48 += m_A16 * f6_10; + m_A49 += m_A17 * f6_10; + m_A50 += m_A18 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_11 = -f6 * m_A52; + m_A53 += m_A13 * f6_11; + m_A54 += m_A14 * f6_11; + m_A55 += m_A15 * f6_11; + m_A56 += m_A16 * f6_11; + m_A57 += m_A17 * f6_11; + m_A58 += m_A18 * f6_11; + RHS11 += f6_11 * RHS6; + const double f6_12 = -f6 * m_A60; + m_A61 += m_A13 * f6_12; + m_A62 += m_A14 * f6_12; + m_A63 += m_A15 * f6_12; + m_A64 += m_A16 * f6_12; + m_A65 += m_A17 * f6_12; + m_A66 += m_A18 * f6_12; + RHS12 += f6_12 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_8 = -f7 * m_A29; + m_A30 += m_A22 * f7_8; + m_A31 += m_A23 * f7_8; + m_A32 += m_A24 * f7_8; + m_A33 += m_A25 * f7_8; + m_A34 += m_A26 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_9 = -f7 * m_A37; + m_A38 += m_A22 * f7_9; + m_A39 += m_A23 * f7_9; + m_A40 += m_A24 * f7_9; + m_A41 += m_A25 * f7_9; + m_A42 += m_A26 * f7_9; + RHS9 += f7_9 * RHS7; + const double f7_10 = -f7 * m_A45; + m_A46 += m_A22 * f7_10; + m_A47 += m_A23 * f7_10; + m_A48 += m_A24 * f7_10; + m_A49 += m_A25 * f7_10; + m_A50 += m_A26 * f7_10; + RHS10 += f7_10 * RHS7; + const double f7_11 = -f7 * m_A53; + m_A54 += m_A22 * f7_11; + m_A55 += m_A23 * f7_11; + m_A56 += m_A24 * f7_11; + m_A57 += m_A25 * f7_11; + m_A58 += m_A26 * f7_11; + RHS11 += f7_11 * RHS7; + const double f7_12 = -f7 * m_A61; + m_A62 += m_A22 * f7_12; + m_A63 += m_A23 * f7_12; + m_A64 += m_A24 * f7_12; + m_A65 += m_A25 * f7_12; + m_A66 += m_A26 * f7_12; + RHS12 += f7_12 * RHS7; + const double f8 = 1.0 / m_A30; + const double f8_9 = -f8 * m_A38; + m_A39 += m_A31 * f8_9; + m_A40 += m_A32 * f8_9; + m_A41 += m_A33 * f8_9; + m_A42 += m_A34 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_10 = -f8 * m_A46; + m_A47 += m_A31 * f8_10; + m_A48 += m_A32 * f8_10; + m_A49 += m_A33 * f8_10; + m_A50 += m_A34 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_11 = -f8 * m_A54; + m_A55 += m_A31 * f8_11; + m_A56 += m_A32 * f8_11; + m_A57 += m_A33 * f8_11; + m_A58 += m_A34 * f8_11; + RHS11 += f8_11 * RHS8; + const double f8_12 = -f8 * m_A62; + m_A63 += m_A31 * f8_12; + m_A64 += m_A32 * f8_12; + m_A65 += m_A33 * f8_12; + m_A66 += m_A34 * f8_12; + RHS12 += f8_12 * RHS8; + const double f9 = 1.0 / m_A39; + const double f9_10 = -f9 * m_A47; + m_A48 += m_A40 * f9_10; + m_A49 += m_A41 * f9_10; + m_A50 += m_A42 * f9_10; + RHS10 += f9_10 * RHS9; + const double f9_11 = -f9 * m_A55; + m_A56 += m_A40 * f9_11; + m_A57 += m_A41 * f9_11; + m_A58 += m_A42 * f9_11; + RHS11 += f9_11 * RHS9; + const double f9_12 = -f9 * m_A63; + m_A64 += m_A40 * f9_12; + m_A65 += m_A41 * f9_12; + m_A66 += m_A42 * f9_12; + RHS12 += f9_12 * RHS9; + const double f10 = 1.0 / m_A48; + const double f10_11 = -f10 * m_A56; + m_A57 += m_A49 * f10_11; + m_A58 += m_A50 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_12 = -f10 * m_A64; + m_A65 += m_A49 * f10_12; + m_A66 += m_A50 * f10_12; + RHS12 += f10_12 * RHS10; + const double f11 = 1.0 / m_A57; + const double f11_12 = -f11 * m_A65; + m_A66 += m_A58 * f11_12; + RHS12 += f11_12 * RHS11; + V[12] = RHS12 / m_A66; + double tmp11 = 0.0; + tmp11 += m_A58 * V[12]; + V[11] = (RHS11 - tmp11) / m_A57; + double tmp10 = 0.0; + tmp10 += m_A49 * V[11]; + tmp10 += m_A50 * V[12]; + V[10] = (RHS10 - tmp10) / m_A48; + double tmp9 = 0.0; + tmp9 += m_A40 * V[10]; + tmp9 += m_A41 * V[11]; + tmp9 += m_A42 * V[12]; + V[9] = (RHS9 - tmp9) / m_A39; + double tmp8 = 0.0; + tmp8 += m_A31 * V[9]; + tmp8 += m_A32 * V[10]; + tmp8 += m_A33 * V[11]; + tmp8 += m_A34 * V[12]; + V[8] = (RHS8 - tmp8) / m_A30; + double tmp7 = 0.0; + tmp7 += m_A22 * V[8]; + tmp7 += m_A23 * V[9]; + tmp7 += m_A24 * V[10]; + tmp7 += m_A25 * V[11]; + tmp7 += m_A26 * V[12]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A13 * V[7]; + tmp6 += m_A14 * V[8]; + tmp6 += m_A15 * V[9]; + tmp6 += m_A16 * V[10]; + tmp6 += m_A17 * V[11]; + tmp6 += m_A18 * V[12]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[8]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[9]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[11]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[12]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[10]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// konami1x +static void nl_gcr_49_double_double_62b99b9904a8c804(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A13 += go[12]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A15 += go[14]; + double RHS7 = Idr[14]; + RHS7 += Idr[15]; + RHS7 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A16 += gt[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A17 += go[16]; + double RHS8 = Idr[16]; + RHS8 += Idr[17]; + RHS8 += Idr[18]; + RHS8 += Idr[19]; + RHS8 += Idr[20]; + RHS8 += Idr[21]; + RHS8 += Idr[22]; + RHS8 -= go[17] * *cnV[17]; + RHS8 -= go[18] * *cnV[18]; + RHS8 -= go[19] * *cnV[19]; + RHS8 -= go[20] * *cnV[20]; + RHS8 -= go[21] * *cnV[21]; + RHS8 -= go[22] * *cnV[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A19 += go[23]; + double RHS9 = Idr[23]; + RHS9 += Idr[24]; + RHS9 -= go[24] * *cnV[24]; + m_A20 += gt[25]; + m_A20 += gt[26]; + m_A21 += go[25]; + double RHS10 = Idr[25]; + RHS10 += Idr[26]; + RHS10 -= go[26] * *cnV[26]; + m_A25 += gt[27]; + m_A25 += gt[28]; + m_A25 += gt[29]; + m_A25 += gt[30]; + m_A26 += go[27]; + m_A24 += go[28]; + m_A23 += go[29]; + m_A22 += go[30]; + double RHS11 = Idr[27]; + RHS11 += Idr[28]; + RHS11 += Idr[29]; + RHS11 += Idr[30]; + m_A30 += gt[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A31 += go[31]; + m_A29 += go[32]; + m_A28 += go[33]; + m_A27 += go[34]; + double RHS12 = Idr[31]; + RHS12 += Idr[32]; + RHS12 += Idr[33]; + RHS12 += Idr[34]; + m_A35 += gt[35]; + m_A35 += gt[36]; + m_A35 += gt[37]; + m_A35 += gt[38]; + m_A36 += go[35]; + m_A34 += go[36]; + m_A33 += go[37]; + m_A32 += go[38]; + double RHS13 = Idr[35]; + RHS13 += Idr[36]; + RHS13 += Idr[37]; + RHS13 += Idr[38]; + m_A38 += gt[39]; + m_A38 += gt[40]; + m_A38 += gt[41]; + m_A37 += go[39]; + m_A39 += go[40]; + double RHS14 = Idr[39]; + RHS14 += Idr[40]; + RHS14 += Idr[41]; + RHS14 -= go[41] * *cnV[41]; + m_A43 += gt[42]; + m_A43 += gt[43]; + m_A43 += gt[44]; + m_A43 += gt[45]; + m_A43 += gt[46]; + m_A44 += go[42]; + m_A42 += go[43]; + m_A41 += go[44]; + m_A40 += go[45]; + double RHS15 = Idr[42]; + RHS15 += Idr[43]; + RHS15 += Idr[44]; + RHS15 += Idr[45]; + RHS15 += Idr[46]; + RHS15 -= go[46] * *cnV[46]; + m_A48 += gt[47]; + m_A48 += gt[48]; + m_A48 += gt[49]; + m_A48 += gt[50]; + m_A48 += gt[51]; + m_A45 += go[47]; + m_A46 += go[48]; + m_A47 += go[49]; + double RHS16 = Idr[47]; + RHS16 += Idr[48]; + RHS16 += Idr[49]; + RHS16 += Idr[50]; + RHS16 += Idr[51]; + RHS16 -= go[50] * *cnV[50]; + RHS16 -= go[51] * *cnV[51]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A22; + m_A25 += m_A1 * f0_11; + RHS11 += f0_11 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_11 = -f1 * m_A23; + m_A25 += m_A3 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_11 = -f2 * m_A24; + m_A25 += m_A5 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_12 = -f3 * m_A27; + m_A30 += m_A7 * f3_12; + RHS12 += f3_12 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_12 = -f4 * m_A28; + m_A30 += m_A9 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_12 = -f5 * m_A29; + m_A30 += m_A11 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_13 = -f6 * m_A32; + m_A35 += m_A13 * f6_13; + RHS13 += f6_13 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_13 = -f7 * m_A33; + m_A35 += m_A15 * f7_13; + RHS13 += f7_13 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_16 = -f8 * m_A45; + m_A47 += m_A17 * f8_16; + RHS16 += f8_16 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_13 = -f9 * m_A34; + m_A35 += m_A19 * f9_13; + RHS13 += f9_13 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_14 = -f10 * m_A37; + m_A38 += m_A21 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A25; + const double f11_15 = -f11 * m_A40; + m_A43 += m_A26 * f11_15; + RHS15 += f11_15 * RHS11; + const double f12 = 1.0 / m_A30; + const double f12_15 = -f12 * m_A41; + m_A43 += m_A31 * f12_15; + RHS15 += f12_15 * RHS12; + const double f13 = 1.0 / m_A35; + const double f13_15 = -f13 * m_A42; + m_A43 += m_A36 * f13_15; + RHS15 += f13_15 * RHS13; + const double f14 = 1.0 / m_A38; + const double f14_16 = -f14 * m_A46; + m_A48 += m_A39 * f14_16; + RHS16 += f14_16 * RHS14; + const double f15 = 1.0 / m_A43; + const double f15_16 = -f15 * m_A47; + m_A48 += m_A44 * f15_16; + RHS16 += f15_16 * RHS15; + V[16] = RHS16 / m_A48; + double tmp15 = 0.0; + tmp15 += m_A44 * V[16]; + V[15] = (RHS15 - tmp15) / m_A43; + double tmp14 = 0.0; + tmp14 += m_A39 * V[16]; + V[14] = (RHS14 - tmp14) / m_A38; + double tmp13 = 0.0; + tmp13 += m_A36 * V[15]; + V[13] = (RHS13 - tmp13) / m_A35; + double tmp12 = 0.0; + tmp12 += m_A31 * V[15]; + V[12] = (RHS12 - tmp12) / m_A30; + double tmp11 = 0.0; + tmp11 += m_A26 * V[15]; + V[11] = (RHS11 - tmp11) / m_A25; + double tmp10 = 0.0; + tmp10 += m_A21 * V[14]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[13]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[15]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[13]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[13]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[12]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[12]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[12]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[11]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[11]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// konami2x +static void nl_gcr_85_double_double_f6900d3f36a91049(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A13 += go[12]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A15 += go[14]; + double RHS7 = Idr[14]; + RHS7 += Idr[15]; + RHS7 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A17 += go[16]; + double RHS8 = Idr[16]; + RHS8 += Idr[17]; + RHS8 -= go[17] * *cnV[17]; + m_A18 += gt[18]; + m_A18 += gt[19]; + m_A19 += go[18]; + double RHS9 = Idr[18]; + RHS9 += Idr[19]; + RHS9 -= go[19] * *cnV[19]; + m_A20 += gt[20]; + m_A20 += gt[21]; + m_A21 += go[20]; + double RHS10 = Idr[20]; + RHS10 += Idr[21]; + RHS10 -= go[21] * *cnV[21]; + m_A22 += gt[22]; + m_A22 += gt[23]; + m_A23 += go[22]; + double RHS11 = Idr[22]; + RHS11 += Idr[23]; + RHS11 -= go[23] * *cnV[23]; + m_A24 += gt[24]; + m_A24 += gt[25]; + m_A25 += go[24]; + double RHS12 = Idr[24]; + RHS12 += Idr[25]; + RHS12 -= go[25] * *cnV[25]; + m_A26 += gt[26]; + m_A26 += gt[27]; + m_A26 += gt[28]; + m_A26 += gt[29]; + m_A26 += gt[30]; + m_A26 += gt[31]; + m_A26 += gt[32]; + m_A27 += go[26]; + double RHS13 = Idr[26]; + RHS13 += Idr[27]; + RHS13 += Idr[28]; + RHS13 += Idr[29]; + RHS13 += Idr[30]; + RHS13 += Idr[31]; + RHS13 += Idr[32]; + RHS13 -= go[27] * *cnV[27]; + RHS13 -= go[28] * *cnV[28]; + RHS13 -= go[29] * *cnV[29]; + RHS13 -= go[30] * *cnV[30]; + RHS13 -= go[31] * *cnV[31]; + RHS13 -= go[32] * *cnV[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A29 += go[33]; + double RHS14 = Idr[33]; + RHS14 += Idr[34]; + RHS14 -= go[34] * *cnV[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A31 += go[35]; + double RHS15 = Idr[35]; + RHS15 += Idr[36]; + RHS15 -= go[36] * *cnV[36]; + m_A35 += gt[37]; + m_A35 += gt[38]; + m_A35 += gt[39]; + m_A35 += gt[40]; + m_A36 += go[37]; + m_A34 += go[38]; + m_A33 += go[39]; + m_A32 += go[40]; + double RHS16 = Idr[37]; + RHS16 += Idr[38]; + RHS16 += Idr[39]; + RHS16 += Idr[40]; + m_A37 += gt[41]; + m_A37 += gt[42]; + m_A38 += go[41]; + double RHS17 = Idr[41]; + RHS17 += Idr[42]; + RHS17 -= go[42] * *cnV[42]; + m_A39 += gt[43]; + m_A39 += gt[44]; + m_A40 += go[43]; + double RHS18 = Idr[43]; + RHS18 += Idr[44]; + RHS18 -= go[44] * *cnV[44]; + m_A41 += gt[45]; + m_A41 += gt[46]; + m_A42 += go[45]; + double RHS19 = Idr[45]; + RHS19 += Idr[46]; + RHS19 -= go[46] * *cnV[46]; + m_A43 += gt[47]; + m_A43 += gt[48]; + m_A44 += go[47]; + double RHS20 = Idr[47]; + RHS20 += Idr[48]; + RHS20 -= go[48] * *cnV[48]; + m_A46 += gt[49]; + m_A46 += gt[50]; + m_A46 += gt[51]; + m_A45 += go[49]; + m_A47 += go[50]; + double RHS21 = Idr[49]; + RHS21 += Idr[50]; + RHS21 += Idr[51]; + RHS21 -= go[51] * *cnV[51]; + m_A51 += gt[52]; + m_A51 += gt[53]; + m_A51 += gt[54]; + m_A51 += gt[55]; + m_A52 += go[52]; + m_A50 += go[53]; + m_A49 += go[54]; + m_A48 += go[55]; + double RHS22 = Idr[52]; + RHS22 += Idr[53]; + RHS22 += Idr[54]; + RHS22 += Idr[55]; + m_A56 += gt[56]; + m_A56 += gt[57]; + m_A56 += gt[58]; + m_A56 += gt[59]; + m_A57 += go[56]; + m_A55 += go[57]; + m_A54 += go[58]; + m_A53 += go[59]; + double RHS23 = Idr[56]; + RHS23 += Idr[57]; + RHS23 += Idr[58]; + RHS23 += Idr[59]; + m_A61 += gt[60]; + m_A61 += gt[61]; + m_A61 += gt[62]; + m_A61 += gt[63]; + m_A62 += go[60]; + m_A60 += go[61]; + m_A59 += go[62]; + m_A58 += go[63]; + double RHS24 = Idr[60]; + RHS24 += Idr[61]; + RHS24 += Idr[62]; + RHS24 += Idr[63]; + m_A66 += gt[64]; + m_A66 += gt[65]; + m_A66 += gt[66]; + m_A66 += gt[67]; + m_A67 += go[64]; + m_A65 += go[65]; + m_A64 += go[66]; + m_A63 += go[67]; + double RHS25 = Idr[64]; + RHS25 += Idr[65]; + RHS25 += Idr[66]; + RHS25 += Idr[67]; + m_A71 += gt[68]; + m_A71 += gt[69]; + m_A71 += gt[70]; + m_A71 += gt[71]; + m_A72 += go[68]; + m_A70 += go[69]; + m_A69 += go[70]; + m_A68 += go[71]; + double RHS26 = Idr[68]; + RHS26 += Idr[69]; + RHS26 += Idr[70]; + RHS26 += Idr[71]; + m_A75 += gt[72]; + m_A75 += gt[73]; + m_A75 += gt[74]; + m_A75 += gt[75]; + m_A75 += gt[76]; + m_A73 += go[72]; + m_A74 += go[73]; + m_A76 += go[74]; + double RHS27 = Idr[72]; + RHS27 += Idr[73]; + RHS27 += Idr[74]; + RHS27 += Idr[75]; + RHS27 += Idr[76]; + RHS27 -= go[75] * *cnV[75]; + RHS27 -= go[76] * *cnV[76]; + m_A84 += gt[77]; + m_A84 += gt[78]; + m_A84 += gt[79]; + m_A84 += gt[80]; + m_A84 += gt[81]; + m_A84 += gt[82]; + m_A84 += gt[83]; + m_A84 += gt[84]; + m_A83 += go[77]; + m_A80 += go[78]; + m_A82 += go[79]; + m_A81 += go[80]; + m_A79 += go[81]; + m_A78 += go[82]; + m_A77 += go[83]; + double RHS28 = Idr[77]; + RHS28 += Idr[78]; + RHS28 += Idr[79]; + RHS28 += Idr[80]; + RHS28 += Idr[81]; + RHS28 += Idr[82]; + RHS28 += Idr[83]; + RHS28 += Idr[84]; + RHS28 -= go[84] * *cnV[84]; + const double f0 = 1.0 / m_A0; + const double f0_16 = -f0 * m_A32; + m_A35 += m_A1 * f0_16; + RHS16 += f0_16 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_16 = -f1 * m_A33; + m_A35 += m_A3 * f1_16; + RHS16 += f1_16 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_16 = -f2 * m_A34; + m_A35 += m_A5 * f2_16; + RHS16 += f2_16 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_22 = -f3 * m_A48; + m_A51 += m_A7 * f3_22; + RHS22 += f3_22 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_22 = -f4 * m_A49; + m_A51 += m_A9 * f4_22; + RHS22 += f4_22 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_22 = -f5 * m_A50; + m_A51 += m_A11 * f5_22; + RHS22 += f5_22 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_23 = -f6 * m_A53; + m_A56 += m_A13 * f6_23; + RHS23 += f6_23 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_23 = -f7 * m_A54; + m_A56 += m_A15 * f7_23; + RHS23 += f7_23 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_23 = -f8 * m_A55; + m_A56 += m_A17 * f8_23; + RHS23 += f8_23 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_25 = -f9 * m_A63; + m_A66 += m_A19 * f9_25; + RHS25 += f9_25 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_26 = -f10 * m_A68; + m_A71 += m_A21 * f10_26; + RHS26 += f10_26 * RHS10; + const double f11 = 1.0 / m_A22; + const double f11_24 = -f11 * m_A58; + m_A61 += m_A23 * f11_24; + RHS24 += f11_24 * RHS11; + const double f12 = 1.0 / m_A24; + const double f12_24 = -f12 * m_A59; + m_A61 += m_A25 * f12_24; + RHS24 += f12_24 * RHS12; + const double f13 = 1.0 / m_A26; + const double f13_27 = -f13 * m_A73; + m_A76 += m_A27 * f13_27; + RHS27 += f13_27 * RHS13; + const double f14 = 1.0 / m_A28; + const double f14_24 = -f14 * m_A60; + m_A61 += m_A29 * f14_24; + RHS24 += f14_24 * RHS14; + const double f15 = 1.0 / m_A30; + const double f15_21 = -f15 * m_A45; + m_A46 += m_A31 * f15_21; + RHS21 += f15_21 * RHS15; + const double f16 = 1.0 / m_A35; + const double f16_28 = -f16 * m_A77; + m_A84 += m_A36 * f16_28; + RHS28 += f16_28 * RHS16; + const double f17 = 1.0 / m_A37; + const double f17_25 = -f17 * m_A64; + m_A66 += m_A38 * f17_25; + RHS25 += f17_25 * RHS17; + const double f18 = 1.0 / m_A39; + const double f18_25 = -f18 * m_A65; + m_A66 += m_A40 * f18_25; + RHS25 += f18_25 * RHS18; + const double f19 = 1.0 / m_A41; + const double f19_26 = -f19 * m_A69; + m_A71 += m_A42 * f19_26; + RHS26 += f19_26 * RHS19; + const double f20 = 1.0 / m_A43; + const double f20_26 = -f20 * m_A70; + m_A71 += m_A44 * f20_26; + RHS26 += f20_26 * RHS20; + const double f21 = 1.0 / m_A46; + const double f21_27 = -f21 * m_A74; + m_A75 += m_A47 * f21_27; + RHS27 += f21_27 * RHS21; + const double f22 = 1.0 / m_A51; + const double f22_28 = -f22 * m_A78; + m_A84 += m_A52 * f22_28; + RHS28 += f22_28 * RHS22; + const double f23 = 1.0 / m_A56; + const double f23_28 = -f23 * m_A79; + m_A84 += m_A57 * f23_28; + RHS28 += f23_28 * RHS23; + const double f24 = 1.0 / m_A61; + const double f24_28 = -f24 * m_A80; + m_A84 += m_A62 * f24_28; + RHS28 += f24_28 * RHS24; + const double f25 = 1.0 / m_A66; + const double f25_28 = -f25 * m_A81; + m_A84 += m_A67 * f25_28; + RHS28 += f25_28 * RHS25; + const double f26 = 1.0 / m_A71; + const double f26_28 = -f26 * m_A82; + m_A84 += m_A72 * f26_28; + RHS28 += f26_28 * RHS26; + const double f27 = 1.0 / m_A75; + const double f27_28 = -f27 * m_A83; + m_A84 += m_A76 * f27_28; + RHS28 += f27_28 * RHS27; + V[28] = RHS28 / m_A84; + double tmp27 = 0.0; + tmp27 += m_A76 * V[28]; + V[27] = (RHS27 - tmp27) / m_A75; + double tmp26 = 0.0; + tmp26 += m_A72 * V[28]; + V[26] = (RHS26 - tmp26) / m_A71; + double tmp25 = 0.0; + tmp25 += m_A67 * V[28]; + V[25] = (RHS25 - tmp25) / m_A66; + double tmp24 = 0.0; + tmp24 += m_A62 * V[28]; + V[24] = (RHS24 - tmp24) / m_A61; + double tmp23 = 0.0; + tmp23 += m_A57 * V[28]; + V[23] = (RHS23 - tmp23) / m_A56; + double tmp22 = 0.0; + tmp22 += m_A52 * V[28]; + V[22] = (RHS22 - tmp22) / m_A51; + double tmp21 = 0.0; + tmp21 += m_A47 * V[27]; + V[21] = (RHS21 - tmp21) / m_A46; + double tmp20 = 0.0; + tmp20 += m_A44 * V[26]; + V[20] = (RHS20 - tmp20) / m_A43; + double tmp19 = 0.0; + tmp19 += m_A42 * V[26]; + V[19] = (RHS19 - tmp19) / m_A41; + double tmp18 = 0.0; + tmp18 += m_A40 * V[25]; + V[18] = (RHS18 - tmp18) / m_A39; + double tmp17 = 0.0; + tmp17 += m_A38 * V[25]; + V[17] = (RHS17 - tmp17) / m_A37; + double tmp16 = 0.0; + tmp16 += m_A36 * V[28]; + V[16] = (RHS16 - tmp16) / m_A35; + double tmp15 = 0.0; + tmp15 += m_A31 * V[21]; + V[15] = (RHS15 - tmp15) / m_A30; + double tmp14 = 0.0; + tmp14 += m_A29 * V[24]; + V[14] = (RHS14 - tmp14) / m_A28; + double tmp13 = 0.0; + tmp13 += m_A27 * V[28]; + V[13] = (RHS13 - tmp13) / m_A26; + double tmp12 = 0.0; + tmp12 += m_A25 * V[24]; + V[12] = (RHS12 - tmp12) / m_A24; + double tmp11 = 0.0; + tmp11 += m_A23 * V[24]; + V[11] = (RHS11 - tmp11) / m_A22; + double tmp10 = 0.0; + tmp10 += m_A21 * V[26]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[25]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[23]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[23]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[23]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[22]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[22]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[22]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[16]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[16]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[16]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// mario +static void nl_gcr_29_double_double_80b4b1e5cc58d303(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A8 += go[9]; + m_A7 += go[10]; + m_A7 += go[11]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[12] * *cnV[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A10 += go[13]; + double RHS4 = Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A12 += go[16]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A16 += go[18]; + m_A16 += go[19]; + m_A13 += go[20]; + m_A13 += go[21]; + m_A15 += go[22]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + m_A22 += gt[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A20 += go[25]; + m_A21 += go[26]; + m_A19 += go[27]; + m_A18 += go[28]; + m_A17 += go[29]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 -= go[30] * *cnV[30]; + m_A28 += gt[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A28 += gt[35]; + m_A28 += gt[36]; + m_A25 += go[31]; + m_A24 += go[32]; + m_A26 += go[33]; + m_A26 += go[34]; + double RHS8 = Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A17; + m_A22 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A18; + m_A22 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A19; + m_A22 += m_A5 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A13; + m_A14 += m_A7 * f3_6; + m_A16 += m_A8 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_8 = -f3 * m_A24; + m_A26 += m_A7 * f3_8; + m_A28 += m_A8 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_8 = -f4 * m_A25; + m_A28 += m_A10 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_7 = -f5 * m_A20; + m_A22 += m_A12 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_7 = -f6 * m_A21; + m_A22 += m_A15 * f6_7; + m_A23 += m_A16 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A26; + m_A27 += m_A15 * f6_8; + m_A28 += m_A16 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_8 = -f7 * m_A27; + m_A28 += m_A23 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A28; + double tmp7 = 0.0; + tmp7 += m_A23 * V[8]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A15 * V[7]; + tmp6 += m_A16 * V[8]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[7]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[8]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + tmp3 += m_A8 * V[8]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// mario +static void nl_gcr_62_double_double_afce66fb47d3c5f3(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[8] * *cnV[8]; + RHS3 -= go[9] * *cnV[9]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A9 += go[14]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[15] * *cnV[15]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + m_A10 += gt[21]; + m_A10 += gt[22]; + m_A12 += go[21]; + m_A11 += go[22]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + m_A13 += gt[23]; + m_A13 += gt[24]; + m_A13 += gt[25]; + m_A14 += go[23]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A16 += go[26]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[27] * *cnV[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A17 += gt[30]; + m_A17 += gt[31]; + m_A18 += go[28]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[29] * *cnV[29]; + RHS8 -= go[30] * *cnV[30]; + RHS8 -= go[31] * *cnV[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A19 += go[32]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 -= go[33] * *cnV[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A22 += gt[37]; + m_A21 += go[34]; + m_A23 += go[35]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 -= go[36] * *cnV[36]; + RHS10 -= go[37] * *cnV[37]; + m_A27 += gt[38]; + m_A27 += gt[39]; + m_A27 += gt[40]; + m_A27 += gt[41]; + m_A27 += gt[42]; + m_A24 += go[38]; + m_A25 += go[39]; + m_A28 += go[40]; + double RHS11 = Idr[38]; + RHS11 += Idr[39]; + RHS11 += Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 -= go[41] * *cnV[41]; + RHS11 -= go[42] * *cnV[42]; + m_A32 += gt[43]; + m_A32 += gt[44]; + m_A31 += go[43]; + m_A30 += go[44]; + double RHS12 = Idr[43]; + RHS12 += Idr[44]; + m_A34 += gt[45]; + m_A34 += gt[46]; + m_A34 += gt[47]; + m_A34 += gt[48]; + m_A34 += gt[49]; + m_A34 += gt[50]; + m_A33 += go[45]; + m_A37 += go[46]; + m_A36 += go[47]; + double RHS13 = Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 += Idr[48]; + RHS13 += Idr[49]; + RHS13 += Idr[50]; + RHS13 -= go[48] * *cnV[48]; + RHS13 -= go[49] * *cnV[49]; + RHS13 -= go[50] * *cnV[50]; + m_A39 += gt[51]; + m_A39 += gt[52]; + m_A39 += gt[53]; + m_A39 += gt[54]; + m_A40 += go[51]; + m_A38 += go[52]; + double RHS14 = Idr[51]; + RHS14 += Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 -= go[53] * *cnV[53]; + RHS14 -= go[54] * *cnV[54]; + m_A46 += gt[55]; + m_A46 += gt[56]; + m_A46 += gt[57]; + m_A46 += gt[58]; + m_A46 += gt[59]; + m_A44 += go[55]; + m_A45 += go[56]; + m_A43 += go[57]; + m_A42 += go[58]; + m_A41 += go[59]; + double RHS15 = Idr[55]; + RHS15 += Idr[56]; + RHS15 += Idr[57]; + RHS15 += Idr[58]; + RHS15 += Idr[59]; + m_A53 += gt[60]; + m_A53 += gt[61]; + m_A53 += gt[62]; + m_A53 += gt[63]; + m_A50 += go[60]; + m_A54 += go[61]; + m_A48 += go[62]; + double RHS16 = Idr[60]; + RHS16 += Idr[61]; + RHS16 += Idr[62]; + RHS16 += Idr[63]; + RHS16 -= go[63] * *cnV[63]; + m_A61 += gt[64]; + m_A61 += gt[65]; + m_A61 += gt[66]; + m_A61 += gt[67]; + m_A61 += gt[68]; + m_A57 += go[64]; + m_A58 += go[65]; + m_A60 += go[66]; + m_A55 += go[67]; + m_A56 += go[68]; + double RHS17 = Idr[64]; + RHS17 += Idr[65]; + RHS17 += Idr[66]; + RHS17 += Idr[67]; + RHS17 += Idr[68]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A19; + m_A20 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f0_15 = -f0 * m_A41; + m_A44 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A21; + m_A23 += m_A3 * f1_10; + RHS10 += f1_10 * RHS1; + const double f1_15 = -f1 * m_A42; + m_A46 += m_A3 * f1_15; + RHS15 += f1_15 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_15 = -f2 * m_A43; + m_A46 += m_A5 * f2_15; + RHS15 += f2_15 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_11 = -f3 * m_A24; + m_A26 += m_A7 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_13 = -f4 * m_A33; + m_A35 += m_A9 * f4_13; + RHS13 += f4_13 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_11 = -f5 * m_A25; + m_A27 += m_A11 * f5_11; + m_A29 += m_A12 * f5_11; + RHS11 += f5_11 * RHS5; + const double f5_16 = -f5 * m_A48; + m_A49 += m_A11 * f5_16; + m_A53 += m_A12 * f5_16; + RHS16 += f5_16 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_14 = -f6 * m_A38; + m_A40 += m_A14 * f6_14; + RHS14 += f6_14 * RHS6; + const double f6_17 = -f6 * m_A55; + m_A61 += m_A14 * f6_17; + RHS17 += f6_17 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_12 = -f7 * m_A30; + m_A32 += m_A16 * f7_12; + RHS12 += f7_12 * RHS7; + const double f7_17 = -f7 * m_A56; + m_A57 += m_A16 * f7_17; + RHS17 += f7_17 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_12 = -f8 * m_A31; + m_A32 += m_A18 * f8_12; + RHS12 += f8_12 * RHS8; + const double f9 = 1.0 / m_A20; + const double f9_15 = -f9 * m_A44; + RHS15 += f9_15 * RHS9; + const double f10 = 1.0 / m_A22; + const double f10_11 = -f10 * m_A26; + m_A28 += m_A23 * f10_11; + RHS11 += f10_11 * RHS10; + const double f11 = 1.0 / m_A27; + const double f11_15 = -f11 * m_A45; + m_A46 += m_A28 * f11_15; + m_A47 += m_A29 * f11_15; + RHS15 += f11_15 * RHS11; + const double f11_16 = -f11 * m_A49; + m_A52 += m_A28 * f11_16; + m_A53 += m_A29 * f11_16; + RHS16 += f11_16 * RHS11; + const double f12 = 1.0 / m_A32; + const double f12_17 = -f12 * m_A57; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A34; + const double f13_16 = -f13 * m_A50; + m_A51 += m_A35 * f13_16; + m_A53 += m_A36 * f13_16; + m_A54 += m_A37 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_17 = -f13 * m_A58; + m_A59 += m_A35 * f13_17; + m_A60 += m_A36 * f13_17; + m_A61 += m_A37 * f13_17; + RHS17 += f13_17 * RHS13; + const double f14 = 1.0 / m_A39; + const double f14_16 = -f14 * m_A51; + m_A54 += m_A40 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_17 = -f14 * m_A59; + m_A61 += m_A40 * f14_17; + RHS17 += f14_17 * RHS14; + const double f15 = 1.0 / m_A46; + const double f15_16 = -f15 * m_A52; + m_A53 += m_A47 * f15_16; + RHS16 += f15_16 * RHS15; + const double f16 = 1.0 / m_A53; + const double f16_17 = -f16 * m_A60; + m_A61 += m_A54 * f16_17; + RHS17 += f16_17 * RHS16; + V[17] = RHS17 / m_A61; + double tmp16 = 0.0; + tmp16 += m_A54 * V[17]; + V[16] = (RHS16 - tmp16) / m_A53; + double tmp15 = 0.0; + tmp15 += m_A47 * V[16]; + V[15] = (RHS15 - tmp15) / m_A46; + double tmp14 = 0.0; + tmp14 += m_A40 * V[17]; + V[14] = (RHS14 - tmp14) / m_A39; + double tmp13 = 0.0; + tmp13 += m_A35 * V[14]; + tmp13 += m_A36 * V[16]; + tmp13 += m_A37 * V[17]; + V[13] = (RHS13 - tmp13) / m_A34; + double tmp12 = 0.0; + V[12] = (RHS12 - tmp12) / m_A32; + double tmp11 = 0.0; + tmp11 += m_A28 * V[15]; + tmp11 += m_A29 * V[16]; + V[11] = (RHS11 - tmp11) / m_A27; + double tmp10 = 0.0; + tmp10 += m_A23 * V[15]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A18 * V[12]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[12]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[17]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[11]; + tmp5 += m_A12 * V[16]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[14]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[10]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[15]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// pong +static void nl_gcr_10_double_double_13e7b5ac1a260dbf(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A8 += go[9]; + m_A7 += go[10]; + m_A6 += go[11]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A6; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A5 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// pong +static void nl_gcr_35_double_double_dbafc5ddaf7a08f8(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[8]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A9 += go[11]; + m_A7 += go[12]; + m_A7 += go[13]; + m_A7 += go[14]; + m_A8 += go[15]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A13 += go[16]; + m_A12 += go[17]; + m_A10 += go[18]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A15 += gt[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A17 += go[23]; + m_A14 += go[24]; + m_A14 += go[25]; + m_A14 += go[26]; + double RHS5 = Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 -= go[27] * *cnV[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A19 += go[28]; + m_A20 += go[29]; + m_A18 += go[30]; + double RHS6 = Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 -= go[31] * *cnV[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A28 += gt[34]; + m_A29 += go[32]; + m_A25 += go[33]; + m_A26 += go[34]; + double RHS7 = Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + m_A34 += gt[35]; + m_A34 += gt[36]; + m_A34 += gt[37]; + m_A31 += go[35]; + m_A30 += go[36]; + m_A33 += go[37]; + double RHS8 = Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A11 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A18; + m_A22 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A25; + m_A28 += m_A5 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_5 = -f3 * m_A14; + m_A15 += m_A7 * f3_5; + m_A16 += m_A8 * f3_5; + m_A17 += m_A9 * f3_5; + RHS5 += f3_5 * RHS3; + const double f3_6 = -f3 * m_A19; + m_A21 += m_A7 * f3_6; + m_A22 += m_A8 * f3_6; + m_A24 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_8 = -f3 * m_A30; + m_A31 += m_A7 * f3_8; + m_A32 += m_A8 * f3_8; + m_A34 += m_A9 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_6 = -f4 * m_A20; + m_A22 += m_A12 * f4_6; + m_A23 += m_A13 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_7 = -f4 * m_A26; + m_A27 += m_A12 * f4_7; + m_A28 += m_A13 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A16 * f5_6; + m_A24 += m_A17 * f5_6; + RHS6 += f5_6 * RHS5; + const double f5_8 = -f5 * m_A31; + m_A32 += m_A16 * f5_8; + m_A34 += m_A17 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A22; + const double f6_7 = -f6 * m_A27; + m_A28 += m_A23 * f6_7; + m_A29 += m_A24 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A32; + m_A33 += m_A23 * f6_8; + m_A34 += m_A24 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A28; + const double f7_8 = -f7 * m_A33; + m_A34 += m_A29 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A34; + double tmp7 = 0.0; + tmp7 += m_A29 * V[8]; + V[7] = (RHS7 - tmp7) / m_A28; + double tmp6 = 0.0; + tmp6 += m_A23 * V[7]; + tmp6 += m_A24 * V[8]; + V[6] = (RHS6 - tmp6) / m_A22; + double tmp5 = 0.0; + tmp5 += m_A16 * V[6]; + tmp5 += m_A17 * V[8]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A12 * V[6]; + tmp4 += m_A13 * V[7]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A7 * V[5]; + tmp3 += m_A8 * V[6]; + tmp3 += m_A9 * V[8]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// pong +static void nl_gcr_7_double_double_e51b463cd890ef6d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A5 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// popeye +static void nl_gcr_50_double_double_c6f25bb06e161d1c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A10 += go[9]; + m_A7 += go[10]; + m_A8 += go[11]; + m_A9 += go[12]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A13 += go[15]; + m_A13 += go[16]; + m_A12 += go[17]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A16 += go[20]; + m_A15 += go[21]; + m_A15 += go[22]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A18 += go[25]; + m_A17 += go[26]; + double RHS6 = Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[27] * *cnV[27]; + m_A26 += gt[28]; + m_A26 += gt[29]; + m_A26 += gt[30]; + m_A24 += go[28]; + m_A23 += go[29]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 -= go[30] * *cnV[30]; + m_A33 += gt[31]; + m_A33 += gt[32]; + m_A33 += gt[33]; + m_A30 += go[31]; + m_A29 += go[32]; + double RHS8 = Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 -= go[33] * *cnV[33]; + m_A40 += gt[34]; + m_A40 += gt[35]; + m_A40 += gt[36]; + m_A40 += gt[37]; + m_A36 += go[34]; + m_A35 += go[35]; + double RHS9 = Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 -= go[36] * *cnV[36]; + RHS9 -= go[37] * *cnV[37]; + m_A45 += gt[38]; + m_A45 += gt[39]; + m_A45 += gt[40]; + m_A45 += gt[41]; + m_A45 += gt[42]; + m_A45 += gt[43]; + m_A45 += gt[44]; + m_A45 += gt[45]; + m_A43 += go[38]; + m_A43 += go[39]; + m_A42 += go[40]; + m_A42 += go[41]; + double RHS10 = Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 -= go[42] * *cnV[42]; + RHS10 -= go[43] * *cnV[43]; + RHS10 -= go[44] * *cnV[44]; + RHS10 -= go[45] * *cnV[45]; + m_A49 += gt[46]; + m_A49 += gt[47]; + m_A47 += go[46]; + double RHS11 = Idr[46]; + RHS11 += Idr[47]; + RHS11 -= go[47] * *cnV[47]; + const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A29; + m_A33 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A23; + m_A26 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A17; + m_A19 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A18; + m_A19 += m_A7 * f3_6; + m_A20 += m_A8 * f3_6; + m_A21 += m_A9 * f3_6; + m_A22 += m_A10 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_7 = -f3 * m_A24; + m_A25 += m_A7 * f3_7; + m_A26 += m_A8 * f3_7; + m_A27 += m_A9 * f3_7; + m_A28 += m_A10 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_8 = -f3 * m_A30; + m_A31 += m_A7 * f3_8; + m_A32 += m_A8 * f3_8; + m_A33 += m_A9 * f3_8; + m_A34 += m_A10 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A35; + m_A37 += m_A7 * f3_9; + m_A38 += m_A8 * f3_9; + m_A39 += m_A9 * f3_9; + m_A40 += m_A10 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_9 = -f4 * m_A36; + m_A40 += m_A12 * f4_9; + m_A41 += m_A13 * f4_9; + RHS9 += f4_9 * RHS4; + const double f4_10 = -f4 * m_A42; + m_A44 += m_A12 * f4_10; + m_A45 += m_A13 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_10 = -f5 * m_A43; + m_A45 += m_A15 * f5_10; + m_A46 += m_A16 * f5_10; + RHS10 += f5_10 * RHS5; + const double f5_11 = -f5 * m_A47; + m_A48 += m_A15 * f5_11; + m_A49 += m_A16 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_7 = -f6 * m_A25; + m_A26 += m_A20 * f6_7; + m_A27 += m_A21 * f6_7; + m_A28 += m_A22 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A31; + m_A32 += m_A20 * f6_8; + m_A33 += m_A21 * f6_8; + m_A34 += m_A22 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A37; + m_A38 += m_A20 * f6_9; + m_A39 += m_A21 * f6_9; + m_A40 += m_A22 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A26; + const double f7_8 = -f7 * m_A32; + m_A33 += m_A27 * f7_8; + m_A34 += m_A28 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_9 = -f7 * m_A38; + m_A39 += m_A27 * f7_9; + m_A40 += m_A28 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A33; + const double f8_9 = -f8 * m_A39; + m_A40 += m_A34 * f8_9; + RHS9 += f8_9 * RHS8; + const double f9 = 1.0 / m_A40; + const double f9_10 = -f9 * m_A44; + m_A45 += m_A41 * f9_10; + RHS10 += f9_10 * RHS9; + const double f10 = 1.0 / m_A45; + const double f10_11 = -f10 * m_A48; + m_A49 += m_A46 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A49; + double tmp10 = 0.0; + tmp10 += m_A46 * V[11]; + V[10] = (RHS10 - tmp10) / m_A45; + double tmp9 = 0.0; + tmp9 += m_A41 * V[10]; + V[9] = (RHS9 - tmp9) / m_A40; + double tmp8 = 0.0; + tmp8 += m_A34 * V[9]; + V[8] = (RHS8 - tmp8) / m_A33; + double tmp7 = 0.0; + tmp7 += m_A27 * V[8]; + tmp7 += m_A28 * V[9]; + V[7] = (RHS7 - tmp7) / m_A26; + double tmp6 = 0.0; + tmp6 += m_A20 * V[7]; + tmp6 += m_A21 * V[8]; + tmp6 += m_A22 * V[9]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A15 * V[10]; + tmp5 += m_A16 * V[11]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A12 * V[9]; + tmp4 += m_A13 * V[10]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + tmp3 += m_A8 * V[7]; + tmp3 += m_A9 * V[8]; + tmp3 += m_A10 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// rebound,astrob +static void nl_gcr_13_double_double_a41a44bd5c424f88(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A11 += go[12]; + m_A10 += go[13]; + m_A9 += go[14]; + m_A8 += go[15]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[16] * *cnV[16]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A8; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A9; + m_A12 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A7 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A7 * V[4]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// rebound +static void nl_gcr_28_double_double_8bec817b324dcc3(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[3]; + m_A4 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A6 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A7 += gt[15]; + m_A7 += gt[16]; + m_A8 += go[10]; + m_A8 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A13 += go[17]; + m_A10 += go[18]; + m_A9 += go[19]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + m_A16 += gt[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A18 += go[20]; + m_A14 += go[21]; + m_A14 += go[22]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A23 += go[27]; + m_A23 += go[28]; + m_A20 += go[29]; + m_A19 += go[30]; + m_A19 += go[31]; + double RHS6 = Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 += Idr[36]; + RHS6 -= go[32] * *cnV[32]; + RHS6 -= go[33] * *cnV[33]; + RHS6 -= go[34] * *cnV[34]; + RHS6 -= go[35] * *cnV[35]; + RHS6 -= go[36] * *cnV[36]; + m_A27 += gt[37]; + m_A27 += gt[38]; + m_A27 += gt[39]; + m_A27 += gt[40]; + m_A27 += gt[41]; + m_A26 += go[37]; + m_A26 += go[38]; + m_A25 += go[39]; + m_A24 += go[40]; + double RHS7 = Idr[37]; + RHS7 += Idr[38]; + RHS7 += Idr[39]; + RHS7 += Idr[40]; + RHS7 += Idr[41]; + RHS7 -= go[41] * *cnV[41]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A9; + m_A11 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A10; + m_A11 += m_A3 * f1_4; + m_A12 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A14; + m_A15 += m_A3 * f1_5; + m_A16 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_7 = -f2 * m_A24; + m_A27 += m_A6 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_6 = -f3 * m_A19; + m_A22 += m_A8 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_5 = -f4 * m_A15; + m_A16 += m_A12 * f4_5; + m_A17 += m_A13 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_6 = -f4 * m_A20; + m_A21 += m_A12 * f4_6; + m_A22 += m_A13 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A16; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A17 * f5_6; + m_A23 += m_A18 * f5_6; + RHS6 += f5_6 * RHS5; + const double f5_7 = -f5 * m_A25; + m_A26 += m_A17 * f5_7; + m_A27 += m_A18 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A22; + const double f6_7 = -f6 * m_A26; + m_A27 += m_A23 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A27; + double tmp6 = 0.0; + tmp6 += m_A23 * V[7]; + V[6] = (RHS6 - tmp6) / m_A22; + double tmp5 = 0.0; + tmp5 += m_A17 * V[6]; + tmp5 += m_A18 * V[7]; + V[5] = (RHS5 - tmp5) / m_A16; + double tmp4 = 0.0; + tmp4 += m_A12 * V[5]; + tmp4 += m_A13 * V[6]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A8 * V[6]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[7]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// rebound +static void nl_gcr_7_double_double_ae15f7f8a55fc96(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A5 += go[6]; + m_A4 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// ripoff,sundance +static void nl_gcr_10_double_double_43188bf576854ae0(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A5 += gt[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A6 += go[4]; + m_A4 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[6] * *cnV[6]; + m_A9 += gt[7]; + m_A9 += gt[8]; + m_A7 += go[7]; + m_A8 += go[8]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// ripoff +static void nl_gcr_11_double_double_aa07266ef5d420d1(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A6 += gt[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A7 += go[4]; + m_A5 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A10 += gt[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A8 += go[9]; + m_A9 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A9; + m_A10 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A10; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// ripoff +static void nl_gcr_16_double_double_698d5dd47fb16d5(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A7 += gt[6]; + m_A7 += gt[7]; + m_A6 += go[6]; + m_A8 += go[7]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + m_A10 += gt[8]; + m_A10 += gt[9]; + m_A9 += go[8]; + m_A11 += go[9]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + m_A15 += gt[10]; + m_A15 += gt[11]; + m_A15 += gt[12]; + m_A15 += gt[13]; + m_A14 += go[10]; + m_A13 += go[11]; + m_A12 += go[12]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 += Idr[12]; + RHS5 += Idr[13]; + RHS5 -= go[13] * *cnV[13]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A12; + m_A15 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A6; + m_A7 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A9; + m_A10 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_5 = -f3 * m_A13; + m_A15 += m_A8 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_5 = -f4 * m_A14; + m_A15 += m_A11 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A15; + double tmp4 = 0.0; + tmp4 += m_A11 * V[5]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[5]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// ripoff +static void nl_gcr_20_double_double_e60314070a75e121(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A2 += go[0]; + m_A2 += go[1]; + m_A1 += go[2]; + m_A1 += go[3]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A3 += gt[7]; + m_A3 += gt[8]; + m_A4 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A7 += go[9]; + m_A5 += go[10]; + m_A5 += go[11]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A9 += go[13]; + m_A9 += go[14]; + m_A10 += go[15]; + m_A10 += go[16]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[17] * *cnV[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A12 += go[18]; + m_A12 += go[19]; + m_A14 += go[20]; + m_A11 += go[21]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + m_A19 += gt[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A18 += go[22]; + m_A17 += go[23]; + m_A17 += go[24]; + m_A16 += go[25]; + m_A15 += go[26]; + m_A15 += go[27]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 -= go[28] * *cnV[28]; + RHS5 -= go[29] * *cnV[29]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A6 += m_A1 * f0_2; + m_A7 += m_A2 * f0_2; + RHS2 += f0_2 * RHS0; + const double f0_5 = -f0 * m_A15; + m_A16 += m_A1 * f0_5; + m_A19 += m_A2 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_4 = -f1 * m_A11; + m_A13 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_5 = -f2 * m_A16; + m_A19 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_4 = -f3 * m_A12; + m_A13 += m_A9 * f3_4; + m_A14 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A17; + m_A18 += m_A9 * f3_5; + m_A19 += m_A10 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A14 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A19; + double tmp4 = 0.0; + tmp4 += m_A14 * V[5]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A9 * V[4]; + tmp3 += m_A10 * V[5]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + tmp0 += m_A2 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// ripoff +static void nl_gcr_29_double_double_4b5ecfbb8f9fa97b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A6 += go[4]; + m_A5 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + m_A7 += gt[6]; + m_A7 += gt[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A7 += gt[10]; + m_A7 += gt[11]; + m_A7 += gt[12]; + m_A8 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[7] * *cnV[7]; + RHS3 -= go[8] * *cnV[8]; + RHS3 -= go[9] * *cnV[9]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A11 += go[13]; + m_A10 += go[14]; + double RHS4 = Idr[13]; + RHS4 += Idr[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A12 += go[15]; + m_A13 += go[16]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + m_A18 += gt[18]; + m_A18 += gt[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A19 += go[18]; + m_A19 += go[19]; + m_A16 += go[20]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 -= go[21] * *cnV[21]; + m_A22 += gt[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A21 += go[22]; + m_A20 += go[23]; + double RHS7 = Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 -= go[24] * *cnV[24]; + m_A28 += gt[25]; + m_A28 += gt[26]; + m_A28 += gt[27]; + m_A28 += gt[28]; + m_A28 += gt[29]; + m_A28 += gt[30]; + m_A24 += go[25]; + m_A25 += go[26]; + m_A26 += go[27]; + m_A26 += go[28]; + double RHS8 = Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 -= go[29] * *cnV[29]; + RHS8 -= go[30] * *cnV[30]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A20; + m_A22 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A12; + m_A14 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_5 = -f2 * m_A13; + m_A14 += m_A5 * f2_5; + m_A15 += m_A6 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_6 = -f2 * m_A16; + m_A17 += m_A5 * f2_6; + m_A18 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_8 = -f3 * m_A24; + m_A26 += m_A8 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_7 = -f4 * m_A21; + m_A22 += m_A10 * f4_7; + m_A23 += m_A11 * f4_7; + RHS7 += f4_7 * RHS4; + const double f4_8 = -f4 * m_A25; + m_A27 += m_A10 * f4_8; + m_A28 += m_A11 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_6 = -f5 * m_A17; + m_A18 += m_A15 * f5_6; + RHS6 += f5_6 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_8 = -f6 * m_A26; + m_A28 += m_A19 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_8 = -f7 * m_A27; + m_A28 += m_A23 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A28; + double tmp7 = 0.0; + tmp7 += m_A23 * V[8]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A19 * V[8]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A15 * V[6]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A10 * V[7]; + tmp4 += m_A11 * V[8]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[6]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[5]; + tmp2 += m_A6 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// ripoff +static void nl_gcr_35_double_double_76c9e236353caed1(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A3 += go[0]; + m_A2 += go[1]; + m_A1 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A10 += go[12]; + m_A9 += go[13]; + m_A8 += go[14]; + m_A7 += go[15]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 -= go[16] * *cnV[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A12 += go[17]; + m_A11 += go[18]; + double RHS3 = Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 += Idr[20]; + RHS3 -= go[19] * *cnV[19]; + RHS3 -= go[20] * *cnV[20]; + m_A20 += gt[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A20 += gt[24]; + m_A18 += go[21]; + m_A17 += go[22]; + double RHS4 = Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 -= go[23] * *cnV[23]; + RHS4 -= go[24] * *cnV[24]; + m_A27 += gt[25]; + m_A27 += gt[26]; + m_A27 += gt[27]; + m_A27 += gt[28]; + m_A24 += go[25]; + m_A23 += go[26]; + double RHS5 = Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 -= go[27] * *cnV[27]; + RHS5 -= go[28] * *cnV[28]; + m_A34 += gt[29]; + m_A34 += gt[30]; + m_A34 += gt[31]; + m_A34 += gt[32]; + m_A34 += gt[33]; + m_A34 += gt[34]; + m_A29 += go[29]; + m_A30 += go[30]; + double RHS6 = Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 -= go[31] * *cnV[31]; + RHS6 -= go[32] * *cnV[32]; + RHS6 -= go[33] * *cnV[33]; + RHS6 -= go[34] * *cnV[34]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A11; + m_A13 += m_A1 * f0_3; + m_A14 += m_A2 * f0_3; + m_A15 += m_A3 * f0_3; + RHS3 += f0_3 * RHS0; + const double f0_4 = -f0 * m_A17; + m_A19 += m_A1 * f0_4; + m_A20 += m_A2 * f0_4; + m_A21 += m_A3 * f0_4; + RHS4 += f0_4 * RHS0; + const double f0_5 = -f0 * m_A23; + m_A25 += m_A1 * f0_5; + m_A26 += m_A2 * f0_5; + m_A27 += m_A3 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A4; + const double f1_6 = -f1 * m_A29; + m_A30 += m_A5 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A12; + m_A13 += m_A7 * f2_3; + m_A14 += m_A8 * f2_3; + m_A15 += m_A9 * f2_3; + m_A16 += m_A10 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_4 = -f2 * m_A18; + m_A19 += m_A7 * f2_4; + m_A20 += m_A8 * f2_4; + m_A21 += m_A9 * f2_4; + m_A22 += m_A10 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A24; + m_A25 += m_A7 * f2_5; + m_A26 += m_A8 * f2_5; + m_A27 += m_A9 * f2_5; + m_A28 += m_A10 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_6 = -f2 * m_A30; + m_A31 += m_A7 * f2_6; + m_A32 += m_A8 * f2_6; + m_A33 += m_A9 * f2_6; + m_A34 += m_A10 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A13; + const double f3_4 = -f3 * m_A19; + m_A20 += m_A14 * f3_4; + m_A21 += m_A15 * f3_4; + m_A22 += m_A16 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A25; + m_A26 += m_A14 * f3_5; + m_A27 += m_A15 * f3_5; + m_A28 += m_A16 * f3_5; + RHS5 += f3_5 * RHS3; + const double f3_6 = -f3 * m_A31; + m_A32 += m_A14 * f3_6; + m_A33 += m_A15 * f3_6; + m_A34 += m_A16 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A20; + const double f4_5 = -f4 * m_A26; + m_A27 += m_A21 * f4_5; + m_A28 += m_A22 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_6 = -f4 * m_A32; + m_A33 += m_A21 * f4_6; + m_A34 += m_A22 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A27; + const double f5_6 = -f5 * m_A33; + m_A34 += m_A28 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A34; + double tmp5 = 0.0; + tmp5 += m_A28 * V[6]; + V[5] = (RHS5 - tmp5) / m_A27; + double tmp4 = 0.0; + tmp4 += m_A21 * V[5]; + tmp4 += m_A22 * V[6]; + V[4] = (RHS4 - tmp4) / m_A20; + double tmp3 = 0.0; + tmp3 += m_A14 * V[4]; + tmp3 += m_A15 * V[5]; + tmp3 += m_A16 * V[6]; + V[3] = (RHS3 - tmp3) / m_A13; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + tmp2 += m_A8 * V[4]; + tmp2 += m_A9 * V[5]; + tmp2 += m_A10 * V[6]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A5 * V[2]; + V[1] = (RHS1 - tmp1) / m_A4; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + tmp0 += m_A2 * V[4]; + tmp0 += m_A3 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// ripoff +static void nl_gcr_59_double_double_be7c805100c522fd(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 -= go[10] * *cnV[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A9 += go[11]; + double RHS4 = Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[12] * *cnV[12]; + RHS4 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A12 += go[14]; + m_A11 += go[15]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A14 += go[16]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 -= go[17] * *cnV[17]; + RHS6 -= go[18] * *cnV[18]; + m_A15 += gt[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A16 += go[19]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 -= go[20] * *cnV[20]; + RHS7 -= go[21] * *cnV[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A18 += go[22]; + double RHS8 = Idr[22]; + RHS8 += Idr[23]; + RHS8 += Idr[24]; + RHS8 -= go[23] * *cnV[23]; + RHS8 -= go[24] * *cnV[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A20 += go[25]; + double RHS9 = Idr[25]; + RHS9 += Idr[26]; + RHS9 += Idr[27]; + RHS9 -= go[26] * *cnV[26]; + RHS9 -= go[27] * *cnV[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A23 += go[28]; + m_A22 += go[29]; + double RHS10 = Idr[28]; + RHS10 += Idr[29]; + m_A24 += gt[30]; + m_A24 += gt[31]; + m_A24 += gt[32]; + m_A25 += go[30]; + double RHS11 = Idr[30]; + RHS11 += Idr[31]; + RHS11 += Idr[32]; + RHS11 -= go[31] * *cnV[31]; + RHS11 -= go[32] * *cnV[32]; + m_A26 += gt[33]; + m_A26 += gt[34]; + m_A26 += gt[35]; + m_A27 += go[33]; + double RHS12 = Idr[33]; + RHS12 += Idr[34]; + RHS12 += Idr[35]; + RHS12 -= go[34] * *cnV[34]; + RHS12 -= go[35] * *cnV[35]; + m_A28 += gt[36]; + m_A28 += gt[37]; + m_A28 += gt[38]; + m_A29 += go[36]; + double RHS13 = Idr[36]; + RHS13 += Idr[37]; + RHS13 += Idr[38]; + RHS13 -= go[37] * *cnV[37]; + RHS13 -= go[38] * *cnV[38]; + m_A35 += gt[39]; + m_A35 += gt[40]; + m_A35 += gt[41]; + m_A35 += gt[42]; + m_A35 += gt[43]; + m_A35 += gt[44]; + m_A34 += go[39]; + m_A33 += go[40]; + m_A32 += go[41]; + m_A31 += go[42]; + m_A30 += go[43]; + double RHS14 = Idr[39]; + RHS14 += Idr[40]; + RHS14 += Idr[41]; + RHS14 += Idr[42]; + RHS14 += Idr[43]; + RHS14 += Idr[44]; + RHS14 -= go[44] * *cnV[44]; + m_A38 += gt[45]; + m_A38 += gt[46]; + m_A37 += go[45]; + m_A39 += go[46]; + double RHS15 = Idr[45]; + RHS15 += Idr[46]; + m_A40 += gt[47]; + m_A40 += gt[48]; + m_A40 += gt[49]; + m_A41 += go[47]; + double RHS16 = Idr[47]; + RHS16 += Idr[48]; + RHS16 += Idr[49]; + RHS16 -= go[48] * *cnV[48]; + RHS16 -= go[49] * *cnV[49]; + m_A46 += gt[50]; + m_A46 += gt[51]; + m_A46 += gt[52]; + m_A43 += go[50]; + m_A45 += go[51]; + m_A42 += go[52]; + double RHS17 = Idr[50]; + RHS17 += Idr[51]; + RHS17 += Idr[52]; + m_A58 += gt[53]; + m_A58 += gt[54]; + m_A58 += gt[55]; + m_A58 += gt[56]; + m_A58 += gt[57]; + m_A58 += gt[58]; + m_A58 += gt[59]; + m_A58 += gt[60]; + m_A58 += gt[61]; + m_A58 += gt[62]; + m_A56 += go[53]; + m_A55 += go[54]; + m_A54 += go[55]; + m_A53 += go[56]; + m_A52 += go[57]; + m_A51 += go[58]; + m_A50 += go[59]; + m_A49 += go[60]; + m_A48 += go[61]; + double RHS18 = Idr[53]; + RHS18 += Idr[54]; + RHS18 += Idr[55]; + RHS18 += Idr[56]; + RHS18 += Idr[57]; + RHS18 += Idr[58]; + RHS18 += Idr[59]; + RHS18 += Idr[60]; + RHS18 += Idr[61]; + RHS18 += Idr[62]; + RHS18 -= go[62] * *cnV[62]; + const double f0 = 1.0 / m_A0; + const double f0_14 = -f0 * m_A30; + m_A35 += m_A1 * f0_14; + RHS14 += f0_14 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_14 = -f1 * m_A31; + m_A35 += m_A3 * f1_14; + RHS14 += f1_14 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_14 = -f2 * m_A32; + m_A35 += m_A5 * f2_14; + RHS14 += f2_14 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_15 = -f3 * m_A37; + m_A38 += m_A7 * f3_15; + RHS15 += f3_15 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_14 = -f4 * m_A33; + m_A35 += m_A9 * f4_14; + RHS14 += f4_14 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_14 = -f5 * m_A34; + m_A35 += m_A11 * f5_14; + m_A36 += m_A12 * f5_14; + RHS14 += f5_14 * RHS5; + const double f5_17 = -f5 * m_A42; + m_A44 += m_A11 * f5_17; + m_A46 += m_A12 * f5_17; + RHS17 += f5_17 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_18 = -f6 * m_A48; + m_A58 += m_A14 * f6_18; + RHS18 += f6_18 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_18 = -f7 * m_A49; + m_A58 += m_A16 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_18 = -f8 * m_A50; + m_A58 += m_A18 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_18 = -f9 * m_A51; + m_A58 += m_A20 * f9_18; + RHS18 += f9_18 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_17 = -f10 * m_A43; + m_A46 += m_A22 * f10_17; + m_A47 += m_A23 * f10_17; + RHS17 += f10_17 * RHS10; + const double f10_18 = -f10 * m_A52; + m_A57 += m_A22 * f10_18; + m_A58 += m_A23 * f10_18; + RHS18 += f10_18 * RHS10; + const double f11 = 1.0 / m_A24; + const double f11_18 = -f11 * m_A53; + m_A58 += m_A25 * f11_18; + RHS18 += f11_18 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_18 = -f12 * m_A54; + m_A58 += m_A27 * f12_18; + RHS18 += f12_18 * RHS12; + const double f13 = 1.0 / m_A28; + const double f13_18 = -f13 * m_A55; + m_A58 += m_A29 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A35; + const double f14_17 = -f14 * m_A44; + m_A46 += m_A36 * f14_17; + RHS17 += f14_17 * RHS14; + const double f15 = 1.0 / m_A38; + const double f15_17 = -f15 * m_A45; + m_A46 += m_A39 * f15_17; + RHS17 += f15_17 * RHS15; + const double f16 = 1.0 / m_A40; + const double f16_18 = -f16 * m_A56; + m_A58 += m_A41 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A46; + const double f17_18 = -f17 * m_A57; + m_A58 += m_A47 * f17_18; + RHS18 += f17_18 * RHS17; + V[18] = RHS18 / m_A58; + double tmp17 = 0.0; + tmp17 += m_A47 * V[18]; + V[17] = (RHS17 - tmp17) / m_A46; + double tmp16 = 0.0; + tmp16 += m_A41 * V[18]; + V[16] = (RHS16 - tmp16) / m_A40; + double tmp15 = 0.0; + tmp15 += m_A39 * V[17]; + V[15] = (RHS15 - tmp15) / m_A38; + double tmp14 = 0.0; + tmp14 += m_A36 * V[17]; + V[14] = (RHS14 - tmp14) / m_A35; + double tmp13 = 0.0; + tmp13 += m_A29 * V[18]; + V[13] = (RHS13 - tmp13) / m_A28; + double tmp12 = 0.0; + tmp12 += m_A27 * V[18]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A25 * V[18]; + V[11] = (RHS11 - tmp11) / m_A24; + double tmp10 = 0.0; + tmp10 += m_A22 * V[17]; + tmp10 += m_A23 * V[18]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + tmp9 += m_A20 * V[18]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[18]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[18]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[18]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[14]; + tmp5 += m_A12 * V[17]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[14]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[15]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[14]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[14]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[14]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// segas16b_audio +static void nl_gcr_111_double_double_9f7104c5e25c87dd(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A8 += go[9]; + m_A7 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[11] * *cnV[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A12 += go[12]; + m_A10 += go[13]; + m_A11 += go[14]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + m_A13 += gt[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A15 += go[15]; + m_A14 += go[16]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[17] * *cnV[17]; + RHS5 -= go[18] * *cnV[18]; + RHS5 -= go[19] * *cnV[19]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A17 += go[22]; + m_A18 += go[23]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A20 += go[24]; + m_A21 += go[25]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A23 += go[26]; + m_A24 += go[27]; + double RHS8 = Idr[26]; + RHS8 += Idr[27]; + m_A25 += gt[28]; + m_A25 += gt[29]; + m_A26 += go[28]; + m_A27 += go[29]; + double RHS9 = Idr[28]; + RHS9 += Idr[29]; + m_A28 += gt[30]; + m_A28 += gt[31]; + m_A29 += go[30]; + double RHS10 = Idr[30]; + RHS10 += Idr[31]; + RHS10 -= go[31] * *cnV[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A31 += go[32]; + double RHS11 = Idr[32]; + RHS11 += Idr[33]; + RHS11 += Idr[34]; + RHS11 += Idr[35]; + RHS11 -= go[33] * *cnV[33]; + RHS11 -= go[34] * *cnV[34]; + RHS11 -= go[35] * *cnV[35]; + m_A34 += gt[36]; + m_A34 += gt[37]; + m_A34 += gt[38]; + m_A33 += go[36]; + m_A32 += go[37]; + double RHS12 = Idr[36]; + RHS12 += Idr[37]; + RHS12 += Idr[38]; + RHS12 -= go[38] * *cnV[38]; + m_A37 += gt[39]; + m_A37 += gt[40]; + m_A37 += gt[41]; + m_A37 += gt[42]; + m_A37 += gt[43]; + m_A37 += gt[44]; + m_A37 += gt[45]; + m_A38 += go[39]; + m_A36 += go[40]; + double RHS13 = Idr[39]; + RHS13 += Idr[40]; + RHS13 += Idr[41]; + RHS13 += Idr[42]; + RHS13 += Idr[43]; + RHS13 += Idr[44]; + RHS13 += Idr[45]; + RHS13 -= go[41] * *cnV[41]; + RHS13 -= go[42] * *cnV[42]; + RHS13 -= go[43] * *cnV[43]; + RHS13 -= go[44] * *cnV[44]; + RHS13 -= go[45] * *cnV[45]; + m_A40 += gt[46]; + m_A40 += gt[47]; + m_A40 += gt[48]; + m_A40 += gt[49]; + m_A40 += gt[50]; + m_A40 += gt[51]; + m_A40 += gt[52]; + m_A41 += go[46]; + m_A39 += go[47]; + double RHS14 = Idr[46]; + RHS14 += Idr[47]; + RHS14 += Idr[48]; + RHS14 += Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 += Idr[52]; + RHS14 -= go[48] * *cnV[48]; + RHS14 -= go[49] * *cnV[49]; + RHS14 -= go[50] * *cnV[50]; + RHS14 -= go[51] * *cnV[51]; + RHS14 -= go[52] * *cnV[52]; + m_A44 += gt[53]; + m_A44 += gt[54]; + m_A44 += gt[55]; + m_A44 += gt[56]; + m_A45 += go[53]; + m_A43 += go[54]; + m_A42 += go[55]; + double RHS15 = Idr[53]; + RHS15 += Idr[54]; + RHS15 += Idr[55]; + RHS15 += Idr[56]; + RHS15 -= go[56] * *cnV[56]; + m_A48 += gt[57]; + m_A48 += gt[58]; + m_A48 += gt[59]; + m_A48 += gt[60]; + m_A48 += gt[61]; + m_A48 += gt[62]; + m_A48 += gt[63]; + m_A49 += go[57]; + m_A46 += go[58]; + double RHS16 = Idr[57]; + RHS16 += Idr[58]; + RHS16 += Idr[59]; + RHS16 += Idr[60]; + RHS16 += Idr[61]; + RHS16 += Idr[62]; + RHS16 += Idr[63]; + RHS16 -= go[59] * *cnV[59]; + RHS16 -= go[60] * *cnV[60]; + RHS16 -= go[61] * *cnV[61]; + RHS16 -= go[62] * *cnV[62]; + RHS16 -= go[63] * *cnV[63]; + m_A51 += gt[64]; + m_A51 += gt[65]; + m_A51 += gt[66]; + m_A53 += go[64]; + m_A50 += go[65]; + double RHS17 = Idr[64]; + RHS17 += Idr[65]; + RHS17 += Idr[66]; + RHS17 -= go[66] * *cnV[66]; + m_A58 += gt[67]; + m_A58 += gt[68]; + m_A58 += gt[69]; + m_A58 += gt[70]; + m_A58 += gt[71]; + m_A58 += gt[72]; + m_A57 += go[67]; + m_A62 += go[68]; + m_A62 += go[69]; + m_A56 += go[70]; + m_A55 += go[71]; + m_A54 += go[72]; + double RHS18 = Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + RHS18 += Idr[72]; + m_A67 += gt[73]; + m_A67 += gt[74]; + m_A67 += gt[75]; + m_A67 += gt[76]; + m_A67 += gt[77]; + m_A65 += go[73]; + m_A64 += go[74]; + m_A63 += go[75]; + double RHS19 = Idr[73]; + RHS19 += Idr[74]; + RHS19 += Idr[75]; + RHS19 += Idr[76]; + RHS19 += Idr[77]; + RHS19 -= go[76] * *cnV[76]; + RHS19 -= go[77] * *cnV[77]; + m_A76 += gt[78]; + m_A76 += gt[79]; + m_A76 += gt[80]; + m_A76 += gt[81]; + m_A76 += gt[82]; + m_A73 += go[78]; + m_A72 += go[79]; + m_A71 += go[80]; + double RHS20 = Idr[78]; + RHS20 += Idr[79]; + RHS20 += Idr[80]; + RHS20 += Idr[81]; + RHS20 += Idr[82]; + RHS20 -= go[81] * *cnV[81]; + RHS20 -= go[82] * *cnV[82]; + m_A84 += gt[83]; + m_A84 += gt[84]; + m_A84 += gt[85]; + m_A84 += gt[86]; + m_A84 += gt[87]; + m_A84 += gt[88]; + m_A82 += go[83]; + m_A80 += go[84]; + m_A79 += go[85]; + m_A81 += go[86]; + double RHS21 = Idr[83]; + RHS21 += Idr[84]; + RHS21 += Idr[85]; + RHS21 += Idr[86]; + RHS21 += Idr[87]; + RHS21 += Idr[88]; + RHS21 -= go[87] * *cnV[87]; + RHS21 -= go[88] * *cnV[88]; + m_A94 += gt[89]; + m_A94 += gt[90]; + m_A94 += gt[91]; + m_A94 += gt[92]; + m_A94 += gt[93]; + m_A94 += gt[94]; + m_A87 += go[89]; + m_A88 += go[90]; + m_A89 += go[91]; + m_A86 += go[92]; + double RHS22 = Idr[89]; + RHS22 += Idr[90]; + RHS22 += Idr[91]; + RHS22 += Idr[92]; + RHS22 += Idr[93]; + RHS22 += Idr[94]; + RHS22 -= go[93] * *cnV[93]; + RHS22 -= go[94] * *cnV[94]; + m_A101 += gt[95]; + m_A101 += gt[96]; + m_A101 += gt[97]; + m_A101 += gt[98]; + m_A101 += gt[99]; + m_A101 += gt[100]; + m_A101 += gt[101]; + m_A96 += go[95]; + m_A97 += go[96]; + double RHS23 = Idr[95]; + RHS23 += Idr[96]; + RHS23 += Idr[97]; + RHS23 += Idr[98]; + RHS23 += Idr[99]; + RHS23 += Idr[100]; + RHS23 += Idr[101]; + RHS23 -= go[97] * *cnV[97]; + RHS23 -= go[98] * *cnV[98]; + RHS23 -= go[99] * *cnV[99]; + RHS23 -= go[100] * *cnV[100]; + RHS23 -= go[101] * *cnV[101]; + m_A110 += gt[102]; + m_A110 += gt[103]; + m_A110 += gt[104]; + m_A110 += gt[105]; + m_A110 += gt[106]; + m_A110 += gt[107]; + m_A109 += go[102]; + m_A103 += go[103]; + m_A105 += go[104]; + m_A105 += go[105]; + double RHS24 = Idr[102]; + RHS24 += Idr[103]; + RHS24 += Idr[104]; + RHS24 += Idr[105]; + RHS24 += Idr[106]; + RHS24 += Idr[107]; + RHS24 -= go[106] * *cnV[106]; + RHS24 -= go[107] * *cnV[107]; + const double f0 = 1.0 / m_A0; + const double f0_13 = -f0 * m_A36; + m_A38 += m_A1 * f0_13; + RHS13 += f0_13 * RHS0; + const double f0_19 = -f0 * m_A63; + m_A67 += m_A1 * f0_19; + RHS19 += f0_19 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_14 = -f1 * m_A39; + m_A41 += m_A3 * f1_14; + RHS14 += f1_14 * RHS1; + const double f1_20 = -f1 * m_A71; + m_A76 += m_A3 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_15 = -f2 * m_A42; + m_A44 += m_A5 * f2_15; + RHS15 += f2_15 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_15 = -f3 * m_A43; + m_A44 += m_A7 * f3_15; + m_A45 += m_A8 * f3_15; + RHS15 += f3_15 * RHS3; + const double f3_16 = -f3 * m_A46; + m_A47 += m_A7 * f3_16; + m_A49 += m_A8 * f3_16; + RHS16 += f3_16 * RHS3; + const double f3_21 = -f3 * m_A79; + m_A81 += m_A7 * f3_21; + m_A84 += m_A8 * f3_21; + RHS21 += f3_21 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_17 = -f4 * m_A50; + m_A51 += m_A10 * f4_17; + m_A52 += m_A11 * f4_17; + m_A53 += m_A12 * f4_17; + RHS17 += f4_17 * RHS4; + const double f4_21 = -f4 * m_A80; + m_A83 += m_A10 * f4_21; + m_A84 += m_A11 * f4_21; + m_A85 += m_A12 * f4_21; + RHS21 += f4_21 * RHS4; + const double f4_22 = -f4 * m_A86; + m_A89 += m_A10 * f4_22; + m_A93 += m_A11 * f4_22; + m_A94 += m_A12 * f4_22; + RHS22 += f4_22 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_22 = -f5 * m_A87; + m_A89 += m_A14 * f5_22; + m_A94 += m_A15 * f5_22; + RHS22 += f5_22 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_18 = -f6 * m_A54; + m_A58 += m_A17 * f6_18; + m_A61 += m_A18 * f6_18; + RHS18 += f6_18 * RHS6; + const double f6_22 = -f6 * m_A88; + m_A90 += m_A17 * f6_22; + m_A94 += m_A18 * f6_22; + RHS22 += f6_22 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_18 = -f7 * m_A55; + m_A58 += m_A20 * f7_18; + m_A59 += m_A21 * f7_18; + RHS18 += f7_18 * RHS7; + const double f7_19 = -f7 * m_A64; + m_A66 += m_A20 * f7_19; + m_A67 += m_A21 * f7_19; + RHS19 += f7_19 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_18 = -f8 * m_A56; + m_A58 += m_A23 * f8_18; + m_A60 += m_A24 * f8_18; + RHS18 += f8_18 * RHS8; + const double f8_20 = -f8 * m_A72; + m_A74 += m_A23 * f8_20; + m_A76 += m_A24 * f8_20; + RHS20 += f8_20 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_12 = -f9 * m_A32; + m_A34 += m_A26 * f9_12; + m_A35 += m_A27 * f9_12; + RHS12 += f9_12 * RHS9; + const double f9_24 = -f9 * m_A103; + m_A104 += m_A26 * f9_24; + m_A110 += m_A27 * f9_24; + RHS24 += f9_24 * RHS9; + const double f10 = 1.0 / m_A28; + const double f10_12 = -f10 * m_A33; + m_A34 += m_A29 * f10_12; + RHS12 += f10_12 * RHS10; + const double f11 = 1.0 / m_A30; + const double f11_18 = -f11 * m_A57; + m_A58 += m_A31 * f11_18; + RHS18 += f11_18 * RHS11; + const double f11_23 = -f11 * m_A96; + m_A97 += m_A31 * f11_23; + RHS23 += f11_23 * RHS11; + const double f12 = 1.0 / m_A34; + const double f12_24 = -f12 * m_A104; + m_A110 += m_A35 * f12_24; + RHS24 += f12_24 * RHS12; + const double f13 = 1.0 / m_A37; + const double f13_19 = -f13 * m_A65; + m_A67 += m_A38 * f13_19; + RHS19 += f13_19 * RHS13; + const double f14 = 1.0 / m_A40; + const double f14_20 = -f14 * m_A73; + m_A76 += m_A41 * f14_20; + RHS20 += f14_20 * RHS14; + const double f15 = 1.0 / m_A44; + const double f15_16 = -f15 * m_A47; + m_A49 += m_A45 * f15_16; + RHS16 += f15_16 * RHS15; + const double f15_21 = -f15 * m_A81; + m_A84 += m_A45 * f15_21; + RHS21 += f15_21 * RHS15; + const double f16 = 1.0 / m_A48; + const double f16_21 = -f16 * m_A82; + m_A84 += m_A49 * f16_21; + RHS21 += f16_21 * RHS16; + const double f17 = 1.0 / m_A51; + const double f17_21 = -f17 * m_A83; + m_A84 += m_A52 * f17_21; + m_A85 += m_A53 * f17_21; + RHS21 += f17_21 * RHS17; + const double f17_22 = -f17 * m_A89; + m_A93 += m_A52 * f17_22; + m_A94 += m_A53 * f17_22; + RHS22 += f17_22 * RHS17; + const double f18 = 1.0 / m_A58; + const double f18_19 = -f18 * m_A66; + m_A67 += m_A59 * f18_19; + m_A68 += m_A60 * f18_19; + m_A69 += m_A61 * f18_19; + m_A70 += m_A62 * f18_19; + RHS19 += f18_19 * RHS18; + const double f18_20 = -f18 * m_A74; + m_A75 += m_A59 * f18_20; + m_A76 += m_A60 * f18_20; + m_A77 += m_A61 * f18_20; + m_A78 += m_A62 * f18_20; + RHS20 += f18_20 * RHS18; + const double f18_22 = -f18 * m_A90; + m_A91 += m_A59 * f18_22; + m_A92 += m_A60 * f18_22; + m_A94 += m_A61 * f18_22; + m_A95 += m_A62 * f18_22; + RHS22 += f18_22 * RHS18; + const double f18_23 = -f18 * m_A97; + m_A98 += m_A59 * f18_23; + m_A99 += m_A60 * f18_23; + m_A100 += m_A61 * f18_23; + m_A102 += m_A62 * f18_23; + RHS23 += f18_23 * RHS18; + const double f18_24 = -f18 * m_A105; + m_A106 += m_A59 * f18_24; + m_A107 += m_A60 * f18_24; + m_A108 += m_A61 * f18_24; + m_A110 += m_A62 * f18_24; + RHS24 += f18_24 * RHS18; + const double f19 = 1.0 / m_A67; + const double f19_20 = -f19 * m_A75; + m_A76 += m_A68 * f19_20; + m_A77 += m_A69 * f19_20; + m_A78 += m_A70 * f19_20; + RHS20 += f19_20 * RHS19; + const double f19_22 = -f19 * m_A91; + m_A92 += m_A68 * f19_22; + m_A94 += m_A69 * f19_22; + m_A95 += m_A70 * f19_22; + RHS22 += f19_22 * RHS19; + const double f19_23 = -f19 * m_A98; + m_A99 += m_A68 * f19_23; + m_A100 += m_A69 * f19_23; + m_A102 += m_A70 * f19_23; + RHS23 += f19_23 * RHS19; + const double f19_24 = -f19 * m_A106; + m_A107 += m_A68 * f19_24; + m_A108 += m_A69 * f19_24; + m_A110 += m_A70 * f19_24; + RHS24 += f19_24 * RHS19; + const double f20 = 1.0 / m_A76; + const double f20_22 = -f20 * m_A92; + m_A94 += m_A77 * f20_22; + m_A95 += m_A78 * f20_22; + RHS22 += f20_22 * RHS20; + const double f20_23 = -f20 * m_A99; + m_A100 += m_A77 * f20_23; + m_A102 += m_A78 * f20_23; + RHS23 += f20_23 * RHS20; + const double f20_24 = -f20 * m_A107; + m_A108 += m_A77 * f20_24; + m_A110 += m_A78 * f20_24; + RHS24 += f20_24 * RHS20; + const double f21 = 1.0 / m_A84; + const double f21_22 = -f21 * m_A93; + m_A94 += m_A85 * f21_22; + RHS22 += f21_22 * RHS21; + const double f22 = 1.0 / m_A94; + const double f22_23 = -f22 * m_A100; + m_A102 += m_A95 * f22_23; + RHS23 += f22_23 * RHS22; + const double f22_24 = -f22 * m_A108; + m_A110 += m_A95 * f22_24; + RHS24 += f22_24 * RHS22; + const double f23 = 1.0 / m_A101; + const double f23_24 = -f23 * m_A109; + m_A110 += m_A102 * f23_24; + RHS24 += f23_24 * RHS23; + V[24] = RHS24 / m_A110; + double tmp23 = 0.0; + tmp23 += m_A102 * V[24]; + V[23] = (RHS23 - tmp23) / m_A101; + double tmp22 = 0.0; + tmp22 += m_A95 * V[24]; + V[22] = (RHS22 - tmp22) / m_A94; + double tmp21 = 0.0; + tmp21 += m_A85 * V[22]; + V[21] = (RHS21 - tmp21) / m_A84; + double tmp20 = 0.0; + tmp20 += m_A77 * V[22]; + tmp20 += m_A78 * V[24]; + V[20] = (RHS20 - tmp20) / m_A76; + double tmp19 = 0.0; + tmp19 += m_A68 * V[20]; + tmp19 += m_A69 * V[22]; + tmp19 += m_A70 * V[24]; + V[19] = (RHS19 - tmp19) / m_A67; + double tmp18 = 0.0; + tmp18 += m_A59 * V[19]; + tmp18 += m_A60 * V[20]; + tmp18 += m_A61 * V[22]; + tmp18 += m_A62 * V[24]; + V[18] = (RHS18 - tmp18) / m_A58; + double tmp17 = 0.0; + tmp17 += m_A52 * V[21]; + tmp17 += m_A53 * V[22]; + V[17] = (RHS17 - tmp17) / m_A51; + double tmp16 = 0.0; + tmp16 += m_A49 * V[21]; + V[16] = (RHS16 - tmp16) / m_A48; + double tmp15 = 0.0; + tmp15 += m_A45 * V[21]; + V[15] = (RHS15 - tmp15) / m_A44; + double tmp14 = 0.0; + tmp14 += m_A41 * V[20]; + V[14] = (RHS14 - tmp14) / m_A40; + double tmp13 = 0.0; + tmp13 += m_A38 * V[19]; + V[13] = (RHS13 - tmp13) / m_A37; + double tmp12 = 0.0; + tmp12 += m_A35 * V[24]; + V[12] = (RHS12 - tmp12) / m_A34; + double tmp11 = 0.0; + tmp11 += m_A31 * V[18]; + V[11] = (RHS11 - tmp11) / m_A30; + double tmp10 = 0.0; + tmp10 += m_A29 * V[12]; + V[10] = (RHS10 - tmp10) / m_A28; + double tmp9 = 0.0; + tmp9 += m_A26 * V[12]; + tmp9 += m_A27 * V[24]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A23 * V[18]; + tmp8 += m_A24 * V[20]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A20 * V[18]; + tmp7 += m_A21 * V[19]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A17 * V[18]; + tmp6 += m_A18 * V[22]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[17]; + tmp5 += m_A15 * V[22]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A10 * V[17]; + tmp4 += m_A11 * V[21]; + tmp4 += m_A12 * V[22]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A7 * V[15]; + tmp3 += m_A8 * V[21]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[15]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[20]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[19]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// segaspeech +static void nl_gcr_21_double_double_b22769fbf3159a8d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A4 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A6 += go[8]; + m_A7 += go[9]; + m_A7 += go[10]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A10 += gt[13]; + m_A10 += gt[14]; + m_A9 += go[13]; + m_A8 += go[14]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A15 += go[15]; + m_A12 += go[16]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A20 += gt[24]; + m_A20 += gt[25]; + m_A17 += go[22]; + m_A17 += go[23]; + m_A16 += go[24]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[25] * *cnV[25]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A12; + m_A13 += m_A3 * f1_4; + m_A15 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A16; + m_A18 += m_A3 * f1_5; + m_A20 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_5 = -f2 * m_A17; + m_A19 += m_A6 * f2_5; + m_A20 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A13; + m_A15 += m_A11 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A18; + m_A20 += m_A11 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A14; + const double f4_5 = -f4 * m_A19; + m_A20 += m_A15 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A20; + double tmp4 = 0.0; + tmp4 += m_A15 * V[5]; + V[4] = (RHS4 - tmp4) / m_A14; + double tmp3 = 0.0; + tmp3 += m_A11 * V[5]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// segausb +static void nl_gcr_12_double_double_5b73834d5f313d38(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A7 += gt[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A6 += go[7]; + m_A5 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[9] * *cnV[9]; + m_A11 += gt[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A9 += go[10]; + m_A10 += go[11]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A7 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A6; + m_A7 += m_A3 * f1_2; + m_A8 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A8 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A8 * V[3]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// segausb +static void nl_gcr_30_double_double_8cc4eb213eaeef9b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 -= go[8] * *cnV[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A10 += go[9]; + m_A9 += go[10]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + RHS4 += Idr[11]; + RHS4 -= go[11] * *cnV[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A13 += go[12]; + m_A12 += go[13]; + double RHS5 = Idr[12]; + RHS5 += Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[14] * *cnV[14]; + RHS5 -= go[15] * *cnV[15]; + m_A19 += gt[16]; + m_A19 += gt[17]; + m_A19 += gt[18]; + m_A19 += gt[19]; + m_A19 += gt[20]; + m_A19 += gt[21]; + m_A18 += go[16]; + m_A17 += go[17]; + m_A16 += go[18]; + m_A15 += go[19]; + m_A14 += go[20]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 -= go[21] * *cnV[21]; + m_A24 += gt[22]; + m_A24 += gt[23]; + m_A24 += gt[24]; + m_A22 += go[22]; + m_A21 += go[23]; + double RHS7 = Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 -= go[24] * *cnV[24]; + m_A29 += gt[25]; + m_A29 += gt[26]; + m_A29 += gt[27]; + m_A29 += gt[28]; + m_A29 += gt[29]; + m_A29 += gt[30]; + m_A29 += gt[31]; + m_A28 += go[25]; + m_A26 += go[26]; + double RHS8 = Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[27] * *cnV[27]; + RHS8 -= go[28] * *cnV[28]; + RHS8 -= go[29] * *cnV[29]; + RHS8 -= go[30] * *cnV[30]; + RHS8 -= go[31] * *cnV[31]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A14; + m_A19 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A15; + m_A19 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A16; + m_A19 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A17; + m_A19 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_6 = -f4 * m_A18; + m_A19 += m_A9 * f4_6; + m_A20 += m_A10 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_7 = -f4 * m_A21; + m_A23 += m_A9 * f4_7; + m_A24 += m_A10 * f4_7; + RHS7 += f4_7 * RHS4; + const double f4_8 = -f4 * m_A26; + m_A27 += m_A9 * f4_8; + m_A28 += m_A10 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_7 = -f5 * m_A22; + m_A24 += m_A12 * f5_7; + m_A25 += m_A13 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_7 = -f6 * m_A23; + m_A24 += m_A20 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A27; + m_A28 += m_A20 * f6_8; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A24; + const double f7_8 = -f7 * m_A28; + m_A29 += m_A25 * f7_8; + RHS8 += f7_8 * RHS7; + V[8] = RHS8 / m_A29; + double tmp7 = 0.0; + tmp7 += m_A25 * V[8]; + V[7] = (RHS7 - tmp7) / m_A24; + double tmp6 = 0.0; + tmp6 += m_A20 * V[7]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A12 * V[7]; + tmp5 += m_A13 * V[8]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[6]; + tmp4 += m_A10 * V[7]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// segausb +static void nl_gcr_84_double_double_c61e08cf5e35918(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + m_A2 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + m_A3 += gt[2]; + m_A3 += gt[3]; + m_A5 += go[2]; + m_A4 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + m_A6 += gt[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[4]; + m_A8 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A10 += go[11]; + m_A11 += go[12]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A12 += gt[14]; + m_A13 += go[14]; + double RHS4 = Idr[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A16 += go[15]; + m_A15 += go[16]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + m_A17 += gt[17]; + m_A17 += gt[18]; + m_A18 += go[17]; + double RHS6 = Idr[17]; + RHS6 += Idr[18]; + RHS6 -= go[18] * *cnV[18]; + m_A19 += gt[19]; + m_A19 += gt[20]; + m_A19 += gt[21]; + m_A19 += gt[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A20 += go[19]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 -= go[20] * *cnV[20]; + RHS7 -= go[21] * *cnV[21]; + RHS7 -= go[22] * *cnV[22]; + RHS7 -= go[23] * *cnV[23]; + RHS7 -= go[24] * *cnV[24]; + RHS7 -= go[25] * *cnV[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A21 += gt[30]; + m_A21 += gt[31]; + m_A21 += gt[32]; + m_A22 += go[26]; + double RHS8 = Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 -= go[27] * *cnV[27]; + RHS8 -= go[28] * *cnV[28]; + RHS8 -= go[29] * *cnV[29]; + RHS8 -= go[30] * *cnV[30]; + RHS8 -= go[31] * *cnV[31]; + RHS8 -= go[32] * *cnV[32]; + m_A23 += gt[33]; + m_A23 += gt[34]; + m_A25 += go[33]; + m_A24 += go[34]; + double RHS9 = Idr[33]; + RHS9 += Idr[34]; + m_A28 += gt[35]; + m_A28 += gt[36]; + m_A28 += gt[37]; + m_A28 += gt[38]; + m_A28 += gt[39]; + m_A28 += gt[40]; + m_A30 += go[35]; + m_A27 += go[36]; + m_A26 += go[37]; + m_A29 += go[38]; + double RHS10 = Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 -= go[39] * *cnV[39]; + RHS10 -= go[40] * *cnV[40]; + m_A34 += gt[41]; + m_A34 += gt[42]; + m_A34 += gt[43]; + m_A34 += gt[44]; + m_A34 += gt[45]; + m_A34 += gt[46]; + m_A31 += go[41]; + m_A33 += go[42]; + m_A37 += go[43]; + m_A32 += go[44]; + double RHS11 = Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 += Idr[46]; + RHS11 -= go[45] * *cnV[45]; + RHS11 -= go[46] * *cnV[46]; + m_A41 += gt[47]; + m_A41 += gt[48]; + m_A41 += gt[49]; + m_A41 += gt[50]; + m_A44 += go[47]; + m_A39 += go[48]; + m_A38 += go[49]; + double RHS12 = Idr[47]; + RHS12 += Idr[48]; + RHS12 += Idr[49]; + RHS12 += Idr[50]; + RHS12 -= go[50] * *cnV[50]; + m_A45 += gt[51]; + m_A45 += gt[52]; + m_A45 += gt[53]; + m_A45 += gt[54]; + m_A45 += gt[55]; + m_A46 += go[51]; + double RHS13 = Idr[51]; + RHS13 += Idr[52]; + RHS13 += Idr[53]; + RHS13 += Idr[54]; + RHS13 += Idr[55]; + RHS13 -= go[52] * *cnV[52]; + RHS13 -= go[53] * *cnV[53]; + RHS13 -= go[54] * *cnV[54]; + RHS13 -= go[55] * *cnV[55]; + m_A50 += gt[56]; + m_A50 += gt[57]; + m_A50 += gt[58]; + m_A50 += gt[59]; + m_A50 += gt[60]; + m_A49 += go[56]; + m_A48 += go[57]; + m_A47 += go[58]; + double RHS14 = Idr[56]; + RHS14 += Idr[57]; + RHS14 += Idr[58]; + RHS14 += Idr[59]; + RHS14 += Idr[60]; + RHS14 -= go[59] * *cnV[59]; + RHS14 -= go[60] * *cnV[60]; + m_A59 += gt[61]; + m_A59 += gt[62]; + m_A59 += gt[63]; + m_A59 += gt[64]; + m_A54 += go[61]; + m_A53 += go[62]; + m_A55 += go[63]; + double RHS15 = Idr[61]; + RHS15 += Idr[62]; + RHS15 += Idr[63]; + RHS15 += Idr[64]; + RHS15 -= go[64] * *cnV[64]; + m_A67 += gt[65]; + m_A67 += gt[66]; + m_A67 += gt[67]; + m_A63 += go[65]; + m_A69 += go[66]; + m_A64 += go[67]; + double RHS16 = Idr[65]; + RHS16 += Idr[66]; + RHS16 += Idr[67]; + m_A74 += gt[68]; + m_A74 += gt[69]; + m_A74 += gt[70]; + m_A74 += gt[71]; + m_A70 += go[68]; + m_A71 += go[69]; + double RHS17 = Idr[68]; + RHS17 += Idr[69]; + RHS17 += Idr[70]; + RHS17 += Idr[71]; + RHS17 -= go[70] * *cnV[70]; + RHS17 -= go[71] * *cnV[71]; + m_A83 += gt[72]; + m_A83 += gt[73]; + m_A83 += gt[74]; + m_A83 += gt[75]; + m_A83 += gt[76]; + m_A83 += gt[77]; + m_A76 += go[72]; + m_A78 += go[73]; + m_A81 += go[74]; + m_A77 += go[75]; + double RHS18 = Idr[72]; + RHS18 += Idr[73]; + RHS18 += Idr[74]; + RHS18 += Idr[75]; + RHS18 += Idr[76]; + RHS18 += Idr[77]; + RHS18 -= go[76] * *cnV[76]; + RHS18 -= go[77] * *cnV[77]; + const double f0 = 1.0 / m_A0; + const double f0_10 = -f0 * m_A26; + m_A28 += m_A1 * f0_10; + m_A29 += m_A2 * f0_10; + RHS10 += f0_10 * RHS0; + const double f0_14 = -f0 * m_A47; + m_A49 += m_A1 * f0_14; + m_A50 += m_A2 * f0_14; + RHS14 += f0_14 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_10 = -f1 * m_A27; + m_A28 += m_A4 * f1_10; + m_A30 += m_A5 * f1_10; + RHS10 += f1_10 * RHS1; + const double f1_15 = -f1 * m_A53; + m_A55 += m_A4 * f1_15; + m_A59 += m_A5 * f1_15; + RHS15 += f1_15 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_11 = -f2 * m_A31; + m_A32 += m_A7 * f2_11; + m_A36 += m_A8 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_11 = -f3 * m_A32; + m_A34 += m_A10 * f3_11; + m_A36 += m_A11 * f3_11; + RHS11 += f3_11 * RHS3; + const double f3_15 = -f3 * m_A54; + m_A56 += m_A10 * f3_15; + m_A59 += m_A11 * f3_15; + RHS15 += f3_15 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_16 = -f4 * m_A63; + m_A67 += m_A13 * f4_16; + RHS16 += f4_16 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_11 = -f5 * m_A33; + m_A34 += m_A15 * f5_11; + m_A35 += m_A16 * f5_11; + RHS11 += f5_11 * RHS5; + const double f5_12 = -f5 * m_A38; + m_A40 += m_A15 * f5_12; + m_A41 += m_A16 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_12 = -f6 * m_A39; + m_A41 += m_A18 * f6_12; + RHS12 += f6_12 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_17 = -f7 * m_A70; + m_A71 += m_A20 * f7_17; + RHS17 += f7_17 * RHS7; + const double f8 = 1.0 / m_A21; + const double f8_18 = -f8 * m_A76; + m_A78 += m_A22 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A23; + const double f9_14 = -f9 * m_A48; + m_A50 += m_A24 * f9_14; + m_A52 += m_A25 * f9_14; + RHS14 += f9_14 * RHS9; + const double f9_18 = -f9 * m_A77; + m_A79 += m_A24 * f9_18; + m_A83 += m_A25 * f9_18; + RHS18 += f9_18 * RHS9; + const double f10 = 1.0 / m_A28; + const double f10_14 = -f10 * m_A49; + m_A50 += m_A29 * f10_14; + m_A51 += m_A30 * f10_14; + RHS14 += f10_14 * RHS10; + const double f10_15 = -f10 * m_A55; + m_A58 += m_A29 * f10_15; + m_A59 += m_A30 * f10_15; + RHS15 += f10_15 * RHS10; + const double f11 = 1.0 / m_A34; + const double f11_12 = -f11 * m_A40; + m_A41 += m_A35 * f11_12; + m_A42 += m_A36 * f11_12; + m_A43 += m_A37 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_15 = -f11 * m_A56; + m_A57 += m_A35 * f11_15; + m_A59 += m_A36 * f11_15; + m_A60 += m_A37 * f11_15; + RHS15 += f11_15 * RHS11; + const double f11_16 = -f11 * m_A64; + m_A65 += m_A35 * f11_16; + m_A66 += m_A36 * f11_16; + m_A67 += m_A37 * f11_16; + RHS16 += f11_16 * RHS11; + const double f12 = 1.0 / m_A41; + const double f12_15 = -f12 * m_A57; + m_A59 += m_A42 * f12_15; + m_A60 += m_A43 * f12_15; + m_A61 += m_A44 * f12_15; + RHS15 += f12_15 * RHS12; + const double f12_16 = -f12 * m_A65; + m_A66 += m_A42 * f12_16; + m_A67 += m_A43 * f12_16; + m_A68 += m_A44 * f12_16; + RHS16 += f12_16 * RHS12; + const double f12_17 = -f12 * m_A71; + m_A72 += m_A42 * f12_17; + m_A73 += m_A43 * f12_17; + m_A74 += m_A44 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A45; + const double f13_18 = -f13 * m_A78; + m_A83 += m_A46 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A50; + const double f14_15 = -f14 * m_A58; + m_A59 += m_A51 * f14_15; + m_A62 += m_A52 * f14_15; + RHS15 += f14_15 * RHS14; + const double f14_18 = -f14 * m_A79; + m_A80 += m_A51 * f14_18; + m_A83 += m_A52 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A59; + const double f15_16 = -f15 * m_A66; + m_A67 += m_A60 * f15_16; + m_A68 += m_A61 * f15_16; + m_A69 += m_A62 * f15_16; + RHS16 += f15_16 * RHS15; + const double f15_17 = -f15 * m_A72; + m_A73 += m_A60 * f15_17; + m_A74 += m_A61 * f15_17; + m_A75 += m_A62 * f15_17; + RHS17 += f15_17 * RHS15; + const double f15_18 = -f15 * m_A80; + m_A81 += m_A60 * f15_18; + m_A82 += m_A61 * f15_18; + m_A83 += m_A62 * f15_18; + RHS18 += f15_18 * RHS15; + const double f16 = 1.0 / m_A67; + const double f16_17 = -f16 * m_A73; + m_A74 += m_A68 * f16_17; + m_A75 += m_A69 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_18 = -f16 * m_A81; + m_A82 += m_A68 * f16_18; + m_A83 += m_A69 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A74; + const double f17_18 = -f17 * m_A82; + m_A83 += m_A75 * f17_18; + RHS18 += f17_18 * RHS17; + V[18] = RHS18 / m_A83; + double tmp17 = 0.0; + tmp17 += m_A75 * V[18]; + V[17] = (RHS17 - tmp17) / m_A74; + double tmp16 = 0.0; + tmp16 += m_A68 * V[17]; + tmp16 += m_A69 * V[18]; + V[16] = (RHS16 - tmp16) / m_A67; + double tmp15 = 0.0; + tmp15 += m_A60 * V[16]; + tmp15 += m_A61 * V[17]; + tmp15 += m_A62 * V[18]; + V[15] = (RHS15 - tmp15) / m_A59; + double tmp14 = 0.0; + tmp14 += m_A51 * V[15]; + tmp14 += m_A52 * V[18]; + V[14] = (RHS14 - tmp14) / m_A50; + double tmp13 = 0.0; + tmp13 += m_A46 * V[18]; + V[13] = (RHS13 - tmp13) / m_A45; + double tmp12 = 0.0; + tmp12 += m_A42 * V[15]; + tmp12 += m_A43 * V[16]; + tmp12 += m_A44 * V[17]; + V[12] = (RHS12 - tmp12) / m_A41; + double tmp11 = 0.0; + tmp11 += m_A35 * V[12]; + tmp11 += m_A36 * V[15]; + tmp11 += m_A37 * V[16]; + V[11] = (RHS11 - tmp11) / m_A34; + double tmp10 = 0.0; + tmp10 += m_A29 * V[14]; + tmp10 += m_A30 * V[15]; + V[10] = (RHS10 - tmp10) / m_A28; + double tmp9 = 0.0; + tmp9 += m_A24 * V[14]; + tmp9 += m_A25 * V[18]; + V[9] = (RHS9 - tmp9) / m_A23; + double tmp8 = 0.0; + tmp8 += m_A22 * V[13]; + V[8] = (RHS8 - tmp8) / m_A21; + double tmp7 = 0.0; + tmp7 += m_A20 * V[12]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A18 * V[12]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A15 * V[11]; + tmp5 += m_A16 * V[12]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A13 * V[16]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A10 * V[11]; + tmp3 += m_A11 * V[15]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + tmp2 += m_A8 * V[15]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[10]; + tmp1 += m_A5 * V[15]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[10]; + tmp0 += m_A2 * V[14]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sfxphasor +static void nl_gcr_40_double_double_53bd9f9a45276ed0(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[8]; + m_A7 += go[9]; + m_A6 += go[10]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A9 += go[11]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A11 += go[14]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[15] * *cnV[15]; + RHS4 -= go[16] * *cnV[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A13 += go[17]; + m_A13 += go[18]; + m_A13 += go[19]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A15 += go[22]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A17 += go[25]; + m_A16 += go[26]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + m_A24 += gt[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A24 += gt[30]; + m_A24 += gt[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A24 += gt[34]; + m_A22 += go[27]; + m_A25 += go[28]; + m_A25 += go[29]; + m_A21 += go[30]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 -= go[31] * *cnV[31]; + RHS8 -= go[32] * *cnV[32]; + RHS8 -= go[33] * *cnV[33]; + RHS8 -= go[34] * *cnV[34]; + m_A27 += gt[35]; + m_A27 += gt[36]; + m_A27 += gt[37]; + m_A27 += gt[38]; + m_A27 += gt[39]; + m_A27 += gt[40]; + m_A27 += gt[41]; + m_A27 += gt[42]; + m_A26 += go[35]; + m_A26 += go[36]; + m_A26 += go[37]; + m_A28 += go[38]; + m_A28 += go[39]; + double RHS9 = Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + RHS9 += Idr[42]; + RHS9 -= go[40] * *cnV[40]; + RHS9 -= go[41] * *cnV[41]; + RHS9 -= go[42] * *cnV[42]; + m_A32 += gt[43]; + m_A32 += gt[44]; + m_A32 += gt[45]; + m_A32 += gt[46]; + m_A32 += gt[47]; + m_A33 += go[43]; + m_A29 += go[44]; + m_A31 += go[45]; + m_A31 += go[46]; + double RHS10 = Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + RHS10 += Idr[47]; + RHS10 -= go[47] * *cnV[47]; + m_A39 += gt[48]; + m_A39 += gt[49]; + m_A39 += gt[50]; + m_A39 += gt[51]; + m_A39 += gt[52]; + m_A39 += gt[53]; + m_A39 += gt[54]; + m_A39 += gt[55]; + m_A39 += gt[56]; + m_A37 += go[48]; + m_A37 += go[49]; + m_A36 += go[50]; + m_A35 += go[51]; + m_A34 += go[52]; + m_A38 += go[53]; + double RHS11 = Idr[48]; + RHS11 += Idr[49]; + RHS11 += Idr[50]; + RHS11 += Idr[51]; + RHS11 += Idr[52]; + RHS11 += Idr[53]; + RHS11 += Idr[54]; + RHS11 += Idr[55]; + RHS11 += Idr[56]; + RHS11 -= go[54] * *cnV[54]; + RHS11 -= go[55] * *cnV[55]; + RHS11 -= go[56] * *cnV[56]; + const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A21; + m_A24 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A16; + m_A18 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A17; + m_A18 += m_A5 * f2_7; + m_A19 += m_A6 * f2_7; + m_A20 += m_A7 * f2_7; + RHS7 += f2_7 * RHS2; + const double f2_8 = -f2 * m_A22; + m_A23 += m_A5 * f2_8; + m_A24 += m_A6 * f2_8; + m_A25 += m_A7 * f2_8; + RHS8 += f2_8 * RHS2; + const double f2_10 = -f2 * m_A29; + m_A30 += m_A5 * f2_10; + m_A31 += m_A6 * f2_10; + m_A32 += m_A7 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_11 = -f3 * m_A34; + m_A39 += m_A9 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_11 = -f4 * m_A35; + m_A39 += m_A11 * f4_11; + RHS11 += f4_11 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_9 = -f5 * m_A26; + m_A27 += m_A13 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_11 = -f6 * m_A36; + m_A39 += m_A15 * f6_11; + RHS11 += f6_11 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_8 = -f7 * m_A23; + m_A24 += m_A19 * f7_8; + m_A25 += m_A20 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_10 = -f7 * m_A30; + m_A31 += m_A19 * f7_10; + m_A32 += m_A20 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A24; + const double f8_10 = -f8 * m_A31; + m_A32 += m_A25 * f8_10; + RHS10 += f8_10 * RHS8; + const double f9 = 1.0 / m_A27; + const double f9_11 = -f9 * m_A37; + m_A39 += m_A28 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A32; + const double f10_11 = -f10 * m_A38; + m_A39 += m_A33 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A39; + double tmp10 = 0.0; + tmp10 += m_A33 * V[11]; + V[10] = (RHS10 - tmp10) / m_A32; + double tmp9 = 0.0; + tmp9 += m_A28 * V[11]; + V[9] = (RHS9 - tmp9) / m_A27; + double tmp8 = 0.0; + tmp8 += m_A25 * V[10]; + V[8] = (RHS8 - tmp8) / m_A24; + double tmp7 = 0.0; + tmp7 += m_A19 * V[8]; + tmp7 += m_A20 * V[10]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A15 * V[11]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A13 * V[9]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A11 * V[11]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[11]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + tmp2 += m_A6 * V[8]; + tmp2 += m_A7 * V[10]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// solarq,boxingb +static void nl_gcr_10_double_double_d7d45dc58b08cab9(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A6 += go[6]; + m_A4 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[8] * *cnV[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A7 += go[9]; + m_A8 += go[10]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// solarq +static void nl_gcr_15_double_double_7caaa135bff3d9f3(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A4 += go[2]; + m_A3 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A6 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[6] * *cnV[6]; + m_A9 += gt[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A8 += go[7]; + m_A7 += go[8]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[9] * *cnV[9]; + m_A14 += gt[10]; + m_A14 += gt[11]; + m_A14 += gt[12]; + m_A12 += go[10]; + m_A11 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A11; + m_A13 += m_A3 * f1_4; + m_A14 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A12; + m_A14 += m_A6 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A14; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// solarq +static void nl_gcr_20_double_double_66496d6073aca98e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[4]; + m_A3 += go[5]; + m_A3 += go[6]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A7 += go[10]; + m_A6 += go[11]; + m_A6 += go[12]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A9 += go[14]; + m_A9 += go[15]; + m_A8 += go[16]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A13 += go[20]; + m_A13 += go[21]; + m_A12 += go[22]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 -= go[23] * *cnV[23]; + RHS4 -= go[24] * *cnV[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A17 += go[25]; + double RHS5 = Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 -= go[26] * *cnV[26]; + RHS5 -= go[27] * *cnV[27]; + RHS5 -= go[28] * *cnV[28]; + RHS5 -= go[29] * *cnV[29]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A12; + m_A14 += m_A3 * f1_4; + m_A15 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A13; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A17; + m_A18 += m_A6 * f2_5; + m_A19 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + RHS4 += f3_4 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A19; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// solarq +static void nl_gcr_303_double_double_62612f71055b8fd4(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + double m_A198(0.0); + double m_A199(0.0); + double m_A200(0.0); + double m_A201(0.0); + double m_A202(0.0); + double m_A203(0.0); + double m_A204(0.0); + double m_A205(0.0); + double m_A206(0.0); + double m_A207(0.0); + double m_A208(0.0); + double m_A209(0.0); + double m_A210(0.0); + double m_A211(0.0); + double m_A212(0.0); + double m_A213(0.0); + double m_A214(0.0); + double m_A215(0.0); + double m_A216(0.0); + double m_A217(0.0); + double m_A218(0.0); + double m_A219(0.0); + double m_A220(0.0); + double m_A221(0.0); + double m_A222(0.0); + double m_A223(0.0); + double m_A224(0.0); + double m_A225(0.0); + double m_A226(0.0); + double m_A227(0.0); + double m_A228(0.0); + double m_A229(0.0); + double m_A230(0.0); + double m_A231(0.0); + double m_A232(0.0); + double m_A233(0.0); + double m_A234(0.0); + double m_A235(0.0); + double m_A236(0.0); + double m_A237(0.0); + double m_A238(0.0); + double m_A239(0.0); + double m_A240(0.0); + double m_A241(0.0); + double m_A242(0.0); + double m_A243(0.0); + double m_A244(0.0); + double m_A245(0.0); + double m_A246(0.0); + double m_A247(0.0); + double m_A248(0.0); + double m_A249(0.0); + double m_A250(0.0); + double m_A251(0.0); + double m_A252(0.0); + double m_A253(0.0); + double m_A254(0.0); + double m_A255(0.0); + double m_A256(0.0); + double m_A257(0.0); + double m_A258(0.0); + double m_A259(0.0); + double m_A260(0.0); + double m_A261(0.0); + double m_A262(0.0); + double m_A263(0.0); + double m_A264(0.0); + double m_A265(0.0); + double m_A266(0.0); + double m_A267(0.0); + double m_A268(0.0); + double m_A269(0.0); + double m_A270(0.0); + double m_A271(0.0); + double m_A272(0.0); + double m_A273(0.0); + double m_A274(0.0); + double m_A275(0.0); + double m_A276(0.0); + double m_A277(0.0); + double m_A278(0.0); + double m_A279(0.0); + double m_A280(0.0); + double m_A281(0.0); + double m_A282(0.0); + double m_A283(0.0); + double m_A284(0.0); + double m_A285(0.0); + double m_A286(0.0); + double m_A287(0.0); + double m_A288(0.0); + double m_A289(0.0); + double m_A290(0.0); + double m_A291(0.0); + double m_A292(0.0); + double m_A293(0.0); + double m_A294(0.0); + double m_A295(0.0); + double m_A296(0.0); + double m_A297(0.0); + double m_A298(0.0); + double m_A299(0.0); + double m_A300(0.0); + double m_A301(0.0); + double m_A302(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A0 += gt[7]; + m_A0 += gt[8]; + m_A0 += gt[9]; + m_A0 += gt[10]; + m_A0 += gt[11]; + m_A0 += gt[12]; + m_A0 += gt[13]; + m_A2 += go[0]; + m_A1 += go[1]; + m_A1 += go[2]; + m_A0 += go[3]; + m_A0 += go[4]; + m_A0 += go[5]; + m_A0 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 += Idr[7]; + RHS0 += Idr[8]; + RHS0 += Idr[9]; + RHS0 += Idr[10]; + RHS0 += Idr[11]; + RHS0 += Idr[12]; + RHS0 += Idr[13]; + RHS0 -= go[9] * *cnV[9]; + RHS0 -= go[10] * *cnV[10]; + RHS0 -= go[11] * *cnV[11]; + RHS0 -= go[12] * *cnV[12]; + RHS0 -= go[13] * *cnV[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A4 += gt[16]; + m_A4 += gt[17]; + m_A4 += gt[18]; + m_A4 += gt[19]; + m_A4 += gt[20]; + m_A4 += gt[21]; + m_A4 += gt[22]; + m_A4 += gt[23]; + m_A4 += gt[24]; + m_A4 += gt[25]; + m_A4 += gt[26]; + m_A4 += gt[27]; + m_A4 += go[14]; + m_A4 += go[15]; + m_A4 += go[16]; + m_A4 += go[17]; + m_A5 += go[18]; + m_A5 += go[19]; + m_A5 += go[20]; + m_A5 += go[21]; + m_A6 += go[22]; + double RHS1 = Idr[14]; + RHS1 += Idr[15]; + RHS1 += Idr[16]; + RHS1 += Idr[17]; + RHS1 += Idr[18]; + RHS1 += Idr[19]; + RHS1 += Idr[20]; + RHS1 += Idr[21]; + RHS1 += Idr[22]; + RHS1 += Idr[23]; + RHS1 += Idr[24]; + RHS1 += Idr[25]; + RHS1 += Idr[26]; + RHS1 += Idr[27]; + RHS1 -= go[23] * *cnV[23]; + RHS1 -= go[24] * *cnV[24]; + RHS1 -= go[25] * *cnV[25]; + RHS1 -= go[26] * *cnV[26]; + RHS1 -= go[27] * *cnV[27]; + m_A7 += gt[28]; + m_A7 += gt[29]; + m_A7 += gt[30]; + m_A7 += gt[31]; + m_A7 += gt[32]; + m_A7 += gt[33]; + m_A7 += gt[34]; + m_A7 += gt[35]; + m_A8 += go[28]; + m_A8 += go[29]; + m_A9 += go[30]; + m_A9 += go[31]; + m_A9 += go[32]; + m_A10 += go[33]; + m_A10 += go[34]; + m_A10 += go[35]; + double RHS2 = Idr[28]; + RHS2 += Idr[29]; + RHS2 += Idr[30]; + RHS2 += Idr[31]; + RHS2 += Idr[32]; + RHS2 += Idr[33]; + RHS2 += Idr[34]; + RHS2 += Idr[35]; + m_A11 += gt[36]; + m_A11 += gt[37]; + m_A11 += gt[38]; + m_A11 += gt[39]; + m_A11 += gt[40]; + m_A12 += go[36]; + m_A12 += go[37]; + m_A13 += go[38]; + m_A13 += go[39]; + double RHS3 = Idr[36]; + RHS3 += Idr[37]; + RHS3 += Idr[38]; + RHS3 += Idr[39]; + RHS3 += Idr[40]; + RHS3 -= go[40] * *cnV[40]; + m_A14 += gt[41]; + m_A14 += gt[42]; + m_A14 += gt[43]; + m_A14 += gt[44]; + m_A14 += gt[45]; + m_A14 += gt[46]; + m_A14 += gt[47]; + m_A14 += gt[48]; + m_A14 += gt[49]; + m_A14 += gt[50]; + m_A14 += gt[51]; + m_A14 += gt[52]; + m_A14 += gt[53]; + m_A14 += gt[54]; + m_A14 += go[41]; + m_A14 += go[42]; + m_A14 += go[43]; + m_A14 += go[44]; + m_A15 += go[45]; + m_A15 += go[46]; + m_A15 += go[47]; + m_A15 += go[48]; + m_A16 += go[49]; + double RHS4 = Idr[41]; + RHS4 += Idr[42]; + RHS4 += Idr[43]; + RHS4 += Idr[44]; + RHS4 += Idr[45]; + RHS4 += Idr[46]; + RHS4 += Idr[47]; + RHS4 += Idr[48]; + RHS4 += Idr[49]; + RHS4 += Idr[50]; + RHS4 += Idr[51]; + RHS4 += Idr[52]; + RHS4 += Idr[53]; + RHS4 += Idr[54]; + RHS4 -= go[50] * *cnV[50]; + RHS4 -= go[51] * *cnV[51]; + RHS4 -= go[52] * *cnV[52]; + RHS4 -= go[53] * *cnV[53]; + RHS4 -= go[54] * *cnV[54]; + m_A17 += gt[55]; + m_A17 += gt[56]; + m_A17 += gt[57]; + m_A17 += gt[58]; + m_A17 += gt[59]; + m_A17 += gt[60]; + m_A17 += gt[61]; + m_A17 += gt[62]; + m_A17 += gt[63]; + m_A17 += gt[64]; + m_A17 += gt[65]; + m_A17 += gt[66]; + m_A17 += gt[67]; + m_A17 += gt[68]; + m_A19 += go[55]; + m_A18 += go[56]; + m_A18 += go[57]; + m_A17 += go[58]; + m_A17 += go[59]; + m_A17 += go[60]; + m_A17 += go[61]; + m_A20 += go[62]; + m_A20 += go[63]; + double RHS5 = Idr[55]; + RHS5 += Idr[56]; + RHS5 += Idr[57]; + RHS5 += Idr[58]; + RHS5 += Idr[59]; + RHS5 += Idr[60]; + RHS5 += Idr[61]; + RHS5 += Idr[62]; + RHS5 += Idr[63]; + RHS5 += Idr[64]; + RHS5 += Idr[65]; + RHS5 += Idr[66]; + RHS5 += Idr[67]; + RHS5 += Idr[68]; + RHS5 -= go[64] * *cnV[64]; + RHS5 -= go[65] * *cnV[65]; + RHS5 -= go[66] * *cnV[66]; + RHS5 -= go[67] * *cnV[67]; + RHS5 -= go[68] * *cnV[68]; + m_A21 += gt[69]; + m_A21 += gt[70]; + m_A21 += gt[71]; + m_A21 += gt[72]; + m_A22 += go[69]; + double RHS6 = Idr[69]; + RHS6 += Idr[70]; + RHS6 += Idr[71]; + RHS6 += Idr[72]; + RHS6 -= go[70] * *cnV[70]; + RHS6 -= go[71] * *cnV[71]; + RHS6 -= go[72] * *cnV[72]; + m_A23 += gt[73]; + m_A23 += gt[74]; + m_A23 += gt[75]; + m_A23 += gt[76]; + m_A23 += gt[77]; + m_A23 += gt[78]; + m_A23 += gt[79]; + m_A23 += gt[80]; + m_A24 += go[73]; + m_A24 += go[74]; + m_A25 += go[75]; + m_A25 += go[76]; + m_A25 += go[77]; + m_A26 += go[78]; + m_A26 += go[79]; + m_A26 += go[80]; + double RHS7 = Idr[73]; + RHS7 += Idr[74]; + RHS7 += Idr[75]; + RHS7 += Idr[76]; + RHS7 += Idr[77]; + RHS7 += Idr[78]; + RHS7 += Idr[79]; + RHS7 += Idr[80]; + m_A27 += gt[81]; + m_A27 += gt[82]; + m_A27 += gt[83]; + m_A27 += gt[84]; + m_A27 += gt[85]; + m_A27 += gt[86]; + m_A27 += gt[87]; + m_A27 += gt[88]; + m_A27 += gt[89]; + m_A27 += gt[90]; + m_A27 += gt[91]; + m_A27 += gt[92]; + m_A29 += go[81]; + m_A28 += go[82]; + m_A28 += go[83]; + m_A27 += go[84]; + m_A27 += go[85]; + m_A27 += go[86]; + m_A27 += go[87]; + double RHS8 = Idr[81]; + RHS8 += Idr[82]; + RHS8 += Idr[83]; + RHS8 += Idr[84]; + RHS8 += Idr[85]; + RHS8 += Idr[86]; + RHS8 += Idr[87]; + RHS8 += Idr[88]; + RHS8 += Idr[89]; + RHS8 += Idr[90]; + RHS8 += Idr[91]; + RHS8 += Idr[92]; + RHS8 -= go[88] * *cnV[88]; + RHS8 -= go[89] * *cnV[89]; + RHS8 -= go[90] * *cnV[90]; + RHS8 -= go[91] * *cnV[91]; + RHS8 -= go[92] * *cnV[92]; + m_A30 += gt[93]; + m_A30 += gt[94]; + m_A30 += gt[95]; + m_A30 += gt[96]; + m_A30 += gt[97]; + m_A30 += gt[98]; + m_A30 += gt[99]; + m_A30 += gt[100]; + m_A33 += go[93]; + m_A32 += go[94]; + m_A32 += go[95]; + m_A31 += go[96]; + m_A31 += go[97]; + double RHS9 = Idr[93]; + RHS9 += Idr[94]; + RHS9 += Idr[95]; + RHS9 += Idr[96]; + RHS9 += Idr[97]; + RHS9 += Idr[98]; + RHS9 += Idr[99]; + RHS9 += Idr[100]; + RHS9 -= go[98] * *cnV[98]; + RHS9 -= go[99] * *cnV[99]; + RHS9 -= go[100] * *cnV[100]; + m_A34 += gt[101]; + m_A34 += gt[102]; + m_A34 += gt[103]; + m_A34 += gt[104]; + m_A34 += gt[105]; + m_A34 += gt[106]; + m_A34 += gt[107]; + m_A34 += gt[108]; + m_A34 += gt[109]; + m_A34 += gt[110]; + m_A34 += gt[111]; + m_A34 += gt[112]; + m_A36 += go[101]; + m_A35 += go[102]; + m_A35 += go[103]; + m_A34 += go[104]; + m_A34 += go[105]; + m_A34 += go[106]; + m_A34 += go[107]; + double RHS10 = Idr[101]; + RHS10 += Idr[102]; + RHS10 += Idr[103]; + RHS10 += Idr[104]; + RHS10 += Idr[105]; + RHS10 += Idr[106]; + RHS10 += Idr[107]; + RHS10 += Idr[108]; + RHS10 += Idr[109]; + RHS10 += Idr[110]; + RHS10 += Idr[111]; + RHS10 += Idr[112]; + RHS10 -= go[108] * *cnV[108]; + RHS10 -= go[109] * *cnV[109]; + RHS10 -= go[110] * *cnV[110]; + RHS10 -= go[111] * *cnV[111]; + RHS10 -= go[112] * *cnV[112]; + m_A37 += gt[113]; + m_A37 += gt[114]; + m_A37 += gt[115]; + m_A37 += gt[116]; + m_A37 += gt[117]; + m_A38 += go[113]; + m_A38 += go[114]; + m_A39 += go[115]; + m_A39 += go[116]; + double RHS11 = Idr[113]; + RHS11 += Idr[114]; + RHS11 += Idr[115]; + RHS11 += Idr[116]; + RHS11 += Idr[117]; + RHS11 -= go[117] * *cnV[117]; + m_A40 += gt[118]; + m_A40 += gt[119]; + m_A40 += gt[120]; + m_A40 += gt[121]; + m_A40 += gt[122]; + m_A40 += gt[123]; + m_A42 += go[118]; + m_A41 += go[119]; + m_A41 += go[120]; + m_A43 += go[121]; + m_A43 += go[122]; + double RHS12 = Idr[118]; + RHS12 += Idr[119]; + RHS12 += Idr[120]; + RHS12 += Idr[121]; + RHS12 += Idr[122]; + RHS12 += Idr[123]; + RHS12 -= go[123] * *cnV[123]; + m_A44 += gt[124]; + m_A44 += gt[125]; + m_A44 += gt[126]; + m_A44 += gt[127]; + m_A44 += gt[128]; + m_A44 += gt[129]; + m_A44 += gt[130]; + m_A45 += go[124]; + m_A46 += go[125]; + double RHS13 = Idr[124]; + RHS13 += Idr[125]; + RHS13 += Idr[126]; + RHS13 += Idr[127]; + RHS13 += Idr[128]; + RHS13 += Idr[129]; + RHS13 += Idr[130]; + RHS13 -= go[126] * *cnV[126]; + RHS13 -= go[127] * *cnV[127]; + RHS13 -= go[128] * *cnV[128]; + RHS13 -= go[129] * *cnV[129]; + RHS13 -= go[130] * *cnV[130]; + m_A47 += gt[131]; + m_A47 += gt[132]; + m_A47 += gt[133]; + m_A47 += gt[134]; + m_A48 += go[131]; + double RHS14 = Idr[131]; + RHS14 += Idr[132]; + RHS14 += Idr[133]; + RHS14 += Idr[134]; + RHS14 -= go[132] * *cnV[132]; + RHS14 -= go[133] * *cnV[133]; + RHS14 -= go[134] * *cnV[134]; + m_A49 += gt[135]; + m_A49 += gt[136]; + m_A50 += go[135]; + double RHS15 = Idr[135]; + RHS15 += Idr[136]; + RHS15 -= go[136] * *cnV[136]; + m_A51 += gt[137]; + m_A51 += gt[138]; + m_A51 += gt[139]; + m_A51 += gt[140]; + m_A51 += gt[141]; + m_A51 += gt[142]; + m_A51 += gt[143]; + m_A52 += go[137]; + double RHS16 = Idr[137]; + RHS16 += Idr[138]; + RHS16 += Idr[139]; + RHS16 += Idr[140]; + RHS16 += Idr[141]; + RHS16 += Idr[142]; + RHS16 += Idr[143]; + RHS16 -= go[138] * *cnV[138]; + RHS16 -= go[139] * *cnV[139]; + RHS16 -= go[140] * *cnV[140]; + RHS16 -= go[141] * *cnV[141]; + RHS16 -= go[142] * *cnV[142]; + RHS16 -= go[143] * *cnV[143]; + m_A53 += gt[144]; + m_A53 += gt[145]; + m_A53 += gt[146]; + m_A53 += gt[147]; + m_A53 += gt[148]; + m_A53 += gt[149]; + m_A53 += gt[150]; + m_A54 += go[144]; + m_A55 += go[145]; + double RHS17 = Idr[144]; + RHS17 += Idr[145]; + RHS17 += Idr[146]; + RHS17 += Idr[147]; + RHS17 += Idr[148]; + RHS17 += Idr[149]; + RHS17 += Idr[150]; + RHS17 -= go[146] * *cnV[146]; + RHS17 -= go[147] * *cnV[147]; + RHS17 -= go[148] * *cnV[148]; + RHS17 -= go[149] * *cnV[149]; + RHS17 -= go[150] * *cnV[150]; + m_A56 += gt[151]; + m_A56 += gt[152]; + m_A56 += gt[153]; + m_A57 += go[151]; + double RHS18 = Idr[151]; + RHS18 += Idr[152]; + RHS18 += Idr[153]; + RHS18 -= go[152] * *cnV[152]; + RHS18 -= go[153] * *cnV[153]; + m_A58 += gt[154]; + m_A58 += gt[155]; + m_A58 += gt[156]; + m_A58 += gt[157]; + m_A58 += gt[158]; + m_A58 += gt[159]; + m_A59 += go[154]; + m_A60 += go[155]; + m_A60 += go[156]; + m_A61 += go[157]; + m_A61 += go[158]; + double RHS19 = Idr[154]; + RHS19 += Idr[155]; + RHS19 += Idr[156]; + RHS19 += Idr[157]; + RHS19 += Idr[158]; + RHS19 += Idr[159]; + RHS19 -= go[159] * *cnV[159]; + m_A62 += gt[160]; + m_A62 += gt[161]; + m_A64 += go[160]; + m_A63 += go[161]; + double RHS20 = Idr[160]; + RHS20 += Idr[161]; + m_A65 += gt[162]; + m_A65 += gt[163]; + m_A65 += gt[164]; + m_A65 += gt[165]; + m_A65 += gt[166]; + m_A65 += gt[167]; + m_A65 += gt[168]; + m_A66 += go[162]; + double RHS21 = Idr[162]; + RHS21 += Idr[163]; + RHS21 += Idr[164]; + RHS21 += Idr[165]; + RHS21 += Idr[166]; + RHS21 += Idr[167]; + RHS21 += Idr[168]; + RHS21 -= go[163] * *cnV[163]; + RHS21 -= go[164] * *cnV[164]; + RHS21 -= go[165] * *cnV[165]; + RHS21 -= go[166] * *cnV[166]; + RHS21 -= go[167] * *cnV[167]; + RHS21 -= go[168] * *cnV[168]; + m_A67 += gt[169]; + m_A67 += gt[170]; + m_A68 += go[169]; + m_A69 += go[170]; + double RHS22 = Idr[169]; + RHS22 += Idr[170]; + m_A70 += gt[171]; + m_A70 += gt[172]; + m_A71 += go[171]; + double RHS23 = Idr[171]; + RHS23 += Idr[172]; + RHS23 -= go[172] * *cnV[172]; + m_A74 += gt[173]; + m_A74 += gt[174]; + m_A74 += gt[175]; + m_A74 += gt[176]; + m_A74 += gt[177]; + m_A74 += gt[178]; + m_A73 += go[173]; + m_A73 += go[174]; + m_A72 += go[175]; + double RHS24 = Idr[173]; + RHS24 += Idr[174]; + RHS24 += Idr[175]; + RHS24 += Idr[176]; + RHS24 += Idr[177]; + RHS24 += Idr[178]; + RHS24 -= go[176] * *cnV[176]; + RHS24 -= go[177] * *cnV[177]; + RHS24 -= go[178] * *cnV[178]; + m_A77 += gt[179]; + m_A77 += gt[180]; + m_A78 += go[179]; + m_A79 += go[180]; + double RHS25 = Idr[179]; + RHS25 += Idr[180]; + m_A82 += gt[181]; + m_A82 += gt[182]; + m_A82 += gt[183]; + m_A82 += gt[184]; + m_A82 += gt[185]; + m_A83 += go[181]; + m_A83 += go[182]; + m_A80 += go[183]; + m_A80 += go[184]; + double RHS26 = Idr[181]; + RHS26 += Idr[182]; + RHS26 += Idr[183]; + RHS26 += Idr[184]; + RHS26 += Idr[185]; + RHS26 -= go[185] * *cnV[185]; + m_A85 += gt[186]; + m_A85 += gt[187]; + m_A85 += gt[188]; + m_A85 += gt[189]; + m_A85 += gt[190]; + m_A85 += gt[191]; + m_A85 += gt[192]; + m_A85 += gt[193]; + m_A86 += go[186]; + m_A86 += go[187]; + m_A86 += go[188]; + m_A84 += go[189]; + m_A84 += go[190]; + m_A87 += go[191]; + m_A87 += go[192]; + m_A87 += go[193]; + double RHS27 = Idr[186]; + RHS27 += Idr[187]; + RHS27 += Idr[188]; + RHS27 += Idr[189]; + RHS27 += Idr[190]; + RHS27 += Idr[191]; + RHS27 += Idr[192]; + RHS27 += Idr[193]; + m_A89 += gt[194]; + m_A89 += gt[195]; + m_A89 += gt[196]; + m_A89 += gt[197]; + m_A89 += gt[198]; + m_A89 += gt[199]; + m_A89 += gt[200]; + m_A89 += gt[201]; + m_A89 += gt[202]; + m_A89 += gt[203]; + m_A89 += gt[204]; + m_A89 += gt[205]; + m_A89 += gt[206]; + m_A89 += gt[207]; + m_A89 += go[194]; + m_A89 += go[195]; + m_A89 += go[196]; + m_A89 += go[197]; + m_A88 += go[198]; + m_A88 += go[199]; + m_A90 += go[200]; + m_A90 += go[201]; + m_A91 += go[202]; + double RHS28 = Idr[194]; + RHS28 += Idr[195]; + RHS28 += Idr[196]; + RHS28 += Idr[197]; + RHS28 += Idr[198]; + RHS28 += Idr[199]; + RHS28 += Idr[200]; + RHS28 += Idr[201]; + RHS28 += Idr[202]; + RHS28 += Idr[203]; + RHS28 += Idr[204]; + RHS28 += Idr[205]; + RHS28 += Idr[206]; + RHS28 += Idr[207]; + RHS28 -= go[203] * *cnV[203]; + RHS28 -= go[204] * *cnV[204]; + RHS28 -= go[205] * *cnV[205]; + RHS28 -= go[206] * *cnV[206]; + RHS28 -= go[207] * *cnV[207]; + m_A94 += gt[208]; + m_A94 += gt[209]; + m_A94 += gt[210]; + m_A93 += go[208]; + m_A92 += go[209]; + double RHS29 = Idr[208]; + RHS29 += Idr[209]; + RHS29 += Idr[210]; + RHS29 -= go[210] * *cnV[210]; + m_A99 += gt[211]; + m_A99 += gt[212]; + m_A99 += gt[213]; + m_A99 += gt[214]; + m_A99 += gt[215]; + m_A99 += gt[216]; + m_A99 += gt[217]; + m_A99 += gt[218]; + m_A99 += gt[219]; + m_A96 += go[211]; + m_A96 += go[212]; + m_A98 += go[213]; + m_A98 += go[214]; + m_A102 += go[215]; + m_A103 += go[216]; + m_A97 += go[217]; + m_A97 += go[218]; + double RHS30 = Idr[211]; + RHS30 += Idr[212]; + RHS30 += Idr[213]; + RHS30 += Idr[214]; + RHS30 += Idr[215]; + RHS30 += Idr[216]; + RHS30 += Idr[217]; + RHS30 += Idr[218]; + RHS30 += Idr[219]; + RHS30 -= go[219] * *cnV[219]; + m_A105 += gt[220]; + m_A105 += gt[221]; + m_A105 += gt[222]; + m_A105 += gt[223]; + m_A105 += gt[224]; + m_A104 += go[220]; + m_A106 += go[221]; + m_A107 += go[222]; + double RHS31 = Idr[220]; + RHS31 += Idr[221]; + RHS31 += Idr[222]; + RHS31 += Idr[223]; + RHS31 += Idr[224]; + RHS31 -= go[223] * *cnV[223]; + RHS31 -= go[224] * *cnV[224]; + m_A111 += gt[225]; + m_A111 += gt[226]; + m_A111 += gt[227]; + m_A111 += gt[228]; + m_A111 += gt[229]; + m_A109 += go[225]; + m_A108 += go[226]; + m_A113 += go[227]; + double RHS32 = Idr[225]; + RHS32 += Idr[226]; + RHS32 += Idr[227]; + RHS32 += Idr[228]; + RHS32 += Idr[229]; + RHS32 -= go[228] * *cnV[228]; + RHS32 -= go[229] * *cnV[229]; + m_A119 += gt[230]; + m_A119 += gt[231]; + m_A119 += gt[232]; + m_A119 += gt[233]; + m_A119 += gt[234]; + m_A119 += gt[235]; + m_A119 += gt[236]; + m_A116 += go[230]; + m_A117 += go[231]; + m_A118 += go[232]; + m_A121 += go[233]; + m_A124 += go[234]; + double RHS33 = Idr[230]; + RHS33 += Idr[231]; + RHS33 += Idr[232]; + RHS33 += Idr[233]; + RHS33 += Idr[234]; + RHS33 += Idr[235]; + RHS33 += Idr[236]; + RHS33 -= go[235] * *cnV[235]; + RHS33 -= go[236] * *cnV[236]; + m_A126 += gt[237]; + m_A126 += gt[238]; + m_A126 += gt[239]; + m_A126 += gt[240]; + m_A126 += gt[241]; + m_A126 += gt[242]; + m_A126 += gt[243]; + m_A126 += gt[244]; + m_A127 += go[237]; + m_A127 += go[238]; + m_A127 += go[239]; + m_A125 += go[240]; + m_A125 += go[241]; + m_A128 += go[242]; + m_A128 += go[243]; + m_A128 += go[244]; + double RHS34 = Idr[237]; + RHS34 += Idr[238]; + RHS34 += Idr[239]; + RHS34 += Idr[240]; + RHS34 += Idr[241]; + RHS34 += Idr[242]; + RHS34 += Idr[243]; + RHS34 += Idr[244]; + m_A130 += gt[245]; + m_A130 += gt[246]; + m_A130 += gt[247]; + m_A130 += gt[248]; + m_A130 += gt[249]; + m_A130 += gt[250]; + m_A130 += gt[251]; + m_A130 += gt[252]; + m_A130 += gt[253]; + m_A130 += gt[254]; + m_A130 += gt[255]; + m_A130 += gt[256]; + m_A130 += gt[257]; + m_A130 += gt[258]; + m_A130 += go[245]; + m_A130 += go[246]; + m_A130 += go[247]; + m_A130 += go[248]; + m_A129 += go[249]; + m_A129 += go[250]; + m_A131 += go[251]; + m_A131 += go[252]; + m_A132 += go[253]; + double RHS35 = Idr[245]; + RHS35 += Idr[246]; + RHS35 += Idr[247]; + RHS35 += Idr[248]; + RHS35 += Idr[249]; + RHS35 += Idr[250]; + RHS35 += Idr[251]; + RHS35 += Idr[252]; + RHS35 += Idr[253]; + RHS35 += Idr[254]; + RHS35 += Idr[255]; + RHS35 += Idr[256]; + RHS35 += Idr[257]; + RHS35 += Idr[258]; + RHS35 -= go[254] * *cnV[254]; + RHS35 -= go[255] * *cnV[255]; + RHS35 -= go[256] * *cnV[256]; + RHS35 -= go[257] * *cnV[257]; + RHS35 -= go[258] * *cnV[258]; + m_A137 += gt[259]; + m_A137 += gt[260]; + m_A137 += gt[261]; + m_A137 += gt[262]; + m_A137 += gt[263]; + m_A137 += gt[264]; + m_A137 += gt[265]; + m_A137 += gt[266]; + m_A137 += gt[267]; + m_A134 += go[259]; + m_A134 += go[260]; + m_A135 += go[261]; + m_A135 += go[262]; + m_A140 += go[263]; + m_A143 += go[264]; + m_A133 += go[265]; + m_A133 += go[266]; + double RHS36 = Idr[259]; + RHS36 += Idr[260]; + RHS36 += Idr[261]; + RHS36 += Idr[262]; + RHS36 += Idr[263]; + RHS36 += Idr[264]; + RHS36 += Idr[265]; + RHS36 += Idr[266]; + RHS36 += Idr[267]; + RHS36 -= go[267] * *cnV[267]; + m_A145 += gt[268]; + m_A145 += gt[269]; + m_A146 += go[268]; + m_A144 += go[269]; + double RHS37 = Idr[268]; + RHS37 += Idr[269]; + m_A148 += gt[270]; + m_A148 += gt[271]; + m_A148 += gt[272]; + m_A148 += gt[273]; + m_A148 += gt[274]; + m_A148 += gt[275]; + m_A148 += gt[276]; + m_A147 += go[270]; + m_A149 += go[271]; + double RHS38 = Idr[270]; + RHS38 += Idr[271]; + RHS38 += Idr[272]; + RHS38 += Idr[273]; + RHS38 += Idr[274]; + RHS38 += Idr[275]; + RHS38 += Idr[276]; + RHS38 -= go[272] * *cnV[272]; + RHS38 -= go[273] * *cnV[273]; + RHS38 -= go[274] * *cnV[274]; + RHS38 -= go[275] * *cnV[275]; + RHS38 -= go[276] * *cnV[276]; + m_A158 += gt[277]; + m_A158 += gt[278]; + m_A158 += gt[279]; + m_A158 += gt[280]; + m_A158 += gt[281]; + m_A158 += gt[282]; + m_A154 += go[277]; + m_A154 += go[278]; + m_A151 += go[279]; + m_A152 += go[280]; + m_A150 += go[281]; + double RHS39 = Idr[277]; + RHS39 += Idr[278]; + RHS39 += Idr[279]; + RHS39 += Idr[280]; + RHS39 += Idr[281]; + RHS39 += Idr[282]; + RHS39 -= go[282] * *cnV[282]; + m_A172 += gt[283]; + m_A172 += gt[284]; + m_A172 += gt[285]; + m_A172 += gt[286]; + m_A172 += gt[287]; + m_A166 += go[283]; + m_A167 += go[284]; + m_A169 += go[285]; + m_A168 += go[286]; + double RHS40 = Idr[283]; + RHS40 += Idr[284]; + RHS40 += Idr[285]; + RHS40 += Idr[286]; + RHS40 += Idr[287]; + RHS40 -= go[287] * *cnV[287]; + m_A181 += gt[288]; + m_A181 += gt[289]; + m_A181 += gt[290]; + m_A181 += gt[291]; + m_A180 += go[288]; + m_A182 += go[289]; + double RHS41 = Idr[288]; + RHS41 += Idr[289]; + RHS41 += Idr[290]; + RHS41 += Idr[291]; + RHS41 -= go[290] * *cnV[290]; + RHS41 -= go[291] * *cnV[291]; + m_A186 += gt[292]; + m_A186 += gt[293]; + m_A186 += gt[294]; + m_A186 += gt[295]; + m_A186 += gt[296]; + m_A185 += go[292]; + m_A183 += go[293]; + m_A184 += go[294]; + double RHS42 = Idr[292]; + RHS42 += Idr[293]; + RHS42 += Idr[294]; + RHS42 += Idr[295]; + RHS42 += Idr[296]; + RHS42 -= go[295] * *cnV[295]; + RHS42 -= go[296] * *cnV[296]; + m_A195 += gt[297]; + m_A195 += gt[298]; + m_A195 += gt[299]; + m_A195 += gt[300]; + m_A195 += gt[301]; + m_A195 += gt[302]; + m_A195 += gt[303]; + m_A195 += gt[304]; + m_A195 += gt[305]; + m_A195 += gt[306]; + m_A195 += gt[307]; + m_A189 += go[297]; + m_A189 += go[298]; + m_A191 += go[299]; + m_A190 += go[300]; + m_A190 += go[301]; + m_A188 += go[302]; + m_A188 += go[303]; + m_A188 += go[304]; + m_A198 += go[305]; + m_A198 += go[306]; + double RHS43 = Idr[297]; + RHS43 += Idr[298]; + RHS43 += Idr[299]; + RHS43 += Idr[300]; + RHS43 += Idr[301]; + RHS43 += Idr[302]; + RHS43 += Idr[303]; + RHS43 += Idr[304]; + RHS43 += Idr[305]; + RHS43 += Idr[306]; + RHS43 += Idr[307]; + RHS43 -= go[307] * *cnV[307]; + m_A205 += gt[308]; + m_A205 += gt[309]; + m_A205 += gt[310]; + m_A205 += gt[311]; + m_A205 += gt[312]; + m_A205 += gt[313]; + m_A205 += gt[314]; + m_A205 += gt[315]; + m_A205 += gt[316]; + m_A205 += gt[317]; + m_A205 += gt[318]; + m_A205 += gt[319]; + m_A205 += gt[320]; + m_A203 += go[308]; + m_A203 += go[309]; + m_A203 += go[310]; + m_A203 += go[311]; + m_A204 += go[312]; + m_A204 += go[313]; + m_A204 += go[314]; + m_A202 += go[315]; + m_A207 += go[316]; + m_A207 += go[317]; + m_A206 += go[318]; + m_A206 += go[319]; + double RHS44 = Idr[308]; + RHS44 += Idr[309]; + RHS44 += Idr[310]; + RHS44 += Idr[311]; + RHS44 += Idr[312]; + RHS44 += Idr[313]; + RHS44 += Idr[314]; + RHS44 += Idr[315]; + RHS44 += Idr[316]; + RHS44 += Idr[317]; + RHS44 += Idr[318]; + RHS44 += Idr[319]; + RHS44 += Idr[320]; + RHS44 -= go[320] * *cnV[320]; + m_A211 += gt[321]; + m_A211 += gt[322]; + m_A211 += gt[323]; + m_A211 += gt[324]; + m_A211 += gt[325]; + m_A211 += gt[326]; + m_A211 += gt[327]; + m_A211 += gt[328]; + m_A211 += gt[329]; + m_A211 += gt[330]; + m_A211 += gt[331]; + m_A211 += gt[332]; + m_A211 += gt[333]; + m_A208 += go[321]; + m_A208 += go[322]; + m_A208 += go[323]; + m_A208 += go[324]; + m_A210 += go[325]; + m_A210 += go[326]; + m_A210 += go[327]; + m_A209 += go[328]; + m_A212 += go[329]; + m_A212 += go[330]; + m_A213 += go[331]; + m_A213 += go[332]; + double RHS45 = Idr[321]; + RHS45 += Idr[322]; + RHS45 += Idr[323]; + RHS45 += Idr[324]; + RHS45 += Idr[325]; + RHS45 += Idr[326]; + RHS45 += Idr[327]; + RHS45 += Idr[328]; + RHS45 += Idr[329]; + RHS45 += Idr[330]; + RHS45 += Idr[331]; + RHS45 += Idr[332]; + RHS45 += Idr[333]; + RHS45 -= go[333] * *cnV[333]; + m_A222 += gt[334]; + m_A222 += gt[335]; + m_A222 += gt[336]; + m_A222 += gt[337]; + m_A222 += gt[338]; + m_A222 += gt[339]; + m_A222 += gt[340]; + m_A222 += gt[341]; + m_A222 += gt[342]; + m_A222 += gt[343]; + m_A222 += gt[344]; + m_A215 += go[334]; + m_A215 += go[335]; + m_A218 += go[336]; + m_A217 += go[337]; + m_A217 += go[338]; + m_A214 += go[339]; + m_A214 += go[340]; + m_A214 += go[341]; + m_A227 += go[342]; + m_A227 += go[343]; + double RHS46 = Idr[334]; + RHS46 += Idr[335]; + RHS46 += Idr[336]; + RHS46 += Idr[337]; + RHS46 += Idr[338]; + RHS46 += Idr[339]; + RHS46 += Idr[340]; + RHS46 += Idr[341]; + RHS46 += Idr[342]; + RHS46 += Idr[343]; + RHS46 += Idr[344]; + RHS46 -= go[344] * *cnV[344]; + m_A241 += gt[345]; + m_A241 += gt[346]; + m_A241 += gt[347]; + m_A241 += gt[348]; + m_A241 += gt[349]; + m_A241 += gt[350]; + m_A237 += go[345]; + m_A230 += go[346]; + m_A229 += go[347]; + m_A228 += go[348]; + m_A234 += go[349]; + double RHS47 = Idr[345]; + RHS47 += Idr[346]; + RHS47 += Idr[347]; + RHS47 += Idr[348]; + RHS47 += Idr[349]; + RHS47 += Idr[350]; + RHS47 -= go[350] * *cnV[350]; + m_A257 += gt[351]; + m_A257 += gt[352]; + m_A257 += gt[353]; + m_A257 += gt[354]; + m_A257 += gt[355]; + m_A257 += gt[356]; + m_A257 += gt[357]; + m_A257 += gt[358]; + m_A257 += gt[359]; + m_A257 += gt[360]; + m_A257 += gt[361]; + m_A257 += gt[362]; + m_A249 += go[351]; + m_A246 += go[352]; + m_A248 += go[353]; + m_A247 += go[354]; + m_A247 += go[355]; + m_A247 += go[356]; + m_A253 += go[357]; + m_A253 += go[358]; + m_A254 += go[359]; + m_A254 += go[360]; + double RHS48 = Idr[351]; + RHS48 += Idr[352]; + RHS48 += Idr[353]; + RHS48 += Idr[354]; + RHS48 += Idr[355]; + RHS48 += Idr[356]; + RHS48 += Idr[357]; + RHS48 += Idr[358]; + RHS48 += Idr[359]; + RHS48 += Idr[360]; + RHS48 += Idr[361]; + RHS48 += Idr[362]; + RHS48 -= go[361] * *cnV[361]; + RHS48 -= go[362] * *cnV[362]; + m_A273 += gt[363]; + m_A273 += gt[364]; + m_A273 += gt[365]; + m_A273 += gt[366]; + m_A273 += gt[367]; + m_A273 += gt[368]; + m_A273 += gt[369]; + m_A273 += gt[370]; + m_A273 += gt[371]; + m_A273 += gt[372]; + m_A273 += gt[373]; + m_A262 += go[363]; + m_A262 += go[364]; + m_A264 += go[365]; + m_A269 += go[366]; + m_A269 += go[367]; + m_A263 += go[368]; + m_A263 += go[369]; + m_A263 += go[370]; + m_A261 += go[371]; + m_A261 += go[372]; + double RHS49 = Idr[363]; + RHS49 += Idr[364]; + RHS49 += Idr[365]; + RHS49 += Idr[366]; + RHS49 += Idr[367]; + RHS49 += Idr[368]; + RHS49 += Idr[369]; + RHS49 += Idr[370]; + RHS49 += Idr[371]; + RHS49 += Idr[372]; + RHS49 += Idr[373]; + RHS49 -= go[373] * *cnV[373]; + m_A288 += gt[374]; + m_A288 += gt[375]; + m_A288 += gt[376]; + m_A288 += gt[377]; + m_A288 += gt[378]; + m_A288 += gt[379]; + m_A288 += gt[380]; + m_A288 += gt[381]; + m_A288 += gt[382]; + m_A288 += gt[383]; + m_A288 += gt[384]; + m_A277 += go[374]; + m_A277 += go[375]; + m_A279 += go[376]; + m_A283 += go[377]; + m_A283 += go[378]; + m_A278 += go[379]; + m_A278 += go[380]; + m_A278 += go[381]; + m_A276 += go[382]; + m_A276 += go[383]; + double RHS50 = Idr[374]; + RHS50 += Idr[375]; + RHS50 += Idr[376]; + RHS50 += Idr[377]; + RHS50 += Idr[378]; + RHS50 += Idr[379]; + RHS50 += Idr[380]; + RHS50 += Idr[381]; + RHS50 += Idr[382]; + RHS50 += Idr[383]; + RHS50 += Idr[384]; + RHS50 -= go[384] * *cnV[384]; + m_A302 += gt[385]; + m_A302 += gt[386]; + m_A302 += gt[387]; + m_A302 += gt[388]; + m_A302 += gt[389]; + m_A302 += gt[390]; + m_A302 += gt[391]; + m_A302 += gt[392]; + m_A302 += gt[393]; + m_A302 += gt[394]; + m_A302 += gt[395]; + m_A302 += gt[396]; + m_A292 += go[385]; + m_A290 += go[386]; + m_A293 += go[387]; + m_A291 += go[388]; + m_A291 += go[389]; + m_A291 += go[390]; + m_A297 += go[391]; + m_A297 += go[392]; + m_A296 += go[393]; + m_A296 += go[394]; + double RHS51 = Idr[385]; + RHS51 += Idr[386]; + RHS51 += Idr[387]; + RHS51 += Idr[388]; + RHS51 += Idr[389]; + RHS51 += Idr[390]; + RHS51 += Idr[391]; + RHS51 += Idr[392]; + RHS51 += Idr[393]; + RHS51 += Idr[394]; + RHS51 += Idr[395]; + RHS51 += Idr[396]; + RHS51 -= go[395] * *cnV[395]; + RHS51 -= go[396] * *cnV[396]; + const double f0 = 1.0 / m_A0; + const double f0_27 = -f0 * m_A84; + m_A85 += m_A1 * f0_27; + m_A86 += m_A2 * f0_27; + m_A87 += m_A3 * f0_27; + RHS27 += f0_27 * RHS0; + const double f0_44 = -f0 * m_A202; + m_A204 += m_A1 * f0_44; + m_A205 += m_A2 * f0_44; + m_A207 += m_A3 * f0_44; + RHS44 += f0_44 * RHS0; + const double f0_49 = -f0 * m_A261; + m_A263 += m_A1 * f0_49; + m_A269 += m_A2 * f0_49; + m_A273 += m_A3 * f0_49; + RHS49 += f0_49 * RHS0; + const double f1 = 1.0 / m_A4; + const double f1_44 = -f1 * m_A203; + m_A205 += m_A5 * f1_44; + m_A206 += m_A6 * f1_44; + RHS44 += f1_44 * RHS1; + const double f1_48 = -f1 * m_A246; + m_A254 += m_A5 * f1_48; + m_A257 += m_A6 * f1_48; + RHS48 += f1_48 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_28 = -f2 * m_A88; + m_A89 += m_A8 * f2_28; + m_A90 += m_A9 * f2_28; + m_A91 += m_A10 * f2_28; + RHS28 += f2_28 * RHS2; + const double f2_43 = -f2 * m_A188; + m_A190 += m_A8 * f2_43; + m_A195 += m_A9 * f2_43; + m_A198 += m_A10 * f2_43; + RHS43 += f2_43 * RHS2; + const double f2_48 = -f2 * m_A247; + m_A248 += m_A8 * f2_48; + m_A253 += m_A9 * f2_48; + m_A257 += m_A10 * f2_48; + RHS48 += f2_48 * RHS2; + const double f3 = 1.0 / m_A11; + const double f3_30 = -f3 * m_A96; + m_A99 += m_A12 * f3_30; + m_A103 += m_A13 * f3_30; + RHS30 += f3_30 * RHS3; + const double f3_49 = -f3 * m_A262; + m_A264 += m_A12 * f3_49; + m_A273 += m_A13 * f3_49; + RHS49 += f3_49 * RHS3; + const double f4 = 1.0 / m_A14; + const double f4_45 = -f4 * m_A208; + m_A211 += m_A15 * f4_45; + m_A213 += m_A16 * f4_45; + RHS45 += f4_45 * RHS4; + const double f4_51 = -f4 * m_A290; + m_A296 += m_A15 * f4_51; + m_A302 += m_A16 * f4_51; + RHS51 += f4_51 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_34 = -f5 * m_A125; + m_A126 += m_A18 * f5_34; + m_A127 += m_A19 * f5_34; + m_A128 += m_A20 * f5_34; + RHS34 += f5_34 * RHS5; + const double f5_45 = -f5 * m_A209; + m_A210 += m_A18 * f5_45; + m_A211 += m_A19 * f5_45; + m_A212 += m_A20 * f5_45; + RHS45 += f5_45 * RHS5; + const double f5_50 = -f5 * m_A276; + m_A278 += m_A18 * f5_50; + m_A283 += m_A19 * f5_50; + m_A288 += m_A20 * f5_50; + RHS50 += f5_50 * RHS5; + const double f6 = 1.0 / m_A21; + const double f6_24 = -f6 * m_A72; + m_A74 += m_A22 * f6_24; + RHS24 += f6_24 * RHS6; + const double f7 = 1.0 / m_A23; + const double f7_35 = -f7 * m_A129; + m_A130 += m_A24 * f7_35; + m_A131 += m_A25 * f7_35; + m_A132 += m_A26 * f7_35; + RHS35 += f7_35 * RHS7; + const double f7_46 = -f7 * m_A214; + m_A217 += m_A24 * f7_46; + m_A222 += m_A25 * f7_46; + m_A227 += m_A26 * f7_46; + RHS46 += f7_46 * RHS7; + const double f7_51 = -f7 * m_A291; + m_A293 += m_A24 * f7_51; + m_A297 += m_A25 * f7_51; + m_A302 += m_A26 * f7_51; + RHS51 += f7_51 * RHS7; + const double f8 = 1.0 / m_A27; + const double f8_30 = -f8 * m_A97; + m_A99 += m_A28 * f8_30; + m_A101 += m_A29 * f8_30; + RHS30 += f8_30 * RHS8; + const double f8_39 = -f8 * m_A150; + m_A155 += m_A28 * f8_39; + m_A158 += m_A29 * f8_39; + RHS39 += f8_39 * RHS8; + const double f9 = 1.0 / m_A30; + const double f9_24 = -f9 * m_A73; + m_A74 += m_A31 * f9_24; + m_A75 += m_A32 * f9_24; + m_A76 += m_A33 * f9_24; + RHS24 += f9_24 * RHS9; + const double f9_26 = -f9 * m_A80; + m_A81 += m_A31 * f9_26; + m_A82 += m_A32 * f9_26; + m_A83 += m_A33 * f9_26; + RHS26 += f9_26 * RHS9; + const double f9_39 = -f9 * m_A151; + m_A153 += m_A31 * f9_39; + m_A154 += m_A32 * f9_39; + m_A158 += m_A33 * f9_39; + RHS39 += f9_39 * RHS9; + const double f10 = 1.0 / m_A34; + const double f10_36 = -f10 * m_A133; + m_A137 += m_A35 * f10_36; + m_A138 += m_A36 * f10_36; + RHS36 += f10_36 * RHS10; + const double f10_39 = -f10 * m_A152; + m_A157 += m_A35 * f10_39; + m_A158 += m_A36 * f10_39; + RHS39 += f10_39 * RHS10; + const double f11 = 1.0 / m_A37; + const double f11_36 = -f11 * m_A134; + m_A137 += m_A38 * f11_36; + m_A143 += m_A39 * f11_36; + RHS36 += f11_36 * RHS11; + const double f11_50 = -f11 * m_A277; + m_A279 += m_A38 * f11_50; + m_A288 += m_A39 * f11_50; + RHS50 += f11_50 * RHS11; + const double f12 = 1.0 / m_A40; + const double f12_30 = -f12 * m_A98; + m_A99 += m_A41 * f12_30; + m_A100 += m_A42 * f12_30; + m_A102 += m_A43 * f12_30; + RHS30 += f12_30 * RHS12; + const double f12_32 = -f12 * m_A108; + m_A110 += m_A41 * f12_32; + m_A111 += m_A42 * f12_32; + m_A114 += m_A43 * f12_32; + RHS32 += f12_32 * RHS12; + const double f12_43 = -f12 * m_A189; + m_A191 += m_A41 * f12_43; + m_A192 += m_A42 * f12_43; + m_A195 += m_A43 * f12_43; + RHS43 += f12_43 * RHS12; + const double f13 = 1.0 / m_A44; + const double f13_31 = -f13 * m_A104; + m_A105 += m_A45 * f13_31; + m_A107 += m_A46 * f13_31; + RHS31 += f13_31 * RHS13; + const double f14 = 1.0 / m_A47; + const double f14_37 = -f14 * m_A144; + m_A145 += m_A48 * f14_37; + RHS37 += f14_37 * RHS14; + const double f15 = 1.0 / m_A49; + const double f15_40 = -f15 * m_A166; + m_A172 += m_A50 * f15_40; + RHS40 += f15_40 * RHS15; + const double f16 = 1.0 / m_A51; + const double f16_32 = -f16 * m_A109; + m_A113 += m_A52 * f16_32; + RHS32 += f16_32 * RHS16; + const double f17 = 1.0 / m_A53; + const double f17_33 = -f17 * m_A116; + m_A119 += m_A54 * f17_33; + m_A124 += m_A55 * f17_33; + RHS33 += f17_33 * RHS17; + const double f18 = 1.0 / m_A56; + const double f18_29 = -f18 * m_A92; + m_A94 += m_A57 * f18_29; + RHS29 += f18_29 * RHS18; + const double f19 = 1.0 / m_A58; + const double f19_33 = -f19 * m_A117; + m_A119 += m_A59 * f19_33; + m_A120 += m_A60 * f19_33; + m_A122 += m_A61 * f19_33; + RHS33 += f19_33 * RHS19; + const double f19_36 = -f19 * m_A135; + m_A136 += m_A59 * f19_36; + m_A137 += m_A60 * f19_36; + m_A140 += m_A61 * f19_36; + RHS36 += f19_36 * RHS19; + const double f19_46 = -f19 * m_A215; + m_A216 += m_A59 * f19_46; + m_A218 += m_A60 * f19_46; + m_A222 += m_A61 * f19_46; + RHS46 += f19_46 * RHS19; + const double f20 = 1.0 / m_A62; + const double f20_33 = -f20 * m_A118; + m_A119 += m_A63 * f20_33; + m_A123 += m_A64 * f20_33; + RHS33 += f20_33 * RHS20; + const double f20_47 = -f20 * m_A228; + m_A232 += m_A63 * f20_47; + m_A241 += m_A64 * f20_47; + RHS47 += f20_47 * RHS20; + const double f21 = 1.0 / m_A65; + const double f21_41 = -f21 * m_A180; + m_A182 += m_A66 * f21_41; + RHS41 += f21_41 * RHS21; + const double f22 = 1.0 / m_A67; + const double f22_29 = -f22 * m_A93; + m_A94 += m_A68 * f22_29; + m_A95 += m_A69 * f22_29; + RHS29 += f22_29 * RHS22; + const double f22_47 = -f22 * m_A229; + m_A231 += m_A68 * f22_47; + m_A241 += m_A69 * f22_47; + RHS47 += f22_47 * RHS22; + const double f23 = 1.0 / m_A70; + const double f23_38 = -f23 * m_A147; + m_A149 += m_A71 * f23_38; + RHS38 += f23_38 * RHS23; + const double f23_42 = -f23 * m_A183; + m_A186 += m_A71 * f23_42; + RHS42 += f23_42 * RHS23; + const double f24 = 1.0 / m_A74; + const double f24_26 = -f24 * m_A81; + m_A82 += m_A75 * f24_26; + m_A83 += m_A76 * f24_26; + RHS26 += f24_26 * RHS24; + const double f24_39 = -f24 * m_A153; + m_A154 += m_A75 * f24_39; + m_A158 += m_A76 * f24_39; + RHS39 += f24_39 * RHS24; + const double f25 = 1.0 / m_A77; + const double f25_42 = -f25 * m_A184; + m_A186 += m_A78 * f25_42; + m_A187 += m_A79 * f25_42; + RHS42 += f25_42 * RHS25; + const double f25_47 = -f25 * m_A230; + m_A238 += m_A78 * f25_47; + m_A241 += m_A79 * f25_47; + RHS47 += f25_47 * RHS25; + const double f26 = 1.0 / m_A82; + const double f26_39 = -f26 * m_A154; + m_A158 += m_A83 * f26_39; + RHS39 += f26_39 * RHS26; + const double f27 = 1.0 / m_A85; + const double f27_44 = -f27 * m_A204; + m_A205 += m_A86 * f27_44; + m_A207 += m_A87 * f27_44; + RHS44 += f27_44 * RHS27; + const double f27_49 = -f27 * m_A263; + m_A269 += m_A86 * f27_49; + m_A273 += m_A87 * f27_49; + RHS49 += f27_49 * RHS27; + const double f28 = 1.0 / m_A89; + const double f28_43 = -f28 * m_A190; + m_A195 += m_A90 * f28_43; + m_A198 += m_A91 * f28_43; + RHS43 += f28_43 * RHS28; + const double f28_48 = -f28 * m_A248; + m_A253 += m_A90 * f28_48; + m_A257 += m_A91 * f28_48; + RHS48 += f28_48 * RHS28; + const double f29 = 1.0 / m_A94; + const double f29_47 = -f29 * m_A231; + m_A241 += m_A95 * f29_47; + RHS47 += f29_47 * RHS29; + const double f30 = 1.0 / m_A99; + const double f30_32 = -f30 * m_A110; + m_A111 += m_A100 * f30_32; + m_A112 += m_A101 * f30_32; + m_A114 += m_A102 * f30_32; + m_A115 += m_A103 * f30_32; + RHS32 += f30_32 * RHS30; + const double f30_39 = -f30 * m_A155; + m_A156 += m_A100 * f30_39; + m_A158 += m_A101 * f30_39; + m_A160 += m_A102 * f30_39; + m_A164 += m_A103 * f30_39; + RHS39 += f30_39 * RHS30; + const double f30_43 = -f30 * m_A191; + m_A192 += m_A100 * f30_43; + m_A193 += m_A101 * f30_43; + m_A195 += m_A102 * f30_43; + m_A199 += m_A103 * f30_43; + RHS43 += f30_43 * RHS30; + const double f30_49 = -f30 * m_A264; + m_A265 += m_A100 * f30_49; + m_A266 += m_A101 * f30_49; + m_A268 += m_A102 * f30_49; + m_A273 += m_A103 * f30_49; + RHS49 += f30_49 * RHS30; + const double f31 = 1.0 / m_A105; + const double f31_40 = -f31 * m_A167; + m_A172 += m_A106 * f31_40; + m_A179 += m_A107 * f31_40; + RHS40 += f31_40 * RHS31; + const double f31_51 = -f31 * m_A292; + m_A294 += m_A106 * f31_51; + m_A302 += m_A107 * f31_51; + RHS51 += f31_51 * RHS31; + const double f32 = 1.0 / m_A111; + const double f32_39 = -f32 * m_A156; + m_A158 += m_A112 * f32_39; + m_A159 += m_A113 * f32_39; + m_A160 += m_A114 * f32_39; + m_A164 += m_A115 * f32_39; + RHS39 += f32_39 * RHS32; + const double f32_40 = -f32 * m_A168; + m_A171 += m_A112 * f32_40; + m_A172 += m_A113 * f32_40; + m_A173 += m_A114 * f32_40; + m_A177 += m_A115 * f32_40; + RHS40 += f32_40 * RHS32; + const double f32_43 = -f32 * m_A192; + m_A193 += m_A112 * f32_43; + m_A194 += m_A113 * f32_43; + m_A195 += m_A114 * f32_43; + m_A199 += m_A115 * f32_43; + RHS43 += f32_43 * RHS32; + const double f32_49 = -f32 * m_A265; + m_A266 += m_A112 * f32_49; + m_A267 += m_A113 * f32_49; + m_A268 += m_A114 * f32_49; + m_A273 += m_A115 * f32_49; + RHS49 += f32_49 * RHS32; + const double f33 = 1.0 / m_A119; + const double f33_36 = -f33 * m_A136; + m_A137 += m_A120 * f33_36; + m_A139 += m_A121 * f33_36; + m_A140 += m_A122 * f33_36; + m_A141 += m_A123 * f33_36; + m_A142 += m_A124 * f33_36; + RHS36 += f33_36 * RHS33; + const double f33_40 = -f33 * m_A169; + m_A170 += m_A120 * f33_40; + m_A172 += m_A121 * f33_40; + m_A174 += m_A122 * f33_40; + m_A175 += m_A123 * f33_40; + m_A176 += m_A124 * f33_40; + RHS40 += f33_40 * RHS33; + const double f33_46 = -f33 * m_A216; + m_A218 += m_A120 * f33_46; + m_A220 += m_A121 * f33_46; + m_A222 += m_A122 * f33_46; + m_A223 += m_A123 * f33_46; + m_A224 += m_A124 * f33_46; + RHS46 += f33_46 * RHS33; + const double f33_47 = -f33 * m_A232; + m_A233 += m_A120 * f33_47; + m_A236 += m_A121 * f33_47; + m_A240 += m_A122 * f33_47; + m_A241 += m_A123 * f33_47; + m_A242 += m_A124 * f33_47; + RHS47 += f33_47 * RHS33; + const double f33_48 = -f33 * m_A249; + m_A250 += m_A120 * f33_48; + m_A252 += m_A121 * f33_48; + m_A255 += m_A122 * f33_48; + m_A256 += m_A123 * f33_48; + m_A257 += m_A124 * f33_48; + RHS48 += f33_48 * RHS33; + const double f34 = 1.0 / m_A126; + const double f34_45 = -f34 * m_A210; + m_A211 += m_A127 * f34_45; + m_A212 += m_A128 * f34_45; + RHS45 += f34_45 * RHS34; + const double f34_50 = -f34 * m_A278; + m_A283 += m_A127 * f34_50; + m_A288 += m_A128 * f34_50; + RHS50 += f34_50 * RHS34; + const double f35 = 1.0 / m_A130; + const double f35_46 = -f35 * m_A217; + m_A222 += m_A131 * f35_46; + m_A227 += m_A132 * f35_46; + RHS46 += f35_46 * RHS35; + const double f35_51 = -f35 * m_A293; + m_A297 += m_A131 * f35_51; + m_A302 += m_A132 * f35_51; + RHS51 += f35_51 * RHS35; + const double f36 = 1.0 / m_A137; + const double f36_39 = -f36 * m_A157; + m_A158 += m_A138 * f36_39; + m_A159 += m_A139 * f36_39; + m_A161 += m_A140 * f36_39; + m_A162 += m_A141 * f36_39; + m_A163 += m_A142 * f36_39; + m_A165 += m_A143 * f36_39; + RHS39 += f36_39 * RHS36; + const double f36_40 = -f36 * m_A170; + m_A171 += m_A138 * f36_40; + m_A172 += m_A139 * f36_40; + m_A174 += m_A140 * f36_40; + m_A175 += m_A141 * f36_40; + m_A176 += m_A142 * f36_40; + m_A178 += m_A143 * f36_40; + RHS40 += f36_40 * RHS36; + const double f36_46 = -f36 * m_A218; + m_A219 += m_A138 * f36_46; + m_A220 += m_A139 * f36_46; + m_A222 += m_A140 * f36_46; + m_A223 += m_A141 * f36_46; + m_A224 += m_A142 * f36_46; + m_A226 += m_A143 * f36_46; + RHS46 += f36_46 * RHS36; + const double f36_47 = -f36 * m_A233; + m_A235 += m_A138 * f36_47; + m_A236 += m_A139 * f36_47; + m_A240 += m_A140 * f36_47; + m_A241 += m_A141 * f36_47; + m_A242 += m_A142 * f36_47; + m_A244 += m_A143 * f36_47; + RHS47 += f36_47 * RHS36; + const double f36_48 = -f36 * m_A250; + m_A251 += m_A138 * f36_48; + m_A252 += m_A139 * f36_48; + m_A255 += m_A140 * f36_48; + m_A256 += m_A141 * f36_48; + m_A257 += m_A142 * f36_48; + m_A259 += m_A143 * f36_48; + RHS48 += f36_48 * RHS36; + const double f36_50 = -f36 * m_A279; + m_A280 += m_A138 * f36_50; + m_A281 += m_A139 * f36_50; + m_A284 += m_A140 * f36_50; + m_A285 += m_A141 * f36_50; + m_A286 += m_A142 * f36_50; + m_A288 += m_A143 * f36_50; + RHS50 += f36_50 * RHS36; + const double f37 = 1.0 / m_A145; + const double f37_47 = -f37 * m_A234; + m_A241 += m_A146 * f37_47; + RHS47 += f37_47 * RHS37; + const double f38 = 1.0 / m_A148; + const double f38_42 = -f38 * m_A185; + m_A186 += m_A149 * f38_42; + RHS42 += f38_42 * RHS38; + const double f39 = 1.0 / m_A158; + const double f39_40 = -f39 * m_A171; + m_A172 += m_A159 * f39_40; + m_A173 += m_A160 * f39_40; + m_A174 += m_A161 * f39_40; + m_A175 += m_A162 * f39_40; + m_A176 += m_A163 * f39_40; + m_A177 += m_A164 * f39_40; + m_A178 += m_A165 * f39_40; + RHS40 += f39_40 * RHS39; + const double f39_43 = -f39 * m_A193; + m_A194 += m_A159 * f39_43; + m_A195 += m_A160 * f39_43; + m_A196 += m_A161 * f39_43; + m_A197 += m_A162 * f39_43; + m_A198 += m_A163 * f39_43; + m_A199 += m_A164 * f39_43; + m_A200 += m_A165 * f39_43; + RHS43 += f39_43 * RHS39; + const double f39_46 = -f39 * m_A219; + m_A220 += m_A159 * f39_46; + m_A221 += m_A160 * f39_46; + m_A222 += m_A161 * f39_46; + m_A223 += m_A162 * f39_46; + m_A224 += m_A163 * f39_46; + m_A225 += m_A164 * f39_46; + m_A226 += m_A165 * f39_46; + RHS46 += f39_46 * RHS39; + const double f39_47 = -f39 * m_A235; + m_A236 += m_A159 * f39_47; + m_A239 += m_A160 * f39_47; + m_A240 += m_A161 * f39_47; + m_A241 += m_A162 * f39_47; + m_A242 += m_A163 * f39_47; + m_A243 += m_A164 * f39_47; + m_A244 += m_A165 * f39_47; + RHS47 += f39_47 * RHS39; + const double f39_48 = -f39 * m_A251; + m_A252 += m_A159 * f39_48; + m_A253 += m_A160 * f39_48; + m_A255 += m_A161 * f39_48; + m_A256 += m_A162 * f39_48; + m_A257 += m_A163 * f39_48; + m_A258 += m_A164 * f39_48; + m_A259 += m_A165 * f39_48; + RHS48 += f39_48 * RHS39; + const double f39_49 = -f39 * m_A266; + m_A267 += m_A159 * f39_49; + m_A268 += m_A160 * f39_49; + m_A270 += m_A161 * f39_49; + m_A271 += m_A162 * f39_49; + m_A272 += m_A163 * f39_49; + m_A273 += m_A164 * f39_49; + m_A274 += m_A165 * f39_49; + RHS49 += f39_49 * RHS39; + const double f39_50 = -f39 * m_A280; + m_A281 += m_A159 * f39_50; + m_A282 += m_A160 * f39_50; + m_A284 += m_A161 * f39_50; + m_A285 += m_A162 * f39_50; + m_A286 += m_A163 * f39_50; + m_A287 += m_A164 * f39_50; + m_A288 += m_A165 * f39_50; + RHS50 += f39_50 * RHS39; + const double f40 = 1.0 / m_A172; + const double f40_43 = -f40 * m_A194; + m_A195 += m_A173 * f40_43; + m_A196 += m_A174 * f40_43; + m_A197 += m_A175 * f40_43; + m_A198 += m_A176 * f40_43; + m_A199 += m_A177 * f40_43; + m_A200 += m_A178 * f40_43; + m_A201 += m_A179 * f40_43; + RHS43 += f40_43 * RHS40; + const double f40_46 = -f40 * m_A220; + m_A221 += m_A173 * f40_46; + m_A222 += m_A174 * f40_46; + m_A223 += m_A175 * f40_46; + m_A224 += m_A176 * f40_46; + m_A225 += m_A177 * f40_46; + m_A226 += m_A178 * f40_46; + m_A227 += m_A179 * f40_46; + RHS46 += f40_46 * RHS40; + const double f40_47 = -f40 * m_A236; + m_A239 += m_A173 * f40_47; + m_A240 += m_A174 * f40_47; + m_A241 += m_A175 * f40_47; + m_A242 += m_A176 * f40_47; + m_A243 += m_A177 * f40_47; + m_A244 += m_A178 * f40_47; + m_A245 += m_A179 * f40_47; + RHS47 += f40_47 * RHS40; + const double f40_48 = -f40 * m_A252; + m_A253 += m_A173 * f40_48; + m_A255 += m_A174 * f40_48; + m_A256 += m_A175 * f40_48; + m_A257 += m_A176 * f40_48; + m_A258 += m_A177 * f40_48; + m_A259 += m_A178 * f40_48; + m_A260 += m_A179 * f40_48; + RHS48 += f40_48 * RHS40; + const double f40_49 = -f40 * m_A267; + m_A268 += m_A173 * f40_49; + m_A270 += m_A174 * f40_49; + m_A271 += m_A175 * f40_49; + m_A272 += m_A176 * f40_49; + m_A273 += m_A177 * f40_49; + m_A274 += m_A178 * f40_49; + m_A275 += m_A179 * f40_49; + RHS49 += f40_49 * RHS40; + const double f40_50 = -f40 * m_A281; + m_A282 += m_A173 * f40_50; + m_A284 += m_A174 * f40_50; + m_A285 += m_A175 * f40_50; + m_A286 += m_A176 * f40_50; + m_A287 += m_A177 * f40_50; + m_A288 += m_A178 * f40_50; + m_A289 += m_A179 * f40_50; + RHS50 += f40_50 * RHS40; + const double f40_51 = -f40 * m_A294; + m_A295 += m_A173 * f40_51; + m_A297 += m_A174 * f40_51; + m_A298 += m_A175 * f40_51; + m_A299 += m_A176 * f40_51; + m_A300 += m_A177 * f40_51; + m_A301 += m_A178 * f40_51; + m_A302 += m_A179 * f40_51; + RHS51 += f40_51 * RHS40; + const double f41 = 1.0 / m_A181; + const double f41_47 = -f41 * m_A237; + m_A241 += m_A182 * f41_47; + RHS47 += f41_47 * RHS41; + const double f42 = 1.0 / m_A186; + const double f42_47 = -f42 * m_A238; + m_A241 += m_A187 * f42_47; + RHS47 += f42_47 * RHS42; + const double f43 = 1.0 / m_A195; + const double f43_46 = -f43 * m_A221; + m_A222 += m_A196 * f43_46; + m_A223 += m_A197 * f43_46; + m_A224 += m_A198 * f43_46; + m_A225 += m_A199 * f43_46; + m_A226 += m_A200 * f43_46; + m_A227 += m_A201 * f43_46; + RHS46 += f43_46 * RHS43; + const double f43_47 = -f43 * m_A239; + m_A240 += m_A196 * f43_47; + m_A241 += m_A197 * f43_47; + m_A242 += m_A198 * f43_47; + m_A243 += m_A199 * f43_47; + m_A244 += m_A200 * f43_47; + m_A245 += m_A201 * f43_47; + RHS47 += f43_47 * RHS43; + const double f43_48 = -f43 * m_A253; + m_A255 += m_A196 * f43_48; + m_A256 += m_A197 * f43_48; + m_A257 += m_A198 * f43_48; + m_A258 += m_A199 * f43_48; + m_A259 += m_A200 * f43_48; + m_A260 += m_A201 * f43_48; + RHS48 += f43_48 * RHS43; + const double f43_49 = -f43 * m_A268; + m_A270 += m_A196 * f43_49; + m_A271 += m_A197 * f43_49; + m_A272 += m_A198 * f43_49; + m_A273 += m_A199 * f43_49; + m_A274 += m_A200 * f43_49; + m_A275 += m_A201 * f43_49; + RHS49 += f43_49 * RHS43; + const double f43_50 = -f43 * m_A282; + m_A284 += m_A196 * f43_50; + m_A285 += m_A197 * f43_50; + m_A286 += m_A198 * f43_50; + m_A287 += m_A199 * f43_50; + m_A288 += m_A200 * f43_50; + m_A289 += m_A201 * f43_50; + RHS50 += f43_50 * RHS43; + const double f43_51 = -f43 * m_A295; + m_A297 += m_A196 * f43_51; + m_A298 += m_A197 * f43_51; + m_A299 += m_A198 * f43_51; + m_A300 += m_A199 * f43_51; + m_A301 += m_A200 * f43_51; + m_A302 += m_A201 * f43_51; + RHS51 += f43_51 * RHS43; + const double f44 = 1.0 / m_A205; + const double f44_48 = -f44 * m_A254; + m_A257 += m_A206 * f44_48; + m_A258 += m_A207 * f44_48; + RHS48 += f44_48 * RHS44; + const double f44_49 = -f44 * m_A269; + m_A272 += m_A206 * f44_49; + m_A273 += m_A207 * f44_49; + RHS49 += f44_49 * RHS44; + const double f45 = 1.0 / m_A211; + const double f45_50 = -f45 * m_A283; + m_A288 += m_A212 * f45_50; + m_A289 += m_A213 * f45_50; + RHS50 += f45_50 * RHS45; + const double f45_51 = -f45 * m_A296; + m_A301 += m_A212 * f45_51; + m_A302 += m_A213 * f45_51; + RHS51 += f45_51 * RHS45; + const double f46 = 1.0 / m_A222; + const double f46_47 = -f46 * m_A240; + m_A241 += m_A223 * f46_47; + m_A242 += m_A224 * f46_47; + m_A243 += m_A225 * f46_47; + m_A244 += m_A226 * f46_47; + m_A245 += m_A227 * f46_47; + RHS47 += f46_47 * RHS46; + const double f46_48 = -f46 * m_A255; + m_A256 += m_A223 * f46_48; + m_A257 += m_A224 * f46_48; + m_A258 += m_A225 * f46_48; + m_A259 += m_A226 * f46_48; + m_A260 += m_A227 * f46_48; + RHS48 += f46_48 * RHS46; + const double f46_49 = -f46 * m_A270; + m_A271 += m_A223 * f46_49; + m_A272 += m_A224 * f46_49; + m_A273 += m_A225 * f46_49; + m_A274 += m_A226 * f46_49; + m_A275 += m_A227 * f46_49; + RHS49 += f46_49 * RHS46; + const double f46_50 = -f46 * m_A284; + m_A285 += m_A223 * f46_50; + m_A286 += m_A224 * f46_50; + m_A287 += m_A225 * f46_50; + m_A288 += m_A226 * f46_50; + m_A289 += m_A227 * f46_50; + RHS50 += f46_50 * RHS46; + const double f46_51 = -f46 * m_A297; + m_A298 += m_A223 * f46_51; + m_A299 += m_A224 * f46_51; + m_A300 += m_A225 * f46_51; + m_A301 += m_A226 * f46_51; + m_A302 += m_A227 * f46_51; + RHS51 += f46_51 * RHS46; + const double f47 = 1.0 / m_A241; + const double f47_48 = -f47 * m_A256; + m_A257 += m_A242 * f47_48; + m_A258 += m_A243 * f47_48; + m_A259 += m_A244 * f47_48; + m_A260 += m_A245 * f47_48; + RHS48 += f47_48 * RHS47; + const double f47_49 = -f47 * m_A271; + m_A272 += m_A242 * f47_49; + m_A273 += m_A243 * f47_49; + m_A274 += m_A244 * f47_49; + m_A275 += m_A245 * f47_49; + RHS49 += f47_49 * RHS47; + const double f47_50 = -f47 * m_A285; + m_A286 += m_A242 * f47_50; + m_A287 += m_A243 * f47_50; + m_A288 += m_A244 * f47_50; + m_A289 += m_A245 * f47_50; + RHS50 += f47_50 * RHS47; + const double f47_51 = -f47 * m_A298; + m_A299 += m_A242 * f47_51; + m_A300 += m_A243 * f47_51; + m_A301 += m_A244 * f47_51; + m_A302 += m_A245 * f47_51; + RHS51 += f47_51 * RHS47; + const double f48 = 1.0 / m_A257; + const double f48_49 = -f48 * m_A272; + m_A273 += m_A258 * f48_49; + m_A274 += m_A259 * f48_49; + m_A275 += m_A260 * f48_49; + RHS49 += f48_49 * RHS48; + const double f48_50 = -f48 * m_A286; + m_A287 += m_A258 * f48_50; + m_A288 += m_A259 * f48_50; + m_A289 += m_A260 * f48_50; + RHS50 += f48_50 * RHS48; + const double f48_51 = -f48 * m_A299; + m_A300 += m_A258 * f48_51; + m_A301 += m_A259 * f48_51; + m_A302 += m_A260 * f48_51; + RHS51 += f48_51 * RHS48; + const double f49 = 1.0 / m_A273; + const double f49_50 = -f49 * m_A287; + m_A288 += m_A274 * f49_50; + m_A289 += m_A275 * f49_50; + RHS50 += f49_50 * RHS49; + const double f49_51 = -f49 * m_A300; + m_A301 += m_A274 * f49_51; + m_A302 += m_A275 * f49_51; + RHS51 += f49_51 * RHS49; + const double f50 = 1.0 / m_A288; + const double f50_51 = -f50 * m_A301; + m_A302 += m_A289 * f50_51; + RHS51 += f50_51 * RHS50; + V[51] = RHS51 / m_A302; + double tmp50 = 0.0; + tmp50 += m_A289 * V[51]; + V[50] = (RHS50 - tmp50) / m_A288; + double tmp49 = 0.0; + tmp49 += m_A274 * V[50]; + tmp49 += m_A275 * V[51]; + V[49] = (RHS49 - tmp49) / m_A273; + double tmp48 = 0.0; + tmp48 += m_A258 * V[49]; + tmp48 += m_A259 * V[50]; + tmp48 += m_A260 * V[51]; + V[48] = (RHS48 - tmp48) / m_A257; + double tmp47 = 0.0; + tmp47 += m_A242 * V[48]; + tmp47 += m_A243 * V[49]; + tmp47 += m_A244 * V[50]; + tmp47 += m_A245 * V[51]; + V[47] = (RHS47 - tmp47) / m_A241; + double tmp46 = 0.0; + tmp46 += m_A223 * V[47]; + tmp46 += m_A224 * V[48]; + tmp46 += m_A225 * V[49]; + tmp46 += m_A226 * V[50]; + tmp46 += m_A227 * V[51]; + V[46] = (RHS46 - tmp46) / m_A222; + double tmp45 = 0.0; + tmp45 += m_A212 * V[50]; + tmp45 += m_A213 * V[51]; + V[45] = (RHS45 - tmp45) / m_A211; + double tmp44 = 0.0; + tmp44 += m_A206 * V[48]; + tmp44 += m_A207 * V[49]; + V[44] = (RHS44 - tmp44) / m_A205; + double tmp43 = 0.0; + tmp43 += m_A196 * V[46]; + tmp43 += m_A197 * V[47]; + tmp43 += m_A198 * V[48]; + tmp43 += m_A199 * V[49]; + tmp43 += m_A200 * V[50]; + tmp43 += m_A201 * V[51]; + V[43] = (RHS43 - tmp43) / m_A195; + double tmp42 = 0.0; + tmp42 += m_A187 * V[47]; + V[42] = (RHS42 - tmp42) / m_A186; + double tmp41 = 0.0; + tmp41 += m_A182 * V[47]; + V[41] = (RHS41 - tmp41) / m_A181; + double tmp40 = 0.0; + tmp40 += m_A173 * V[43]; + tmp40 += m_A174 * V[46]; + tmp40 += m_A175 * V[47]; + tmp40 += m_A176 * V[48]; + tmp40 += m_A177 * V[49]; + tmp40 += m_A178 * V[50]; + tmp40 += m_A179 * V[51]; + V[40] = (RHS40 - tmp40) / m_A172; + double tmp39 = 0.0; + tmp39 += m_A159 * V[40]; + tmp39 += m_A160 * V[43]; + tmp39 += m_A161 * V[46]; + tmp39 += m_A162 * V[47]; + tmp39 += m_A163 * V[48]; + tmp39 += m_A164 * V[49]; + tmp39 += m_A165 * V[50]; + V[39] = (RHS39 - tmp39) / m_A158; + double tmp38 = 0.0; + tmp38 += m_A149 * V[42]; + V[38] = (RHS38 - tmp38) / m_A148; + double tmp37 = 0.0; + tmp37 += m_A146 * V[47]; + V[37] = (RHS37 - tmp37) / m_A145; + double tmp36 = 0.0; + tmp36 += m_A138 * V[39]; + tmp36 += m_A139 * V[40]; + tmp36 += m_A140 * V[46]; + tmp36 += m_A141 * V[47]; + tmp36 += m_A142 * V[48]; + tmp36 += m_A143 * V[50]; + V[36] = (RHS36 - tmp36) / m_A137; + double tmp35 = 0.0; + tmp35 += m_A131 * V[46]; + tmp35 += m_A132 * V[51]; + V[35] = (RHS35 - tmp35) / m_A130; + double tmp34 = 0.0; + tmp34 += m_A127 * V[45]; + tmp34 += m_A128 * V[50]; + V[34] = (RHS34 - tmp34) / m_A126; + double tmp33 = 0.0; + tmp33 += m_A120 * V[36]; + tmp33 += m_A121 * V[40]; + tmp33 += m_A122 * V[46]; + tmp33 += m_A123 * V[47]; + tmp33 += m_A124 * V[48]; + V[33] = (RHS33 - tmp33) / m_A119; + double tmp32 = 0.0; + tmp32 += m_A112 * V[39]; + tmp32 += m_A113 * V[40]; + tmp32 += m_A114 * V[43]; + tmp32 += m_A115 * V[49]; + V[32] = (RHS32 - tmp32) / m_A111; + double tmp31 = 0.0; + tmp31 += m_A106 * V[40]; + tmp31 += m_A107 * V[51]; + V[31] = (RHS31 - tmp31) / m_A105; + double tmp30 = 0.0; + tmp30 += m_A100 * V[32]; + tmp30 += m_A101 * V[39]; + tmp30 += m_A102 * V[43]; + tmp30 += m_A103 * V[49]; + V[30] = (RHS30 - tmp30) / m_A99; + double tmp29 = 0.0; + tmp29 += m_A95 * V[47]; + V[29] = (RHS29 - tmp29) / m_A94; + double tmp28 = 0.0; + tmp28 += m_A90 * V[43]; + tmp28 += m_A91 * V[48]; + V[28] = (RHS28 - tmp28) / m_A89; + double tmp27 = 0.0; + tmp27 += m_A86 * V[44]; + tmp27 += m_A87 * V[49]; + V[27] = (RHS27 - tmp27) / m_A85; + double tmp26 = 0.0; + tmp26 += m_A83 * V[39]; + V[26] = (RHS26 - tmp26) / m_A82; + double tmp25 = 0.0; + tmp25 += m_A78 * V[42]; + tmp25 += m_A79 * V[47]; + V[25] = (RHS25 - tmp25) / m_A77; + double tmp24 = 0.0; + tmp24 += m_A75 * V[26]; + tmp24 += m_A76 * V[39]; + V[24] = (RHS24 - tmp24) / m_A74; + double tmp23 = 0.0; + tmp23 += m_A71 * V[42]; + V[23] = (RHS23 - tmp23) / m_A70; + double tmp22 = 0.0; + tmp22 += m_A68 * V[29]; + tmp22 += m_A69 * V[47]; + V[22] = (RHS22 - tmp22) / m_A67; + double tmp21 = 0.0; + tmp21 += m_A66 * V[47]; + V[21] = (RHS21 - tmp21) / m_A65; + double tmp20 = 0.0; + tmp20 += m_A63 * V[33]; + tmp20 += m_A64 * V[47]; + V[20] = (RHS20 - tmp20) / m_A62; + double tmp19 = 0.0; + tmp19 += m_A59 * V[33]; + tmp19 += m_A60 * V[36]; + tmp19 += m_A61 * V[46]; + V[19] = (RHS19 - tmp19) / m_A58; + double tmp18 = 0.0; + tmp18 += m_A57 * V[29]; + V[18] = (RHS18 - tmp18) / m_A56; + double tmp17 = 0.0; + tmp17 += m_A54 * V[33]; + tmp17 += m_A55 * V[48]; + V[17] = (RHS17 - tmp17) / m_A53; + double tmp16 = 0.0; + tmp16 += m_A52 * V[40]; + V[16] = (RHS16 - tmp16) / m_A51; + double tmp15 = 0.0; + tmp15 += m_A50 * V[40]; + V[15] = (RHS15 - tmp15) / m_A49; + double tmp14 = 0.0; + tmp14 += m_A48 * V[37]; + V[14] = (RHS14 - tmp14) / m_A47; + double tmp13 = 0.0; + tmp13 += m_A45 * V[31]; + tmp13 += m_A46 * V[51]; + V[13] = (RHS13 - tmp13) / m_A44; + double tmp12 = 0.0; + tmp12 += m_A41 * V[30]; + tmp12 += m_A42 * V[32]; + tmp12 += m_A43 * V[43]; + V[12] = (RHS12 - tmp12) / m_A40; + double tmp11 = 0.0; + tmp11 += m_A38 * V[36]; + tmp11 += m_A39 * V[50]; + V[11] = (RHS11 - tmp11) / m_A37; + double tmp10 = 0.0; + tmp10 += m_A35 * V[36]; + tmp10 += m_A36 * V[39]; + V[10] = (RHS10 - tmp10) / m_A34; + double tmp9 = 0.0; + tmp9 += m_A31 * V[24]; + tmp9 += m_A32 * V[26]; + tmp9 += m_A33 * V[39]; + V[9] = (RHS9 - tmp9) / m_A30; + double tmp8 = 0.0; + tmp8 += m_A28 * V[30]; + tmp8 += m_A29 * V[39]; + V[8] = (RHS8 - tmp8) / m_A27; + double tmp7 = 0.0; + tmp7 += m_A24 * V[35]; + tmp7 += m_A25 * V[46]; + tmp7 += m_A26 * V[51]; + V[7] = (RHS7 - tmp7) / m_A23; + double tmp6 = 0.0; + tmp6 += m_A22 * V[24]; + V[6] = (RHS6 - tmp6) / m_A21; + double tmp5 = 0.0; + tmp5 += m_A18 * V[34]; + tmp5 += m_A19 * V[45]; + tmp5 += m_A20 * V[50]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A15 * V[45]; + tmp4 += m_A16 * V[51]; + V[4] = (RHS4 - tmp4) / m_A14; + double tmp3 = 0.0; + tmp3 += m_A12 * V[30]; + tmp3 += m_A13 * V[49]; + V[3] = (RHS3 - tmp3) / m_A11; + double tmp2 = 0.0; + tmp2 += m_A8 * V[28]; + tmp2 += m_A9 * V[43]; + tmp2 += m_A10 * V[48]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A5 * V[44]; + tmp1 += m_A6 * V[48]; + V[1] = (RHS1 - tmp1) / m_A4; + double tmp0 = 0.0; + tmp0 += m_A1 * V[27]; + tmp0 += m_A2 * V[44]; + tmp0 += m_A3 * V[49]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// solarq +static void nl_gcr_45_double_double_e081f90c2e0313f6(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A5 += go[4]; + m_A4 += go[5]; + m_A4 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[12]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + RHS2 -= go[15] * *cnV[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A10 += go[16]; + m_A9 += go[17]; + double RHS3 = Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[18] * *cnV[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A11 += gt[23]; + m_A11 += gt[24]; + m_A11 += gt[25]; + m_A11 += gt[26]; + m_A14 += go[19]; + m_A13 += go[20]; + m_A13 += go[21]; + m_A12 += go[22]; + m_A12 += go[23]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 += Idr[26]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + RHS4 -= go[26] * *cnV[26]; + m_A17 += gt[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A17 += gt[30]; + m_A17 += gt[31]; + m_A17 += gt[32]; + m_A16 += go[27]; + m_A16 += go[28]; + m_A15 += go[29]; + double RHS5 = Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 += Idr[30]; + RHS5 += Idr[31]; + RHS5 += Idr[32]; + RHS5 -= go[30] * *cnV[30]; + RHS5 -= go[31] * *cnV[31]; + RHS5 -= go[32] * *cnV[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A22 += gt[37]; + m_A22 += gt[38]; + m_A21 += go[33]; + m_A21 += go[34]; + m_A20 += go[35]; + double RHS6 = Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 += Idr[36]; + RHS6 += Idr[37]; + RHS6 += Idr[38]; + RHS6 -= go[36] * *cnV[36]; + RHS6 -= go[37] * *cnV[37]; + RHS6 -= go[38] * *cnV[38]; + m_A27 += gt[39]; + m_A27 += gt[40]; + m_A27 += gt[41]; + m_A27 += gt[42]; + m_A27 += gt[43]; + m_A28 += go[39]; + m_A28 += go[40]; + m_A25 += go[41]; + m_A25 += go[42]; + double RHS7 = Idr[39]; + RHS7 += Idr[40]; + RHS7 += Idr[41]; + RHS7 += Idr[42]; + RHS7 += Idr[43]; + RHS7 -= go[43] * *cnV[43]; + m_A33 += gt[44]; + m_A33 += gt[45]; + m_A33 += gt[46]; + m_A33 += gt[47]; + m_A33 += gt[48]; + m_A32 += go[44]; + m_A32 += go[45]; + m_A29 += go[46]; + m_A30 += go[47]; + double RHS8 = Idr[44]; + RHS8 += Idr[45]; + RHS8 += Idr[46]; + RHS8 += Idr[47]; + RHS8 += Idr[48]; + RHS8 -= go[48] * *cnV[48]; + m_A37 += gt[49]; + m_A37 += gt[50]; + m_A37 += gt[51]; + m_A37 += gt[52]; + m_A37 += gt[53]; + m_A38 += go[49]; + m_A38 += go[50]; + m_A35 += go[51]; + m_A35 += go[52]; + double RHS9 = Idr[49]; + RHS9 += Idr[50]; + RHS9 += Idr[51]; + RHS9 += Idr[52]; + RHS9 += Idr[53]; + RHS9 -= go[53] * *cnV[53]; + m_A44 += gt[54]; + m_A44 += gt[55]; + m_A44 += gt[56]; + m_A44 += gt[57]; + m_A44 += gt[58]; + m_A43 += go[54]; + m_A43 += go[55]; + m_A40 += go[56]; + m_A39 += go[57]; + double RHS10 = Idr[54]; + RHS10 += Idr[55]; + RHS10 += Idr[56]; + RHS10 += Idr[57]; + RHS10 += Idr[58]; + RHS10 -= go[58] * *cnV[58]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A15; + m_A17 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A16; + m_A17 += m_A3 * f1_5; + m_A18 += m_A4 * f1_5; + m_A19 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_7 = -f1 * m_A25; + m_A26 += m_A3 * f1_7; + m_A27 += m_A4 * f1_7; + m_A28 += m_A5 * f1_7; + RHS7 += f1_7 * RHS1; + const double f1_8 = -f1 * m_A29; + m_A31 += m_A3 * f1_8; + m_A32 += m_A4 * f1_8; + m_A33 += m_A5 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_6 = -f2 * m_A20; + m_A22 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_8 = -f3 * m_A30; + m_A33 += m_A9 * f3_8; + m_A34 += m_A10 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_10 = -f3 * m_A39; + m_A42 += m_A9 * f3_10; + m_A44 += m_A10 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_6 = -f4 * m_A21; + m_A22 += m_A12 * f4_6; + m_A23 += m_A13 * f4_6; + m_A24 += m_A14 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_9 = -f4 * m_A35; + m_A36 += m_A12 * f4_9; + m_A37 += m_A13 * f4_9; + m_A38 += m_A14 * f4_9; + RHS9 += f4_9 * RHS4; + const double f4_10 = -f4 * m_A40; + m_A41 += m_A12 * f4_10; + m_A43 += m_A13 * f4_10; + m_A44 += m_A14 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_7 = -f5 * m_A26; + m_A27 += m_A18 * f5_7; + m_A28 += m_A19 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_8 = -f5 * m_A31; + m_A32 += m_A18 * f5_8; + m_A33 += m_A19 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A22; + const double f6_9 = -f6 * m_A36; + m_A37 += m_A23 * f6_9; + m_A38 += m_A24 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_10 = -f6 * m_A41; + m_A43 += m_A23 * f6_10; + m_A44 += m_A24 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A27; + const double f7_8 = -f7 * m_A32; + m_A33 += m_A28 * f7_8; + RHS8 += f7_8 * RHS7; + const double f8 = 1.0 / m_A33; + const double f8_10 = -f8 * m_A42; + m_A44 += m_A34 * f8_10; + RHS10 += f8_10 * RHS8; + const double f9 = 1.0 / m_A37; + const double f9_10 = -f9 * m_A43; + m_A44 += m_A38 * f9_10; + RHS10 += f9_10 * RHS9; + V[10] = RHS10 / m_A44; + double tmp9 = 0.0; + tmp9 += m_A38 * V[10]; + V[9] = (RHS9 - tmp9) / m_A37; + double tmp8 = 0.0; + tmp8 += m_A34 * V[10]; + V[8] = (RHS8 - tmp8) / m_A33; + double tmp7 = 0.0; + tmp7 += m_A28 * V[8]; + V[7] = (RHS7 - tmp7) / m_A27; + double tmp6 = 0.0; + tmp6 += m_A23 * V[9]; + tmp6 += m_A24 * V[10]; + V[6] = (RHS6 - tmp6) / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[7]; + tmp5 += m_A19 * V[8]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A12 * V[6]; + tmp4 += m_A13 * V[9]; + tmp4 += m_A14 * V[10]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[8]; + tmp3 += m_A10 * V[10]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[6]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + tmp1 += m_A4 * V[7]; + tmp1 += m_A5 * V[8]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// solarq +static void nl_gcr_70_double_double_4e4931ccbfb7a3c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A4 += go[3]; + m_A3 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A7 += go[9]; + m_A6 += go[10]; + m_A6 += go[11]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A10 += go[13]; + m_A9 += go[14]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A11 += gt[23]; + m_A11 += gt[24]; + m_A11 += gt[25]; + m_A11 += gt[26]; + m_A12 += go[20]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 += Idr[26]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + RHS4 -= go[26] * *cnV[26]; + m_A13 += gt[27]; + m_A13 += gt[28]; + m_A13 += gt[29]; + m_A13 += gt[30]; + m_A13 += gt[31]; + m_A14 += go[27]; + m_A15 += go[28]; + double RHS5 = Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 += Idr[30]; + RHS5 += Idr[31]; + RHS5 -= go[29] * *cnV[29]; + RHS5 -= go[30] * *cnV[30]; + RHS5 -= go[31] * *cnV[31]; + m_A16 += gt[32]; + m_A16 += gt[33]; + m_A16 += gt[34]; + m_A16 += gt[35]; + m_A16 += gt[36]; + m_A16 += gt[37]; + m_A16 += gt[38]; + m_A17 += go[32]; + m_A18 += go[33]; + double RHS6 = Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 += Idr[36]; + RHS6 += Idr[37]; + RHS6 += Idr[38]; + RHS6 -= go[34] * *cnV[34]; + RHS6 -= go[35] * *cnV[35]; + RHS6 -= go[36] * *cnV[36]; + RHS6 -= go[37] * *cnV[37]; + RHS6 -= go[38] * *cnV[38]; + m_A19 += gt[39]; + m_A19 += gt[40]; + m_A19 += gt[41]; + m_A19 += gt[42]; + m_A20 += go[39]; + m_A21 += go[40]; + double RHS7 = Idr[39]; + RHS7 += Idr[40]; + RHS7 += Idr[41]; + RHS7 += Idr[42]; + RHS7 -= go[41] * *cnV[41]; + RHS7 -= go[42] * *cnV[42]; + m_A22 += gt[43]; + m_A22 += gt[44]; + m_A22 += gt[45]; + m_A22 += gt[46]; + m_A22 += gt[47]; + m_A23 += go[43]; + m_A24 += go[44]; + double RHS8 = Idr[43]; + RHS8 += Idr[44]; + RHS8 += Idr[45]; + RHS8 += Idr[46]; + RHS8 += Idr[47]; + RHS8 -= go[45] * *cnV[45]; + RHS8 -= go[46] * *cnV[46]; + RHS8 -= go[47] * *cnV[47]; + m_A25 += gt[48]; + m_A25 += gt[49]; + m_A25 += gt[50]; + m_A26 += go[48]; + m_A27 += go[49]; + double RHS9 = Idr[48]; + RHS9 += Idr[49]; + RHS9 += Idr[50]; + RHS9 -= go[50] * *cnV[50]; + m_A30 += gt[51]; + m_A30 += gt[52]; + m_A30 += gt[53]; + m_A30 += gt[54]; + m_A30 += gt[55]; + m_A30 += gt[56]; + m_A29 += go[51]; + m_A29 += go[52]; + m_A28 += go[53]; + double RHS10 = Idr[51]; + RHS10 += Idr[52]; + RHS10 += Idr[53]; + RHS10 += Idr[54]; + RHS10 += Idr[55]; + RHS10 += Idr[56]; + RHS10 -= go[54] * *cnV[54]; + RHS10 -= go[55] * *cnV[55]; + RHS10 -= go[56] * *cnV[56]; + m_A35 += gt[57]; + m_A35 += gt[58]; + m_A35 += gt[59]; + m_A35 += gt[60]; + m_A35 += gt[61]; + m_A33 += go[57]; + m_A33 += go[58]; + m_A32 += go[59]; + double RHS11 = Idr[57]; + RHS11 += Idr[58]; + RHS11 += Idr[59]; + RHS11 += Idr[60]; + RHS11 += Idr[61]; + RHS11 -= go[60] * *cnV[60]; + RHS11 -= go[61] * *cnV[61]; + m_A39 += gt[62]; + m_A39 += gt[63]; + m_A39 += gt[64]; + m_A39 += gt[65]; + m_A39 += gt[66]; + m_A40 += go[62]; + m_A37 += go[63]; + double RHS12 = Idr[62]; + RHS12 += Idr[63]; + RHS12 += Idr[64]; + RHS12 += Idr[65]; + RHS12 += Idr[66]; + RHS12 -= go[64] * *cnV[64]; + RHS12 -= go[65] * *cnV[65]; + RHS12 -= go[66] * *cnV[66]; + m_A42 += gt[67]; + m_A42 += gt[68]; + m_A42 += gt[69]; + m_A42 += gt[70]; + m_A42 += gt[71]; + m_A42 += gt[72]; + m_A42 += gt[73]; + m_A43 += go[67]; + m_A41 += go[68]; + double RHS13 = Idr[67]; + RHS13 += Idr[68]; + RHS13 += Idr[69]; + RHS13 += Idr[70]; + RHS13 += Idr[71]; + RHS13 += Idr[72]; + RHS13 += Idr[73]; + RHS13 -= go[69] * *cnV[69]; + RHS13 -= go[70] * *cnV[70]; + RHS13 -= go[71] * *cnV[71]; + RHS13 -= go[72] * *cnV[72]; + RHS13 -= go[73] * *cnV[73]; + m_A48 += gt[74]; + m_A48 += gt[75]; + m_A48 += gt[76]; + m_A46 += go[74]; + m_A45 += go[75]; + m_A50 += go[76]; + double RHS14 = Idr[74]; + RHS14 += Idr[75]; + RHS14 += Idr[76]; + m_A55 += gt[77]; + m_A55 += gt[78]; + m_A55 += gt[79]; + m_A53 += go[77]; + m_A51 += go[78]; + m_A57 += go[79]; + double RHS15 = Idr[77]; + RHS15 += Idr[78]; + RHS15 += Idr[79]; + m_A62 += gt[80]; + m_A62 += gt[81]; + m_A62 += gt[82]; + m_A62 += gt[83]; + m_A62 += gt[84]; + m_A58 += go[80]; + m_A60 += go[81]; + m_A59 += go[82]; + double RHS16 = Idr[80]; + RHS16 += Idr[81]; + RHS16 += Idr[82]; + RHS16 += Idr[83]; + RHS16 += Idr[84]; + RHS16 -= go[83] * *cnV[83]; + RHS16 -= go[84] * *cnV[84]; + m_A69 += gt[85]; + m_A69 += gt[86]; + m_A69 += gt[87]; + m_A69 += gt[88]; + m_A69 += gt[89]; + m_A69 += gt[90]; + m_A64 += go[85]; + m_A67 += go[86]; + m_A65 += go[87]; + m_A66 += go[88]; + double RHS17 = Idr[85]; + RHS17 += Idr[86]; + RHS17 += Idr[87]; + RHS17 += Idr[88]; + RHS17 += Idr[89]; + RHS17 += Idr[90]; + RHS17 -= go[89] * *cnV[89]; + RHS17 -= go[90] * *cnV[90]; + const double f0 = 1.0 / m_A0; + const double f0_10 = -f0 * m_A28; + m_A30 += m_A1 * f0_10; + RHS10 += f0_10 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A29; + m_A30 += m_A3 * f1_10; + m_A31 += m_A4 * f1_10; + RHS10 += f1_10 * RHS1; + const double f1_11 = -f1 * m_A32; + m_A34 += m_A3 * f1_11; + m_A35 += m_A4 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_11 = -f2 * m_A33; + m_A35 += m_A6 * f2_11; + m_A36 += m_A7 * f2_11; + RHS11 += f2_11 * RHS2; + const double f2_12 = -f2 * m_A37; + m_A38 += m_A6 * f2_12; + m_A39 += m_A7 * f2_12; + RHS12 += f2_12 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_17 = -f3 * m_A64; + m_A66 += m_A9 * f3_17; + m_A69 += m_A10 * f3_17; + RHS17 += f3_17 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_16 = -f4 * m_A58; + m_A59 += m_A12 * f4_16; + RHS16 += f4_16 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_15 = -f5 * m_A51; + m_A52 += m_A14 * f5_15; + m_A55 += m_A15 * f5_15; + RHS15 += f5_15 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_15 = -f6 * m_A52; + m_A53 += m_A17 * f6_15; + m_A55 += m_A18 * f6_15; + RHS15 += f6_15 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_13 = -f7 * m_A41; + m_A43 += m_A20 * f7_13; + m_A44 += m_A21 * f7_13; + RHS13 += f7_13 * RHS7; + const double f7_14 = -f7 * m_A45; + m_A48 += m_A20 * f7_14; + m_A49 += m_A21 * f7_14; + RHS14 += f7_14 * RHS7; + const double f7_15 = -f7 * m_A53; + m_A54 += m_A20 * f7_15; + m_A55 += m_A21 * f7_15; + RHS15 += f7_15 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_14 = -f8 * m_A46; + m_A47 += m_A23 * f8_14; + m_A48 += m_A24 * f8_14; + RHS14 += f8_14 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_16 = -f9 * m_A59; + m_A62 += m_A26 * f9_16; + m_A63 += m_A27 * f9_16; + RHS16 += f9_16 * RHS9; + const double f9_17 = -f9 * m_A65; + m_A68 += m_A26 * f9_17; + m_A69 += m_A27 * f9_17; + RHS17 += f9_17 * RHS9; + const double f10 = 1.0 / m_A30; + const double f10_11 = -f10 * m_A34; + m_A35 += m_A31 * f10_11; + RHS11 += f10_11 * RHS10; + const double f11 = 1.0 / m_A35; + const double f11_12 = -f11 * m_A38; + m_A39 += m_A36 * f11_12; + RHS12 += f11_12 * RHS11; + const double f12 = 1.0 / m_A39; + const double f12_17 = -f12 * m_A66; + m_A69 += m_A40 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A42; + const double f13_14 = -f13 * m_A47; + m_A48 += m_A43 * f13_14; + m_A49 += m_A44 * f13_14; + RHS14 += f13_14 * RHS13; + const double f14 = 1.0 / m_A48; + const double f14_15 = -f14 * m_A54; + m_A55 += m_A49 * f14_15; + m_A56 += m_A50 * f14_15; + RHS15 += f14_15 * RHS14; + const double f14_16 = -f14 * m_A60; + m_A61 += m_A49 * f14_16; + m_A62 += m_A50 * f14_16; + RHS16 += f14_16 * RHS14; + const double f15 = 1.0 / m_A55; + const double f15_16 = -f15 * m_A61; + m_A62 += m_A56 * f15_16; + m_A63 += m_A57 * f15_16; + RHS16 += f15_16 * RHS15; + const double f15_17 = -f15 * m_A67; + m_A68 += m_A56 * f15_17; + m_A69 += m_A57 * f15_17; + RHS17 += f15_17 * RHS15; + const double f16 = 1.0 / m_A62; + const double f16_17 = -f16 * m_A68; + m_A69 += m_A63 * f16_17; + RHS17 += f16_17 * RHS16; + V[17] = RHS17 / m_A69; + double tmp16 = 0.0; + tmp16 += m_A63 * V[17]; + V[16] = (RHS16 - tmp16) / m_A62; + double tmp15 = 0.0; + tmp15 += m_A56 * V[16]; + tmp15 += m_A57 * V[17]; + V[15] = (RHS15 - tmp15) / m_A55; + double tmp14 = 0.0; + tmp14 += m_A49 * V[15]; + tmp14 += m_A50 * V[16]; + V[14] = (RHS14 - tmp14) / m_A48; + double tmp13 = 0.0; + tmp13 += m_A43 * V[14]; + tmp13 += m_A44 * V[15]; + V[13] = (RHS13 - tmp13) / m_A42; + double tmp12 = 0.0; + tmp12 += m_A40 * V[17]; + V[12] = (RHS12 - tmp12) / m_A39; + double tmp11 = 0.0; + tmp11 += m_A36 * V[12]; + V[11] = (RHS11 - tmp11) / m_A35; + double tmp10 = 0.0; + tmp10 += m_A31 * V[11]; + V[10] = (RHS10 - tmp10) / m_A30; + double tmp9 = 0.0; + tmp9 += m_A26 * V[16]; + tmp9 += m_A27 * V[17]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A23 * V[13]; + tmp8 += m_A24 * V[14]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A20 * V[14]; + tmp7 += m_A21 * V[15]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A17 * V[7]; + tmp6 += m_A18 * V[15]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[6]; + tmp5 += m_A15 * V[15]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A12 * V[9]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[12]; + tmp3 += m_A10 * V[17]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[11]; + tmp2 += m_A7 * V[12]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[10]; + tmp1 += m_A4 * V[11]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[10]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// solarq +static void nl_gcr_76_double_double_34e910fc1896999f(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A5 += go[4]; + m_A4 += go[5]; + m_A4 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[12]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 -= go[13] * *cnV[13]; + RHS2 -= go[14] * *cnV[14]; + RHS2 -= go[15] * *cnV[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A8 += gt[22]; + m_A8 += gt[23]; + m_A11 += go[16]; + m_A10 += go[17]; + m_A10 += go[18]; + m_A9 += go[19]; + m_A9 += go[20]; + double RHS3 = Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 += Idr[20]; + RHS3 += Idr[21]; + RHS3 += Idr[22]; + RHS3 += Idr[23]; + RHS3 -= go[21] * *cnV[21]; + RHS3 -= go[22] * *cnV[22]; + RHS3 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A12 += gt[26]; + m_A13 += go[24]; + m_A14 += go[25]; + double RHS4 = Idr[24]; + RHS4 += Idr[25]; + RHS4 += Idr[26]; + RHS4 -= go[26] * *cnV[26]; + m_A15 += gt[27]; + m_A15 += gt[28]; + m_A15 += gt[29]; + m_A15 += gt[30]; + m_A16 += go[27]; + double RHS5 = Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 += Idr[30]; + RHS5 -= go[28] * *cnV[28]; + RHS5 -= go[29] * *cnV[29]; + RHS5 -= go[30] * *cnV[30]; + m_A17 += gt[31]; + m_A17 += gt[32]; + m_A17 += gt[33]; + m_A17 += gt[34]; + m_A17 += gt[35]; + m_A17 += gt[36]; + m_A17 += gt[37]; + m_A17 += gt[38]; + m_A20 += go[31]; + m_A19 += go[32]; + m_A19 += go[33]; + m_A18 += go[34]; + m_A18 += go[35]; + double RHS6 = Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 += Idr[35]; + RHS6 += Idr[36]; + RHS6 += Idr[37]; + RHS6 += Idr[38]; + RHS6 -= go[36] * *cnV[36]; + RHS6 -= go[37] * *cnV[37]; + RHS6 -= go[38] * *cnV[38]; + m_A21 += gt[39]; + m_A21 += gt[40]; + m_A21 += gt[41]; + m_A23 += go[39]; + m_A22 += go[40]; + double RHS7 = Idr[39]; + RHS7 += Idr[40]; + RHS7 += Idr[41]; + RHS7 -= go[41] * *cnV[41]; + m_A26 += gt[42]; + m_A26 += gt[43]; + m_A26 += gt[44]; + m_A26 += gt[45]; + m_A26 += gt[46]; + m_A26 += gt[47]; + m_A25 += go[42]; + m_A25 += go[43]; + m_A24 += go[44]; + double RHS8 = Idr[42]; + RHS8 += Idr[43]; + RHS8 += Idr[44]; + RHS8 += Idr[45]; + RHS8 += Idr[46]; + RHS8 += Idr[47]; + RHS8 -= go[45] * *cnV[45]; + RHS8 -= go[46] * *cnV[46]; + RHS8 -= go[47] * *cnV[47]; + m_A31 += gt[48]; + m_A31 += gt[49]; + m_A31 += gt[50]; + m_A31 += gt[51]; + m_A31 += gt[52]; + m_A32 += go[48]; + m_A32 += go[49]; + m_A29 += go[50]; + m_A29 += go[51]; + double RHS9 = Idr[48]; + RHS9 += Idr[49]; + RHS9 += Idr[50]; + RHS9 += Idr[51]; + RHS9 += Idr[52]; + RHS9 -= go[52] * *cnV[52]; + m_A35 += gt[53]; + m_A35 += gt[54]; + m_A35 += gt[55]; + m_A35 += gt[56]; + m_A35 += gt[57]; + m_A35 += gt[58]; + m_A34 += go[53]; + m_A34 += go[54]; + m_A33 += go[55]; + double RHS10 = Idr[53]; + RHS10 += Idr[54]; + RHS10 += Idr[55]; + RHS10 += Idr[56]; + RHS10 += Idr[57]; + RHS10 += Idr[58]; + RHS10 -= go[56] * *cnV[56]; + RHS10 -= go[57] * *cnV[57]; + RHS10 -= go[58] * *cnV[58]; + m_A40 += gt[59]; + m_A40 += gt[60]; + m_A40 += gt[61]; + m_A40 += gt[62]; + m_A40 += gt[63]; + m_A40 += gt[64]; + m_A39 += go[59]; + m_A39 += go[60]; + m_A38 += go[61]; + double RHS11 = Idr[59]; + RHS11 += Idr[60]; + RHS11 += Idr[61]; + RHS11 += Idr[62]; + RHS11 += Idr[63]; + RHS11 += Idr[64]; + RHS11 -= go[62] * *cnV[62]; + RHS11 -= go[63] * *cnV[63]; + RHS11 -= go[64] * *cnV[64]; + m_A45 += gt[65]; + m_A45 += gt[66]; + m_A45 += gt[67]; + m_A45 += gt[68]; + m_A45 += gt[69]; + m_A46 += go[65]; + m_A46 += go[66]; + m_A43 += go[67]; + m_A43 += go[68]; + double RHS12 = Idr[65]; + RHS12 += Idr[66]; + RHS12 += Idr[67]; + RHS12 += Idr[68]; + RHS12 += Idr[69]; + RHS12 -= go[69] * *cnV[69]; + m_A49 += gt[70]; + m_A49 += gt[71]; + m_A49 += gt[72]; + m_A49 += gt[73]; + m_A49 += gt[74]; + m_A50 += go[70]; + m_A50 += go[71]; + m_A47 += go[72]; + m_A47 += go[73]; + double RHS13 = Idr[70]; + RHS13 += Idr[71]; + RHS13 += Idr[72]; + RHS13 += Idr[73]; + RHS13 += Idr[74]; + RHS13 -= go[74] * *cnV[74]; + m_A55 += gt[75]; + m_A55 += gt[76]; + m_A55 += gt[77]; + m_A55 += gt[78]; + m_A52 += go[75]; + m_A54 += go[76]; + m_A54 += go[77]; + m_A51 += go[78]; + double RHS14 = Idr[75]; + RHS14 += Idr[76]; + RHS14 += Idr[77]; + RHS14 += Idr[78]; + m_A60 += gt[79]; + m_A60 += gt[80]; + m_A60 += gt[81]; + m_A60 += gt[82]; + m_A58 += go[79]; + m_A57 += go[80]; + m_A62 += go[81]; + double RHS15 = Idr[79]; + RHS15 += Idr[80]; + RHS15 += Idr[81]; + RHS15 += Idr[82]; + RHS15 -= go[82] * *cnV[82]; + m_A68 += gt[83]; + m_A68 += gt[84]; + m_A68 += gt[85]; + m_A68 += gt[86]; + m_A64 += go[83]; + m_A66 += go[84]; + m_A66 += go[85]; + m_A63 += go[86]; + double RHS16 = Idr[83]; + RHS16 += Idr[84]; + RHS16 += Idr[85]; + RHS16 += Idr[86]; + m_A75 += gt[87]; + m_A75 += gt[88]; + m_A75 += gt[89]; + m_A75 += gt[90]; + m_A75 += gt[91]; + m_A72 += go[87]; + m_A72 += go[88]; + m_A70 += go[89]; + m_A73 += go[90]; + double RHS17 = Idr[87]; + RHS17 += Idr[88]; + RHS17 += Idr[89]; + RHS17 += Idr[90]; + RHS17 += Idr[91]; + RHS17 -= go[91] * *cnV[91]; + const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A24; + m_A26 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A25; + m_A26 += m_A3 * f1_8; + m_A27 += m_A4 * f1_8; + m_A28 += m_A5 * f1_8; + RHS8 += f1_8 * RHS1; + const double f1_9 = -f1 * m_A29; + m_A30 += m_A3 * f1_9; + m_A31 += m_A4 * f1_9; + m_A32 += m_A5 * f1_9; + RHS9 += f1_9 * RHS1; + const double f1_17 = -f1 * m_A70; + m_A71 += m_A3 * f1_17; + m_A72 += m_A4 * f1_17; + m_A75 += m_A5 * f1_17; + RHS17 += f1_17 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_10 = -f2 * m_A33; + m_A35 += m_A7 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_10 = -f3 * m_A34; + m_A35 += m_A9 * f3_10; + m_A36 += m_A10 * f3_10; + m_A37 += m_A11 * f3_10; + RHS10 += f3_10 * RHS3; + const double f3_12 = -f3 * m_A43; + m_A44 += m_A9 * f3_12; + m_A45 += m_A10 * f3_12; + m_A46 += m_A11 * f3_12; + RHS12 += f3_12 * RHS3; + const double f3_14 = -f3 * m_A51; + m_A53 += m_A9 * f3_14; + m_A54 += m_A10 * f3_14; + m_A55 += m_A11 * f3_14; + RHS14 += f3_14 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_14 = -f4 * m_A52; + m_A55 += m_A13 * f4_14; + m_A56 += m_A14 * f4_14; + RHS14 += f4_14 * RHS4; + const double f4_15 = -f4 * m_A57; + m_A59 += m_A13 * f4_15; + m_A60 += m_A14 * f4_15; + RHS15 += f4_15 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_11 = -f5 * m_A38; + m_A40 += m_A16 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_11 = -f6 * m_A39; + m_A40 += m_A18 * f6_11; + m_A41 += m_A19 * f6_11; + m_A42 += m_A20 * f6_11; + RHS11 += f6_11 * RHS6; + const double f6_13 = -f6 * m_A47; + m_A48 += m_A18 * f6_13; + m_A49 += m_A19 * f6_13; + m_A50 += m_A20 * f6_13; + RHS13 += f6_13 * RHS6; + const double f6_16 = -f6 * m_A63; + m_A65 += m_A18 * f6_16; + m_A66 += m_A19 * f6_16; + m_A68 += m_A20 * f6_16; + RHS16 += f6_16 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_15 = -f7 * m_A58; + m_A60 += m_A22 * f7_15; + m_A61 += m_A23 * f7_15; + RHS15 += f7_15 * RHS7; + const double f7_16 = -f7 * m_A64; + m_A67 += m_A22 * f7_16; + m_A68 += m_A23 * f7_16; + RHS16 += f7_16 * RHS7; + const double f8 = 1.0 / m_A26; + const double f8_9 = -f8 * m_A30; + m_A31 += m_A27 * f8_9; + m_A32 += m_A28 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_17 = -f8 * m_A71; + m_A72 += m_A27 * f8_17; + m_A75 += m_A28 * f8_17; + RHS17 += f8_17 * RHS8; + const double f9 = 1.0 / m_A31; + const double f9_17 = -f9 * m_A72; + m_A75 += m_A32 * f9_17; + RHS17 += f9_17 * RHS9; + const double f10 = 1.0 / m_A35; + const double f10_12 = -f10 * m_A44; + m_A45 += m_A36 * f10_12; + m_A46 += m_A37 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_14 = -f10 * m_A53; + m_A54 += m_A36 * f10_14; + m_A55 += m_A37 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A40; + const double f11_13 = -f11 * m_A48; + m_A49 += m_A41 * f11_13; + m_A50 += m_A42 * f11_13; + RHS13 += f11_13 * RHS11; + const double f11_16 = -f11 * m_A65; + m_A66 += m_A41 * f11_16; + m_A68 += m_A42 * f11_16; + RHS16 += f11_16 * RHS11; + const double f12 = 1.0 / m_A45; + const double f12_14 = -f12 * m_A54; + m_A55 += m_A46 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A49; + const double f13_16 = -f13 * m_A66; + m_A68 += m_A50 * f13_16; + RHS16 += f13_16 * RHS13; + const double f14 = 1.0 / m_A55; + const double f14_15 = -f14 * m_A59; + m_A60 += m_A56 * f14_15; + RHS15 += f14_15 * RHS14; + const double f15 = 1.0 / m_A60; + const double f15_16 = -f15 * m_A67; + m_A68 += m_A61 * f15_16; + m_A69 += m_A62 * f15_16; + RHS16 += f15_16 * RHS15; + const double f15_17 = -f15 * m_A73; + m_A74 += m_A61 * f15_17; + m_A75 += m_A62 * f15_17; + RHS17 += f15_17 * RHS15; + const double f16 = 1.0 / m_A68; + const double f16_17 = -f16 * m_A74; + m_A75 += m_A69 * f16_17; + RHS17 += f16_17 * RHS16; + V[17] = RHS17 / m_A75; + double tmp16 = 0.0; + tmp16 += m_A69 * V[17]; + V[16] = (RHS16 - tmp16) / m_A68; + double tmp15 = 0.0; + tmp15 += m_A61 * V[16]; + tmp15 += m_A62 * V[17]; + V[15] = (RHS15 - tmp15) / m_A60; + double tmp14 = 0.0; + tmp14 += m_A56 * V[15]; + V[14] = (RHS14 - tmp14) / m_A55; + double tmp13 = 0.0; + tmp13 += m_A50 * V[16]; + V[13] = (RHS13 - tmp13) / m_A49; + double tmp12 = 0.0; + tmp12 += m_A46 * V[14]; + V[12] = (RHS12 - tmp12) / m_A45; + double tmp11 = 0.0; + tmp11 += m_A41 * V[13]; + tmp11 += m_A42 * V[16]; + V[11] = (RHS11 - tmp11) / m_A40; + double tmp10 = 0.0; + tmp10 += m_A36 * V[12]; + tmp10 += m_A37 * V[14]; + V[10] = (RHS10 - tmp10) / m_A35; + double tmp9 = 0.0; + tmp9 += m_A32 * V[17]; + V[9] = (RHS9 - tmp9) / m_A31; + double tmp8 = 0.0; + tmp8 += m_A27 * V[9]; + tmp8 += m_A28 * V[17]; + V[8] = (RHS8 - tmp8) / m_A26; + double tmp7 = 0.0; + tmp7 += m_A22 * V[15]; + tmp7 += m_A23 * V[16]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A18 * V[11]; + tmp6 += m_A19 * V[13]; + tmp6 += m_A20 * V[16]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A16 * V[11]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A13 * V[14]; + tmp4 += m_A14 * V[15]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[10]; + tmp3 += m_A10 * V[12]; + tmp3 += m_A11 * V[14]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[10]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[8]; + tmp1 += m_A4 * V[9]; + tmp1 += m_A5 * V[17]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacewar +static void nl_gcr_20_double_double_e0b492db40bba291(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + m_A4 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + m_A5 += gt[4]; + m_A5 += gt[5]; + m_A7 += go[4]; + m_A6 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + m_A9 += gt[6]; + m_A9 += gt[7]; + m_A9 += gt[8]; + m_A8 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 += Idr[8]; + RHS3 -= go[7] * *cnV[7]; + RHS3 -= go[8] * *cnV[8]; + m_A15 += gt[9]; + m_A15 += gt[10]; + m_A15 += gt[11]; + m_A11 += go[9]; + m_A13 += go[10]; + m_A12 += go[11]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + RHS4 += Idr[11]; + m_A19 += gt[12]; + m_A19 += gt[13]; + m_A19 += gt[14]; + m_A17 += go[12]; + double RHS5 = Idr[12]; + RHS5 += Idr[13]; + RHS5 += Idr[14]; + RHS5 -= go[13] * *cnV[13]; + RHS5 -= go[14] * *cnV[14]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A11; + m_A15 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A12; + m_A14 += m_A3 * f1_4; + m_A15 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A13; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A17; + m_A18 += m_A6 * f2_5; + m_A19 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A19; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacewar +static void nl_gcr_22_double_double_e9e8211f43d8f4b3(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[2]; + m_A4 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A7 += go[9]; + m_A6 += go[10]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A9 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A11 += go[14]; + m_A10 += go[15]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[16] * *cnV[16]; + m_A17 += gt[17]; + m_A17 += gt[18]; + m_A17 += gt[19]; + m_A17 += gt[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A14 += go[17]; + m_A18 += go[18]; + m_A15 += go[19]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + m_A21 += gt[23]; + m_A21 += gt[24]; + m_A19 += go[23]; + m_A20 += go[24]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A14; + m_A15 += m_A3 * f1_5; + m_A16 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A11; + m_A12 += m_A6 * f2_4; + m_A13 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A15; + m_A16 += m_A6 * f2_5; + m_A17 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_6 = -f3 * m_A19; + m_A21 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_5 = -f4 * m_A16; + m_A17 += m_A13 * f4_5; + RHS5 += f4_5 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_6 = -f5 * m_A20; + m_A21 += m_A18 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A21; + double tmp5 = 0.0; + tmp5 += m_A18 * V[6]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A13 * V[5]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[6]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacewar +static void nl_gcr_24_double_double_b09deef9a25aecaf(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A12 += go[10]; + m_A11 += go[11]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 += Idr[12]; + RHS5 -= go[12] * *cnV[12]; + m_A19 += gt[13]; + m_A19 += gt[14]; + m_A19 += gt[15]; + m_A19 += gt[16]; + m_A19 += gt[17]; + m_A19 += gt[18]; + m_A17 += go[13]; + m_A16 += go[14]; + m_A15 += go[15]; + m_A14 += go[16]; + m_A13 += go[17]; + m_A18 += go[18]; + double RHS6 = Idr[13]; + RHS6 += Idr[14]; + RHS6 += Idr[15]; + RHS6 += Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + m_A23 += gt[19]; + m_A23 += gt[20]; + m_A23 += gt[21]; + m_A21 += go[19]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 -= go[20] * *cnV[20]; + RHS7 -= go[21] * *cnV[21]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A13; + m_A19 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A14; + m_A19 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A15; + m_A19 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A16; + m_A19 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_6 = -f4 * m_A17; + m_A19 += m_A9 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_6 = -f5 * m_A18; + m_A19 += m_A11 * f5_6; + m_A20 += m_A12 * f5_6; + RHS6 += f5_6 * RHS5; + const double f5_7 = -f5 * m_A21; + m_A22 += m_A11 * f5_7; + m_A23 += m_A12 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_7 = -f6 * m_A22; + m_A23 += m_A20 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A23; + double tmp6 = 0.0; + tmp6 += m_A20 * V[7]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A11 * V[6]; + tmp5 += m_A12 * V[7]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[6]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacewar +static void nl_gcr_28_double_double_15e8f6fb021de0f9(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A8 += go[11]; + m_A9 += go[12]; + m_A7 += go[13]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A10 += go[16]; + m_A11 += go[17]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A16 += gt[20]; + m_A15 += go[18]; + m_A17 += go[19]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 -= go[20] * *cnV[20]; + m_A20 += gt[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A18 += go[21]; + double RHS6 = Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 -= go[22] * *cnV[22]; + RHS6 -= go[23] * *cnV[23]; + m_A27 += gt[24]; + m_A27 += gt[25]; + m_A27 += gt[26]; + m_A27 += gt[27]; + m_A27 += gt[28]; + m_A22 += go[24]; + m_A23 += go[25]; + m_A25 += go[26]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 -= go[27] * *cnV[27]; + RHS7 -= go[28] * *cnV[28]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A15; + m_A16 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A22; + m_A25 += m_A5 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A7 * f3_4; + m_A13 += m_A8 * f3_4; + m_A14 += m_A9 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_6 = -f3 * m_A18; + m_A19 += m_A7 * f3_6; + m_A20 += m_A8 * f3_6; + m_A21 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_7 = -f3 * m_A23; + m_A24 += m_A7 * f3_7; + m_A26 += m_A8 * f3_7; + m_A27 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_6 = -f4 * m_A19; + m_A20 += m_A13 * f4_6; + m_A21 += m_A14 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_7 = -f4 * m_A24; + m_A26 += m_A13 * f4_7; + m_A27 += m_A14 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A16; + const double f5_7 = -f5 * m_A25; + m_A27 += m_A17 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A20; + const double f6_7 = -f6 * m_A26; + m_A27 += m_A21 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A27; + double tmp6 = 0.0; + tmp6 += m_A21 * V[7]; + V[6] = (RHS6 - tmp6) / m_A20; + double tmp5 = 0.0; + tmp5 += m_A17 * V[7]; + V[5] = (RHS5 - tmp5) / m_A16; + double tmp4 = 0.0; + tmp4 += m_A13 * V[6]; + tmp4 += m_A14 * V[7]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A7 * V[4]; + tmp3 += m_A8 * V[6]; + tmp3 += m_A9 * V[7]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[5]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_110_double_double_4dbd0f2aec7ef707(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[3]; + m_A5 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[7]; + m_A8 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A11 += go[14]; + m_A12 += go[15]; + m_A10 += go[16]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A14 += go[17]; + m_A15 += go[18]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A17 += go[24]; + double RHS5 = Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A19 += go[27]; + double RHS6 = Idr[27]; + RHS6 += Idr[28]; + RHS6 -= go[28] * *cnV[28]; + m_A20 += gt[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A22 += go[29]; + m_A23 += go[30]; + m_A21 += go[31]; + double RHS7 = Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 += Idr[32]; + RHS7 -= go[32] * *cnV[32]; + m_A24 += gt[33]; + m_A24 += gt[34]; + m_A24 += gt[35]; + m_A24 += gt[36]; + m_A24 += gt[37]; + m_A24 += gt[38]; + m_A24 += gt[39]; + m_A25 += go[33]; + m_A26 += go[34]; + double RHS8 = Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 += Idr[38]; + RHS8 += Idr[39]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + RHS8 -= go[38] * *cnV[38]; + RHS8 -= go[39] * *cnV[39]; + m_A27 += gt[40]; + m_A27 += gt[41]; + m_A27 += gt[42]; + m_A30 += go[40]; + m_A29 += go[41]; + m_A28 += go[42]; + double RHS9 = Idr[40]; + RHS9 += Idr[41]; + RHS9 += Idr[42]; + m_A31 += gt[43]; + m_A31 += gt[44]; + m_A31 += gt[45]; + m_A31 += gt[46]; + m_A31 += gt[47]; + m_A31 += gt[48]; + m_A31 += gt[49]; + m_A33 += go[43]; + m_A32 += go[44]; + double RHS10 = Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + RHS10 += Idr[47]; + RHS10 += Idr[48]; + RHS10 += Idr[49]; + RHS10 -= go[45] * *cnV[45]; + RHS10 -= go[46] * *cnV[46]; + RHS10 -= go[47] * *cnV[47]; + RHS10 -= go[48] * *cnV[48]; + RHS10 -= go[49] * *cnV[49]; + m_A36 += gt[50]; + m_A36 += gt[51]; + m_A35 += go[50]; + m_A34 += go[51]; + double RHS11 = Idr[50]; + RHS11 += Idr[51]; + m_A41 += gt[52]; + m_A41 += gt[53]; + m_A41 += gt[54]; + m_A41 += gt[55]; + m_A41 += gt[56]; + m_A42 += go[52]; + m_A39 += go[53]; + double RHS12 = Idr[52]; + RHS12 += Idr[53]; + RHS12 += Idr[54]; + RHS12 += Idr[55]; + RHS12 += Idr[56]; + RHS12 -= go[54] * *cnV[54]; + RHS12 -= go[55] * *cnV[55]; + RHS12 -= go[56] * *cnV[56]; + m_A46 += gt[57]; + m_A46 += gt[58]; + m_A46 += gt[59]; + m_A46 += gt[60]; + m_A46 += gt[61]; + m_A43 += go[57]; + m_A44 += go[58]; + m_A48 += go[59]; + double RHS13 = Idr[57]; + RHS13 += Idr[58]; + RHS13 += Idr[59]; + RHS13 += Idr[60]; + RHS13 += Idr[61]; + RHS13 -= go[60] * *cnV[60]; + RHS13 -= go[61] * *cnV[61]; + m_A52 += gt[62]; + m_A52 += gt[63]; + m_A51 += go[62]; + m_A50 += go[63]; + double RHS14 = Idr[62]; + RHS14 += Idr[63]; + m_A57 += gt[64]; + m_A57 += gt[65]; + m_A57 += gt[66]; + m_A59 += go[64]; + m_A55 += go[65]; + double RHS15 = Idr[64]; + RHS15 += Idr[65]; + RHS15 += Idr[66]; + RHS15 -= go[66] * *cnV[66]; + m_A62 += gt[67]; + m_A62 += gt[68]; + m_A62 += gt[69]; + m_A62 += gt[70]; + m_A62 += gt[71]; + m_A63 += go[67]; + m_A60 += go[68]; + double RHS16 = Idr[67]; + RHS16 += Idr[68]; + RHS16 += Idr[69]; + RHS16 += Idr[70]; + RHS16 += Idr[71]; + RHS16 -= go[69] * *cnV[69]; + RHS16 -= go[70] * *cnV[70]; + RHS16 -= go[71] * *cnV[71]; + m_A65 += gt[72]; + m_A65 += gt[73]; + m_A65 += gt[74]; + m_A64 += go[72]; + m_A67 += go[73]; + m_A66 += go[74]; + double RHS17 = Idr[72]; + RHS17 += Idr[73]; + RHS17 += Idr[74]; + m_A71 += gt[75]; + m_A71 += gt[76]; + m_A71 += gt[77]; + m_A71 += gt[78]; + m_A71 += gt[79]; + m_A68 += go[75]; + m_A69 += go[76]; + m_A73 += go[77]; + double RHS18 = Idr[75]; + RHS18 += Idr[76]; + RHS18 += Idr[77]; + RHS18 += Idr[78]; + RHS18 += Idr[79]; + RHS18 -= go[78] * *cnV[78]; + RHS18 -= go[79] * *cnV[79]; + m_A77 += gt[80]; + m_A77 += gt[81]; + m_A77 += gt[82]; + m_A79 += go[80]; + m_A75 += go[81]; + double RHS19 = Idr[80]; + RHS19 += Idr[81]; + RHS19 += Idr[82]; + RHS19 -= go[82] * *cnV[82]; + m_A85 += gt[83]; + m_A85 += gt[84]; + m_A85 += gt[85]; + m_A82 += go[83]; + m_A83 += go[84]; + m_A80 += go[85]; + double RHS20 = Idr[83]; + RHS20 += Idr[84]; + RHS20 += Idr[85]; + m_A93 += gt[86]; + m_A93 += gt[87]; + m_A93 += gt[88]; + m_A93 += gt[89]; + m_A93 += gt[90]; + m_A93 += gt[91]; + m_A88 += go[86]; + m_A91 += go[87]; + m_A90 += go[88]; + m_A87 += go[89]; + double RHS21 = Idr[86]; + RHS21 += Idr[87]; + RHS21 += Idr[88]; + RHS21 += Idr[89]; + RHS21 += Idr[90]; + RHS21 += Idr[91]; + RHS21 -= go[90] * *cnV[90]; + RHS21 -= go[91] * *cnV[91]; + m_A100 += gt[92]; + m_A100 += gt[93]; + m_A100 += gt[94]; + m_A97 += go[92]; + m_A98 += go[93]; + m_A95 += go[94]; + double RHS22 = Idr[92]; + RHS22 += Idr[93]; + RHS22 += Idr[94]; + m_A109 += gt[95]; + m_A109 += gt[96]; + m_A109 += gt[97]; + m_A109 += gt[98]; + m_A109 += gt[99]; + m_A109 += gt[100]; + m_A103 += go[95]; + m_A106 += go[96]; + m_A102 += go[97]; + m_A104 += go[98]; + double RHS23 = Idr[95]; + RHS23 += Idr[96]; + RHS23 += Idr[97]; + RHS23 += Idr[98]; + RHS23 += Idr[99]; + RHS23 += Idr[100]; + RHS23 -= go[99] * *cnV[99]; + RHS23 -= go[100] * *cnV[100]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A34; + m_A36 += m_A1 * f0_11; + RHS11 += f0_11 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_11 = -f1 * m_A35; + m_A36 += m_A3 * f1_11; + m_A37 += m_A4 * f1_11; + m_A38 += m_A5 * f1_11; + RHS11 += f1_11 * RHS1; + const double f1_12 = -f1 * m_A39; + m_A40 += m_A3 * f1_12; + m_A41 += m_A4 * f1_12; + m_A42 += m_A5 * f1_12; + RHS12 += f1_12 * RHS1; + const double f1_20 = -f1 * m_A80; + m_A81 += m_A3 * f1_20; + m_A82 += m_A4 * f1_20; + m_A85 += m_A5 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_13 = -f2 * m_A43; + m_A45 += m_A7 * f2_13; + m_A48 += m_A8 * f2_13; + RHS13 += f2_13 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_13 = -f3 * m_A44; + m_A46 += m_A10 * f3_13; + m_A47 += m_A11 * f3_13; + m_A49 += m_A12 * f3_13; + RHS13 += f3_13 * RHS3; + const double f3_15 = -f3 * m_A55; + m_A56 += m_A10 * f3_15; + m_A57 += m_A11 * f3_15; + m_A59 += m_A12 * f3_15; + RHS15 += f3_15 * RHS3; + const double f3_21 = -f3 * m_A87; + m_A89 += m_A10 * f3_21; + m_A90 += m_A11 * f3_21; + m_A93 += m_A12 * f3_21; + RHS21 += f3_21 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_21 = -f4 * m_A88; + m_A90 += m_A14 * f4_21; + m_A93 += m_A15 * f4_21; + RHS21 += f4_21 * RHS4; + const double f5 = 1.0 / m_A16; + const double f5_14 = -f5 * m_A50; + m_A52 += m_A17 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_17 = -f6 * m_A64; + m_A65 += m_A19 * f6_17; + RHS17 += f6_17 * RHS6; + const double f7 = 1.0 / m_A20; + const double f7_14 = -f7 * m_A51; + m_A52 += m_A21 * f7_14; + m_A53 += m_A22 * f7_14; + m_A54 += m_A23 * f7_14; + RHS14 += f7_14 * RHS7; + const double f7_16 = -f7 * m_A60; + m_A61 += m_A21 * f7_16; + m_A62 += m_A22 * f7_16; + m_A63 += m_A23 * f7_16; + RHS16 += f7_16 * RHS7; + const double f7_22 = -f7 * m_A95; + m_A96 += m_A21 * f7_22; + m_A97 += m_A22 * f7_22; + m_A100 += m_A23 * f7_22; + RHS22 += f7_22 * RHS7; + const double f8 = 1.0 / m_A24; + const double f8_18 = -f8 * m_A68; + m_A70 += m_A25 * f8_18; + m_A73 += m_A26 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A27; + const double f9_18 = -f9 * m_A69; + m_A71 += m_A28 * f9_18; + m_A72 += m_A29 * f9_18; + m_A74 += m_A30 * f9_18; + RHS18 += f9_18 * RHS9; + const double f9_19 = -f9 * m_A75; + m_A76 += m_A28 * f9_19; + m_A77 += m_A29 * f9_19; + m_A79 += m_A30 * f9_19; + RHS19 += f9_19 * RHS9; + const double f9_23 = -f9 * m_A102; + m_A105 += m_A28 * f9_23; + m_A106 += m_A29 * f9_23; + m_A109 += m_A30 * f9_23; + RHS23 += f9_23 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_23 = -f10 * m_A103; + m_A106 += m_A32 * f10_23; + m_A109 += m_A33 * f10_23; + RHS23 += f10_23 * RHS10; + const double f11 = 1.0 / m_A36; + const double f11_12 = -f11 * m_A40; + m_A41 += m_A37 * f11_12; + m_A42 += m_A38 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_20 = -f11 * m_A81; + m_A82 += m_A37 * f11_20; + m_A85 += m_A38 * f11_20; + RHS20 += f11_20 * RHS11; + const double f12 = 1.0 / m_A41; + const double f12_13 = -f12 * m_A45; + m_A48 += m_A42 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_20 = -f12 * m_A82; + m_A85 += m_A42 * f12_20; + RHS20 += f12_20 * RHS12; + const double f13 = 1.0 / m_A46; + const double f13_15 = -f13 * m_A56; + m_A57 += m_A47 * f13_15; + m_A58 += m_A48 * f13_15; + m_A59 += m_A49 * f13_15; + RHS15 += f13_15 * RHS13; + const double f13_20 = -f13 * m_A83; + m_A84 += m_A47 * f13_20; + m_A85 += m_A48 * f13_20; + m_A86 += m_A49 * f13_20; + RHS20 += f13_20 * RHS13; + const double f13_21 = -f13 * m_A89; + m_A90 += m_A47 * f13_21; + m_A92 += m_A48 * f13_21; + m_A93 += m_A49 * f13_21; + RHS21 += f13_21 * RHS13; + const double f14 = 1.0 / m_A52; + const double f14_16 = -f14 * m_A61; + m_A62 += m_A53 * f14_16; + m_A63 += m_A54 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_22 = -f14 * m_A96; + m_A97 += m_A53 * f14_22; + m_A100 += m_A54 * f14_22; + RHS22 += f14_22 * RHS14; + const double f15 = 1.0 / m_A57; + const double f15_20 = -f15 * m_A84; + m_A85 += m_A58 * f15_20; + m_A86 += m_A59 * f15_20; + RHS20 += f15_20 * RHS15; + const double f15_21 = -f15 * m_A90; + m_A92 += m_A58 * f15_21; + m_A93 += m_A59 * f15_21; + RHS21 += f15_21 * RHS15; + const double f16 = 1.0 / m_A62; + const double f16_18 = -f16 * m_A70; + m_A73 += m_A63 * f16_18; + RHS18 += f16_18 * RHS16; + const double f16_22 = -f16 * m_A97; + m_A100 += m_A63 * f16_22; + RHS22 += f16_22 * RHS16; + const double f17 = 1.0 / m_A65; + const double f17_21 = -f17 * m_A91; + m_A93 += m_A66 * f17_21; + m_A94 += m_A67 * f17_21; + RHS21 += f17_21 * RHS17; + const double f17_23 = -f17 * m_A104; + m_A107 += m_A66 * f17_23; + m_A109 += m_A67 * f17_23; + RHS23 += f17_23 * RHS17; + const double f18 = 1.0 / m_A71; + const double f18_19 = -f18 * m_A76; + m_A77 += m_A72 * f18_19; + m_A78 += m_A73 * f18_19; + m_A79 += m_A74 * f18_19; + RHS19 += f18_19 * RHS18; + const double f18_22 = -f18 * m_A98; + m_A99 += m_A72 * f18_22; + m_A100 += m_A73 * f18_22; + m_A101 += m_A74 * f18_22; + RHS22 += f18_22 * RHS18; + const double f18_23 = -f18 * m_A105; + m_A106 += m_A72 * f18_23; + m_A108 += m_A73 * f18_23; + m_A109 += m_A74 * f18_23; + RHS23 += f18_23 * RHS18; + const double f19 = 1.0 / m_A77; + const double f19_22 = -f19 * m_A99; + m_A100 += m_A78 * f19_22; + m_A101 += m_A79 * f19_22; + RHS22 += f19_22 * RHS19; + const double f19_23 = -f19 * m_A106; + m_A108 += m_A78 * f19_23; + m_A109 += m_A79 * f19_23; + RHS23 += f19_23 * RHS19; + const double f20 = 1.0 / m_A85; + const double f20_21 = -f20 * m_A92; + m_A93 += m_A86 * f20_21; + RHS21 += f20_21 * RHS20; + const double f21 = 1.0 / m_A93; + const double f21_23 = -f21 * m_A107; + m_A109 += m_A94 * f21_23; + RHS23 += f21_23 * RHS21; + const double f22 = 1.0 / m_A100; + const double f22_23 = -f22 * m_A108; + m_A109 += m_A101 * f22_23; + RHS23 += f22_23 * RHS22; + V[23] = RHS23 / m_A109; + double tmp22 = 0.0; + tmp22 += m_A101 * V[23]; + V[22] = (RHS22 - tmp22) / m_A100; + double tmp21 = 0.0; + tmp21 += m_A94 * V[23]; + V[21] = (RHS21 - tmp21) / m_A93; + double tmp20 = 0.0; + tmp20 += m_A86 * V[21]; + V[20] = (RHS20 - tmp20) / m_A85; + double tmp19 = 0.0; + tmp19 += m_A78 * V[22]; + tmp19 += m_A79 * V[23]; + V[19] = (RHS19 - tmp19) / m_A77; + double tmp18 = 0.0; + tmp18 += m_A72 * V[19]; + tmp18 += m_A73 * V[22]; + tmp18 += m_A74 * V[23]; + V[18] = (RHS18 - tmp18) / m_A71; + double tmp17 = 0.0; + tmp17 += m_A66 * V[21]; + tmp17 += m_A67 * V[23]; + V[17] = (RHS17 - tmp17) / m_A65; + double tmp16 = 0.0; + tmp16 += m_A63 * V[22]; + V[16] = (RHS16 - tmp16) / m_A62; + double tmp15 = 0.0; + tmp15 += m_A58 * V[20]; + tmp15 += m_A59 * V[21]; + V[15] = (RHS15 - tmp15) / m_A57; + double tmp14 = 0.0; + tmp14 += m_A53 * V[16]; + tmp14 += m_A54 * V[22]; + V[14] = (RHS14 - tmp14) / m_A52; + double tmp13 = 0.0; + tmp13 += m_A47 * V[15]; + tmp13 += m_A48 * V[20]; + tmp13 += m_A49 * V[21]; + V[13] = (RHS13 - tmp13) / m_A46; + double tmp12 = 0.0; + tmp12 += m_A42 * V[20]; + V[12] = (RHS12 - tmp12) / m_A41; + double tmp11 = 0.0; + tmp11 += m_A37 * V[12]; + tmp11 += m_A38 * V[20]; + V[11] = (RHS11 - tmp11) / m_A36; + double tmp10 = 0.0; + tmp10 += m_A32 * V[19]; + tmp10 += m_A33 * V[23]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A28 * V[18]; + tmp9 += m_A29 * V[19]; + tmp9 += m_A30 * V[23]; + V[9] = (RHS9 - tmp9) / m_A27; + double tmp8 = 0.0; + tmp8 += m_A25 * V[16]; + tmp8 += m_A26 * V[22]; + V[8] = (RHS8 - tmp8) / m_A24; + double tmp7 = 0.0; + tmp7 += m_A21 * V[14]; + tmp7 += m_A22 * V[16]; + tmp7 += m_A23 * V[22]; + V[7] = (RHS7 - tmp7) / m_A20; + double tmp6 = 0.0; + tmp6 += m_A19 * V[17]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A17 * V[14]; + V[5] = (RHS5 - tmp5) / m_A16; + double tmp4 = 0.0; + tmp4 += m_A14 * V[15]; + tmp4 += m_A15 * V[21]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A10 * V[13]; + tmp3 += m_A11 * V[15]; + tmp3 += m_A12 * V[21]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[12]; + tmp2 += m_A8 * V[20]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[11]; + tmp1 += m_A4 * V[12]; + tmp1 += m_A5 * V[20]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[11]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_15_double_double_8c1dd4afcf0f8ea2(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[4]; + m_A4 += go[5]; + m_A3 += go[6]; + m_A3 += go[7]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A6 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A9 += gt[17]; + m_A8 += go[12]; + m_A8 += go[13]; + m_A7 += go[14]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A12 += go[18]; + m_A11 += go[19]; + m_A11 += go[20]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A11; + m_A13 += m_A3 * f1_4; + m_A14 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A12; + m_A14 += m_A6 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A14; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_16_double_double_f4da1503eabe16cf(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[13] * *cnV[13]; + m_A15 += gt[14]; + m_A15 += gt[15]; + m_A15 += gt[16]; + m_A15 += gt[17]; + m_A15 += gt[18]; + m_A14 += go[14]; + m_A13 += go[15]; + m_A12 += go[16]; + m_A11 += go[17]; + m_A10 += go[18]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A10; + m_A15 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A11; + m_A15 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_5 = -f2 * m_A12; + m_A15 += m_A5 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_5 = -f3 * m_A13; + m_A15 += m_A7 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_5 = -f4 * m_A14; + m_A15 += m_A9 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A15; + double tmp4 = 0.0; + tmp4 += m_A9 * V[5]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[5]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[5]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_175_double_double_b1db23287df1da54(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A6 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A7 += gt[12]; + m_A7 += gt[13]; + m_A7 += gt[14]; + m_A7 += gt[15]; + m_A9 += go[12]; + m_A8 += go[13]; + m_A8 += go[14]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A15 += go[16]; + m_A11 += go[17]; + m_A14 += go[18]; + m_A13 += go[19]; + m_A12 += go[20]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[21] * *cnV[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A16 += gt[27]; + m_A17 += go[22]; + m_A17 += go[23]; + m_A18 += go[24]; + m_A19 += go[25]; + m_A19 += go[26]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 -= go[27] * *cnV[27]; + m_A20 += gt[28]; + m_A20 += gt[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A20 += gt[34]; + m_A21 += go[28]; + m_A22 += go[29]; + double RHS6 = Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 += Idr[34]; + RHS6 -= go[30] * *cnV[30]; + RHS6 -= go[31] * *cnV[31]; + RHS6 -= go[32] * *cnV[32]; + RHS6 -= go[33] * *cnV[33]; + RHS6 -= go[34] * *cnV[34]; + m_A23 += gt[35]; + m_A23 += gt[36]; + m_A23 += gt[37]; + m_A23 += gt[38]; + m_A23 += gt[39]; + m_A23 += gt[40]; + m_A24 += go[35]; + m_A25 += go[36]; + m_A26 += go[37]; + double RHS7 = Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 += Idr[38]; + RHS7 += Idr[39]; + RHS7 += Idr[40]; + RHS7 -= go[38] * *cnV[38]; + RHS7 -= go[39] * *cnV[39]; + RHS7 -= go[40] * *cnV[40]; + m_A27 += gt[41]; + m_A27 += gt[42]; + m_A27 += gt[43]; + m_A27 += gt[44]; + m_A27 += gt[45]; + m_A27 += gt[46]; + m_A27 += gt[47]; + m_A28 += go[41]; + double RHS8 = Idr[41]; + RHS8 += Idr[42]; + RHS8 += Idr[43]; + RHS8 += Idr[44]; + RHS8 += Idr[45]; + RHS8 += Idr[46]; + RHS8 += Idr[47]; + RHS8 -= go[42] * *cnV[42]; + RHS8 -= go[43] * *cnV[43]; + RHS8 -= go[44] * *cnV[44]; + RHS8 -= go[45] * *cnV[45]; + RHS8 -= go[46] * *cnV[46]; + RHS8 -= go[47] * *cnV[47]; + m_A29 += gt[48]; + m_A29 += gt[49]; + m_A29 += gt[50]; + m_A29 += gt[51]; + m_A29 += gt[52]; + m_A29 += gt[53]; + m_A34 += go[48]; + m_A33 += go[49]; + m_A32 += go[50]; + m_A31 += go[51]; + m_A30 += go[52]; + double RHS9 = Idr[48]; + RHS9 += Idr[49]; + RHS9 += Idr[50]; + RHS9 += Idr[51]; + RHS9 += Idr[52]; + RHS9 += Idr[53]; + RHS9 -= go[53] * *cnV[53]; + m_A35 += gt[54]; + m_A35 += gt[55]; + m_A35 += gt[56]; + m_A36 += go[54]; + double RHS10 = Idr[54]; + RHS10 += Idr[55]; + RHS10 += Idr[56]; + RHS10 -= go[55] * *cnV[55]; + RHS10 -= go[56] * *cnV[56]; + m_A37 += gt[57]; + m_A37 += gt[58]; + m_A37 += gt[59]; + m_A37 += gt[60]; + m_A37 += gt[61]; + m_A37 += gt[62]; + m_A37 += gt[63]; + m_A38 += go[57]; + m_A39 += go[58]; + double RHS11 = Idr[57]; + RHS11 += Idr[58]; + RHS11 += Idr[59]; + RHS11 += Idr[60]; + RHS11 += Idr[61]; + RHS11 += Idr[62]; + RHS11 += Idr[63]; + RHS11 -= go[59] * *cnV[59]; + RHS11 -= go[60] * *cnV[60]; + RHS11 -= go[61] * *cnV[61]; + RHS11 -= go[62] * *cnV[62]; + RHS11 -= go[63] * *cnV[63]; + m_A40 += gt[64]; + m_A40 += gt[65]; + m_A40 += gt[66]; + m_A40 += gt[67]; + m_A40 += gt[68]; + m_A40 += gt[69]; + m_A43 += go[64]; + m_A43 += go[65]; + m_A41 += go[66]; + m_A41 += go[67]; + m_A42 += go[68]; + double RHS12 = Idr[64]; + RHS12 += Idr[65]; + RHS12 += Idr[66]; + RHS12 += Idr[67]; + RHS12 += Idr[68]; + RHS12 += Idr[69]; + RHS12 -= go[69] * *cnV[69]; + m_A44 += gt[70]; + m_A44 += gt[71]; + m_A46 += go[70]; + m_A45 += go[71]; + double RHS13 = Idr[70]; + RHS13 += Idr[71]; + m_A47 += gt[72]; + m_A47 += gt[73]; + m_A47 += gt[74]; + m_A47 += gt[75]; + m_A47 += gt[76]; + m_A47 += gt[77]; + m_A48 += go[72]; + m_A50 += go[73]; + m_A49 += go[74]; + double RHS14 = Idr[72]; + RHS14 += Idr[73]; + RHS14 += Idr[74]; + RHS14 += Idr[75]; + RHS14 += Idr[76]; + RHS14 += Idr[77]; + RHS14 -= go[75] * *cnV[75]; + RHS14 -= go[76] * *cnV[76]; + RHS14 -= go[77] * *cnV[77]; + m_A51 += gt[78]; + m_A51 += gt[79]; + m_A51 += gt[80]; + m_A51 += gt[81]; + m_A52 += go[78]; + m_A52 += go[79]; + m_A53 += go[80]; + double RHS15 = Idr[78]; + RHS15 += Idr[79]; + RHS15 += Idr[80]; + RHS15 += Idr[81]; + RHS15 -= go[81] * *cnV[81]; + m_A56 += gt[82]; + m_A56 += gt[83]; + m_A56 += gt[84]; + m_A56 += gt[85]; + m_A55 += go[82]; + m_A54 += go[83]; + double RHS16 = Idr[82]; + RHS16 += Idr[83]; + RHS16 += Idr[84]; + RHS16 += Idr[85]; + RHS16 -= go[84] * *cnV[84]; + RHS16 -= go[85] * *cnV[85]; + m_A59 += gt[86]; + m_A59 += gt[87]; + m_A59 += gt[88]; + m_A63 += go[86]; + m_A58 += go[87]; + double RHS17 = Idr[86]; + RHS17 += Idr[87]; + RHS17 += Idr[88]; + RHS17 -= go[88] * *cnV[88]; + m_A66 += gt[89]; + m_A66 += gt[90]; + m_A66 += gt[91]; + m_A66 += gt[92]; + m_A66 += gt[93]; + m_A64 += go[89]; + m_A65 += go[90]; + double RHS18 = Idr[89]; + RHS18 += Idr[90]; + RHS18 += Idr[91]; + RHS18 += Idr[92]; + RHS18 += Idr[93]; + RHS18 -= go[91] * *cnV[91]; + RHS18 -= go[92] * *cnV[92]; + RHS18 -= go[93] * *cnV[93]; + m_A72 += gt[94]; + m_A72 += gt[95]; + m_A72 += gt[96]; + m_A72 += gt[97]; + m_A70 += go[94]; + m_A69 += go[95]; + double RHS19 = Idr[94]; + RHS19 += Idr[95]; + RHS19 += Idr[96]; + RHS19 += Idr[97]; + RHS19 -= go[96] * *cnV[96]; + RHS19 -= go[97] * *cnV[97]; + m_A82 += gt[98]; + m_A82 += gt[99]; + m_A82 += gt[100]; + m_A82 += gt[101]; + m_A79 += go[98]; + m_A78 += go[99]; + double RHS20 = Idr[98]; + RHS20 += Idr[99]; + RHS20 += Idr[100]; + RHS20 += Idr[101]; + RHS20 -= go[100] * *cnV[100]; + RHS20 -= go[101] * *cnV[101]; + m_A92 += gt[102]; + m_A92 += gt[103]; + m_A92 += gt[104]; + m_A92 += gt[105]; + m_A88 += go[102]; + m_A87 += go[103]; + double RHS21 = Idr[102]; + RHS21 += Idr[103]; + RHS21 += Idr[104]; + RHS21 += Idr[105]; + RHS21 -= go[104] * *cnV[104]; + RHS21 -= go[105] * *cnV[105]; + m_A98 += gt[106]; + m_A98 += gt[107]; + m_A98 += gt[108]; + m_A98 += gt[109]; + m_A97 += go[106]; + m_A96 += go[107]; + double RHS22 = Idr[106]; + RHS22 += Idr[107]; + RHS22 += Idr[108]; + RHS22 += Idr[109]; + RHS22 -= go[108] * *cnV[108]; + RHS22 -= go[109] * *cnV[109]; + m_A103 += gt[110]; + m_A103 += gt[111]; + m_A103 += gt[112]; + m_A103 += gt[113]; + m_A103 += gt[114]; + m_A103 += gt[115]; + m_A103 += gt[116]; + m_A104 += go[110]; + m_A104 += go[111]; + m_A101 += go[112]; + m_A101 += go[113]; + m_A100 += go[114]; + double RHS23 = Idr[110]; + RHS23 += Idr[111]; + RHS23 += Idr[112]; + RHS23 += Idr[113]; + RHS23 += Idr[114]; + RHS23 += Idr[115]; + RHS23 += Idr[116]; + RHS23 -= go[115] * *cnV[115]; + RHS23 -= go[116] * *cnV[116]; + m_A108 += gt[117]; + m_A108 += gt[118]; + m_A108 += gt[119]; + m_A108 += gt[120]; + m_A108 += gt[121]; + m_A108 += gt[122]; + m_A106 += go[117]; + m_A105 += go[118]; + m_A105 += go[119]; + m_A110 += go[120]; + double RHS24 = Idr[117]; + RHS24 += Idr[118]; + RHS24 += Idr[119]; + RHS24 += Idr[120]; + RHS24 += Idr[121]; + RHS24 += Idr[122]; + RHS24 -= go[121] * *cnV[121]; + RHS24 -= go[122] * *cnV[122]; + m_A115 += gt[123]; + m_A115 += gt[124]; + m_A115 += gt[125]; + m_A117 += go[123]; + m_A111 += go[124]; + double RHS25 = Idr[123]; + RHS25 += Idr[124]; + RHS25 += Idr[125]; + RHS25 -= go[125] * *cnV[125]; + m_A120 += gt[126]; + m_A120 += gt[127]; + m_A120 += gt[128]; + m_A120 += gt[129]; + m_A120 += gt[130]; + m_A118 += go[126]; + m_A119 += go[127]; + double RHS26 = Idr[126]; + RHS26 += Idr[127]; + RHS26 += Idr[128]; + RHS26 += Idr[129]; + RHS26 += Idr[130]; + RHS26 -= go[128] * *cnV[128]; + RHS26 -= go[129] * *cnV[129]; + RHS26 -= go[130] * *cnV[130]; + m_A126 += gt[131]; + m_A126 += gt[132]; + m_A126 += gt[133]; + m_A126 += gt[134]; + m_A126 += gt[135]; + m_A126 += gt[136]; + m_A124 += go[131]; + m_A128 += go[132]; + m_A123 += go[133]; + m_A123 += go[134]; + double RHS27 = Idr[131]; + RHS27 += Idr[132]; + RHS27 += Idr[133]; + RHS27 += Idr[134]; + RHS27 += Idr[135]; + RHS27 += Idr[136]; + RHS27 -= go[135] * *cnV[135]; + RHS27 -= go[136] * *cnV[136]; + m_A138 += gt[137]; + m_A138 += gt[138]; + m_A138 += gt[139]; + m_A138 += gt[140]; + m_A138 += gt[141]; + m_A138 += gt[142]; + m_A129 += go[137]; + m_A131 += go[138]; + m_A132 += go[139]; + m_A130 += go[140]; + double RHS28 = Idr[137]; + RHS28 += Idr[138]; + RHS28 += Idr[139]; + RHS28 += Idr[140]; + RHS28 += Idr[141]; + RHS28 += Idr[142]; + RHS28 -= go[141] * *cnV[141]; + RHS28 -= go[142] * *cnV[142]; + m_A148 += gt[143]; + m_A148 += gt[144]; + m_A148 += gt[145]; + m_A148 += gt[146]; + m_A148 += gt[147]; + m_A148 += gt[148]; + m_A148 += gt[149]; + m_A148 += gt[150]; + m_A148 += gt[151]; + m_A143 += go[143]; + m_A146 += go[144]; + m_A142 += go[145]; + m_A142 += go[146]; + m_A141 += go[147]; + m_A145 += go[148]; + m_A145 += go[149]; + double RHS29 = Idr[143]; + RHS29 += Idr[144]; + RHS29 += Idr[145]; + RHS29 += Idr[146]; + RHS29 += Idr[147]; + RHS29 += Idr[148]; + RHS29 += Idr[149]; + RHS29 += Idr[150]; + RHS29 += Idr[151]; + RHS29 -= go[150] * *cnV[150]; + RHS29 -= go[151] * *cnV[151]; + m_A160 += gt[152]; + m_A160 += gt[153]; + m_A160 += gt[154]; + m_A160 += gt[155]; + m_A160 += gt[156]; + m_A160 += gt[157]; + m_A150 += go[152]; + m_A152 += go[153]; + m_A156 += go[154]; + m_A151 += go[155]; + double RHS30 = Idr[152]; + RHS30 += Idr[153]; + RHS30 += Idr[154]; + RHS30 += Idr[155]; + RHS30 += Idr[156]; + RHS30 += Idr[157]; + RHS30 -= go[156] * *cnV[156]; + RHS30 -= go[157] * *cnV[157]; + m_A165 += gt[158]; + m_A165 += gt[159]; + m_A165 += gt[160]; + m_A165 += gt[161]; + m_A165 += gt[162]; + m_A165 += gt[163]; + m_A165 += gt[164]; + m_A163 += go[158]; + m_A163 += go[159]; + m_A162 += go[160]; + m_A166 += go[161]; + m_A166 += go[162]; + double RHS31 = Idr[158]; + RHS31 += Idr[159]; + RHS31 += Idr[160]; + RHS31 += Idr[161]; + RHS31 += Idr[162]; + RHS31 += Idr[163]; + RHS31 += Idr[164]; + RHS31 -= go[163] * *cnV[163]; + RHS31 -= go[164] * *cnV[164]; + m_A174 += gt[165]; + m_A174 += gt[166]; + m_A174 += gt[167]; + m_A174 += gt[168]; + m_A174 += gt[169]; + m_A174 += gt[170]; + m_A174 += gt[171]; + m_A174 += gt[172]; + m_A174 += gt[173]; + m_A169 += go[165]; + m_A173 += go[166]; + m_A173 += go[167]; + m_A168 += go[168]; + m_A171 += go[169]; + m_A167 += go[170]; + m_A167 += go[171]; + double RHS32 = Idr[165]; + RHS32 += Idr[166]; + RHS32 += Idr[167]; + RHS32 += Idr[168]; + RHS32 += Idr[169]; + RHS32 += Idr[170]; + RHS32 += Idr[171]; + RHS32 += Idr[172]; + RHS32 += Idr[173]; + RHS32 -= go[172] * *cnV[172]; + RHS32 -= go[173] * *cnV[173]; + const double f0 = 1.0 / m_A0; + const double f0_16 = -f0 * m_A54; + m_A56 += m_A1 * f0_16; + RHS16 += f0_16 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_16 = -f1 * m_A55; + m_A56 += m_A3 * f1_16; + m_A57 += m_A4 * f1_16; + RHS16 += f1_16 * RHS1; + const double f1_23 = -f1 * m_A100; + m_A102 += m_A3 * f1_23; + m_A103 += m_A4 * f1_23; + RHS23 += f1_23 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_28 = -f2 * m_A129; + m_A132 += m_A6 * f2_28; + RHS28 += f2_28 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_23 = -f3 * m_A101; + m_A103 += m_A8 * f3_23; + m_A104 += m_A9 * f3_23; + RHS23 += f3_23 * RHS3; + const double f3_29 = -f3 * m_A141; + m_A145 += m_A8 * f3_29; + m_A148 += m_A9 * f3_29; + RHS29 += f3_29 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_17 = -f4 * m_A58; + m_A59 += m_A11 * f4_17; + m_A60 += m_A12 * f4_17; + m_A61 += m_A13 * f4_17; + m_A62 += m_A14 * f4_17; + m_A63 += m_A15 * f4_17; + RHS17 += f4_17 * RHS4; + const double f4_19 = -f4 * m_A69; + m_A71 += m_A11 * f4_19; + m_A72 += m_A12 * f4_19; + m_A73 += m_A13 * f4_19; + m_A74 += m_A14 * f4_19; + m_A76 += m_A15 * f4_19; + RHS19 += f4_19 * RHS4; + const double f4_20 = -f4 * m_A78; + m_A80 += m_A11 * f4_20; + m_A81 += m_A12 * f4_20; + m_A82 += m_A13 * f4_20; + m_A83 += m_A14 * f4_20; + m_A85 += m_A15 * f4_20; + RHS20 += f4_20 * RHS4; + const double f4_21 = -f4 * m_A87; + m_A89 += m_A11 * f4_21; + m_A90 += m_A12 * f4_21; + m_A91 += m_A13 * f4_21; + m_A92 += m_A14 * f4_21; + m_A94 += m_A15 * f4_21; + RHS21 += f4_21 * RHS4; + const double f4_28 = -f4 * m_A130; + m_A132 += m_A11 * f4_28; + m_A133 += m_A12 * f4_28; + m_A134 += m_A13 * f4_28; + m_A135 += m_A14 * f4_28; + m_A138 += m_A15 * f4_28; + RHS28 += f4_28 * RHS4; + const double f5 = 1.0 / m_A16; + const double f5_24 = -f5 * m_A105; + m_A108 += m_A17 * f5_24; + m_A109 += m_A18 * f5_24; + m_A110 += m_A19 * f5_24; + RHS24 += f5_24 * RHS5; + const double f5_28 = -f5 * m_A131; + m_A136 += m_A17 * f5_28; + m_A138 += m_A18 * f5_28; + m_A139 += m_A19 * f5_28; + RHS28 += f5_28 * RHS5; + const double f5_29 = -f5 * m_A142; + m_A146 += m_A17 * f5_29; + m_A147 += m_A18 * f5_29; + m_A148 += m_A19 * f5_29; + RHS29 += f5_29 * RHS5; + const double f6 = 1.0 / m_A20; + const double f6_18 = -f6 * m_A64; + m_A65 += m_A21 * f6_18; + m_A67 += m_A22 * f6_18; + RHS18 += f6_18 * RHS6; + const double f7 = 1.0 / m_A23; + const double f7_18 = -f7 * m_A65; + m_A66 += m_A24 * f7_18; + m_A67 += m_A25 * f7_18; + m_A68 += m_A26 * f7_18; + RHS18 += f7_18 * RHS7; + const double f7_24 = -f7 * m_A106; + m_A107 += m_A24 * f7_24; + m_A108 += m_A25 * f7_24; + m_A110 += m_A26 * f7_24; + RHS24 += f7_24 * RHS7; + const double f7_29 = -f7 * m_A143; + m_A144 += m_A24 * f7_29; + m_A146 += m_A25 * f7_29; + m_A148 += m_A26 * f7_29; + RHS29 += f7_29 * RHS7; + const double f8 = 1.0 / m_A27; + const double f8_30 = -f8 * m_A150; + m_A156 += m_A28 * f8_30; + RHS30 += f8_30 * RHS8; + const double f9 = 1.0 / m_A29; + const double f9_19 = -f9 * m_A70; + m_A72 += m_A30 * f9_19; + m_A73 += m_A31 * f9_19; + m_A74 += m_A32 * f9_19; + m_A75 += m_A33 * f9_19; + m_A77 += m_A34 * f9_19; + RHS19 += f9_19 * RHS9; + const double f9_20 = -f9 * m_A79; + m_A81 += m_A30 * f9_20; + m_A82 += m_A31 * f9_20; + m_A83 += m_A32 * f9_20; + m_A84 += m_A33 * f9_20; + m_A86 += m_A34 * f9_20; + RHS20 += f9_20 * RHS9; + const double f9_21 = -f9 * m_A88; + m_A90 += m_A30 * f9_21; + m_A91 += m_A31 * f9_21; + m_A92 += m_A32 * f9_21; + m_A93 += m_A33 * f9_21; + m_A95 += m_A34 * f9_21; + RHS21 += f9_21 * RHS9; + const double f9_25 = -f9 * m_A111; + m_A112 += m_A30 * f9_25; + m_A113 += m_A31 * f9_25; + m_A114 += m_A32 * f9_25; + m_A115 += m_A33 * f9_25; + m_A117 += m_A34 * f9_25; + RHS25 += f9_25 * RHS9; + const double f9_30 = -f9 * m_A151; + m_A153 += m_A30 * f9_30; + m_A154 += m_A31 * f9_30; + m_A155 += m_A32 * f9_30; + m_A156 += m_A33 * f9_30; + m_A160 += m_A34 * f9_30; + RHS30 += f9_30 * RHS9; + const double f10 = 1.0 / m_A35; + const double f10_22 = -f10 * m_A96; + m_A98 += m_A36 * f10_22; + RHS22 += f10_22 * RHS10; + const double f11 = 1.0 / m_A37; + const double f11_26 = -f11 * m_A118; + m_A119 += m_A38 * f11_26; + m_A121 += m_A39 * f11_26; + RHS26 += f11_26 * RHS11; + const double f12 = 1.0 / m_A40; + const double f12_27 = -f12 * m_A123; + m_A126 += m_A41 * f12_27; + m_A127 += m_A42 * f12_27; + m_A128 += m_A43 * f12_27; + RHS27 += f12_27 * RHS12; + const double f12_30 = -f12 * m_A152; + m_A157 += m_A41 * f12_30; + m_A160 += m_A42 * f12_30; + m_A161 += m_A43 * f12_30; + RHS30 += f12_30 * RHS12; + const double f12_32 = -f12 * m_A167; + m_A171 += m_A41 * f12_32; + m_A172 += m_A42 * f12_32; + m_A174 += m_A43 * f12_32; + RHS32 += f12_32 * RHS12; + const double f13 = 1.0 / m_A44; + const double f13_22 = -f13 * m_A97; + m_A98 += m_A45 * f13_22; + m_A99 += m_A46 * f13_22; + RHS22 += f13_22 * RHS13; + const double f13_31 = -f13 * m_A162; + m_A164 += m_A45 * f13_31; + m_A165 += m_A46 * f13_31; + RHS31 += f13_31 * RHS13; + const double f14 = 1.0 / m_A47; + const double f14_26 = -f14 * m_A119; + m_A120 += m_A48 * f14_26; + m_A121 += m_A49 * f14_26; + m_A122 += m_A50 * f14_26; + RHS26 += f14_26 * RHS14; + const double f14_27 = -f14 * m_A124; + m_A125 += m_A48 * f14_27; + m_A126 += m_A49 * f14_27; + m_A128 += m_A50 * f14_27; + RHS27 += f14_27 * RHS14; + const double f14_32 = -f14 * m_A168; + m_A170 += m_A48 * f14_32; + m_A171 += m_A49 * f14_32; + m_A174 += m_A50 * f14_32; + RHS32 += f14_32 * RHS14; + const double f15 = 1.0 / m_A51; + const double f15_31 = -f15 * m_A163; + m_A165 += m_A52 * f15_31; + m_A166 += m_A53 * f15_31; + RHS31 += f15_31 * RHS15; + const double f15_32 = -f15 * m_A169; + m_A173 += m_A52 * f15_32; + m_A174 += m_A53 * f15_32; + RHS32 += f15_32 * RHS15; + const double f16 = 1.0 / m_A56; + const double f16_23 = -f16 * m_A102; + m_A103 += m_A57 * f16_23; + RHS23 += f16_23 * RHS16; + const double f17 = 1.0 / m_A59; + const double f17_19 = -f17 * m_A71; + m_A72 += m_A60 * f17_19; + m_A73 += m_A61 * f17_19; + m_A74 += m_A62 * f17_19; + m_A76 += m_A63 * f17_19; + RHS19 += f17_19 * RHS17; + const double f17_20 = -f17 * m_A80; + m_A81 += m_A60 * f17_20; + m_A82 += m_A61 * f17_20; + m_A83 += m_A62 * f17_20; + m_A85 += m_A63 * f17_20; + RHS20 += f17_20 * RHS17; + const double f17_21 = -f17 * m_A89; + m_A90 += m_A60 * f17_21; + m_A91 += m_A61 * f17_21; + m_A92 += m_A62 * f17_21; + m_A94 += m_A63 * f17_21; + RHS21 += f17_21 * RHS17; + const double f17_28 = -f17 * m_A132; + m_A133 += m_A60 * f17_28; + m_A134 += m_A61 * f17_28; + m_A135 += m_A62 * f17_28; + m_A138 += m_A63 * f17_28; + RHS28 += f17_28 * RHS17; + const double f18 = 1.0 / m_A66; + const double f18_24 = -f18 * m_A107; + m_A108 += m_A67 * f18_24; + m_A110 += m_A68 * f18_24; + RHS24 += f18_24 * RHS18; + const double f18_29 = -f18 * m_A144; + m_A146 += m_A67 * f18_29; + m_A148 += m_A68 * f18_29; + RHS29 += f18_29 * RHS18; + const double f19 = 1.0 / m_A72; + const double f19_20 = -f19 * m_A81; + m_A82 += m_A73 * f19_20; + m_A83 += m_A74 * f19_20; + m_A84 += m_A75 * f19_20; + m_A85 += m_A76 * f19_20; + m_A86 += m_A77 * f19_20; + RHS20 += f19_20 * RHS19; + const double f19_21 = -f19 * m_A90; + m_A91 += m_A73 * f19_21; + m_A92 += m_A74 * f19_21; + m_A93 += m_A75 * f19_21; + m_A94 += m_A76 * f19_21; + m_A95 += m_A77 * f19_21; + RHS21 += f19_21 * RHS19; + const double f19_25 = -f19 * m_A112; + m_A113 += m_A73 * f19_25; + m_A114 += m_A74 * f19_25; + m_A115 += m_A75 * f19_25; + m_A116 += m_A76 * f19_25; + m_A117 += m_A77 * f19_25; + RHS25 += f19_25 * RHS19; + const double f19_28 = -f19 * m_A133; + m_A134 += m_A73 * f19_28; + m_A135 += m_A74 * f19_28; + m_A137 += m_A75 * f19_28; + m_A138 += m_A76 * f19_28; + m_A140 += m_A77 * f19_28; + RHS28 += f19_28 * RHS19; + const double f19_30 = -f19 * m_A153; + m_A154 += m_A73 * f19_30; + m_A155 += m_A74 * f19_30; + m_A156 += m_A75 * f19_30; + m_A158 += m_A76 * f19_30; + m_A160 += m_A77 * f19_30; + RHS30 += f19_30 * RHS19; + const double f20 = 1.0 / m_A82; + const double f20_21 = -f20 * m_A91; + m_A92 += m_A83 * f20_21; + m_A93 += m_A84 * f20_21; + m_A94 += m_A85 * f20_21; + m_A95 += m_A86 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_25 = -f20 * m_A113; + m_A114 += m_A83 * f20_25; + m_A115 += m_A84 * f20_25; + m_A116 += m_A85 * f20_25; + m_A117 += m_A86 * f20_25; + RHS25 += f20_25 * RHS20; + const double f20_28 = -f20 * m_A134; + m_A135 += m_A83 * f20_28; + m_A137 += m_A84 * f20_28; + m_A138 += m_A85 * f20_28; + m_A140 += m_A86 * f20_28; + RHS28 += f20_28 * RHS20; + const double f20_30 = -f20 * m_A154; + m_A155 += m_A83 * f20_30; + m_A156 += m_A84 * f20_30; + m_A158 += m_A85 * f20_30; + m_A160 += m_A86 * f20_30; + RHS30 += f20_30 * RHS20; + const double f21 = 1.0 / m_A92; + const double f21_25 = -f21 * m_A114; + m_A115 += m_A93 * f21_25; + m_A116 += m_A94 * f21_25; + m_A117 += m_A95 * f21_25; + RHS25 += f21_25 * RHS21; + const double f21_28 = -f21 * m_A135; + m_A137 += m_A93 * f21_28; + m_A138 += m_A94 * f21_28; + m_A140 += m_A95 * f21_28; + RHS28 += f21_28 * RHS21; + const double f21_30 = -f21 * m_A155; + m_A156 += m_A93 * f21_30; + m_A158 += m_A94 * f21_30; + m_A160 += m_A95 * f21_30; + RHS30 += f21_30 * RHS21; + const double f22 = 1.0 / m_A98; + const double f22_31 = -f22 * m_A164; + m_A165 += m_A99 * f22_31; + RHS31 += f22_31 * RHS22; + const double f23 = 1.0 / m_A103; + const double f23_29 = -f23 * m_A145; + m_A148 += m_A104 * f23_29; + RHS29 += f23_29 * RHS23; + const double f24 = 1.0 / m_A108; + const double f24_28 = -f24 * m_A136; + m_A138 += m_A109 * f24_28; + m_A139 += m_A110 * f24_28; + RHS28 += f24_28 * RHS24; + const double f24_29 = -f24 * m_A146; + m_A147 += m_A109 * f24_29; + m_A148 += m_A110 * f24_29; + RHS29 += f24_29 * RHS24; + const double f25 = 1.0 / m_A115; + const double f25_28 = -f25 * m_A137; + m_A138 += m_A116 * f25_28; + m_A140 += m_A117 * f25_28; + RHS28 += f25_28 * RHS25; + const double f25_30 = -f25 * m_A156; + m_A158 += m_A116 * f25_30; + m_A160 += m_A117 * f25_30; + RHS30 += f25_30 * RHS25; + const double f26 = 1.0 / m_A120; + const double f26_27 = -f26 * m_A125; + m_A126 += m_A121 * f26_27; + m_A128 += m_A122 * f26_27; + RHS27 += f26_27 * RHS26; + const double f26_32 = -f26 * m_A170; + m_A171 += m_A121 * f26_32; + m_A174 += m_A122 * f26_32; + RHS32 += f26_32 * RHS26; + const double f27 = 1.0 / m_A126; + const double f27_30 = -f27 * m_A157; + m_A160 += m_A127 * f27_30; + m_A161 += m_A128 * f27_30; + RHS30 += f27_30 * RHS27; + const double f27_32 = -f27 * m_A171; + m_A172 += m_A127 * f27_32; + m_A174 += m_A128 * f27_32; + RHS32 += f27_32 * RHS27; + const double f28 = 1.0 / m_A138; + const double f28_29 = -f28 * m_A147; + m_A148 += m_A139 * f28_29; + m_A149 += m_A140 * f28_29; + RHS29 += f28_29 * RHS28; + const double f28_30 = -f28 * m_A158; + m_A159 += m_A139 * f28_30; + m_A160 += m_A140 * f28_30; + RHS30 += f28_30 * RHS28; + const double f29 = 1.0 / m_A148; + const double f29_30 = -f29 * m_A159; + m_A160 += m_A149 * f29_30; + RHS30 += f29_30 * RHS29; + const double f30 = 1.0 / m_A160; + const double f30_32 = -f30 * m_A172; + m_A174 += m_A161 * f30_32; + RHS32 += f30_32 * RHS30; + const double f31 = 1.0 / m_A165; + const double f31_32 = -f31 * m_A173; + m_A174 += m_A166 * f31_32; + RHS32 += f31_32 * RHS31; + V[32] = RHS32 / m_A174; + double tmp31 = 0.0; + tmp31 += m_A166 * V[32]; + V[31] = (RHS31 - tmp31) / m_A165; + double tmp30 = 0.0; + tmp30 += m_A161 * V[32]; + V[30] = (RHS30 - tmp30) / m_A160; + double tmp29 = 0.0; + tmp29 += m_A149 * V[30]; + V[29] = (RHS29 - tmp29) / m_A148; + double tmp28 = 0.0; + tmp28 += m_A139 * V[29]; + tmp28 += m_A140 * V[30]; + V[28] = (RHS28 - tmp28) / m_A138; + double tmp27 = 0.0; + tmp27 += m_A127 * V[30]; + tmp27 += m_A128 * V[32]; + V[27] = (RHS27 - tmp27) / m_A126; + double tmp26 = 0.0; + tmp26 += m_A121 * V[27]; + tmp26 += m_A122 * V[32]; + V[26] = (RHS26 - tmp26) / m_A120; + double tmp25 = 0.0; + tmp25 += m_A116 * V[28]; + tmp25 += m_A117 * V[30]; + V[25] = (RHS25 - tmp25) / m_A115; + double tmp24 = 0.0; + tmp24 += m_A109 * V[28]; + tmp24 += m_A110 * V[29]; + V[24] = (RHS24 - tmp24) / m_A108; + double tmp23 = 0.0; + tmp23 += m_A104 * V[29]; + V[23] = (RHS23 - tmp23) / m_A103; + double tmp22 = 0.0; + tmp22 += m_A99 * V[31]; + V[22] = (RHS22 - tmp22) / m_A98; + double tmp21 = 0.0; + tmp21 += m_A93 * V[25]; + tmp21 += m_A94 * V[28]; + tmp21 += m_A95 * V[30]; + V[21] = (RHS21 - tmp21) / m_A92; + double tmp20 = 0.0; + tmp20 += m_A83 * V[21]; + tmp20 += m_A84 * V[25]; + tmp20 += m_A85 * V[28]; + tmp20 += m_A86 * V[30]; + V[20] = (RHS20 - tmp20) / m_A82; + double tmp19 = 0.0; + tmp19 += m_A73 * V[20]; + tmp19 += m_A74 * V[21]; + tmp19 += m_A75 * V[25]; + tmp19 += m_A76 * V[28]; + tmp19 += m_A77 * V[30]; + V[19] = (RHS19 - tmp19) / m_A72; + double tmp18 = 0.0; + tmp18 += m_A67 * V[24]; + tmp18 += m_A68 * V[29]; + V[18] = (RHS18 - tmp18) / m_A66; + double tmp17 = 0.0; + tmp17 += m_A60 * V[19]; + tmp17 += m_A61 * V[20]; + tmp17 += m_A62 * V[21]; + tmp17 += m_A63 * V[28]; + V[17] = (RHS17 - tmp17) / m_A59; + double tmp16 = 0.0; + tmp16 += m_A57 * V[23]; + V[16] = (RHS16 - tmp16) / m_A56; + double tmp15 = 0.0; + tmp15 += m_A52 * V[31]; + tmp15 += m_A53 * V[32]; + V[15] = (RHS15 - tmp15) / m_A51; + double tmp14 = 0.0; + tmp14 += m_A48 * V[26]; + tmp14 += m_A49 * V[27]; + tmp14 += m_A50 * V[32]; + V[14] = (RHS14 - tmp14) / m_A47; + double tmp13 = 0.0; + tmp13 += m_A45 * V[22]; + tmp13 += m_A46 * V[31]; + V[13] = (RHS13 - tmp13) / m_A44; + double tmp12 = 0.0; + tmp12 += m_A41 * V[27]; + tmp12 += m_A42 * V[30]; + tmp12 += m_A43 * V[32]; + V[12] = (RHS12 - tmp12) / m_A40; + double tmp11 = 0.0; + tmp11 += m_A38 * V[14]; + tmp11 += m_A39 * V[27]; + V[11] = (RHS11 - tmp11) / m_A37; + double tmp10 = 0.0; + tmp10 += m_A36 * V[22]; + V[10] = (RHS10 - tmp10) / m_A35; + double tmp9 = 0.0; + tmp9 += m_A30 * V[19]; + tmp9 += m_A31 * V[20]; + tmp9 += m_A32 * V[21]; + tmp9 += m_A33 * V[25]; + tmp9 += m_A34 * V[30]; + V[9] = (RHS9 - tmp9) / m_A29; + double tmp8 = 0.0; + tmp8 += m_A28 * V[25]; + V[8] = (RHS8 - tmp8) / m_A27; + double tmp7 = 0.0; + tmp7 += m_A24 * V[18]; + tmp7 += m_A25 * V[24]; + tmp7 += m_A26 * V[29]; + V[7] = (RHS7 - tmp7) / m_A23; + double tmp6 = 0.0; + tmp6 += m_A21 * V[7]; + tmp6 += m_A22 * V[24]; + V[6] = (RHS6 - tmp6) / m_A20; + double tmp5 = 0.0; + tmp5 += m_A17 * V[24]; + tmp5 += m_A18 * V[28]; + tmp5 += m_A19 * V[29]; + V[5] = (RHS5 - tmp5) / m_A16; + double tmp4 = 0.0; + tmp4 += m_A11 * V[17]; + tmp4 += m_A12 * V[19]; + tmp4 += m_A13 * V[20]; + tmp4 += m_A14 * V[21]; + tmp4 += m_A15 * V[28]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[23]; + tmp3 += m_A9 * V[29]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[17]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[16]; + tmp1 += m_A4 * V[23]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[16]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_227_double_double_f3c9a6d53371d709(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + double m_A198(0.0); + double m_A199(0.0); + double m_A200(0.0); + double m_A201(0.0); + double m_A202(0.0); + double m_A203(0.0); + double m_A204(0.0); + double m_A205(0.0); + double m_A206(0.0); + double m_A207(0.0); + double m_A208(0.0); + double m_A209(0.0); + double m_A210(0.0); + double m_A211(0.0); + double m_A212(0.0); + double m_A213(0.0); + double m_A214(0.0); + double m_A215(0.0); + double m_A216(0.0); + double m_A217(0.0); + double m_A218(0.0); + double m_A219(0.0); + double m_A220(0.0); + double m_A221(0.0); + double m_A222(0.0); + double m_A223(0.0); + double m_A224(0.0); + double m_A225(0.0); + double m_A226(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A0 += gt[7]; + m_A0 += gt[8]; + m_A0 += gt[9]; + m_A0 += gt[10]; + m_A0 += gt[11]; + m_A0 += gt[12]; + m_A0 += gt[13]; + m_A2 += go[0]; + m_A1 += go[1]; + m_A1 += go[2]; + m_A0 += go[3]; + m_A0 += go[4]; + m_A0 += go[5]; + m_A0 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 += Idr[7]; + RHS0 += Idr[8]; + RHS0 += Idr[9]; + RHS0 += Idr[10]; + RHS0 += Idr[11]; + RHS0 += Idr[12]; + RHS0 += Idr[13]; + RHS0 -= go[9] * *cnV[9]; + RHS0 -= go[10] * *cnV[10]; + RHS0 -= go[11] * *cnV[11]; + RHS0 -= go[12] * *cnV[12]; + RHS0 -= go[13] * *cnV[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A4 += gt[16]; + m_A4 += gt[17]; + m_A4 += gt[18]; + m_A4 += gt[19]; + m_A4 += gt[20]; + m_A4 += gt[21]; + m_A4 += gt[22]; + m_A4 += gt[23]; + m_A4 += gt[24]; + m_A4 += gt[25]; + m_A5 += go[14]; + m_A5 += go[15]; + m_A4 += go[16]; + m_A4 += go[17]; + m_A4 += go[18]; + m_A4 += go[19]; + double RHS1 = Idr[14]; + RHS1 += Idr[15]; + RHS1 += Idr[16]; + RHS1 += Idr[17]; + RHS1 += Idr[18]; + RHS1 += Idr[19]; + RHS1 += Idr[20]; + RHS1 += Idr[21]; + RHS1 += Idr[22]; + RHS1 += Idr[23]; + RHS1 += Idr[24]; + RHS1 += Idr[25]; + RHS1 -= go[20] * *cnV[20]; + RHS1 -= go[21] * *cnV[21]; + RHS1 -= go[22] * *cnV[22]; + RHS1 -= go[23] * *cnV[23]; + RHS1 -= go[24] * *cnV[24]; + RHS1 -= go[25] * *cnV[25]; + m_A6 += gt[26]; + m_A6 += gt[27]; + m_A6 += gt[28]; + m_A6 += gt[29]; + m_A6 += gt[30]; + m_A6 += gt[31]; + m_A6 += gt[32]; + m_A6 += gt[33]; + m_A6 += gt[34]; + m_A6 += gt[35]; + m_A6 += gt[36]; + m_A6 += gt[37]; + m_A6 += gt[38]; + m_A6 += gt[39]; + m_A9 += go[26]; + m_A7 += go[27]; + m_A7 += go[28]; + m_A6 += go[29]; + m_A6 += go[30]; + m_A6 += go[31]; + m_A6 += go[32]; + m_A8 += go[33]; + m_A8 += go[34]; + double RHS2 = Idr[26]; + RHS2 += Idr[27]; + RHS2 += Idr[28]; + RHS2 += Idr[29]; + RHS2 += Idr[30]; + RHS2 += Idr[31]; + RHS2 += Idr[32]; + RHS2 += Idr[33]; + RHS2 += Idr[34]; + RHS2 += Idr[35]; + RHS2 += Idr[36]; + RHS2 += Idr[37]; + RHS2 += Idr[38]; + RHS2 += Idr[39]; + RHS2 -= go[35] * *cnV[35]; + RHS2 -= go[36] * *cnV[36]; + RHS2 -= go[37] * *cnV[37]; + RHS2 -= go[38] * *cnV[38]; + RHS2 -= go[39] * *cnV[39]; + m_A10 += gt[40]; + m_A10 += gt[41]; + m_A10 += gt[42]; + m_A10 += gt[43]; + m_A10 += gt[44]; + m_A10 += gt[45]; + m_A10 += gt[46]; + m_A10 += gt[47]; + m_A10 += gt[48]; + m_A10 += gt[49]; + m_A10 += gt[50]; + m_A10 += gt[51]; + m_A11 += go[40]; + m_A11 += go[41]; + m_A10 += go[42]; + m_A10 += go[43]; + m_A10 += go[44]; + m_A10 += go[45]; + double RHS3 = Idr[40]; + RHS3 += Idr[41]; + RHS3 += Idr[42]; + RHS3 += Idr[43]; + RHS3 += Idr[44]; + RHS3 += Idr[45]; + RHS3 += Idr[46]; + RHS3 += Idr[47]; + RHS3 += Idr[48]; + RHS3 += Idr[49]; + RHS3 += Idr[50]; + RHS3 += Idr[51]; + RHS3 -= go[46] * *cnV[46]; + RHS3 -= go[47] * *cnV[47]; + RHS3 -= go[48] * *cnV[48]; + RHS3 -= go[49] * *cnV[49]; + RHS3 -= go[50] * *cnV[50]; + RHS3 -= go[51] * *cnV[51]; + m_A12 += gt[52]; + m_A12 += gt[53]; + m_A12 += gt[54]; + m_A13 += go[52]; + double RHS4 = Idr[52]; + RHS4 += Idr[53]; + RHS4 += Idr[54]; + RHS4 -= go[53] * *cnV[53]; + RHS4 -= go[54] * *cnV[54]; + m_A14 += gt[55]; + m_A14 += gt[56]; + m_A14 += gt[57]; + m_A14 += gt[58]; + m_A14 += gt[59]; + m_A14 += gt[60]; + m_A14 += gt[61]; + m_A14 += gt[62]; + m_A16 += go[55]; + m_A16 += go[56]; + m_A16 += go[57]; + m_A15 += go[58]; + m_A15 += go[59]; + m_A17 += go[60]; + m_A17 += go[61]; + m_A17 += go[62]; + double RHS5 = Idr[55]; + RHS5 += Idr[56]; + RHS5 += Idr[57]; + RHS5 += Idr[58]; + RHS5 += Idr[59]; + RHS5 += Idr[60]; + RHS5 += Idr[61]; + RHS5 += Idr[62]; + m_A18 += gt[63]; + m_A18 += gt[64]; + m_A18 += gt[65]; + m_A18 += gt[66]; + m_A18 += gt[67]; + m_A18 += gt[68]; + m_A18 += gt[69]; + m_A18 += gt[70]; + m_A18 += gt[71]; + m_A18 += gt[72]; + m_A18 += gt[73]; + m_A18 += gt[74]; + m_A18 += gt[75]; + m_A18 += gt[76]; + m_A20 += go[63]; + m_A18 += go[64]; + m_A18 += go[65]; + m_A18 += go[66]; + m_A18 += go[67]; + m_A19 += go[68]; + m_A19 += go[69]; + m_A19 += go[70]; + m_A19 += go[71]; + double RHS6 = Idr[63]; + RHS6 += Idr[64]; + RHS6 += Idr[65]; + RHS6 += Idr[66]; + RHS6 += Idr[67]; + RHS6 += Idr[68]; + RHS6 += Idr[69]; + RHS6 += Idr[70]; + RHS6 += Idr[71]; + RHS6 += Idr[72]; + RHS6 += Idr[73]; + RHS6 += Idr[74]; + RHS6 += Idr[75]; + RHS6 += Idr[76]; + RHS6 -= go[72] * *cnV[72]; + RHS6 -= go[73] * *cnV[73]; + RHS6 -= go[74] * *cnV[74]; + RHS6 -= go[75] * *cnV[75]; + RHS6 -= go[76] * *cnV[76]; + m_A21 += gt[77]; + m_A21 += gt[78]; + m_A21 += gt[79]; + m_A21 += gt[80]; + m_A21 += gt[81]; + m_A21 += gt[82]; + m_A21 += gt[83]; + m_A22 += go[77]; + double RHS7 = Idr[77]; + RHS7 += Idr[78]; + RHS7 += Idr[79]; + RHS7 += Idr[80]; + RHS7 += Idr[81]; + RHS7 += Idr[82]; + RHS7 += Idr[83]; + RHS7 -= go[78] * *cnV[78]; + RHS7 -= go[79] * *cnV[79]; + RHS7 -= go[80] * *cnV[80]; + RHS7 -= go[81] * *cnV[81]; + RHS7 -= go[82] * *cnV[82]; + RHS7 -= go[83] * *cnV[83]; + m_A23 += gt[84]; + m_A23 += gt[85]; + m_A23 += gt[86]; + m_A24 += go[84]; + double RHS8 = Idr[84]; + RHS8 += Idr[85]; + RHS8 += Idr[86]; + RHS8 -= go[85] * *cnV[85]; + RHS8 -= go[86] * *cnV[86]; + m_A25 += gt[87]; + m_A25 += gt[88]; + m_A25 += gt[89]; + m_A25 += gt[90]; + m_A26 += go[87]; + double RHS9 = Idr[87]; + RHS9 += Idr[88]; + RHS9 += Idr[89]; + RHS9 += Idr[90]; + RHS9 -= go[88] * *cnV[88]; + RHS9 -= go[89] * *cnV[89]; + RHS9 -= go[90] * *cnV[90]; + m_A27 += gt[91]; + m_A27 += gt[92]; + m_A27 += gt[93]; + m_A28 += go[91]; + double RHS10 = Idr[91]; + RHS10 += Idr[92]; + RHS10 += Idr[93]; + RHS10 -= go[92] * *cnV[92]; + RHS10 -= go[93] * *cnV[93]; + m_A29 += gt[94]; + m_A29 += gt[95]; + m_A31 += go[94]; + m_A30 += go[95]; + double RHS11 = Idr[94]; + RHS11 += Idr[95]; + m_A32 += gt[96]; + m_A32 += gt[97]; + m_A32 += gt[98]; + m_A32 += gt[99]; + m_A32 += gt[100]; + m_A33 += go[96]; + m_A34 += go[97]; + m_A35 += go[98]; + double RHS12 = Idr[96]; + RHS12 += Idr[97]; + RHS12 += Idr[98]; + RHS12 += Idr[99]; + RHS12 += Idr[100]; + RHS12 -= go[99] * *cnV[99]; + RHS12 -= go[100] * *cnV[100]; + m_A36 += gt[101]; + m_A36 += gt[102]; + m_A36 += gt[103]; + m_A36 += gt[104]; + m_A36 += gt[105]; + m_A36 += gt[106]; + m_A36 += gt[107]; + m_A37 += go[101]; + m_A38 += go[102]; + double RHS13 = Idr[101]; + RHS13 += Idr[102]; + RHS13 += Idr[103]; + RHS13 += Idr[104]; + RHS13 += Idr[105]; + RHS13 += Idr[106]; + RHS13 += Idr[107]; + RHS13 -= go[103] * *cnV[103]; + RHS13 -= go[104] * *cnV[104]; + RHS13 -= go[105] * *cnV[105]; + RHS13 -= go[106] * *cnV[106]; + RHS13 -= go[107] * *cnV[107]; + m_A39 += gt[108]; + m_A39 += gt[109]; + m_A39 += gt[110]; + m_A39 += gt[111]; + m_A39 += gt[112]; + m_A39 += gt[113]; + m_A39 += gt[114]; + m_A39 += gt[115]; + m_A39 += gt[116]; + m_A39 += gt[117]; + m_A39 += gt[118]; + m_A44 += go[108]; + m_A44 += go[109]; + m_A40 += go[110]; + m_A40 += go[111]; + m_A43 += go[112]; + m_A42 += go[113]; + m_A42 += go[114]; + m_A41 += go[115]; + m_A41 += go[116]; + m_A41 += go[117]; + double RHS14 = Idr[108]; + RHS14 += Idr[109]; + RHS14 += Idr[110]; + RHS14 += Idr[111]; + RHS14 += Idr[112]; + RHS14 += Idr[113]; + RHS14 += Idr[114]; + RHS14 += Idr[115]; + RHS14 += Idr[116]; + RHS14 += Idr[117]; + RHS14 += Idr[118]; + RHS14 -= go[118] * *cnV[118]; + m_A45 += gt[119]; + m_A45 += gt[120]; + m_A45 += gt[121]; + m_A47 += go[119]; + m_A46 += go[120]; + double RHS15 = Idr[119]; + RHS15 += Idr[120]; + RHS15 += Idr[121]; + RHS15 -= go[121] * *cnV[121]; + m_A49 += gt[122]; + m_A49 += gt[123]; + m_A49 += gt[124]; + m_A49 += gt[125]; + m_A49 += gt[126]; + m_A49 += gt[127]; + m_A49 += gt[128]; + m_A49 += gt[129]; + m_A50 += go[122]; + m_A50 += go[123]; + m_A50 += go[124]; + m_A48 += go[125]; + m_A48 += go[126]; + m_A51 += go[127]; + m_A51 += go[128]; + m_A51 += go[129]; + double RHS16 = Idr[122]; + RHS16 += Idr[123]; + RHS16 += Idr[124]; + RHS16 += Idr[125]; + RHS16 += Idr[126]; + RHS16 += Idr[127]; + RHS16 += Idr[128]; + RHS16 += Idr[129]; + m_A52 += gt[130]; + m_A52 += gt[131]; + m_A52 += gt[132]; + m_A52 += gt[133]; + m_A52 += gt[134]; + m_A52 += gt[135]; + m_A52 += gt[136]; + m_A52 += gt[137]; + m_A52 += gt[138]; + m_A52 += gt[139]; + m_A52 += gt[140]; + m_A52 += gt[141]; + m_A52 += gt[142]; + m_A52 += gt[143]; + m_A54 += go[130]; + m_A52 += go[131]; + m_A52 += go[132]; + m_A52 += go[133]; + m_A52 += go[134]; + m_A53 += go[135]; + m_A53 += go[136]; + m_A53 += go[137]; + m_A53 += go[138]; + double RHS17 = Idr[130]; + RHS17 += Idr[131]; + RHS17 += Idr[132]; + RHS17 += Idr[133]; + RHS17 += Idr[134]; + RHS17 += Idr[135]; + RHS17 += Idr[136]; + RHS17 += Idr[137]; + RHS17 += Idr[138]; + RHS17 += Idr[139]; + RHS17 += Idr[140]; + RHS17 += Idr[141]; + RHS17 += Idr[142]; + RHS17 += Idr[143]; + RHS17 -= go[139] * *cnV[139]; + RHS17 -= go[140] * *cnV[140]; + RHS17 -= go[141] * *cnV[141]; + RHS17 -= go[142] * *cnV[142]; + RHS17 -= go[143] * *cnV[143]; + m_A59 += gt[144]; + m_A59 += gt[145]; + m_A59 += gt[146]; + m_A59 += gt[147]; + m_A59 += gt[148]; + m_A59 += gt[149]; + m_A58 += go[144]; + m_A57 += go[145]; + m_A56 += go[146]; + m_A55 += go[147]; + double RHS18 = Idr[144]; + RHS18 += Idr[145]; + RHS18 += Idr[146]; + RHS18 += Idr[147]; + RHS18 += Idr[148]; + RHS18 += Idr[149]; + RHS18 -= go[148] * *cnV[148]; + RHS18 -= go[149] * *cnV[149]; + m_A61 += gt[150]; + m_A61 += gt[151]; + m_A61 += gt[152]; + m_A61 += gt[153]; + m_A61 += gt[154]; + m_A61 += gt[155]; + m_A63 += go[150]; + m_A62 += go[151]; + m_A62 += go[152]; + m_A64 += go[153]; + m_A64 += go[154]; + double RHS19 = Idr[150]; + RHS19 += Idr[151]; + RHS19 += Idr[152]; + RHS19 += Idr[153]; + RHS19 += Idr[154]; + RHS19 += Idr[155]; + RHS19 -= go[155] * *cnV[155]; + m_A65 += gt[156]; + m_A65 += gt[157]; + m_A65 += gt[158]; + m_A65 += gt[159]; + m_A65 += gt[160]; + m_A65 += gt[161]; + m_A65 += gt[162]; + m_A66 += go[156]; + double RHS20 = Idr[156]; + RHS20 += Idr[157]; + RHS20 += Idr[158]; + RHS20 += Idr[159]; + RHS20 += Idr[160]; + RHS20 += Idr[161]; + RHS20 += Idr[162]; + RHS20 -= go[157] * *cnV[157]; + RHS20 -= go[158] * *cnV[158]; + RHS20 -= go[159] * *cnV[159]; + RHS20 -= go[160] * *cnV[160]; + RHS20 -= go[161] * *cnV[161]; + RHS20 -= go[162] * *cnV[162]; + m_A68 += gt[163]; + m_A68 += gt[164]; + m_A68 += gt[165]; + m_A68 += gt[166]; + m_A68 += gt[167]; + m_A68 += gt[168]; + m_A68 += gt[169]; + m_A68 += gt[170]; + m_A68 += gt[171]; + m_A68 += gt[172]; + m_A68 += gt[173]; + m_A68 += gt[174]; + m_A68 += gt[175]; + m_A68 += gt[176]; + m_A69 += go[163]; + m_A68 += go[164]; + m_A68 += go[165]; + m_A68 += go[166]; + m_A68 += go[167]; + m_A67 += go[168]; + m_A67 += go[169]; + m_A70 += go[170]; + m_A70 += go[171]; + double RHS21 = Idr[163]; + RHS21 += Idr[164]; + RHS21 += Idr[165]; + RHS21 += Idr[166]; + RHS21 += Idr[167]; + RHS21 += Idr[168]; + RHS21 += Idr[169]; + RHS21 += Idr[170]; + RHS21 += Idr[171]; + RHS21 += Idr[172]; + RHS21 += Idr[173]; + RHS21 += Idr[174]; + RHS21 += Idr[175]; + RHS21 += Idr[176]; + RHS21 -= go[172] * *cnV[172]; + RHS21 -= go[173] * *cnV[173]; + RHS21 -= go[174] * *cnV[174]; + RHS21 -= go[175] * *cnV[175]; + RHS21 -= go[176] * *cnV[176]; + m_A72 += gt[177]; + m_A72 += gt[178]; + m_A72 += gt[179]; + m_A72 += gt[180]; + m_A72 += gt[181]; + m_A72 += gt[182]; + m_A71 += go[177]; + m_A74 += go[178]; + m_A73 += go[179]; + double RHS22 = Idr[177]; + RHS22 += Idr[178]; + RHS22 += Idr[179]; + RHS22 += Idr[180]; + RHS22 += Idr[181]; + RHS22 += Idr[182]; + RHS22 -= go[180] * *cnV[180]; + RHS22 -= go[181] * *cnV[181]; + RHS22 -= go[182] * *cnV[182]; + m_A76 += gt[183]; + m_A76 += gt[184]; + m_A75 += go[183]; + m_A77 += go[184]; + double RHS23 = Idr[183]; + RHS23 += Idr[184]; + m_A79 += gt[185]; + m_A79 += gt[186]; + m_A79 += gt[187]; + m_A79 += gt[188]; + m_A79 += gt[189]; + m_A79 += gt[190]; + m_A79 += gt[191]; + m_A79 += gt[192]; + m_A81 += go[185]; + m_A81 += go[186]; + m_A81 += go[187]; + m_A78 += go[188]; + m_A78 += go[189]; + m_A80 += go[190]; + m_A80 += go[191]; + m_A80 += go[192]; + double RHS24 = Idr[185]; + RHS24 += Idr[186]; + RHS24 += Idr[187]; + RHS24 += Idr[188]; + RHS24 += Idr[189]; + RHS24 += Idr[190]; + RHS24 += Idr[191]; + RHS24 += Idr[192]; + m_A86 += gt[193]; + m_A86 += gt[194]; + m_A86 += gt[195]; + m_A86 += gt[196]; + m_A86 += gt[197]; + m_A86 += gt[198]; + m_A82 += go[193]; + m_A91 += go[194]; + m_A91 += go[195]; + m_A84 += go[196]; + m_A84 += go[197]; + double RHS25 = Idr[193]; + RHS25 += Idr[194]; + RHS25 += Idr[195]; + RHS25 += Idr[196]; + RHS25 += Idr[197]; + RHS25 += Idr[198]; + RHS25 -= go[198] * *cnV[198]; + m_A96 += gt[199]; + m_A96 += gt[200]; + m_A96 += gt[201]; + m_A96 += gt[202]; + m_A96 += gt[203]; + m_A96 += gt[204]; + m_A96 += gt[205]; + m_A96 += gt[206]; + m_A96 += gt[207]; + m_A96 += gt[208]; + m_A96 += gt[209]; + m_A96 += gt[210]; + m_A96 += gt[211]; + m_A97 += go[199]; + m_A97 += go[200]; + m_A94 += go[201]; + m_A94 += go[202]; + m_A94 += go[203]; + m_A94 += go[204]; + m_A95 += go[205]; + m_A95 += go[206]; + m_A95 += go[207]; + m_A93 += go[208]; + m_A98 += go[209]; + m_A98 += go[210]; + double RHS26 = Idr[199]; + RHS26 += Idr[200]; + RHS26 += Idr[201]; + RHS26 += Idr[202]; + RHS26 += Idr[203]; + RHS26 += Idr[204]; + RHS26 += Idr[205]; + RHS26 += Idr[206]; + RHS26 += Idr[207]; + RHS26 += Idr[208]; + RHS26 += Idr[209]; + RHS26 += Idr[210]; + RHS26 += Idr[211]; + RHS26 -= go[211] * *cnV[211]; + m_A101 += gt[212]; + m_A101 += gt[213]; + m_A101 += gt[214]; + m_A101 += gt[215]; + m_A101 += gt[216]; + m_A101 += gt[217]; + m_A101 += gt[218]; + m_A101 += gt[219]; + m_A106 += go[212]; + m_A106 += go[213]; + m_A106 += go[214]; + m_A104 += go[215]; + m_A104 += go[216]; + m_A99 += go[217]; + m_A99 += go[218]; + m_A99 += go[219]; + double RHS27 = Idr[212]; + RHS27 += Idr[213]; + RHS27 += Idr[214]; + RHS27 += Idr[215]; + RHS27 += Idr[216]; + RHS27 += Idr[217]; + RHS27 += Idr[218]; + RHS27 += Idr[219]; + m_A116 += gt[220]; + m_A116 += gt[221]; + m_A116 += gt[222]; + m_A116 += gt[223]; + m_A116 += gt[224]; + m_A108 += go[220]; + m_A110 += go[221]; + m_A113 += go[222]; + m_A112 += go[223]; + m_A107 += go[224]; + double RHS28 = Idr[220]; + RHS28 += Idr[221]; + RHS28 += Idr[222]; + RHS28 += Idr[223]; + RHS28 += Idr[224]; + m_A124 += gt[225]; + m_A124 += gt[226]; + m_A124 += gt[227]; + m_A124 += gt[228]; + m_A124 += gt[229]; + m_A124 += gt[230]; + m_A124 += gt[231]; + m_A124 += gt[232]; + m_A124 += gt[233]; + m_A123 += go[225]; + m_A123 += go[226]; + m_A127 += go[227]; + m_A126 += go[228]; + m_A122 += go[229]; + m_A122 += go[230]; + double RHS29 = Idr[225]; + RHS29 += Idr[226]; + RHS29 += Idr[227]; + RHS29 += Idr[228]; + RHS29 += Idr[229]; + RHS29 += Idr[230]; + RHS29 += Idr[231]; + RHS29 += Idr[232]; + RHS29 += Idr[233]; + RHS29 -= go[231] * *cnV[231]; + RHS29 -= go[232] * *cnV[232]; + RHS29 -= go[233] * *cnV[233]; + m_A133 += gt[234]; + m_A133 += gt[235]; + m_A133 += gt[236]; + m_A133 += gt[237]; + m_A133 += gt[238]; + m_A133 += gt[239]; + m_A130 += go[234]; + m_A139 += go[235]; + m_A129 += go[236]; + m_A128 += go[237]; + double RHS30 = Idr[234]; + RHS30 += Idr[235]; + RHS30 += Idr[236]; + RHS30 += Idr[237]; + RHS30 += Idr[238]; + RHS30 += Idr[239]; + RHS30 -= go[238] * *cnV[238]; + RHS30 -= go[239] * *cnV[239]; + m_A142 += gt[240]; + m_A142 += gt[241]; + m_A142 += gt[242]; + m_A142 += gt[243]; + m_A142 += gt[244]; + m_A142 += gt[245]; + m_A142 += gt[246]; + m_A142 += gt[247]; + m_A142 += gt[248]; + m_A142 += gt[249]; + m_A142 += gt[250]; + m_A143 += go[240]; + m_A144 += go[241]; + m_A144 += go[242]; + m_A141 += go[243]; + m_A141 += go[244]; + m_A141 += go[245]; + m_A140 += go[246]; + m_A140 += go[247]; + double RHS31 = Idr[240]; + RHS31 += Idr[241]; + RHS31 += Idr[242]; + RHS31 += Idr[243]; + RHS31 += Idr[244]; + RHS31 += Idr[245]; + RHS31 += Idr[246]; + RHS31 += Idr[247]; + RHS31 += Idr[248]; + RHS31 += Idr[249]; + RHS31 += Idr[250]; + RHS31 -= go[248] * *cnV[248]; + RHS31 -= go[249] * *cnV[249]; + RHS31 -= go[250] * *cnV[250]; + m_A152 += gt[251]; + m_A152 += gt[252]; + m_A152 += gt[253]; + m_A152 += gt[254]; + m_A152 += gt[255]; + m_A152 += gt[256]; + m_A152 += gt[257]; + m_A152 += gt[258]; + m_A152 += gt[259]; + m_A152 += gt[260]; + m_A152 += gt[261]; + m_A148 += go[251]; + m_A146 += go[252]; + m_A147 += go[253]; + m_A145 += go[254]; + m_A145 += go[255]; + m_A145 += go[256]; + m_A156 += go[257]; + m_A156 += go[258]; + m_A149 += go[259]; + m_A149 += go[260]; + double RHS32 = Idr[251]; + RHS32 += Idr[252]; + RHS32 += Idr[253]; + RHS32 += Idr[254]; + RHS32 += Idr[255]; + RHS32 += Idr[256]; + RHS32 += Idr[257]; + RHS32 += Idr[258]; + RHS32 += Idr[259]; + RHS32 += Idr[260]; + RHS32 += Idr[261]; + RHS32 -= go[261] * *cnV[261]; + m_A164 += gt[262]; + m_A164 += gt[263]; + m_A164 += gt[264]; + m_A164 += gt[265]; + m_A164 += gt[266]; + m_A164 += gt[267]; + m_A164 += gt[268]; + m_A164 += gt[269]; + m_A164 += gt[270]; + m_A164 += gt[271]; + m_A164 += gt[272]; + m_A164 += gt[273]; + m_A164 += gt[274]; + m_A164 += gt[275]; + m_A168 += go[262]; + m_A164 += go[263]; + m_A164 += go[264]; + m_A164 += go[265]; + m_A164 += go[266]; + m_A160 += go[267]; + m_A160 += go[268]; + m_A158 += go[269]; + m_A158 += go[270]; + double RHS33 = Idr[262]; + RHS33 += Idr[263]; + RHS33 += Idr[264]; + RHS33 += Idr[265]; + RHS33 += Idr[266]; + RHS33 += Idr[267]; + RHS33 += Idr[268]; + RHS33 += Idr[269]; + RHS33 += Idr[270]; + RHS33 += Idr[271]; + RHS33 += Idr[272]; + RHS33 += Idr[273]; + RHS33 += Idr[274]; + RHS33 += Idr[275]; + RHS33 -= go[271] * *cnV[271]; + RHS33 -= go[272] * *cnV[272]; + RHS33 -= go[273] * *cnV[273]; + RHS33 -= go[274] * *cnV[274]; + RHS33 -= go[275] * *cnV[275]; + m_A176 += gt[276]; + m_A176 += gt[277]; + m_A176 += gt[278]; + m_A176 += gt[279]; + m_A176 += gt[280]; + m_A176 += gt[281]; + m_A176 += gt[282]; + m_A176 += gt[283]; + m_A176 += gt[284]; + m_A176 += gt[285]; + m_A176 += gt[286]; + m_A172 += go[276]; + m_A171 += go[277]; + m_A171 += go[278]; + m_A170 += go[279]; + m_A170 += go[280]; + m_A170 += go[281]; + m_A169 += go[282]; + m_A169 += go[283]; + double RHS34 = Idr[276]; + RHS34 += Idr[277]; + RHS34 += Idr[278]; + RHS34 += Idr[279]; + RHS34 += Idr[280]; + RHS34 += Idr[281]; + RHS34 += Idr[282]; + RHS34 += Idr[283]; + RHS34 += Idr[284]; + RHS34 += Idr[285]; + RHS34 += Idr[286]; + RHS34 -= go[284] * *cnV[284]; + RHS34 -= go[285] * *cnV[285]; + RHS34 -= go[286] * *cnV[286]; + m_A190 += gt[287]; + m_A190 += gt[288]; + m_A190 += gt[289]; + m_A190 += gt[290]; + m_A190 += gt[291]; + m_A190 += gt[292]; + m_A190 += gt[293]; + m_A190 += gt[294]; + m_A190 += gt[295]; + m_A182 += go[287]; + m_A182 += go[288]; + m_A181 += go[289]; + m_A186 += go[290]; + m_A180 += go[291]; + m_A180 += go[292]; + double RHS35 = Idr[287]; + RHS35 += Idr[288]; + RHS35 += Idr[289]; + RHS35 += Idr[290]; + RHS35 += Idr[291]; + RHS35 += Idr[292]; + RHS35 += Idr[293]; + RHS35 += Idr[294]; + RHS35 += Idr[295]; + RHS35 -= go[293] * *cnV[293]; + RHS35 -= go[294] * *cnV[294]; + RHS35 -= go[295] * *cnV[295]; + m_A203 += gt[296]; + m_A203 += gt[297]; + m_A203 += gt[298]; + m_A203 += gt[299]; + m_A203 += gt[300]; + m_A203 += gt[301]; + m_A203 += gt[302]; + m_A203 += gt[303]; + m_A203 += gt[304]; + m_A203 += gt[305]; + m_A203 += gt[306]; + m_A195 += go[296]; + m_A195 += go[297]; + m_A199 += go[298]; + m_A199 += go[299]; + m_A197 += go[300]; + m_A196 += go[301]; + m_A196 += go[302]; + m_A194 += go[303]; + m_A194 += go[304]; + m_A194 += go[305]; + double RHS36 = Idr[296]; + RHS36 += Idr[297]; + RHS36 += Idr[298]; + RHS36 += Idr[299]; + RHS36 += Idr[300]; + RHS36 += Idr[301]; + RHS36 += Idr[302]; + RHS36 += Idr[303]; + RHS36 += Idr[304]; + RHS36 += Idr[305]; + RHS36 += Idr[306]; + RHS36 -= go[306] * *cnV[306]; + m_A212 += gt[307]; + m_A212 += gt[308]; + m_A212 += gt[309]; + m_A212 += gt[310]; + m_A212 += gt[311]; + m_A212 += gt[312]; + m_A212 += gt[313]; + m_A212 += gt[314]; + m_A212 += gt[315]; + m_A212 += gt[316]; + m_A212 += gt[317]; + m_A212 += gt[318]; + m_A212 += gt[319]; + m_A213 += go[307]; + m_A213 += go[308]; + m_A207 += go[309]; + m_A207 += go[310]; + m_A207 += go[311]; + m_A207 += go[312]; + m_A208 += go[313]; + m_A208 += go[314]; + m_A208 += go[315]; + m_A206 += go[316]; + m_A209 += go[317]; + m_A209 += go[318]; + double RHS37 = Idr[307]; + RHS37 += Idr[308]; + RHS37 += Idr[309]; + RHS37 += Idr[310]; + RHS37 += Idr[311]; + RHS37 += Idr[312]; + RHS37 += Idr[313]; + RHS37 += Idr[314]; + RHS37 += Idr[315]; + RHS37 += Idr[316]; + RHS37 += Idr[317]; + RHS37 += Idr[318]; + RHS37 += Idr[319]; + RHS37 -= go[319] * *cnV[319]; + m_A226 += gt[320]; + m_A226 += gt[321]; + m_A226 += gt[322]; + m_A226 += gt[323]; + m_A226 += gt[324]; + m_A226 += gt[325]; + m_A226 += gt[326]; + m_A226 += gt[327]; + m_A226 += gt[328]; + m_A226 += gt[329]; + m_A226 += gt[330]; + m_A219 += go[320]; + m_A215 += go[321]; + m_A221 += go[322]; + m_A217 += go[323]; + m_A217 += go[324]; + m_A217 += go[325]; + m_A214 += go[326]; + m_A214 += go[327]; + m_A225 += go[328]; + m_A225 += go[329]; + double RHS38 = Idr[320]; + RHS38 += Idr[321]; + RHS38 += Idr[322]; + RHS38 += Idr[323]; + RHS38 += Idr[324]; + RHS38 += Idr[325]; + RHS38 += Idr[326]; + RHS38 += Idr[327]; + RHS38 += Idr[328]; + RHS38 += Idr[329]; + RHS38 += Idr[330]; + RHS38 -= go[330] * *cnV[330]; + const double f0 = 1.0 / m_A0; + const double f0_16 = -f0 * m_A48; + m_A49 += m_A1 * f0_16; + m_A50 += m_A2 * f0_16; + m_A51 += m_A3 * f0_16; + RHS16 += f0_16 * RHS0; + const double f0_26 = -f0 * m_A93; + m_A95 += m_A1 * f0_26; + m_A96 += m_A2 * f0_26; + m_A98 += m_A3 * f0_26; + RHS26 += f0_26 * RHS0; + const double f0_34 = -f0 * m_A169; + m_A170 += m_A1 * f0_34; + m_A171 += m_A2 * f0_34; + m_A176 += m_A3 * f0_34; + RHS34 += f0_34 * RHS0; + const double f1 = 1.0 / m_A4; + const double f1_29 = -f1 * m_A122; + m_A124 += m_A5 * f1_29; + RHS29 += f1_29 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_24 = -f2 * m_A78; + m_A79 += m_A7 * f2_24; + m_A80 += m_A8 * f2_24; + m_A81 += m_A9 * f2_24; + RHS24 += f2_24 * RHS2; + const double f2_31 = -f2 * m_A140; + m_A141 += m_A7 * f2_31; + m_A142 += m_A8 * f2_31; + m_A144 += m_A9 * f2_31; + RHS31 += f2_31 * RHS2; + const double f2_37 = -f2 * m_A206; + m_A208 += m_A7 * f2_37; + m_A209 += m_A8 * f2_37; + m_A212 += m_A9 * f2_37; + RHS37 += f2_37 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_35 = -f3 * m_A180; + m_A190 += m_A11 * f3_35; + RHS35 += f3_35 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_18 = -f4 * m_A55; + m_A59 += m_A13 * f4_18; + RHS18 += f4_18 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_21 = -f5 * m_A67; + m_A68 += m_A15 * f5_21; + m_A69 += m_A16 * f5_21; + m_A70 += m_A17 * f5_21; + RHS21 += f5_21 * RHS5; + const double f5_32 = -f5 * m_A145; + m_A147 += m_A15 * f5_32; + m_A152 += m_A16 * f5_32; + m_A156 += m_A17 * f5_32; + RHS32 += f5_32 * RHS5; + const double f5_36 = -f5 * m_A194; + m_A196 += m_A15 * f5_36; + m_A199 += m_A16 * f5_36; + m_A203 += m_A17 * f5_36; + RHS36 += f5_36 * RHS5; + const double f6 = 1.0 / m_A18; + const double f6_26 = -f6 * m_A94; + m_A96 += m_A19 * f6_26; + m_A97 += m_A20 * f6_26; + RHS26 += f6_26 * RHS6; + const double f6_32 = -f6 * m_A146; + m_A149 += m_A19 * f6_32; + m_A152 += m_A20 * f6_32; + RHS32 += f6_32 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_22 = -f7 * m_A71; + m_A74 += m_A22 * f7_22; + RHS22 += f7_22 * RHS7; + const double f8 = 1.0 / m_A23; + const double f8_18 = -f8 * m_A56; + m_A59 += m_A24 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_23 = -f9 * m_A75; + m_A76 += m_A26 * f9_23; + RHS23 += f9_23 * RHS9; + const double f10 = 1.0 / m_A27; + const double f10_18 = -f10 * m_A57; + m_A59 += m_A28 * f10_18; + RHS18 += f10_18 * RHS10; + const double f11 = 1.0 / m_A29; + const double f11_18 = -f11 * m_A58; + m_A59 += m_A30 * f11_18; + m_A60 += m_A31 * f11_18; + RHS18 += f11_18 * RHS11; + const double f11_28 = -f11 * m_A107; + m_A111 += m_A30 * f11_28; + m_A116 += m_A31 * f11_28; + RHS28 += f11_28 * RHS11; + const double f12 = 1.0 / m_A32; + const double f12_25 = -f12 * m_A82; + m_A83 += m_A33 * f12_25; + m_A86 += m_A34 * f12_25; + m_A88 += m_A35 * f12_25; + RHS25 += f12_25 * RHS12; + const double f12_28 = -f12 * m_A108; + m_A109 += m_A33 * f12_28; + m_A114 += m_A34 * f12_28; + m_A116 += m_A35 * f12_28; + RHS28 += f12_28 * RHS12; + const double f13 = 1.0 / m_A36; + const double f13_25 = -f13 * m_A83; + m_A85 += m_A37 * f13_25; + m_A88 += m_A38 * f13_25; + RHS25 += f13_25 * RHS13; + const double f13_28 = -f13 * m_A109; + m_A110 += m_A37 * f13_28; + m_A116 += m_A38 * f13_28; + RHS28 += f13_28 * RHS13; + const double f14 = 1.0 / m_A39; + const double f14_25 = -f14 * m_A84; + m_A86 += m_A40 * f14_25; + m_A87 += m_A41 * f14_25; + m_A90 += m_A42 * f14_25; + m_A91 += m_A43 * f14_25; + m_A92 += m_A44 * f14_25; + RHS25 += f14_25 * RHS14; + const double f14_27 = -f14 * m_A99; + m_A100 += m_A40 * f14_27; + m_A101 += m_A41 * f14_27; + m_A104 += m_A42 * f14_27; + m_A105 += m_A43 * f14_27; + m_A106 += m_A44 * f14_27; + RHS27 += f14_27 * RHS14; + const double f14_33 = -f14 * m_A158; + m_A159 += m_A40 * f14_33; + m_A160 += m_A41 * f14_33; + m_A164 += m_A42 * f14_33; + m_A166 += m_A43 * f14_33; + m_A168 += m_A44 * f14_33; + RHS33 += f14_33 * RHS14; + const double f14_35 = -f14 * m_A181; + m_A182 += m_A40 * f14_35; + m_A183 += m_A41 * f14_35; + m_A188 += m_A42 * f14_35; + m_A190 += m_A43 * f14_35; + m_A193 += m_A44 * f14_35; + RHS35 += f14_35 * RHS14; + const double f14_38 = -f14 * m_A214; + m_A216 += m_A40 * f14_38; + m_A217 += m_A41 * f14_38; + m_A221 += m_A42 * f14_38; + m_A223 += m_A43 * f14_38; + m_A226 += m_A44 * f14_38; + RHS38 += f14_38 * RHS14; + const double f15 = 1.0 / m_A45; + const double f15_25 = -f15 * m_A85; + m_A88 += m_A46 * f15_25; + m_A89 += m_A47 * f15_25; + RHS25 += f15_25 * RHS15; + const double f15_28 = -f15 * m_A110; + m_A116 += m_A46 * f15_28; + m_A117 += m_A47 * f15_28; + RHS28 += f15_28 * RHS15; + const double f15_30 = -f15 * m_A128; + m_A131 += m_A46 * f15_30; + m_A133 += m_A47 * f15_30; + RHS30 += f15_30 * RHS15; + const double f16 = 1.0 / m_A49; + const double f16_26 = -f16 * m_A95; + m_A96 += m_A50 * f16_26; + m_A98 += m_A51 * f16_26; + RHS26 += f16_26 * RHS16; + const double f16_34 = -f16 * m_A170; + m_A171 += m_A50 * f16_34; + m_A176 += m_A51 * f16_34; + RHS34 += f16_34 * RHS16; + const double f17 = 1.0 / m_A52; + const double f17_37 = -f17 * m_A207; + m_A212 += m_A53 * f17_37; + m_A213 += m_A54 * f17_37; + RHS37 += f17_37 * RHS17; + const double f17_38 = -f17 * m_A215; + m_A225 += m_A53 * f17_38; + m_A226 += m_A54 * f17_38; + RHS38 += f17_38 * RHS17; + const double f18 = 1.0 / m_A59; + const double f18_28 = -f18 * m_A111; + m_A116 += m_A60 * f18_28; + RHS28 += f18_28 * RHS18; + const double f19 = 1.0 / m_A61; + const double f19_29 = -f19 * m_A123; + m_A124 += m_A62 * f19_29; + m_A125 += m_A63 * f19_29; + m_A127 += m_A64 * f19_29; + RHS29 += f19_29 * RHS19; + const double f19_30 = -f19 * m_A129; + m_A132 += m_A62 * f19_30; + m_A133 += m_A63 * f19_30; + m_A138 += m_A64 * f19_30; + RHS30 += f19_30 * RHS19; + const double f19_36 = -f19 * m_A195; + m_A197 += m_A62 * f19_36; + m_A198 += m_A63 * f19_36; + m_A203 += m_A64 * f19_36; + RHS36 += f19_36 * RHS19; + const double f20 = 1.0 / m_A65; + const double f20_30 = -f20 * m_A130; + m_A139 += m_A66 * f20_30; + RHS30 += f20_30 * RHS20; + const double f21 = 1.0 / m_A68; + const double f21_32 = -f21 * m_A147; + m_A152 += m_A69 * f21_32; + m_A156 += m_A70 * f21_32; + RHS32 += f21_32 * RHS21; + const double f21_36 = -f21 * m_A196; + m_A199 += m_A69 * f21_36; + m_A203 += m_A70 * f21_36; + RHS36 += f21_36 * RHS21; + const double f22 = 1.0 / m_A72; + const double f22_28 = -f22 * m_A112; + m_A116 += m_A73 * f22_28; + m_A118 += m_A74 * f22_28; + RHS28 += f22_28 * RHS22; + const double f22_32 = -f22 * m_A148; + m_A150 += m_A73 * f22_32; + m_A152 += m_A74 * f22_32; + RHS32 += f22_32 * RHS22; + const double f23 = 1.0 / m_A76; + const double f23_28 = -f23 * m_A113; + m_A116 += m_A77 * f23_28; + RHS28 += f23_28 * RHS23; + const double f24 = 1.0 / m_A79; + const double f24_31 = -f24 * m_A141; + m_A142 += m_A80 * f24_31; + m_A144 += m_A81 * f24_31; + RHS31 += f24_31 * RHS24; + const double f24_37 = -f24 * m_A208; + m_A209 += m_A80 * f24_37; + m_A212 += m_A81 * f24_37; + RHS37 += f24_37 * RHS24; + const double f25 = 1.0 / m_A86; + const double f25_27 = -f25 * m_A100; + m_A101 += m_A87 * f25_27; + m_A102 += m_A88 * f25_27; + m_A103 += m_A89 * f25_27; + m_A104 += m_A90 * f25_27; + m_A105 += m_A91 * f25_27; + m_A106 += m_A92 * f25_27; + RHS27 += f25_27 * RHS25; + const double f25_28 = -f25 * m_A114; + m_A115 += m_A87 * f25_28; + m_A116 += m_A88 * f25_28; + m_A117 += m_A89 * f25_28; + m_A119 += m_A90 * f25_28; + m_A120 += m_A91 * f25_28; + m_A121 += m_A92 * f25_28; + RHS28 += f25_28 * RHS25; + const double f25_33 = -f25 * m_A159; + m_A160 += m_A87 * f25_33; + m_A161 += m_A88 * f25_33; + m_A162 += m_A89 * f25_33; + m_A164 += m_A90 * f25_33; + m_A166 += m_A91 * f25_33; + m_A168 += m_A92 * f25_33; + RHS33 += f25_33 * RHS25; + const double f25_35 = -f25 * m_A182; + m_A183 += m_A87 * f25_35; + m_A184 += m_A88 * f25_35; + m_A185 += m_A89 * f25_35; + m_A188 += m_A90 * f25_35; + m_A190 += m_A91 * f25_35; + m_A193 += m_A92 * f25_35; + RHS35 += f25_35 * RHS25; + const double f25_38 = -f25 * m_A216; + m_A217 += m_A87 * f25_38; + m_A218 += m_A88 * f25_38; + m_A219 += m_A89 * f25_38; + m_A221 += m_A90 * f25_38; + m_A223 += m_A91 * f25_38; + m_A226 += m_A92 * f25_38; + RHS38 += f25_38 * RHS25; + const double f26 = 1.0 / m_A96; + const double f26_32 = -f26 * m_A149; + m_A152 += m_A97 * f26_32; + m_A154 += m_A98 * f26_32; + RHS32 += f26_32 * RHS26; + const double f26_34 = -f26 * m_A171; + m_A174 += m_A97 * f26_34; + m_A176 += m_A98 * f26_34; + RHS34 += f26_34 * RHS26; + const double f27 = 1.0 / m_A101; + const double f27_28 = -f27 * m_A115; + m_A116 += m_A102 * f27_28; + m_A117 += m_A103 * f27_28; + m_A119 += m_A104 * f27_28; + m_A120 += m_A105 * f27_28; + m_A121 += m_A106 * f27_28; + RHS28 += f27_28 * RHS27; + const double f27_33 = -f27 * m_A160; + m_A161 += m_A102 * f27_33; + m_A162 += m_A103 * f27_33; + m_A164 += m_A104 * f27_33; + m_A166 += m_A105 * f27_33; + m_A168 += m_A106 * f27_33; + RHS33 += f27_33 * RHS27; + const double f27_35 = -f27 * m_A183; + m_A184 += m_A102 * f27_35; + m_A185 += m_A103 * f27_35; + m_A188 += m_A104 * f27_35; + m_A190 += m_A105 * f27_35; + m_A193 += m_A106 * f27_35; + RHS35 += f27_35 * RHS27; + const double f27_38 = -f27 * m_A217; + m_A218 += m_A102 * f27_38; + m_A219 += m_A103 * f27_38; + m_A221 += m_A104 * f27_38; + m_A223 += m_A105 * f27_38; + m_A226 += m_A106 * f27_38; + RHS38 += f27_38 * RHS27; + const double f28 = 1.0 / m_A116; + const double f28_30 = -f28 * m_A131; + m_A133 += m_A117 * f28_30; + m_A134 += m_A118 * f28_30; + m_A135 += m_A119 * f28_30; + m_A137 += m_A120 * f28_30; + m_A139 += m_A121 * f28_30; + RHS30 += f28_30 * RHS28; + const double f28_32 = -f28 * m_A150; + m_A151 += m_A117 * f28_32; + m_A152 += m_A118 * f28_32; + m_A153 += m_A119 * f28_32; + m_A155 += m_A120 * f28_32; + m_A157 += m_A121 * f28_32; + RHS32 += f28_32 * RHS28; + const double f28_33 = -f28 * m_A161; + m_A162 += m_A117 * f28_33; + m_A163 += m_A118 * f28_33; + m_A164 += m_A119 * f28_33; + m_A166 += m_A120 * f28_33; + m_A168 += m_A121 * f28_33; + RHS33 += f28_33 * RHS28; + const double f28_35 = -f28 * m_A184; + m_A185 += m_A117 * f28_35; + m_A187 += m_A118 * f28_35; + m_A188 += m_A119 * f28_35; + m_A190 += m_A120 * f28_35; + m_A193 += m_A121 * f28_35; + RHS35 += f28_35 * RHS28; + const double f28_38 = -f28 * m_A218; + m_A219 += m_A117 * f28_38; + m_A220 += m_A118 * f28_38; + m_A221 += m_A119 * f28_38; + m_A223 += m_A120 * f28_38; + m_A226 += m_A121 * f28_38; + RHS38 += f28_38 * RHS28; + const double f29 = 1.0 / m_A124; + const double f29_30 = -f29 * m_A132; + m_A133 += m_A125 * f29_30; + m_A136 += m_A126 * f29_30; + m_A138 += m_A127 * f29_30; + RHS30 += f29_30 * RHS29; + const double f29_34 = -f29 * m_A172; + m_A173 += m_A125 * f29_34; + m_A176 += m_A126 * f29_34; + m_A178 += m_A127 * f29_34; + RHS34 += f29_34 * RHS29; + const double f29_36 = -f29 * m_A197; + m_A198 += m_A125 * f29_36; + m_A201 += m_A126 * f29_36; + m_A203 += m_A127 * f29_36; + RHS36 += f29_36 * RHS29; + const double f30 = 1.0 / m_A133; + const double f30_32 = -f30 * m_A151; + m_A152 += m_A134 * f30_32; + m_A153 += m_A135 * f30_32; + m_A154 += m_A136 * f30_32; + m_A155 += m_A137 * f30_32; + m_A156 += m_A138 * f30_32; + m_A157 += m_A139 * f30_32; + RHS32 += f30_32 * RHS30; + const double f30_33 = -f30 * m_A162; + m_A163 += m_A134 * f30_33; + m_A164 += m_A135 * f30_33; + m_A165 += m_A136 * f30_33; + m_A166 += m_A137 * f30_33; + m_A167 += m_A138 * f30_33; + m_A168 += m_A139 * f30_33; + RHS33 += f30_33 * RHS30; + const double f30_34 = -f30 * m_A173; + m_A174 += m_A134 * f30_34; + m_A175 += m_A135 * f30_34; + m_A176 += m_A136 * f30_34; + m_A177 += m_A137 * f30_34; + m_A178 += m_A138 * f30_34; + m_A179 += m_A139 * f30_34; + RHS34 += f30_34 * RHS30; + const double f30_35 = -f30 * m_A185; + m_A187 += m_A134 * f30_35; + m_A188 += m_A135 * f30_35; + m_A189 += m_A136 * f30_35; + m_A190 += m_A137 * f30_35; + m_A191 += m_A138 * f30_35; + m_A193 += m_A139 * f30_35; + RHS35 += f30_35 * RHS30; + const double f30_36 = -f30 * m_A198; + m_A199 += m_A134 * f30_36; + m_A200 += m_A135 * f30_36; + m_A201 += m_A136 * f30_36; + m_A202 += m_A137 * f30_36; + m_A203 += m_A138 * f30_36; + m_A205 += m_A139 * f30_36; + RHS36 += f30_36 * RHS30; + const double f30_38 = -f30 * m_A219; + m_A220 += m_A134 * f30_38; + m_A221 += m_A135 * f30_38; + m_A222 += m_A136 * f30_38; + m_A223 += m_A137 * f30_38; + m_A224 += m_A138 * f30_38; + m_A226 += m_A139 * f30_38; + RHS38 += f30_38 * RHS30; + const double f31 = 1.0 / m_A142; + const double f31_35 = -f31 * m_A186; + m_A190 += m_A143 * f31_35; + m_A192 += m_A144 * f31_35; + RHS35 += f31_35 * RHS31; + const double f31_37 = -f31 * m_A209; + m_A210 += m_A143 * f31_37; + m_A212 += m_A144 * f31_37; + RHS37 += f31_37 * RHS31; + const double f32 = 1.0 / m_A152; + const double f32_33 = -f32 * m_A163; + m_A164 += m_A153 * f32_33; + m_A165 += m_A154 * f32_33; + m_A166 += m_A155 * f32_33; + m_A167 += m_A156 * f32_33; + m_A168 += m_A157 * f32_33; + RHS33 += f32_33 * RHS32; + const double f32_34 = -f32 * m_A174; + m_A175 += m_A153 * f32_34; + m_A176 += m_A154 * f32_34; + m_A177 += m_A155 * f32_34; + m_A178 += m_A156 * f32_34; + m_A179 += m_A157 * f32_34; + RHS34 += f32_34 * RHS32; + const double f32_35 = -f32 * m_A187; + m_A188 += m_A153 * f32_35; + m_A189 += m_A154 * f32_35; + m_A190 += m_A155 * f32_35; + m_A191 += m_A156 * f32_35; + m_A193 += m_A157 * f32_35; + RHS35 += f32_35 * RHS32; + const double f32_36 = -f32 * m_A199; + m_A200 += m_A153 * f32_36; + m_A201 += m_A154 * f32_36; + m_A202 += m_A155 * f32_36; + m_A203 += m_A156 * f32_36; + m_A205 += m_A157 * f32_36; + RHS36 += f32_36 * RHS32; + const double f32_38 = -f32 * m_A220; + m_A221 += m_A153 * f32_38; + m_A222 += m_A154 * f32_38; + m_A223 += m_A155 * f32_38; + m_A224 += m_A156 * f32_38; + m_A226 += m_A157 * f32_38; + RHS38 += f32_38 * RHS32; + const double f33 = 1.0 / m_A164; + const double f33_34 = -f33 * m_A175; + m_A176 += m_A165 * f33_34; + m_A177 += m_A166 * f33_34; + m_A178 += m_A167 * f33_34; + m_A179 += m_A168 * f33_34; + RHS34 += f33_34 * RHS33; + const double f33_35 = -f33 * m_A188; + m_A189 += m_A165 * f33_35; + m_A190 += m_A166 * f33_35; + m_A191 += m_A167 * f33_35; + m_A193 += m_A168 * f33_35; + RHS35 += f33_35 * RHS33; + const double f33_36 = -f33 * m_A200; + m_A201 += m_A165 * f33_36; + m_A202 += m_A166 * f33_36; + m_A203 += m_A167 * f33_36; + m_A205 += m_A168 * f33_36; + RHS36 += f33_36 * RHS33; + const double f33_38 = -f33 * m_A221; + m_A222 += m_A165 * f33_38; + m_A223 += m_A166 * f33_38; + m_A224 += m_A167 * f33_38; + m_A226 += m_A168 * f33_38; + RHS38 += f33_38 * RHS33; + const double f34 = 1.0 / m_A176; + const double f34_35 = -f34 * m_A189; + m_A190 += m_A177 * f34_35; + m_A191 += m_A178 * f34_35; + m_A193 += m_A179 * f34_35; + RHS35 += f34_35 * RHS34; + const double f34_36 = -f34 * m_A201; + m_A202 += m_A177 * f34_36; + m_A203 += m_A178 * f34_36; + m_A205 += m_A179 * f34_36; + RHS36 += f34_36 * RHS34; + const double f34_38 = -f34 * m_A222; + m_A223 += m_A177 * f34_38; + m_A224 += m_A178 * f34_38; + m_A226 += m_A179 * f34_38; + RHS38 += f34_38 * RHS34; + const double f35 = 1.0 / m_A190; + const double f35_36 = -f35 * m_A202; + m_A203 += m_A191 * f35_36; + m_A204 += m_A192 * f35_36; + m_A205 += m_A193 * f35_36; + RHS36 += f35_36 * RHS35; + const double f35_37 = -f35 * m_A210; + m_A211 += m_A191 * f35_37; + m_A212 += m_A192 * f35_37; + m_A213 += m_A193 * f35_37; + RHS37 += f35_37 * RHS35; + const double f35_38 = -f35 * m_A223; + m_A224 += m_A191 * f35_38; + m_A225 += m_A192 * f35_38; + m_A226 += m_A193 * f35_38; + RHS38 += f35_38 * RHS35; + const double f36 = 1.0 / m_A203; + const double f36_37 = -f36 * m_A211; + m_A212 += m_A204 * f36_37; + m_A213 += m_A205 * f36_37; + RHS37 += f36_37 * RHS36; + const double f36_38 = -f36 * m_A224; + m_A225 += m_A204 * f36_38; + m_A226 += m_A205 * f36_38; + RHS38 += f36_38 * RHS36; + const double f37 = 1.0 / m_A212; + const double f37_38 = -f37 * m_A225; + m_A226 += m_A213 * f37_38; + RHS38 += f37_38 * RHS37; + V[38] = RHS38 / m_A226; + double tmp37 = 0.0; + tmp37 += m_A213 * V[38]; + V[37] = (RHS37 - tmp37) / m_A212; + double tmp36 = 0.0; + tmp36 += m_A204 * V[37]; + tmp36 += m_A205 * V[38]; + V[36] = (RHS36 - tmp36) / m_A203; + double tmp35 = 0.0; + tmp35 += m_A191 * V[36]; + tmp35 += m_A192 * V[37]; + tmp35 += m_A193 * V[38]; + V[35] = (RHS35 - tmp35) / m_A190; + double tmp34 = 0.0; + tmp34 += m_A177 * V[35]; + tmp34 += m_A178 * V[36]; + tmp34 += m_A179 * V[38]; + V[34] = (RHS34 - tmp34) / m_A176; + double tmp33 = 0.0; + tmp33 += m_A165 * V[34]; + tmp33 += m_A166 * V[35]; + tmp33 += m_A167 * V[36]; + tmp33 += m_A168 * V[38]; + V[33] = (RHS33 - tmp33) / m_A164; + double tmp32 = 0.0; + tmp32 += m_A153 * V[33]; + tmp32 += m_A154 * V[34]; + tmp32 += m_A155 * V[35]; + tmp32 += m_A156 * V[36]; + tmp32 += m_A157 * V[38]; + V[32] = (RHS32 - tmp32) / m_A152; + double tmp31 = 0.0; + tmp31 += m_A143 * V[35]; + tmp31 += m_A144 * V[37]; + V[31] = (RHS31 - tmp31) / m_A142; + double tmp30 = 0.0; + tmp30 += m_A134 * V[32]; + tmp30 += m_A135 * V[33]; + tmp30 += m_A136 * V[34]; + tmp30 += m_A137 * V[35]; + tmp30 += m_A138 * V[36]; + tmp30 += m_A139 * V[38]; + V[30] = (RHS30 - tmp30) / m_A133; + double tmp29 = 0.0; + tmp29 += m_A125 * V[30]; + tmp29 += m_A126 * V[34]; + tmp29 += m_A127 * V[36]; + V[29] = (RHS29 - tmp29) / m_A124; + double tmp28 = 0.0; + tmp28 += m_A117 * V[30]; + tmp28 += m_A118 * V[32]; + tmp28 += m_A119 * V[33]; + tmp28 += m_A120 * V[35]; + tmp28 += m_A121 * V[38]; + V[28] = (RHS28 - tmp28) / m_A116; + double tmp27 = 0.0; + tmp27 += m_A102 * V[28]; + tmp27 += m_A103 * V[30]; + tmp27 += m_A104 * V[33]; + tmp27 += m_A105 * V[35]; + tmp27 += m_A106 * V[38]; + V[27] = (RHS27 - tmp27) / m_A101; + double tmp26 = 0.0; + tmp26 += m_A97 * V[32]; + tmp26 += m_A98 * V[34]; + V[26] = (RHS26 - tmp26) / m_A96; + double tmp25 = 0.0; + tmp25 += m_A87 * V[27]; + tmp25 += m_A88 * V[28]; + tmp25 += m_A89 * V[30]; + tmp25 += m_A90 * V[33]; + tmp25 += m_A91 * V[35]; + tmp25 += m_A92 * V[38]; + V[25] = (RHS25 - tmp25) / m_A86; + double tmp24 = 0.0; + tmp24 += m_A80 * V[31]; + tmp24 += m_A81 * V[37]; + V[24] = (RHS24 - tmp24) / m_A79; + double tmp23 = 0.0; + tmp23 += m_A77 * V[28]; + V[23] = (RHS23 - tmp23) / m_A76; + double tmp22 = 0.0; + tmp22 += m_A73 * V[28]; + tmp22 += m_A74 * V[32]; + V[22] = (RHS22 - tmp22) / m_A72; + double tmp21 = 0.0; + tmp21 += m_A69 * V[32]; + tmp21 += m_A70 * V[36]; + V[21] = (RHS21 - tmp21) / m_A68; + double tmp20 = 0.0; + tmp20 += m_A66 * V[38]; + V[20] = (RHS20 - tmp20) / m_A65; + double tmp19 = 0.0; + tmp19 += m_A62 * V[29]; + tmp19 += m_A63 * V[30]; + tmp19 += m_A64 * V[36]; + V[19] = (RHS19 - tmp19) / m_A61; + double tmp18 = 0.0; + tmp18 += m_A60 * V[28]; + V[18] = (RHS18 - tmp18) / m_A59; + double tmp17 = 0.0; + tmp17 += m_A53 * V[37]; + tmp17 += m_A54 * V[38]; + V[17] = (RHS17 - tmp17) / m_A52; + double tmp16 = 0.0; + tmp16 += m_A50 * V[26]; + tmp16 += m_A51 * V[34]; + V[16] = (RHS16 - tmp16) / m_A49; + double tmp15 = 0.0; + tmp15 += m_A46 * V[28]; + tmp15 += m_A47 * V[30]; + V[15] = (RHS15 - tmp15) / m_A45; + double tmp14 = 0.0; + tmp14 += m_A40 * V[25]; + tmp14 += m_A41 * V[27]; + tmp14 += m_A42 * V[33]; + tmp14 += m_A43 * V[35]; + tmp14 += m_A44 * V[38]; + V[14] = (RHS14 - tmp14) / m_A39; + double tmp13 = 0.0; + tmp13 += m_A37 * V[15]; + tmp13 += m_A38 * V[28]; + V[13] = (RHS13 - tmp13) / m_A36; + double tmp12 = 0.0; + tmp12 += m_A33 * V[13]; + tmp12 += m_A34 * V[25]; + tmp12 += m_A35 * V[28]; + V[12] = (RHS12 - tmp12) / m_A32; + double tmp11 = 0.0; + tmp11 += m_A30 * V[18]; + tmp11 += m_A31 * V[28]; + V[11] = (RHS11 - tmp11) / m_A29; + double tmp10 = 0.0; + tmp10 += m_A28 * V[18]; + V[10] = (RHS10 - tmp10) / m_A27; + double tmp9 = 0.0; + tmp9 += m_A26 * V[23]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A24 * V[18]; + V[8] = (RHS8 - tmp8) / m_A23; + double tmp7 = 0.0; + tmp7 += m_A22 * V[32]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A19 * V[26]; + tmp6 += m_A20 * V[32]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A15 * V[21]; + tmp5 += m_A16 * V[32]; + tmp5 += m_A17 * V[36]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A13 * V[18]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A11 * V[35]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A7 * V[24]; + tmp2 += m_A8 * V[31]; + tmp2 += m_A9 * V[37]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A5 * V[29]; + V[1] = (RHS1 - tmp1) / m_A4; + double tmp0 = 0.0; + tmp0 += m_A1 * V[16]; + tmp0 += m_A2 * V[26]; + tmp0 += m_A3 * V[34]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_43_double_double_6eae7b15cd376318(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + m_A2 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A3 += gt[7]; + m_A3 += gt[8]; + m_A3 += gt[9]; + m_A3 += gt[10]; + m_A3 += gt[11]; + m_A4 += go[5]; + m_A5 += go[6]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A8 += go[12]; + m_A7 += go[13]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 -= go[14] * *cnV[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A9 += gt[17]; + m_A11 += go[15]; + m_A10 += go[16]; + double RHS3 = Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[17] * *cnV[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A14 += go[18]; + m_A12 += go[19]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A18 += gt[27]; + m_A15 += go[23]; + m_A16 += go[24]; + m_A20 += go[25]; + double RHS5 = Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 -= go[26] * *cnV[26]; + RHS5 -= go[27] * *cnV[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A24 += gt[30]; + m_A26 += go[28]; + m_A22 += go[29]; + m_A21 += go[30]; + double RHS6 = Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + m_A29 += gt[31]; + m_A29 += gt[32]; + m_A29 += gt[33]; + m_A29 += gt[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A31 += go[31]; + m_A27 += go[32]; + double RHS7 = Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 -= go[33] * *cnV[33]; + RHS7 -= go[34] * *cnV[34]; + RHS7 -= go[35] * *cnV[35]; + RHS7 -= go[36] * *cnV[36]; + RHS7 -= go[37] * *cnV[37]; + m_A36 += gt[38]; + m_A36 += gt[39]; + m_A36 += gt[40]; + m_A34 += go[38]; + m_A33 += go[39]; + m_A32 += go[40]; + double RHS8 = Idr[38]; + RHS8 += Idr[39]; + RHS8 += Idr[40]; + m_A42 += gt[41]; + m_A42 += gt[42]; + m_A42 += gt[43]; + m_A42 += gt[44]; + m_A42 += gt[45]; + m_A42 += gt[46]; + m_A40 += go[41]; + m_A38 += go[42]; + m_A39 += go[43]; + double RHS9 = Idr[41]; + RHS9 += Idr[42]; + RHS9 += Idr[43]; + RHS9 += Idr[44]; + RHS9 += Idr[45]; + RHS9 += Idr[46]; + RHS9 -= go[44] * *cnV[44]; + RHS9 -= go[45] * *cnV[45]; + RHS9 -= go[46] * *cnV[46]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A12; + m_A13 += m_A1 * f0_4; + m_A14 += m_A2 * f0_4; + RHS4 += f0_4 * RHS0; + const double f0_8 = -f0 * m_A32; + m_A33 += m_A1 * f0_8; + m_A36 += m_A2 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_5 = -f1 * m_A15; + m_A17 += m_A4 * f1_5; + m_A20 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_5 = -f2 * m_A16; + m_A18 += m_A7 * f2_5; + m_A19 += m_A8 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_6 = -f2 * m_A21; + m_A23 += m_A7 * f2_6; + m_A24 += m_A8 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_6 = -f3 * m_A22; + m_A24 += m_A10 * f3_6; + m_A26 += m_A11 * f3_6; + RHS6 += f3_6 * RHS3; + const double f3_7 = -f3 * m_A27; + m_A28 += m_A10 * f3_7; + m_A31 += m_A11 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_9 = -f3 * m_A38; + m_A39 += m_A10 * f3_9; + m_A42 += m_A11 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_5 = -f4 * m_A17; + m_A20 += m_A14 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_8 = -f4 * m_A33; + m_A36 += m_A14 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A18; + const double f5_6 = -f5 * m_A23; + m_A24 += m_A19 * f5_6; + m_A25 += m_A20 * f5_6; + RHS6 += f5_6 * RHS5; + const double f5_8 = -f5 * m_A34; + m_A35 += m_A19 * f5_8; + m_A36 += m_A20 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A24; + const double f6_7 = -f6 * m_A28; + m_A30 += m_A25 * f6_7; + m_A31 += m_A26 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A35; + m_A36 += m_A25 * f6_8; + m_A37 += m_A26 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A39; + m_A41 += m_A25 * f6_9; + m_A42 += m_A26 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A29; + const double f7_9 = -f7 * m_A40; + m_A41 += m_A30 * f7_9; + m_A42 += m_A31 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A36; + const double f8_9 = -f8 * m_A41; + m_A42 += m_A37 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A42; + double tmp8 = 0.0; + tmp8 += m_A37 * V[9]; + V[8] = (RHS8 - tmp8) / m_A36; + double tmp7 = 0.0; + tmp7 += m_A30 * V[8]; + tmp7 += m_A31 * V[9]; + V[7] = (RHS7 - tmp7) / m_A29; + double tmp6 = 0.0; + tmp6 += m_A25 * V[8]; + tmp6 += m_A26 * V[9]; + V[6] = (RHS6 - tmp6) / m_A24; + double tmp5 = 0.0; + tmp5 += m_A19 * V[6]; + tmp5 += m_A20 * V[8]; + V[5] = (RHS5 - tmp5) / m_A18; + double tmp4 = 0.0; + tmp4 += m_A14 * V[8]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A10 * V[6]; + tmp3 += m_A11 * V[9]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[5]; + tmp2 += m_A8 * V[6]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[4]; + tmp1 += m_A5 * V[8]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + tmp0 += m_A2 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_45_double_double_f365c3863b050e35(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A3 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A6 += go[12]; + m_A6 += go[13]; + m_A5 += go[14]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 -= go[15] * *cnV[15]; + m_A7 += gt[16]; + m_A7 += gt[17]; + m_A8 += go[16]; + double RHS3 = Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[17] * *cnV[17]; + m_A9 += gt[18]; + m_A9 += gt[19]; + m_A10 += go[18]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[19] * *cnV[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A12 += go[20]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[21] * *cnV[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A14 += go[22]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 -= go[23] * *cnV[23]; + m_A15 += gt[24]; + m_A15 += gt[25]; + m_A16 += go[24]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 -= go[25] * *cnV[25]; + m_A17 += gt[26]; + m_A17 += gt[27]; + m_A18 += go[26]; + double RHS8 = Idr[26]; + RHS8 += Idr[27]; + RHS8 -= go[27] * *cnV[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A20 += go[28]; + double RHS9 = Idr[28]; + RHS9 += Idr[29]; + RHS9 -= go[29] * *cnV[29]; + m_A21 += gt[30]; + m_A21 += gt[31]; + m_A22 += go[30]; + double RHS10 = Idr[30]; + RHS10 += Idr[31]; + RHS10 -= go[31] * *cnV[31]; + m_A23 += gt[32]; + m_A23 += gt[33]; + m_A24 += go[32]; + double RHS11 = Idr[32]; + RHS11 += Idr[33]; + RHS11 -= go[33] * *cnV[33]; + m_A27 += gt[34]; + m_A27 += gt[35]; + m_A26 += go[34]; + m_A25 += go[35]; + double RHS12 = Idr[34]; + RHS12 += Idr[35]; + m_A32 += gt[36]; + m_A32 += gt[37]; + m_A32 += gt[38]; + m_A32 += gt[39]; + m_A32 += gt[40]; + m_A32 += gt[41]; + m_A29 += go[36]; + m_A33 += go[37]; + m_A30 += go[38]; + m_A30 += go[39]; + double RHS13 = Idr[36]; + RHS13 += Idr[37]; + RHS13 += Idr[38]; + RHS13 += Idr[39]; + RHS13 += Idr[40]; + RHS13 += Idr[41]; + RHS13 -= go[40] * *cnV[40]; + RHS13 -= go[41] * *cnV[41]; + m_A44 += gt[42]; + m_A44 += gt[43]; + m_A44 += gt[44]; + m_A44 += gt[45]; + m_A44 += gt[46]; + m_A44 += gt[47]; + m_A44 += gt[48]; + m_A44 += gt[49]; + m_A44 += gt[50]; + m_A44 += gt[51]; + m_A42 += go[42]; + m_A41 += go[43]; + m_A40 += go[44]; + m_A39 += go[45]; + m_A38 += go[46]; + m_A37 += go[47]; + m_A36 += go[48]; + m_A35 += go[49]; + m_A34 += go[50]; + m_A43 += go[51]; + double RHS14 = Idr[42]; + RHS14 += Idr[43]; + RHS14 += Idr[44]; + RHS14 += Idr[45]; + RHS14 += Idr[46]; + RHS14 += Idr[47]; + RHS14 += Idr[48]; + RHS14 += Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + const double f0 = 1.0 / m_A0; + const double f0_12 = -f0 * m_A25; + m_A27 += m_A1 * f0_12; + RHS12 += f0_12 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_13 = -f1 * m_A29; + m_A30 += m_A3 * f1_13; + RHS13 += f1_13 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_12 = -f2 * m_A26; + m_A27 += m_A5 * f2_12; + m_A28 += m_A6 * f2_12; + RHS12 += f2_12 * RHS2; + const double f2_13 = -f2 * m_A30; + m_A31 += m_A5 * f2_13; + m_A32 += m_A6 * f2_13; + RHS13 += f2_13 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_14 = -f3 * m_A34; + m_A44 += m_A8 * f3_14; + RHS14 += f3_14 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_14 = -f4 * m_A35; + m_A44 += m_A10 * f4_14; + RHS14 += f4_14 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_14 = -f5 * m_A36; + m_A44 += m_A12 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_14 = -f6 * m_A37; + m_A44 += m_A14 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_14 = -f7 * m_A38; + m_A44 += m_A16 * f7_14; + RHS14 += f7_14 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_14 = -f8 * m_A39; + m_A44 += m_A18 * f8_14; + RHS14 += f8_14 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_14 = -f9 * m_A40; + m_A44 += m_A20 * f9_14; + RHS14 += f9_14 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_14 = -f10 * m_A41; + m_A44 += m_A22 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_14 = -f11 * m_A42; + m_A44 += m_A24 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A27; + const double f12_13 = -f12 * m_A31; + m_A32 += m_A28 * f12_13; + RHS13 += f12_13 * RHS12; + const double f13 = 1.0 / m_A32; + const double f13_14 = -f13 * m_A43; + m_A44 += m_A33 * f13_14; + RHS14 += f13_14 * RHS13; + V[14] = RHS14 / m_A44; + double tmp13 = 0.0; + tmp13 += m_A33 * V[14]; + V[13] = (RHS13 - tmp13) / m_A32; + double tmp12 = 0.0; + tmp12 += m_A28 * V[13]; + V[12] = (RHS12 - tmp12) / m_A27; + double tmp11 = 0.0; + tmp11 += m_A24 * V[14]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A22 * V[14]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + tmp9 += m_A20 * V[14]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[14]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[14]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[14]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A12 * V[14]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[14]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[14]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[12]; + tmp2 += m_A6 * V[13]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[12]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_46_double_double_d4c34516ff6aa139(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A11 += go[16]; + m_A10 += go[17]; + m_A9 += go[18]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[19] * *cnV[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A12 += gt[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A12 += gt[26]; + m_A13 += go[20]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + m_A14 += gt[27]; + m_A14 += gt[28]; + m_A14 += gt[29]; + m_A14 += gt[30]; + m_A17 += go[27]; + m_A15 += go[28]; + m_A16 += go[29]; + double RHS6 = Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 -= go[30] * *cnV[30]; + m_A22 += gt[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A21 += go[31]; + m_A20 += go[32]; + m_A19 += go[33]; + m_A18 += go[34]; + double RHS7 = Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 -= go[35] * *cnV[35]; + RHS7 -= go[36] * *cnV[36]; + m_A27 += gt[37]; + m_A27 += gt[38]; + m_A27 += gt[39]; + m_A28 += go[37]; + m_A25 += go[38]; + double RHS8 = Idr[37]; + RHS8 += Idr[38]; + RHS8 += Idr[39]; + RHS8 -= go[39] * *cnV[39]; + m_A30 += gt[40]; + m_A30 += gt[41]; + m_A30 += gt[42]; + m_A32 += go[40]; + m_A29 += go[41]; + double RHS9 = Idr[40]; + RHS9 += Idr[41]; + RHS9 += Idr[42]; + RHS9 -= go[42] * *cnV[42]; + m_A39 += gt[43]; + m_A39 += gt[44]; + m_A39 += gt[45]; + m_A39 += gt[46]; + m_A39 += gt[47]; + m_A39 += gt[48]; + m_A33 += go[43]; + m_A35 += go[44]; + m_A37 += go[45]; + m_A34 += go[46]; + double RHS10 = Idr[43]; + RHS10 += Idr[44]; + RHS10 += Idr[45]; + RHS10 += Idr[46]; + RHS10 += Idr[47]; + RHS10 += Idr[48]; + RHS10 -= go[47] * *cnV[47]; + RHS10 -= go[48] * *cnV[48]; + m_A45 += gt[49]; + m_A45 += gt[50]; + m_A45 += gt[51]; + m_A45 += gt[52]; + m_A45 += gt[53]; + m_A45 += gt[54]; + m_A41 += go[49]; + m_A43 += go[50]; + m_A42 += go[51]; + double RHS11 = Idr[49]; + RHS11 += Idr[50]; + RHS11 += Idr[51]; + RHS11 += Idr[52]; + RHS11 += Idr[53]; + RHS11 += Idr[54]; + RHS11 -= go[52] * *cnV[52]; + RHS11 -= go[53] * *cnV[53]; + RHS11 -= go[54] * *cnV[54]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A18; + m_A22 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A19; + m_A22 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A20; + m_A22 += m_A5 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_10 = -f3 * m_A33; + m_A37 += m_A7 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_7 = -f4 * m_A21; + m_A22 += m_A9 * f4_7; + m_A23 += m_A10 * f4_7; + m_A24 += m_A11 * f4_7; + RHS7 += f4_7 * RHS4; + const double f4_8 = -f4 * m_A25; + m_A26 += m_A9 * f4_8; + m_A27 += m_A10 * f4_8; + m_A28 += m_A11 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_10 = -f4 * m_A34; + m_A36 += m_A9 * f4_10; + m_A37 += m_A10 * f4_10; + m_A39 += m_A11 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_11 = -f5 * m_A41; + m_A43 += m_A13 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_9 = -f6 * m_A29; + m_A30 += m_A15 * f6_9; + m_A31 += m_A16 * f6_9; + m_A32 += m_A17 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_10 = -f6 * m_A35; + m_A38 += m_A15 * f6_10; + m_A39 += m_A16 * f6_10; + m_A40 += m_A17 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_11 = -f6 * m_A42; + m_A43 += m_A15 * f6_11; + m_A44 += m_A16 * f6_11; + m_A45 += m_A17 * f6_11; + RHS11 += f6_11 * RHS6; + const double f7 = 1.0 / m_A22; + const double f7_8 = -f7 * m_A26; + m_A27 += m_A23 * f7_8; + m_A28 += m_A24 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_10 = -f7 * m_A36; + m_A37 += m_A23 * f7_10; + m_A39 += m_A24 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A27; + const double f8_10 = -f8 * m_A37; + m_A39 += m_A28 * f8_10; + RHS10 += f8_10 * RHS8; + const double f9 = 1.0 / m_A30; + const double f9_10 = -f9 * m_A38; + m_A39 += m_A31 * f9_10; + m_A40 += m_A32 * f9_10; + RHS10 += f9_10 * RHS9; + const double f9_11 = -f9 * m_A43; + m_A44 += m_A31 * f9_11; + m_A45 += m_A32 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A39; + const double f10_11 = -f10 * m_A44; + m_A45 += m_A40 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A45; + double tmp10 = 0.0; + tmp10 += m_A40 * V[11]; + V[10] = (RHS10 - tmp10) / m_A39; + double tmp9 = 0.0; + tmp9 += m_A31 * V[10]; + tmp9 += m_A32 * V[11]; + V[9] = (RHS9 - tmp9) / m_A30; + double tmp8 = 0.0; + tmp8 += m_A28 * V[10]; + V[8] = (RHS8 - tmp8) / m_A27; + double tmp7 = 0.0; + tmp7 += m_A23 * V[8]; + tmp7 += m_A24 * V[10]; + V[7] = (RHS7 - tmp7) / m_A22; + double tmp6 = 0.0; + tmp6 += m_A15 * V[9]; + tmp6 += m_A16 * V[10]; + tmp6 += m_A17 * V[11]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A13 * V[9]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A9 * V[7]; + tmp4 += m_A10 * V[8]; + tmp4 += m_A11 * V[10]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[8]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_53_double_double_2a153513d3e8e2cc(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[3]; + m_A5 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[7]; + m_A8 += go[8]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A11 += go[14]; + m_A10 += go[15]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[16] * *cnV[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A14 += go[17]; + m_A13 += go[18]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[19] * *cnV[19]; + m_A17 += gt[20]; + m_A17 += gt[21]; + m_A16 += go[20]; + m_A15 += go[21]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + m_A22 += gt[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A22 += gt[25]; + m_A22 += gt[26]; + m_A23 += go[22]; + m_A20 += go[23]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + m_A27 += gt[27]; + m_A27 += gt[28]; + m_A27 += gt[29]; + m_A27 += gt[30]; + m_A27 += gt[31]; + m_A24 += go[27]; + m_A25 += go[28]; + m_A29 += go[29]; + double RHS7 = Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 -= go[30] * *cnV[30]; + RHS7 -= go[31] * *cnV[31]; + m_A33 += gt[32]; + m_A33 += gt[33]; + m_A33 += gt[34]; + m_A31 += go[32]; + m_A35 += go[33]; + m_A30 += go[34]; + double RHS8 = Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + m_A38 += gt[35]; + m_A38 += gt[36]; + m_A38 += gt[37]; + m_A38 += gt[38]; + m_A38 += gt[39]; + m_A38 += gt[40]; + m_A38 += gt[41]; + m_A36 += go[35]; + m_A40 += go[36]; + double RHS9 = Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + RHS9 -= go[37] * *cnV[37]; + RHS9 -= go[38] * *cnV[38]; + RHS9 -= go[39] * *cnV[39]; + RHS9 -= go[40] * *cnV[40]; + RHS9 -= go[41] * *cnV[41]; + m_A46 += gt[42]; + m_A46 += gt[43]; + m_A46 += gt[44]; + m_A44 += go[42]; + m_A43 += go[43]; + m_A41 += go[44]; + double RHS10 = Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + m_A52 += gt[45]; + m_A52 += gt[46]; + m_A52 += gt[47]; + m_A52 += gt[48]; + m_A52 += gt[49]; + m_A52 += gt[50]; + m_A50 += go[45]; + m_A48 += go[46]; + m_A49 += go[47]; + double RHS11 = Idr[45]; + RHS11 += Idr[46]; + RHS11 += Idr[47]; + RHS11 += Idr[48]; + RHS11 += Idr[49]; + RHS11 += Idr[50]; + RHS11 -= go[48] * *cnV[48]; + RHS11 -= go[49] * *cnV[49]; + RHS11 -= go[50] * *cnV[50]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A15; + m_A17 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A16; + m_A17 += m_A3 * f1_5; + m_A18 += m_A4 * f1_5; + m_A19 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f1_6 = -f1 * m_A20; + m_A21 += m_A3 * f1_6; + m_A22 += m_A4 * f1_6; + m_A23 += m_A5 * f1_6; + RHS6 += f1_6 * RHS1; + const double f1_10 = -f1 * m_A41; + m_A42 += m_A3 * f1_10; + m_A43 += m_A4 * f1_10; + m_A46 += m_A5 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_7 = -f2 * m_A24; + m_A26 += m_A7 * f2_7; + m_A29 += m_A8 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_7 = -f3 * m_A25; + m_A27 += m_A10 * f3_7; + m_A28 += m_A11 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_8 = -f3 * m_A30; + m_A32 += m_A10 * f3_8; + m_A33 += m_A11 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_8 = -f4 * m_A31; + m_A33 += m_A13 * f4_8; + m_A35 += m_A14 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_9 = -f4 * m_A36; + m_A37 += m_A13 * f4_9; + m_A40 += m_A14 * f4_9; + RHS9 += f4_9 * RHS4; + const double f4_11 = -f4 * m_A48; + m_A49 += m_A13 * f4_11; + m_A52 += m_A14 * f4_11; + RHS11 += f4_11 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A18 * f5_6; + m_A23 += m_A19 * f5_6; + RHS6 += f5_6 * RHS5; + const double f5_10 = -f5 * m_A42; + m_A43 += m_A18 * f5_10; + m_A46 += m_A19 * f5_10; + RHS10 += f5_10 * RHS5; + const double f6 = 1.0 / m_A22; + const double f6_7 = -f6 * m_A26; + m_A29 += m_A23 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_10 = -f6 * m_A43; + m_A46 += m_A23 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A27; + const double f7_8 = -f7 * m_A32; + m_A33 += m_A28 * f7_8; + m_A34 += m_A29 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_10 = -f7 * m_A44; + m_A45 += m_A28 * f7_10; + m_A46 += m_A29 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A33; + const double f8_9 = -f8 * m_A37; + m_A39 += m_A34 * f8_9; + m_A40 += m_A35 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_10 = -f8 * m_A45; + m_A46 += m_A34 * f8_10; + m_A47 += m_A35 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_11 = -f8 * m_A49; + m_A51 += m_A34 * f8_11; + m_A52 += m_A35 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A38; + const double f9_11 = -f9 * m_A50; + m_A51 += m_A39 * f9_11; + m_A52 += m_A40 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A46; + const double f10_11 = -f10 * m_A51; + m_A52 += m_A47 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A52; + double tmp10 = 0.0; + tmp10 += m_A47 * V[11]; + V[10] = (RHS10 - tmp10) / m_A46; + double tmp9 = 0.0; + tmp9 += m_A39 * V[10]; + tmp9 += m_A40 * V[11]; + V[9] = (RHS9 - tmp9) / m_A38; + double tmp8 = 0.0; + tmp8 += m_A34 * V[10]; + tmp8 += m_A35 * V[11]; + V[8] = (RHS8 - tmp8) / m_A33; + double tmp7 = 0.0; + tmp7 += m_A28 * V[8]; + tmp7 += m_A29 * V[10]; + V[7] = (RHS7 - tmp7) / m_A27; + double tmp6 = 0.0; + tmp6 += m_A23 * V[10]; + V[6] = (RHS6 - tmp6) / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[6]; + tmp5 += m_A19 * V[10]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A13 * V[8]; + tmp4 += m_A14 * V[11]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A10 * V[7]; + tmp3 += m_A11 * V[8]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[6]; + tmp2 += m_A8 * V[10]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + tmp1 += m_A4 * V[6]; + tmp1 += m_A5 * V[10]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// spacfury +static void nl_gcr_91_double_double_b7b209d222c0a9a6(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A9 += go[10]; + m_A7 += go[11]; + m_A8 += go[12]; + m_A6 += go[13]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A12 += go[14]; + m_A11 += go[15]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 += Idr[20]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + RHS3 -= go[20] * *cnV[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A13 += gt[24]; + m_A13 += gt[25]; + m_A13 += gt[26]; + m_A13 += gt[27]; + m_A14 += go[21]; + m_A15 += go[22]; + double RHS4 = Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 += Idr[26]; + RHS4 += Idr[27]; + RHS4 -= go[23] * *cnV[23]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + RHS4 -= go[26] * *cnV[26]; + RHS4 -= go[27] * *cnV[27]; + m_A16 += gt[28]; + m_A16 += gt[29]; + m_A16 += gt[30]; + m_A18 += go[28]; + m_A19 += go[29]; + m_A17 += go[30]; + double RHS5 = Idr[28]; + RHS5 += Idr[29]; + RHS5 += Idr[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A22 += go[31]; + m_A21 += go[32]; + double RHS6 = Idr[31]; + RHS6 += Idr[32]; + m_A23 += gt[33]; + m_A23 += gt[34]; + m_A23 += gt[35]; + m_A23 += gt[36]; + m_A24 += go[33]; + m_A24 += go[34]; + m_A25 += go[35]; + double RHS7 = Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 -= go[36] * *cnV[36]; + m_A28 += gt[37]; + m_A28 += gt[38]; + m_A28 += gt[39]; + m_A28 += gt[40]; + m_A27 += go[37]; + m_A26 += go[38]; + double RHS8 = Idr[37]; + RHS8 += Idr[38]; + RHS8 += Idr[39]; + RHS8 += Idr[40]; + RHS8 -= go[39] * *cnV[39]; + RHS8 -= go[40] * *cnV[40]; + m_A38 += gt[41]; + m_A38 += gt[42]; + m_A38 += gt[43]; + m_A38 += gt[44]; + m_A38 += gt[45]; + m_A34 += go[41]; + m_A36 += go[42]; + m_A35 += go[43]; + double RHS9 = Idr[41]; + RHS9 += Idr[42]; + RHS9 += Idr[43]; + RHS9 += Idr[44]; + RHS9 += Idr[45]; + RHS9 -= go[44] * *cnV[44]; + RHS9 -= go[45] * *cnV[45]; + m_A45 += gt[46]; + m_A45 += gt[47]; + m_A45 += gt[48]; + m_A45 += gt[49]; + m_A46 += go[46]; + m_A44 += go[47]; + double RHS10 = Idr[46]; + RHS10 += Idr[47]; + RHS10 += Idr[48]; + RHS10 += Idr[49]; + RHS10 -= go[48] * *cnV[48]; + RHS10 -= go[49] * *cnV[49]; + m_A50 += gt[50]; + m_A50 += gt[51]; + m_A50 += gt[52]; + m_A54 += go[50]; + m_A47 += go[51]; + double RHS11 = Idr[50]; + RHS11 += Idr[51]; + RHS11 += Idr[52]; + RHS11 -= go[52] * *cnV[52]; + m_A59 += gt[53]; + m_A59 += gt[54]; + m_A59 += gt[55]; + m_A59 += gt[56]; + m_A59 += gt[57]; + m_A59 += gt[58]; + m_A56 += go[53]; + m_A56 += go[54]; + m_A55 += go[55]; + double RHS12 = Idr[53]; + RHS12 += Idr[54]; + RHS12 += Idr[55]; + RHS12 += Idr[56]; + RHS12 += Idr[57]; + RHS12 += Idr[58]; + RHS12 -= go[56] * *cnV[56]; + RHS12 -= go[57] * *cnV[57]; + RHS12 -= go[58] * *cnV[58]; + m_A69 += gt[59]; + m_A69 += gt[60]; + m_A69 += gt[61]; + m_A69 += gt[62]; + m_A69 += gt[63]; + m_A63 += go[59]; + m_A64 += go[60]; + m_A71 += go[61]; + double RHS13 = Idr[59]; + RHS13 += Idr[60]; + RHS13 += Idr[61]; + RHS13 += Idr[62]; + RHS13 += Idr[63]; + RHS13 -= go[62] * *cnV[62]; + RHS13 -= go[63] * *cnV[63]; + m_A80 += gt[64]; + m_A80 += gt[65]; + m_A80 += gt[66]; + m_A80 += gt[67]; + m_A80 += gt[68]; + m_A72 += go[64]; + m_A73 += go[65]; + m_A76 += go[66]; + double RHS14 = Idr[64]; + RHS14 += Idr[65]; + RHS14 += Idr[66]; + RHS14 += Idr[67]; + RHS14 += Idr[68]; + RHS14 -= go[67] * *cnV[67]; + RHS14 -= go[68] * *cnV[68]; + m_A90 += gt[69]; + m_A90 += gt[70]; + m_A90 += gt[71]; + m_A90 += gt[72]; + m_A83 += go[69]; + m_A88 += go[70]; + m_A86 += go[71]; + m_A82 += go[72]; + double RHS15 = Idr[69]; + RHS15 += Idr[70]; + RHS15 += Idr[71]; + RHS15 += Idr[72]; + const double f0 = 1.0 / m_A0; + const double f0_10 = -f0 * m_A44; + m_A45 += m_A1 * f0_10; + RHS10 += f0_10 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_14 = -f1 * m_A72; + m_A76 += m_A3 * f1_14; + m_A80 += m_A4 * f1_14; + RHS14 += f1_14 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_8 = -f2 * m_A26; + m_A28 += m_A6 * f2_8; + m_A30 += m_A7 * f2_8; + m_A32 += m_A8 * f2_8; + m_A33 += m_A9 * f2_8; + RHS8 += f2_8 * RHS2; + const double f2_11 = -f2 * m_A47; + m_A48 += m_A6 * f2_11; + m_A50 += m_A7 * f2_11; + m_A53 += m_A8 * f2_11; + m_A54 += m_A9 * f2_11; + RHS11 += f2_11 * RHS2; + const double f2_14 = -f2 * m_A73; + m_A74 += m_A6 * f2_14; + m_A77 += m_A7 * f2_14; + m_A80 += m_A8 * f2_14; + m_A81 += m_A9 * f2_14; + RHS14 += f2_14 * RHS2; + const double f2_15 = -f2 * m_A82; + m_A84 += m_A6 * f2_15; + m_A86 += m_A7 * f2_15; + m_A89 += m_A8 * f2_15; + m_A90 += m_A9 * f2_15; + RHS15 += f2_15 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_13 = -f3 * m_A63; + m_A67 += m_A11 * f3_13; + m_A71 += m_A12 * f3_13; + RHS13 += f3_13 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_9 = -f4 * m_A34; + m_A35 += m_A14 * f4_9; + m_A41 += m_A15 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A16; + const double f5_8 = -f5 * m_A27; + m_A28 += m_A17 * f5_8; + m_A29 += m_A18 * f5_8; + m_A31 += m_A19 * f5_8; + RHS8 += f5_8 * RHS5; + const double f5_9 = -f5 * m_A35; + m_A37 += m_A17 * f5_9; + m_A38 += m_A18 * f5_9; + m_A41 += m_A19 * f5_9; + RHS9 += f5_9 * RHS5; + const double f5_13 = -f5 * m_A64; + m_A65 += m_A17 * f5_13; + m_A66 += m_A18 * f5_13; + m_A69 += m_A19 * f5_13; + RHS13 += f5_13 * RHS5; + const double f6 = 1.0 / m_A20; + const double f6_9 = -f6 * m_A36; + m_A38 += m_A21 * f6_9; + m_A40 += m_A22 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_12 = -f6 * m_A55; + m_A57 += m_A21 * f6_12; + m_A59 += m_A22 * f6_12; + RHS12 += f6_12 * RHS6; + const double f7 = 1.0 / m_A23; + const double f7_12 = -f7 * m_A56; + m_A59 += m_A24 * f7_12; + m_A62 += m_A25 * f7_12; + RHS12 += f7_12 * RHS7; + const double f7_15 = -f7 * m_A83; + m_A87 += m_A24 * f7_15; + m_A90 += m_A25 * f7_15; + RHS15 += f7_15 * RHS7; + const double f8 = 1.0 / m_A28; + const double f8_9 = -f8 * m_A37; + m_A38 += m_A29 * f8_9; + m_A39 += m_A30 * f8_9; + m_A41 += m_A31 * f8_9; + m_A42 += m_A32 * f8_9; + m_A43 += m_A33 * f8_9; + RHS9 += f8_9 * RHS8; + const double f8_11 = -f8 * m_A48; + m_A49 += m_A29 * f8_11; + m_A50 += m_A30 * f8_11; + m_A52 += m_A31 * f8_11; + m_A53 += m_A32 * f8_11; + m_A54 += m_A33 * f8_11; + RHS11 += f8_11 * RHS8; + const double f8_13 = -f8 * m_A65; + m_A66 += m_A29 * f8_13; + m_A67 += m_A30 * f8_13; + m_A69 += m_A31 * f8_13; + m_A70 += m_A32 * f8_13; + m_A71 += m_A33 * f8_13; + RHS13 += f8_13 * RHS8; + const double f8_14 = -f8 * m_A74; + m_A75 += m_A29 * f8_14; + m_A77 += m_A30 * f8_14; + m_A79 += m_A31 * f8_14; + m_A80 += m_A32 * f8_14; + m_A81 += m_A33 * f8_14; + RHS14 += f8_14 * RHS8; + const double f8_15 = -f8 * m_A84; + m_A85 += m_A29 * f8_15; + m_A86 += m_A30 * f8_15; + m_A88 += m_A31 * f8_15; + m_A89 += m_A32 * f8_15; + m_A90 += m_A33 * f8_15; + RHS15 += f8_15 * RHS8; + const double f9 = 1.0 / m_A38; + const double f9_11 = -f9 * m_A49; + m_A50 += m_A39 * f9_11; + m_A51 += m_A40 * f9_11; + m_A52 += m_A41 * f9_11; + m_A53 += m_A42 * f9_11; + m_A54 += m_A43 * f9_11; + RHS11 += f9_11 * RHS9; + const double f9_12 = -f9 * m_A57; + m_A58 += m_A39 * f9_12; + m_A59 += m_A40 * f9_12; + m_A60 += m_A41 * f9_12; + m_A61 += m_A42 * f9_12; + m_A62 += m_A43 * f9_12; + RHS12 += f9_12 * RHS9; + const double f9_13 = -f9 * m_A66; + m_A67 += m_A39 * f9_13; + m_A68 += m_A40 * f9_13; + m_A69 += m_A41 * f9_13; + m_A70 += m_A42 * f9_13; + m_A71 += m_A43 * f9_13; + RHS13 += f9_13 * RHS9; + const double f9_14 = -f9 * m_A75; + m_A77 += m_A39 * f9_14; + m_A78 += m_A40 * f9_14; + m_A79 += m_A41 * f9_14; + m_A80 += m_A42 * f9_14; + m_A81 += m_A43 * f9_14; + RHS14 += f9_14 * RHS9; + const double f9_15 = -f9 * m_A85; + m_A86 += m_A39 * f9_15; + m_A87 += m_A40 * f9_15; + m_A88 += m_A41 * f9_15; + m_A89 += m_A42 * f9_15; + m_A90 += m_A43 * f9_15; + RHS15 += f9_15 * RHS9; + const double f10 = 1.0 / m_A45; + const double f10_14 = -f10 * m_A76; + m_A80 += m_A46 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A50; + const double f11_12 = -f11 * m_A58; + m_A59 += m_A51 * f11_12; + m_A60 += m_A52 * f11_12; + m_A61 += m_A53 * f11_12; + m_A62 += m_A54 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_13 = -f11 * m_A67; + m_A68 += m_A51 * f11_13; + m_A69 += m_A52 * f11_13; + m_A70 += m_A53 * f11_13; + m_A71 += m_A54 * f11_13; + RHS13 += f11_13 * RHS11; + const double f11_14 = -f11 * m_A77; + m_A78 += m_A51 * f11_14; + m_A79 += m_A52 * f11_14; + m_A80 += m_A53 * f11_14; + m_A81 += m_A54 * f11_14; + RHS14 += f11_14 * RHS11; + const double f11_15 = -f11 * m_A86; + m_A87 += m_A51 * f11_15; + m_A88 += m_A52 * f11_15; + m_A89 += m_A53 * f11_15; + m_A90 += m_A54 * f11_15; + RHS15 += f11_15 * RHS11; + const double f12 = 1.0 / m_A59; + const double f12_13 = -f12 * m_A68; + m_A69 += m_A60 * f12_13; + m_A70 += m_A61 * f12_13; + m_A71 += m_A62 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_14 = -f12 * m_A78; + m_A79 += m_A60 * f12_14; + m_A80 += m_A61 * f12_14; + m_A81 += m_A62 * f12_14; + RHS14 += f12_14 * RHS12; + const double f12_15 = -f12 * m_A87; + m_A88 += m_A60 * f12_15; + m_A89 += m_A61 * f12_15; + m_A90 += m_A62 * f12_15; + RHS15 += f12_15 * RHS12; + const double f13 = 1.0 / m_A69; + const double f13_14 = -f13 * m_A79; + m_A80 += m_A70 * f13_14; + m_A81 += m_A71 * f13_14; + RHS14 += f13_14 * RHS13; + const double f13_15 = -f13 * m_A88; + m_A89 += m_A70 * f13_15; + m_A90 += m_A71 * f13_15; + RHS15 += f13_15 * RHS13; + const double f14 = 1.0 / m_A80; + const double f14_15 = -f14 * m_A89; + m_A90 += m_A81 * f14_15; + RHS15 += f14_15 * RHS14; + V[15] = RHS15 / m_A90; + double tmp14 = 0.0; + tmp14 += m_A81 * V[15]; + V[14] = (RHS14 - tmp14) / m_A80; + double tmp13 = 0.0; + tmp13 += m_A70 * V[14]; + tmp13 += m_A71 * V[15]; + V[13] = (RHS13 - tmp13) / m_A69; + double tmp12 = 0.0; + tmp12 += m_A60 * V[13]; + tmp12 += m_A61 * V[14]; + tmp12 += m_A62 * V[15]; + V[12] = (RHS12 - tmp12) / m_A59; + double tmp11 = 0.0; + tmp11 += m_A51 * V[12]; + tmp11 += m_A52 * V[13]; + tmp11 += m_A53 * V[14]; + tmp11 += m_A54 * V[15]; + V[11] = (RHS11 - tmp11) / m_A50; + double tmp10 = 0.0; + tmp10 += m_A46 * V[14]; + V[10] = (RHS10 - tmp10) / m_A45; + double tmp9 = 0.0; + tmp9 += m_A39 * V[11]; + tmp9 += m_A40 * V[12]; + tmp9 += m_A41 * V[13]; + tmp9 += m_A42 * V[14]; + tmp9 += m_A43 * V[15]; + V[9] = (RHS9 - tmp9) / m_A38; + double tmp8 = 0.0; + tmp8 += m_A29 * V[9]; + tmp8 += m_A30 * V[11]; + tmp8 += m_A31 * V[13]; + tmp8 += m_A32 * V[14]; + tmp8 += m_A33 * V[15]; + V[8] = (RHS8 - tmp8) / m_A28; + double tmp7 = 0.0; + tmp7 += m_A24 * V[12]; + tmp7 += m_A25 * V[15]; + V[7] = (RHS7 - tmp7) / m_A23; + double tmp6 = 0.0; + tmp6 += m_A21 * V[9]; + tmp6 += m_A22 * V[12]; + V[6] = (RHS6 - tmp6) / m_A20; + double tmp5 = 0.0; + tmp5 += m_A17 * V[8]; + tmp5 += m_A18 * V[9]; + tmp5 += m_A19 * V[13]; + V[5] = (RHS5 - tmp5) / m_A16; + double tmp4 = 0.0; + tmp4 += m_A14 * V[5]; + tmp4 += m_A15 * V[13]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A11 * V[11]; + tmp3 += m_A12 * V[15]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[8]; + tmp2 += m_A7 * V[11]; + tmp2 += m_A8 * V[14]; + tmp2 += m_A9 * V[15]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[10]; + tmp1 += m_A4 * V[14]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[10]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// speedfrk +static void nl_gcr_37_double_double_e4f2ffbf201a3d0c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[15]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[16] * *cnV[16]; + RHS5 -= go[17] * *cnV[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A13 += go[18]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A15 += go[21]; + double RHS7 = Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 -= go[22] * *cnV[22]; + RHS7 -= go[23] * *cnV[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A16 += gt[26]; + m_A17 += go[24]; + double RHS8 = Idr[24]; + RHS8 += Idr[25]; + RHS8 += Idr[26]; + RHS8 -= go[25] * *cnV[25]; + RHS8 -= go[26] * *cnV[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A18 += gt[29]; + m_A19 += go[27]; + double RHS9 = Idr[27]; + RHS9 += Idr[28]; + RHS9 += Idr[29]; + RHS9 -= go[28] * *cnV[28]; + RHS9 -= go[29] * *cnV[29]; + m_A24 += gt[30]; + m_A24 += gt[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A24 += gt[34]; + m_A25 += go[30]; + m_A23 += go[31]; + m_A22 += go[32]; + m_A21 += go[33]; + m_A20 += go[34]; + double RHS10 = Idr[30]; + RHS10 += Idr[31]; + RHS10 += Idr[32]; + RHS10 += Idr[33]; + RHS10 += Idr[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A29 += gt[38]; + m_A29 += gt[39]; + m_A30 += go[35]; + m_A28 += go[36]; + m_A27 += go[37]; + m_A26 += go[38]; + double RHS11 = Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[39] * *cnV[39]; + m_A36 += gt[40]; + m_A36 += gt[41]; + m_A36 += gt[42]; + m_A36 += gt[43]; + m_A36 += gt[44]; + m_A35 += go[40]; + m_A34 += go[41]; + m_A33 += go[42]; + m_A32 += go[43]; + m_A31 += go[44]; + double RHS12 = Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + const double f0 = 1.0 / m_A0; + const double f0_10 = -f0 * m_A20; + m_A24 += m_A1 * f0_10; + RHS10 += f0_10 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A21; + m_A24 += m_A3 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_10 = -f2 * m_A22; + m_A24 += m_A5 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_11 = -f3 * m_A26; + m_A29 += m_A7 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_12 = -f4 * m_A31; + m_A36 += m_A9 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_10 = -f5 * m_A23; + m_A24 += m_A11 * f5_10; + RHS10 += f5_10 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_11 = -f6 * m_A27; + m_A29 += m_A13 * f6_11; + RHS11 += f6_11 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_12 = -f7 * m_A32; + m_A36 += m_A15 * f7_12; + RHS12 += f7_12 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_12 = -f8 * m_A33; + m_A36 += m_A17 * f8_12; + RHS12 += f8_12 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_11 = -f9 * m_A28; + m_A29 += m_A19 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A24; + const double f10_12 = -f10 * m_A34; + m_A36 += m_A25 * f10_12; + RHS12 += f10_12 * RHS10; + const double f11 = 1.0 / m_A29; + const double f11_12 = -f11 * m_A35; + m_A36 += m_A30 * f11_12; + RHS12 += f11_12 * RHS11; + V[12] = RHS12 / m_A36; + double tmp11 = 0.0; + tmp11 += m_A30 * V[12]; + V[11] = (RHS11 - tmp11) / m_A29; + double tmp10 = 0.0; + tmp10 += m_A25 * V[12]; + V[10] = (RHS10 - tmp10) / m_A24; + double tmp9 = 0.0; + tmp9 += m_A19 * V[11]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[12]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[12]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[11]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[10]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[12]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[11]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[10]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[10]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[10]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// speedfrk,cheekyms,rebound,astrob,fireone +static void nl_gcr_7_double_double_7c86a9bc1c6aef4c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A5 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// speedfrk +static void nl_gcr_7_double_double_e07b5b086812756c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A5 += go[7]; + m_A5 += go[8]; + m_A4 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr +static void nl_gcr_10_double_double_ac1e401ddf971e15(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + m_A9 += gt[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A8 += go[7]; + m_A7 += go[8]; + m_A6 += go[9]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A6; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A5 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr,280zzzap +static void nl_gcr_113_double_double_ab9144d965a37e4(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A5 += go[2]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A11 += go[10]; + m_A12 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A14 += go[13]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 -= go[14] * *cnV[14]; + m_A15 += gt[15]; + m_A15 += gt[16]; + m_A15 += gt[17]; + m_A15 += gt[18]; + m_A15 += gt[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A18 += go[15]; + m_A19 += go[16]; + m_A17 += go[17]; + m_A16 += go[18]; + double RHS6 = Idr[15]; + RHS6 += Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + RHS6 -= go[21] * *cnV[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A20 += gt[24]; + m_A20 += gt[25]; + m_A20 += gt[26]; + m_A20 += gt[27]; + m_A20 += gt[28]; + m_A23 += go[22]; + m_A24 += go[23]; + m_A22 += go[24]; + m_A21 += go[25]; + double RHS7 = Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + RHS7 -= go[28] * *cnV[28]; + m_A25 += gt[29]; + m_A25 += gt[30]; + m_A25 += gt[31]; + m_A26 += go[29]; + m_A27 += go[30]; + double RHS8 = Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[31] * *cnV[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A29 += go[32]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 -= go[33] * *cnV[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A30 += gt[37]; + m_A31 += go[34]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 -= go[35] * *cnV[35]; + RHS10 -= go[36] * *cnV[36]; + RHS10 -= go[37] * *cnV[37]; + m_A32 += gt[38]; + m_A32 += gt[39]; + m_A33 += go[38]; + double RHS11 = Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[39] * *cnV[39]; + m_A36 += gt[40]; + m_A36 += gt[41]; + m_A36 += gt[42]; + m_A36 += gt[43]; + m_A35 += go[40]; + m_A34 += go[41]; + double RHS12 = Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 -= go[42] * *cnV[42]; + RHS12 -= go[43] * *cnV[43]; + m_A42 += gt[44]; + m_A42 += gt[45]; + m_A42 += gt[46]; + m_A42 += gt[47]; + m_A40 += go[44]; + m_A39 += go[45]; + double RHS13 = Idr[44]; + RHS13 += Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 -= go[46] * *cnV[46]; + RHS13 -= go[47] * *cnV[47]; + m_A51 += gt[48]; + m_A51 += gt[49]; + m_A51 += gt[50]; + m_A51 += gt[51]; + m_A53 += go[48]; + m_A48 += go[49]; + m_A47 += go[50]; + double RHS14 = Idr[48]; + RHS14 += Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 -= go[51] * *cnV[51]; + m_A57 += gt[52]; + m_A57 += gt[53]; + m_A57 += gt[54]; + m_A56 += go[52]; + m_A58 += go[53]; + double RHS15 = Idr[52]; + RHS15 += Idr[53]; + RHS15 += Idr[54]; + RHS15 -= go[54] * *cnV[54]; + m_A60 += gt[55]; + m_A60 += gt[56]; + m_A60 += gt[57]; + m_A60 += gt[58]; + m_A59 += go[55]; + m_A61 += go[56]; + double RHS16 = Idr[55]; + RHS16 += Idr[56]; + RHS16 += Idr[57]; + RHS16 += Idr[58]; + RHS16 -= go[57] * *cnV[57]; + RHS16 -= go[58] * *cnV[58]; + m_A67 += gt[59]; + m_A67 += gt[60]; + m_A67 += gt[61]; + m_A67 += gt[62]; + m_A67 += gt[63]; + m_A67 += gt[64]; + m_A70 += go[59]; + m_A64 += go[60]; + m_A63 += go[61]; + m_A62 += go[62]; + m_A69 += go[63]; + double RHS17 = Idr[59]; + RHS17 += Idr[60]; + RHS17 += Idr[61]; + RHS17 += Idr[62]; + RHS17 += Idr[63]; + RHS17 += Idr[64]; + RHS17 -= go[64] * *cnV[64]; + m_A74 += gt[65]; + m_A74 += gt[66]; + m_A74 += gt[67]; + m_A74 += gt[68]; + m_A73 += go[65]; + m_A72 += go[66]; + m_A75 += go[67]; + double RHS18 = Idr[65]; + RHS18 += Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 -= go[68] * *cnV[68]; + m_A80 += gt[69]; + m_A80 += gt[70]; + m_A80 += gt[71]; + m_A80 += gt[72]; + m_A80 += gt[73]; + m_A77 += go[69]; + m_A78 += go[70]; + m_A76 += go[71]; + double RHS19 = Idr[69]; + RHS19 += Idr[70]; + RHS19 += Idr[71]; + RHS19 += Idr[72]; + RHS19 += Idr[73]; + RHS19 -= go[72] * *cnV[72]; + RHS19 -= go[73] * *cnV[73]; + m_A89 += gt[74]; + m_A89 += gt[75]; + m_A89 += gt[76]; + m_A89 += gt[77]; + m_A84 += go[74]; + m_A85 += go[75]; + m_A87 += go[76]; + m_A86 += go[77]; + double RHS20 = Idr[74]; + RHS20 += Idr[75]; + RHS20 += Idr[76]; + RHS20 += Idr[77]; + m_A100 += gt[78]; + m_A100 += gt[79]; + m_A100 += gt[80]; + m_A100 += gt[81]; + m_A100 += gt[82]; + m_A100 += gt[83]; + m_A100 += gt[84]; + m_A96 += go[78]; + m_A93 += go[79]; + m_A101 += go[80]; + m_A92 += go[81]; + m_A97 += go[82]; + double RHS21 = Idr[78]; + RHS21 += Idr[79]; + RHS21 += Idr[80]; + RHS21 += Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + RHS21 += Idr[84]; + RHS21 -= go[83] * *cnV[83]; + RHS21 -= go[84] * *cnV[84]; + m_A112 += gt[85]; + m_A112 += gt[86]; + m_A112 += gt[87]; + m_A112 += gt[88]; + m_A112 += gt[89]; + m_A112 += gt[90]; + m_A108 += go[85]; + m_A111 += go[86]; + m_A103 += go[87]; + m_A104 += go[88]; + m_A102 += go[89]; + double RHS22 = Idr[85]; + RHS22 += Idr[86]; + RHS22 += Idr[87]; + RHS22 += Idr[88]; + RHS22 += Idr[89]; + RHS22 += Idr[90]; + RHS22 -= go[90] * *cnV[90]; + const double f0 = 1.0 / m_A0; + const double f0_12 = -f0 * m_A34; + m_A36 += m_A1 * f0_12; + RHS12 += f0_12 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_12 = -f1 * m_A35; + m_A36 += m_A3 * f1_12; + m_A37 += m_A4 * f1_12; + m_A38 += m_A5 * f1_12; + RHS12 += f1_12 * RHS1; + const double f1_13 = -f1 * m_A39; + m_A41 += m_A3 * f1_13; + m_A42 += m_A4 * f1_13; + m_A43 += m_A5 * f1_13; + RHS13 += f1_13 * RHS1; + const double f1_14 = -f1 * m_A47; + m_A49 += m_A3 * f1_14; + m_A50 += m_A4 * f1_14; + m_A51 += m_A5 * f1_14; + RHS14 += f1_14 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_15 = -f2 * m_A56; + m_A57 += m_A7 * f2_15; + RHS15 += f2_15 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_20 = -f3 * m_A84; + m_A89 += m_A9 * f3_20; + RHS20 += f3_20 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_17 = -f4 * m_A62; + m_A67 += m_A11 * f4_17; + m_A69 += m_A12 * f4_17; + RHS17 += f4_17 * RHS4; + const double f4_20 = -f4 * m_A85; + m_A87 += m_A11 * f4_20; + m_A89 += m_A12 * f4_20; + RHS20 += f4_20 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_16 = -f5 * m_A59; + m_A60 += m_A14 * f5_16; + RHS16 += f5_16 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_13 = -f6 * m_A40; + m_A42 += m_A16 * f6_13; + m_A44 += m_A17 * f6_13; + m_A45 += m_A18 * f6_13; + m_A46 += m_A19 * f6_13; + RHS13 += f6_13 * RHS6; + const double f6_17 = -f6 * m_A63; + m_A65 += m_A16 * f6_17; + m_A67 += m_A17 * f6_17; + m_A70 += m_A18 * f6_17; + m_A71 += m_A19 * f6_17; + RHS17 += f6_17 * RHS6; + const double f6_21 = -f6 * m_A92; + m_A94 += m_A16 * f6_21; + m_A97 += m_A17 * f6_21; + m_A100 += m_A18 * f6_21; + m_A101 += m_A19 * f6_21; + RHS21 += f6_21 * RHS6; + const double f6_22 = -f6 * m_A102; + m_A105 += m_A16 * f6_22; + m_A107 += m_A17 * f6_22; + m_A111 += m_A18 * f6_22; + m_A112 += m_A19 * f6_22; + RHS22 += f6_22 * RHS6; + const double f7 = 1.0 / m_A20; + const double f7_14 = -f7 * m_A48; + m_A51 += m_A21 * f7_14; + m_A52 += m_A22 * f7_14; + m_A54 += m_A23 * f7_14; + m_A55 += m_A24 * f7_14; + RHS14 += f7_14 * RHS7; + const double f7_17 = -f7 * m_A64; + m_A66 += m_A21 * f7_17; + m_A67 += m_A22 * f7_17; + m_A70 += m_A23 * f7_17; + m_A71 += m_A24 * f7_17; + RHS17 += f7_17 * RHS7; + const double f7_21 = -f7 * m_A93; + m_A95 += m_A21 * f7_21; + m_A97 += m_A22 * f7_21; + m_A100 += m_A23 * f7_21; + m_A101 += m_A24 * f7_21; + RHS21 += f7_21 * RHS7; + const double f7_22 = -f7 * m_A103; + m_A106 += m_A21 * f7_22; + m_A107 += m_A22 * f7_22; + m_A111 += m_A23 * f7_22; + m_A112 += m_A24 * f7_22; + RHS22 += f7_22 * RHS7; + const double f8 = 1.0 / m_A25; + const double f8_18 = -f8 * m_A72; + m_A74 += m_A26 * f8_18; + m_A75 += m_A27 * f8_18; + RHS18 += f8_18 * RHS8; + const double f8_22 = -f8 * m_A104; + m_A108 += m_A26 * f8_22; + m_A112 += m_A27 * f8_22; + RHS22 += f8_22 * RHS8; + const double f9 = 1.0 / m_A28; + const double f9_18 = -f9 * m_A73; + m_A74 += m_A29 * f9_18; + RHS18 += f9_18 * RHS9; + const double f10 = 1.0 / m_A30; + const double f10_19 = -f10 * m_A76; + m_A80 += m_A31 * f10_19; + RHS19 += f10_19 * RHS10; + const double f11 = 1.0 / m_A32; + const double f11_19 = -f11 * m_A77; + m_A80 += m_A33 * f11_19; + RHS19 += f11_19 * RHS11; + const double f12 = 1.0 / m_A36; + const double f12_13 = -f12 * m_A41; + m_A42 += m_A37 * f12_13; + m_A43 += m_A38 * f12_13; + RHS13 += f12_13 * RHS12; + const double f12_14 = -f12 * m_A49; + m_A50 += m_A37 * f12_14; + m_A51 += m_A38 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A42; + const double f13_14 = -f13 * m_A50; + m_A51 += m_A43 * f13_14; + m_A52 += m_A44 * f13_14; + m_A54 += m_A45 * f13_14; + m_A55 += m_A46 * f13_14; + RHS14 += f13_14 * RHS13; + const double f13_17 = -f13 * m_A65; + m_A66 += m_A43 * f13_17; + m_A67 += m_A44 * f13_17; + m_A70 += m_A45 * f13_17; + m_A71 += m_A46 * f13_17; + RHS17 += f13_17 * RHS13; + const double f13_21 = -f13 * m_A94; + m_A95 += m_A43 * f13_21; + m_A97 += m_A44 * f13_21; + m_A100 += m_A45 * f13_21; + m_A101 += m_A46 * f13_21; + RHS21 += f13_21 * RHS13; + const double f13_22 = -f13 * m_A105; + m_A106 += m_A43 * f13_22; + m_A107 += m_A44 * f13_22; + m_A111 += m_A45 * f13_22; + m_A112 += m_A46 * f13_22; + RHS22 += f13_22 * RHS13; + const double f14 = 1.0 / m_A51; + const double f14_17 = -f14 * m_A66; + m_A67 += m_A52 * f14_17; + m_A68 += m_A53 * f14_17; + m_A70 += m_A54 * f14_17; + m_A71 += m_A55 * f14_17; + RHS17 += f14_17 * RHS14; + const double f14_19 = -f14 * m_A78; + m_A79 += m_A52 * f14_19; + m_A80 += m_A53 * f14_19; + m_A82 += m_A54 * f14_19; + m_A83 += m_A55 * f14_19; + RHS19 += f14_19 * RHS14; + const double f14_21 = -f14 * m_A95; + m_A97 += m_A52 * f14_21; + m_A98 += m_A53 * f14_21; + m_A100 += m_A54 * f14_21; + m_A101 += m_A55 * f14_21; + RHS21 += f14_21 * RHS14; + const double f14_22 = -f14 * m_A106; + m_A107 += m_A52 * f14_22; + m_A109 += m_A53 * f14_22; + m_A111 += m_A54 * f14_22; + m_A112 += m_A55 * f14_22; + RHS22 += f14_22 * RHS14; + const double f15 = 1.0 / m_A57; + const double f15_20 = -f15 * m_A86; + m_A89 += m_A58 * f15_20; + RHS20 += f15_20 * RHS15; + const double f16 = 1.0 / m_A60; + const double f16_21 = -f16 * m_A96; + m_A100 += m_A61 * f16_21; + RHS21 += f16_21 * RHS16; + const double f17 = 1.0 / m_A67; + const double f17_19 = -f17 * m_A79; + m_A80 += m_A68 * f17_19; + m_A81 += m_A69 * f17_19; + m_A82 += m_A70 * f17_19; + m_A83 += m_A71 * f17_19; + RHS19 += f17_19 * RHS17; + const double f17_20 = -f17 * m_A87; + m_A88 += m_A68 * f17_20; + m_A89 += m_A69 * f17_20; + m_A90 += m_A70 * f17_20; + m_A91 += m_A71 * f17_20; + RHS20 += f17_20 * RHS17; + const double f17_21 = -f17 * m_A97; + m_A98 += m_A68 * f17_21; + m_A99 += m_A69 * f17_21; + m_A100 += m_A70 * f17_21; + m_A101 += m_A71 * f17_21; + RHS21 += f17_21 * RHS17; + const double f17_22 = -f17 * m_A107; + m_A109 += m_A68 * f17_22; + m_A110 += m_A69 * f17_22; + m_A111 += m_A70 * f17_22; + m_A112 += m_A71 * f17_22; + RHS22 += f17_22 * RHS17; + const double f18 = 1.0 / m_A74; + const double f18_22 = -f18 * m_A108; + m_A112 += m_A75 * f18_22; + RHS22 += f18_22 * RHS18; + const double f19 = 1.0 / m_A80; + const double f19_20 = -f19 * m_A88; + m_A89 += m_A81 * f19_20; + m_A90 += m_A82 * f19_20; + m_A91 += m_A83 * f19_20; + RHS20 += f19_20 * RHS19; + const double f19_21 = -f19 * m_A98; + m_A99 += m_A81 * f19_21; + m_A100 += m_A82 * f19_21; + m_A101 += m_A83 * f19_21; + RHS21 += f19_21 * RHS19; + const double f19_22 = -f19 * m_A109; + m_A110 += m_A81 * f19_22; + m_A111 += m_A82 * f19_22; + m_A112 += m_A83 * f19_22; + RHS22 += f19_22 * RHS19; + const double f20 = 1.0 / m_A89; + const double f20_21 = -f20 * m_A99; + m_A100 += m_A90 * f20_21; + m_A101 += m_A91 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_22 = -f20 * m_A110; + m_A111 += m_A90 * f20_22; + m_A112 += m_A91 * f20_22; + RHS22 += f20_22 * RHS20; + const double f21 = 1.0 / m_A100; + const double f21_22 = -f21 * m_A111; + m_A112 += m_A101 * f21_22; + RHS22 += f21_22 * RHS21; + V[22] = RHS22 / m_A112; + double tmp21 = 0.0; + tmp21 += m_A101 * V[22]; + V[21] = (RHS21 - tmp21) / m_A100; + double tmp20 = 0.0; + tmp20 += m_A90 * V[21]; + tmp20 += m_A91 * V[22]; + V[20] = (RHS20 - tmp20) / m_A89; + double tmp19 = 0.0; + tmp19 += m_A81 * V[20]; + tmp19 += m_A82 * V[21]; + tmp19 += m_A83 * V[22]; + V[19] = (RHS19 - tmp19) / m_A80; + double tmp18 = 0.0; + tmp18 += m_A75 * V[22]; + V[18] = (RHS18 - tmp18) / m_A74; + double tmp17 = 0.0; + tmp17 += m_A68 * V[19]; + tmp17 += m_A69 * V[20]; + tmp17 += m_A70 * V[21]; + tmp17 += m_A71 * V[22]; + V[17] = (RHS17 - tmp17) / m_A67; + double tmp16 = 0.0; + tmp16 += m_A61 * V[21]; + V[16] = (RHS16 - tmp16) / m_A60; + double tmp15 = 0.0; + tmp15 += m_A58 * V[20]; + V[15] = (RHS15 - tmp15) / m_A57; + double tmp14 = 0.0; + tmp14 += m_A52 * V[17]; + tmp14 += m_A53 * V[19]; + tmp14 += m_A54 * V[21]; + tmp14 += m_A55 * V[22]; + V[14] = (RHS14 - tmp14) / m_A51; + double tmp13 = 0.0; + tmp13 += m_A43 * V[14]; + tmp13 += m_A44 * V[17]; + tmp13 += m_A45 * V[21]; + tmp13 += m_A46 * V[22]; + V[13] = (RHS13 - tmp13) / m_A42; + double tmp12 = 0.0; + tmp12 += m_A37 * V[13]; + tmp12 += m_A38 * V[14]; + V[12] = (RHS12 - tmp12) / m_A36; + double tmp11 = 0.0; + tmp11 += m_A33 * V[19]; + V[11] = (RHS11 - tmp11) / m_A32; + double tmp10 = 0.0; + tmp10 += m_A31 * V[19]; + V[10] = (RHS10 - tmp10) / m_A30; + double tmp9 = 0.0; + tmp9 += m_A29 * V[18]; + V[9] = (RHS9 - tmp9) / m_A28; + double tmp8 = 0.0; + tmp8 += m_A26 * V[18]; + tmp8 += m_A27 * V[22]; + V[8] = (RHS8 - tmp8) / m_A25; + double tmp7 = 0.0; + tmp7 += m_A21 * V[14]; + tmp7 += m_A22 * V[17]; + tmp7 += m_A23 * V[21]; + tmp7 += m_A24 * V[22]; + V[7] = (RHS7 - tmp7) / m_A20; + double tmp6 = 0.0; + tmp6 += m_A16 * V[13]; + tmp6 += m_A17 * V[17]; + tmp6 += m_A18 * V[21]; + tmp6 += m_A19 * V[22]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A14 * V[16]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[17]; + tmp4 += m_A12 * V[20]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[20]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A7 * V[15]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[12]; + tmp1 += m_A4 * V[13]; + tmp1 += m_A5 * V[14]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[12]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr,280zzzap +static void nl_gcr_122_double_double_42c57d523cac30d0(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[5] * *cnV[5]; + RHS2 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[8] * *cnV[8]; + RHS3 -= go[9] * *cnV[9]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[14]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A12 += go[16]; + m_A13 += go[17]; + m_A11 += go[18]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 -= go[19] * *cnV[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A14 += gt[25]; + m_A14 += gt[26]; + m_A15 += go[20]; + double RHS6 = Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 -= go[21] * *cnV[21]; + RHS6 -= go[22] * *cnV[22]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + m_A16 += gt[27]; + m_A16 += gt[28]; + m_A18 += go[27]; + m_A17 += go[28]; + double RHS7 = Idr[27]; + RHS7 += Idr[28]; + m_A19 += gt[29]; + m_A19 += gt[30]; + m_A19 += gt[31]; + m_A20 += go[29]; + double RHS8 = Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[30] * *cnV[30]; + RHS8 -= go[31] * *cnV[31]; + m_A21 += gt[32]; + m_A21 += gt[33]; + m_A22 += go[32]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 -= go[33] * *cnV[33]; + m_A23 += gt[34]; + m_A23 += gt[35]; + m_A23 += gt[36]; + m_A24 += go[34]; + m_A25 += go[35]; + m_A25 += go[36]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + RHS10 += Idr[36]; + m_A26 += gt[37]; + m_A26 += gt[38]; + m_A26 += gt[39]; + m_A26 += gt[40]; + m_A26 += gt[41]; + m_A26 += gt[42]; + m_A26 += gt[43]; + m_A27 += go[37]; + double RHS11 = Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 += Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + RHS11 -= go[40] * *cnV[40]; + RHS11 -= go[41] * *cnV[41]; + RHS11 -= go[42] * *cnV[42]; + RHS11 -= go[43] * *cnV[43]; + m_A28 += gt[44]; + m_A28 += gt[45]; + m_A28 += gt[46]; + m_A29 += go[44]; + double RHS12 = Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + RHS12 -= go[45] * *cnV[45]; + RHS12 -= go[46] * *cnV[46]; + m_A30 += gt[47]; + m_A30 += gt[48]; + m_A30 += gt[49]; + m_A30 += gt[50]; + m_A32 += go[47]; + m_A31 += go[48]; + m_A33 += go[49]; + double RHS13 = Idr[47]; + RHS13 += Idr[48]; + RHS13 += Idr[49]; + RHS13 += Idr[50]; + RHS13 -= go[50] * *cnV[50]; + m_A35 += gt[51]; + m_A35 += gt[52]; + m_A34 += go[51]; + double RHS14 = Idr[51]; + RHS14 += Idr[52]; + RHS14 -= go[52] * *cnV[52]; + m_A37 += gt[53]; + m_A37 += gt[54]; + m_A37 += gt[55]; + m_A37 += gt[56]; + m_A36 += go[53]; + m_A38 += go[54]; + double RHS15 = Idr[53]; + RHS15 += Idr[54]; + RHS15 += Idr[55]; + RHS15 += Idr[56]; + RHS15 -= go[55] * *cnV[55]; + RHS15 -= go[56] * *cnV[56]; + m_A40 += gt[57]; + m_A40 += gt[58]; + m_A39 += go[57]; + double RHS16 = Idr[57]; + RHS16 += Idr[58]; + RHS16 -= go[58] * *cnV[58]; + m_A43 += gt[59]; + m_A43 += gt[60]; + m_A41 += go[59]; + m_A42 += go[60]; + double RHS17 = Idr[59]; + RHS17 += Idr[60]; + m_A47 += gt[61]; + m_A47 += gt[62]; + m_A47 += gt[63]; + m_A47 += gt[64]; + m_A47 += gt[65]; + m_A46 += go[61]; + m_A49 += go[62]; + m_A50 += go[63]; + double RHS18 = Idr[61]; + RHS18 += Idr[62]; + RHS18 += Idr[63]; + RHS18 += Idr[64]; + RHS18 += Idr[65]; + RHS18 -= go[64] * *cnV[64]; + RHS18 -= go[65] * *cnV[65]; + m_A52 += gt[66]; + m_A52 += gt[67]; + m_A51 += go[66]; + double RHS19 = Idr[66]; + RHS19 += Idr[67]; + RHS19 -= go[67] * *cnV[67]; + m_A55 += gt[68]; + m_A55 += gt[69]; + m_A54 += go[68]; + m_A53 += go[69]; + double RHS20 = Idr[68]; + RHS20 += Idr[69]; + m_A60 += gt[70]; + m_A60 += gt[71]; + m_A60 += gt[72]; + m_A60 += gt[73]; + m_A59 += go[70]; + m_A61 += go[71]; + double RHS21 = Idr[70]; + RHS21 += Idr[71]; + RHS21 += Idr[72]; + RHS21 += Idr[73]; + RHS21 -= go[72] * *cnV[72]; + RHS21 -= go[73] * *cnV[73]; + m_A69 += gt[74]; + m_A69 += gt[75]; + m_A69 += gt[76]; + m_A69 += gt[77]; + m_A69 += gt[78]; + m_A69 += gt[79]; + m_A69 += gt[80]; + m_A69 += gt[81]; + m_A69 += gt[82]; + m_A62 += go[74]; + m_A65 += go[75]; + m_A65 += go[76]; + m_A64 += go[77]; + m_A63 += go[78]; + m_A71 += go[79]; + double RHS22 = Idr[74]; + RHS22 += Idr[75]; + RHS22 += Idr[76]; + RHS22 += Idr[77]; + RHS22 += Idr[78]; + RHS22 += Idr[79]; + RHS22 += Idr[80]; + RHS22 += Idr[81]; + RHS22 += Idr[82]; + RHS22 -= go[80] * *cnV[80]; + RHS22 -= go[81] * *cnV[81]; + RHS22 -= go[82] * *cnV[82]; + m_A75 += gt[83]; + m_A75 += gt[84]; + m_A75 += gt[85]; + m_A75 += gt[86]; + m_A74 += go[83]; + m_A76 += go[84]; + double RHS23 = Idr[83]; + RHS23 += Idr[84]; + RHS23 += Idr[85]; + RHS23 += Idr[86]; + RHS23 -= go[85] * *cnV[85]; + RHS23 -= go[86] * *cnV[86]; + m_A82 += gt[87]; + m_A82 += gt[88]; + m_A82 += gt[89]; + m_A82 += gt[90]; + m_A82 += gt[91]; + m_A82 += gt[92]; + m_A77 += go[87]; + m_A78 += go[88]; + m_A84 += go[89]; + double RHS24 = Idr[87]; + RHS24 += Idr[88]; + RHS24 += Idr[89]; + RHS24 += Idr[90]; + RHS24 += Idr[91]; + RHS24 += Idr[92]; + RHS24 -= go[90] * *cnV[90]; + RHS24 -= go[91] * *cnV[91]; + RHS24 -= go[92] * *cnV[92]; + m_A93 += gt[93]; + m_A93 += gt[94]; + m_A93 += gt[95]; + m_A93 += gt[96]; + m_A93 += gt[97]; + m_A91 += go[93]; + m_A89 += go[94]; + m_A88 += go[95]; + m_A87 += go[96]; + m_A86 += go[97]; + double RHS25 = Idr[93]; + RHS25 += Idr[94]; + RHS25 += Idr[95]; + RHS25 += Idr[96]; + RHS25 += Idr[97]; + m_A104 += gt[98]; + m_A104 += gt[99]; + m_A104 += gt[100]; + m_A104 += gt[101]; + m_A104 += gt[102]; + m_A102 += go[98]; + m_A99 += go[99]; + m_A98 += go[100]; + m_A97 += go[101]; + m_A96 += go[102]; + double RHS26 = Idr[98]; + RHS26 += Idr[99]; + RHS26 += Idr[100]; + RHS26 += Idr[101]; + RHS26 += Idr[102]; + m_A113 += gt[103]; + m_A113 += gt[104]; + m_A113 += gt[105]; + m_A113 += gt[106]; + m_A107 += go[103]; + m_A106 += go[104]; + m_A114 += go[105]; + double RHS27 = Idr[103]; + RHS27 += Idr[104]; + RHS27 += Idr[105]; + RHS27 += Idr[106]; + RHS27 -= go[106] * *cnV[106]; + m_A121 += gt[107]; + m_A121 += gt[108]; + m_A121 += gt[109]; + m_A121 += gt[110]; + m_A121 += gt[111]; + m_A118 += go[107]; + m_A117 += go[108]; + m_A120 += go[109]; + m_A116 += go[110]; + m_A115 += go[111]; + double RHS28 = Idr[107]; + RHS28 += Idr[108]; + RHS28 += Idr[109]; + RHS28 += Idr[110]; + RHS28 += Idr[111]; + const double f0 = 1.0 / m_A0; + const double f0_17 = -f0 * m_A41; + m_A43 += m_A1 * f0_17; + RHS17 += f0_17 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_14 = -f1 * m_A34; + m_A35 += m_A3 * f1_14; + RHS14 += f1_14 * RHS1; + const double f1_25 = -f1 * m_A86; + m_A89 += m_A3 * f1_25; + RHS25 += f1_25 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_15 = -f2 * m_A36; + m_A38 += m_A5 * f2_15; + RHS15 += f2_15 * RHS2; + const double f2_25 = -f2 * m_A87; + m_A93 += m_A5 * f2_25; + RHS25 += f2_25 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_22 = -f3 * m_A62; + m_A66 += m_A7 * f3_22; + RHS22 += f3_22 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_16 = -f4 * m_A39; + m_A40 += m_A9 * f4_16; + RHS16 += f4_16 * RHS4; + const double f4_28 = -f4 * m_A115; + m_A117 += m_A9 * f4_28; + RHS28 += f4_28 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_17 = -f5 * m_A42; + m_A43 += m_A11 * f5_17; + m_A44 += m_A12 * f5_17; + m_A45 += m_A13 * f5_17; + RHS17 += f5_17 * RHS5; + const double f5_22 = -f5 * m_A63; + m_A67 += m_A11 * f5_22; + m_A69 += m_A12 * f5_22; + m_A71 += m_A13 * f5_22; + RHS22 += f5_22 * RHS5; + const double f5_25 = -f5 * m_A88; + m_A90 += m_A11 * f5_25; + m_A91 += m_A12 * f5_25; + m_A93 += m_A13 * f5_25; + RHS25 += f5_25 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_18 = -f6 * m_A46; + m_A48 += m_A15 * f6_18; + RHS18 += f6_18 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_22 = -f7 * m_A64; + m_A69 += m_A17 * f7_22; + m_A73 += m_A18 * f7_22; + RHS22 += f7_22 * RHS7; + const double f7_27 = -f7 * m_A106; + m_A109 += m_A17 * f7_27; + m_A113 += m_A18 * f7_27; + RHS27 += f7_27 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_21 = -f8 * m_A59; + m_A61 += m_A20 * f8_21; + RHS21 += f8_21 * RHS8; + const double f8_28 = -f8 * m_A116; + m_A121 += m_A20 * f8_28; + RHS28 += f8_28 * RHS8; + const double f9 = 1.0 / m_A21; + const double f9_19 = -f9 * m_A51; + m_A52 += m_A22 * f9_19; + RHS19 += f9_19 * RHS9; + const double f9_26 = -f9 * m_A96; + m_A99 += m_A22 * f9_26; + RHS26 += f9_26 * RHS9; + const double f10 = 1.0 / m_A23; + const double f10_20 = -f10 * m_A53; + m_A55 += m_A24 * f10_20; + m_A56 += m_A25 * f10_20; + RHS20 += f10_20 * RHS10; + const double f10_22 = -f10 * m_A65; + m_A68 += m_A24 * f10_22; + m_A69 += m_A25 * f10_22; + RHS22 += f10_22 * RHS10; + const double f11 = 1.0 / m_A26; + const double f11_24 = -f11 * m_A77; + m_A81 += m_A27 * f11_24; + RHS24 += f11_24 * RHS11; + const double f12 = 1.0 / m_A28; + const double f12_23 = -f12 * m_A74; + m_A76 += m_A29 * f12_23; + RHS23 += f12_23 * RHS12; + const double f12_26 = -f12 * m_A97; + m_A104 += m_A29 * f12_26; + RHS26 += f12_26 * RHS12; + const double f13 = 1.0 / m_A30; + const double f13_20 = -f13 * m_A54; + m_A55 += m_A31 * f13_20; + m_A57 += m_A32 * f13_20; + m_A58 += m_A33 * f13_20; + RHS20 += f13_20 * RHS13; + const double f13_24 = -f13 * m_A78; + m_A79 += m_A31 * f13_24; + m_A82 += m_A32 * f13_24; + m_A84 += m_A33 * f13_24; + RHS24 += f13_24 * RHS13; + const double f13_26 = -f13 * m_A98; + m_A100 += m_A31 * f13_26; + m_A102 += m_A32 * f13_26; + m_A104 += m_A33 * f13_26; + RHS26 += f13_26 * RHS13; + const double f14 = 1.0 / m_A35; + const double f14_25 = -f14 * m_A89; + RHS25 += f14_25 * RHS14; + const double f15 = 1.0 / m_A37; + const double f15_22 = -f15 * m_A66; + m_A71 += m_A38 * f15_22; + RHS22 += f15_22 * RHS15; + const double f16 = 1.0 / m_A40; + const double f16_28 = -f16 * m_A117; + RHS28 += f16_28 * RHS16; + const double f17 = 1.0 / m_A43; + const double f17_22 = -f17 * m_A67; + m_A69 += m_A44 * f17_22; + m_A71 += m_A45 * f17_22; + RHS22 += f17_22 * RHS17; + const double f17_25 = -f17 * m_A90; + m_A91 += m_A44 * f17_25; + m_A93 += m_A45 * f17_25; + RHS25 += f17_25 * RHS17; + const double f18 = 1.0 / m_A47; + const double f18_27 = -f18 * m_A107; + m_A108 += m_A48 * f18_27; + m_A113 += m_A49 * f18_27; + m_A114 += m_A50 * f18_27; + RHS27 += f18_27 * RHS18; + const double f18_28 = -f18 * m_A118; + m_A119 += m_A48 * f18_28; + m_A120 += m_A49 * f18_28; + m_A121 += m_A50 * f18_28; + RHS28 += f18_28 * RHS18; + const double f19 = 1.0 / m_A52; + const double f19_26 = -f19 * m_A99; + RHS26 += f19_26 * RHS19; + const double f20 = 1.0 / m_A55; + const double f20_22 = -f20 * m_A68; + m_A69 += m_A56 * f20_22; + m_A70 += m_A57 * f20_22; + m_A72 += m_A58 * f20_22; + RHS22 += f20_22 * RHS20; + const double f20_24 = -f20 * m_A79; + m_A80 += m_A56 * f20_24; + m_A82 += m_A57 * f20_24; + m_A84 += m_A58 * f20_24; + RHS24 += f20_24 * RHS20; + const double f20_26 = -f20 * m_A100; + m_A101 += m_A56 * f20_26; + m_A102 += m_A57 * f20_26; + m_A104 += m_A58 * f20_26; + RHS26 += f20_26 * RHS20; + const double f21 = 1.0 / m_A60; + const double f21_27 = -f21 * m_A108; + m_A114 += m_A61 * f21_27; + RHS27 += f21_27 * RHS21; + const double f21_28 = -f21 * m_A119; + m_A121 += m_A61 * f21_28; + RHS28 += f21_28 * RHS21; + const double f22 = 1.0 / m_A69; + const double f22_24 = -f22 * m_A80; + m_A82 += m_A70 * f22_24; + m_A83 += m_A71 * f22_24; + m_A84 += m_A72 * f22_24; + m_A85 += m_A73 * f22_24; + RHS24 += f22_24 * RHS22; + const double f22_25 = -f22 * m_A91; + m_A92 += m_A70 * f22_25; + m_A93 += m_A71 * f22_25; + m_A94 += m_A72 * f22_25; + m_A95 += m_A73 * f22_25; + RHS25 += f22_25 * RHS22; + const double f22_26 = -f22 * m_A101; + m_A102 += m_A70 * f22_26; + m_A103 += m_A71 * f22_26; + m_A104 += m_A72 * f22_26; + m_A105 += m_A73 * f22_26; + RHS26 += f22_26 * RHS22; + const double f22_27 = -f22 * m_A109; + m_A110 += m_A70 * f22_27; + m_A111 += m_A71 * f22_27; + m_A112 += m_A72 * f22_27; + m_A113 += m_A73 * f22_27; + RHS27 += f22_27 * RHS22; + const double f23 = 1.0 / m_A75; + const double f23_24 = -f23 * m_A81; + m_A84 += m_A76 * f23_24; + RHS24 += f23_24 * RHS23; + const double f24 = 1.0 / m_A82; + const double f24_25 = -f24 * m_A92; + m_A93 += m_A83 * f24_25; + m_A94 += m_A84 * f24_25; + m_A95 += m_A85 * f24_25; + RHS25 += f24_25 * RHS24; + const double f24_26 = -f24 * m_A102; + m_A103 += m_A83 * f24_26; + m_A104 += m_A84 * f24_26; + m_A105 += m_A85 * f24_26; + RHS26 += f24_26 * RHS24; + const double f24_27 = -f24 * m_A110; + m_A111 += m_A83 * f24_27; + m_A112 += m_A84 * f24_27; + m_A113 += m_A85 * f24_27; + RHS27 += f24_27 * RHS24; + const double f25 = 1.0 / m_A93; + const double f25_26 = -f25 * m_A103; + m_A104 += m_A94 * f25_26; + m_A105 += m_A95 * f25_26; + RHS26 += f25_26 * RHS25; + const double f25_27 = -f25 * m_A111; + m_A112 += m_A94 * f25_27; + m_A113 += m_A95 * f25_27; + RHS27 += f25_27 * RHS25; + const double f26 = 1.0 / m_A104; + const double f26_27 = -f26 * m_A112; + m_A113 += m_A105 * f26_27; + RHS27 += f26_27 * RHS26; + const double f27 = 1.0 / m_A113; + const double f27_28 = -f27 * m_A120; + m_A121 += m_A114 * f27_28; + RHS28 += f27_28 * RHS27; + V[28] = RHS28 / m_A121; + double tmp27 = 0.0; + tmp27 += m_A114 * V[28]; + V[27] = (RHS27 - tmp27) / m_A113; + double tmp26 = 0.0; + tmp26 += m_A105 * V[27]; + V[26] = (RHS26 - tmp26) / m_A104; + double tmp25 = 0.0; + tmp25 += m_A94 * V[26]; + tmp25 += m_A95 * V[27]; + V[25] = (RHS25 - tmp25) / m_A93; + double tmp24 = 0.0; + tmp24 += m_A83 * V[25]; + tmp24 += m_A84 * V[26]; + tmp24 += m_A85 * V[27]; + V[24] = (RHS24 - tmp24) / m_A82; + double tmp23 = 0.0; + tmp23 += m_A76 * V[26]; + V[23] = (RHS23 - tmp23) / m_A75; + double tmp22 = 0.0; + tmp22 += m_A70 * V[24]; + tmp22 += m_A71 * V[25]; + tmp22 += m_A72 * V[26]; + tmp22 += m_A73 * V[27]; + V[22] = (RHS22 - tmp22) / m_A69; + double tmp21 = 0.0; + tmp21 += m_A61 * V[28]; + V[21] = (RHS21 - tmp21) / m_A60; + double tmp20 = 0.0; + tmp20 += m_A56 * V[22]; + tmp20 += m_A57 * V[24]; + tmp20 += m_A58 * V[26]; + V[20] = (RHS20 - tmp20) / m_A55; + double tmp19 = 0.0; + V[19] = (RHS19 - tmp19) / m_A52; + double tmp18 = 0.0; + tmp18 += m_A48 * V[21]; + tmp18 += m_A49 * V[27]; + tmp18 += m_A50 * V[28]; + V[18] = (RHS18 - tmp18) / m_A47; + double tmp17 = 0.0; + tmp17 += m_A44 * V[22]; + tmp17 += m_A45 * V[25]; + V[17] = (RHS17 - tmp17) / m_A43; + double tmp16 = 0.0; + V[16] = (RHS16 - tmp16) / m_A40; + double tmp15 = 0.0; + tmp15 += m_A38 * V[25]; + V[15] = (RHS15 - tmp15) / m_A37; + double tmp14 = 0.0; + V[14] = (RHS14 - tmp14) / m_A35; + double tmp13 = 0.0; + tmp13 += m_A31 * V[20]; + tmp13 += m_A32 * V[24]; + tmp13 += m_A33 * V[26]; + V[13] = (RHS13 - tmp13) / m_A30; + double tmp12 = 0.0; + tmp12 += m_A29 * V[26]; + V[12] = (RHS12 - tmp12) / m_A28; + double tmp11 = 0.0; + tmp11 += m_A27 * V[23]; + V[11] = (RHS11 - tmp11) / m_A26; + double tmp10 = 0.0; + tmp10 += m_A24 * V[20]; + tmp10 += m_A25 * V[22]; + V[10] = (RHS10 - tmp10) / m_A23; + double tmp9 = 0.0; + tmp9 += m_A22 * V[19]; + V[9] = (RHS9 - tmp9) / m_A21; + double tmp8 = 0.0; + tmp8 += m_A20 * V[28]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A17 * V[22]; + tmp7 += m_A18 * V[27]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A15 * V[21]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A11 * V[17]; + tmp5 += m_A12 * V[22]; + tmp5 += m_A13 * V[25]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[16]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[15]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[25]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[14]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[17]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr,280zzzap +static void nl_gcr_123_double_double_864a61c57bac9c38(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A7 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A9 += go[15]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A11 += go[22]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A14 += go[24]; + m_A13 += go[25]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A16 += go[26]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[27] * *cnV[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A18 += go[28]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 -= go[29] * *cnV[29]; + m_A19 += gt[30]; + m_A19 += gt[31]; + m_A19 += gt[32]; + m_A19 += gt[33]; + m_A19 += gt[34]; + m_A19 += gt[35]; + m_A19 += gt[36]; + m_A20 += go[30]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 -= go[31] * *cnV[31]; + RHS9 -= go[32] * *cnV[32]; + RHS9 -= go[33] * *cnV[33]; + RHS9 -= go[34] * *cnV[34]; + RHS9 -= go[35] * *cnV[35]; + RHS9 -= go[36] * *cnV[36]; + m_A21 += gt[37]; + m_A21 += gt[38]; + m_A21 += gt[39]; + m_A22 += go[37]; + double RHS10 = Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 -= go[38] * *cnV[38]; + RHS10 -= go[39] * *cnV[39]; + m_A23 += gt[40]; + m_A23 += gt[41]; + m_A23 += gt[42]; + m_A23 += gt[43]; + m_A24 += go[40]; + double RHS11 = Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 -= go[41] * *cnV[41]; + RHS11 -= go[42] * *cnV[42]; + RHS11 -= go[43] * *cnV[43]; + m_A25 += gt[44]; + m_A25 += gt[45]; + m_A25 += gt[46]; + m_A25 += gt[47]; + m_A25 += gt[48]; + m_A25 += gt[49]; + m_A25 += gt[50]; + m_A26 += go[44]; + double RHS12 = Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 += Idr[49]; + RHS12 += Idr[50]; + RHS12 -= go[45] * *cnV[45]; + RHS12 -= go[46] * *cnV[46]; + RHS12 -= go[47] * *cnV[47]; + RHS12 -= go[48] * *cnV[48]; + RHS12 -= go[49] * *cnV[49]; + RHS12 -= go[50] * *cnV[50]; + m_A27 += gt[51]; + m_A27 += gt[52]; + m_A28 += go[51]; + double RHS13 = Idr[51]; + RHS13 += Idr[52]; + RHS13 -= go[52] * *cnV[52]; + m_A29 += gt[53]; + m_A29 += gt[54]; + m_A30 += go[53]; + double RHS14 = Idr[53]; + RHS14 += Idr[54]; + RHS14 -= go[54] * *cnV[54]; + m_A31 += gt[55]; + m_A31 += gt[56]; + m_A32 += go[55]; + double RHS15 = Idr[55]; + RHS15 += Idr[56]; + RHS15 -= go[56] * *cnV[56]; + m_A33 += gt[57]; + m_A33 += gt[58]; + m_A33 += gt[59]; + m_A33 += gt[60]; + m_A35 += go[57]; + m_A34 += go[58]; + double RHS16 = Idr[57]; + RHS16 += Idr[58]; + RHS16 += Idr[59]; + RHS16 += Idr[60]; + RHS16 -= go[59] * *cnV[59]; + RHS16 -= go[60] * *cnV[60]; + m_A36 += gt[61]; + m_A36 += gt[62]; + m_A36 += gt[63]; + m_A37 += go[61]; + double RHS17 = Idr[61]; + RHS17 += Idr[62]; + RHS17 += Idr[63]; + RHS17 -= go[62] * *cnV[62]; + RHS17 -= go[63] * *cnV[63]; + m_A38 += gt[64]; + m_A38 += gt[65]; + m_A39 += go[64]; + double RHS18 = Idr[64]; + RHS18 += Idr[65]; + RHS18 -= go[65] * *cnV[65]; + m_A40 += gt[66]; + m_A40 += gt[67]; + m_A41 += go[66]; + double RHS19 = Idr[66]; + RHS19 += Idr[67]; + RHS19 -= go[67] * *cnV[67]; + m_A43 += gt[68]; + m_A43 += gt[69]; + m_A43 += gt[70]; + m_A43 += gt[71]; + m_A42 += go[68]; + double RHS20 = Idr[68]; + RHS20 += Idr[69]; + RHS20 += Idr[70]; + RHS20 += Idr[71]; + RHS20 -= go[69] * *cnV[69]; + RHS20 -= go[70] * *cnV[70]; + RHS20 -= go[71] * *cnV[71]; + m_A47 += gt[72]; + m_A47 += gt[73]; + m_A46 += go[72]; + m_A45 += go[73]; + double RHS21 = Idr[72]; + RHS21 += Idr[73]; + m_A51 += gt[74]; + m_A51 += gt[75]; + m_A49 += go[74]; + double RHS22 = Idr[74]; + RHS22 += Idr[75]; + RHS22 -= go[75] * *cnV[75]; + m_A54 += gt[76]; + m_A54 += gt[77]; + m_A54 += gt[78]; + m_A53 += go[76]; + m_A52 += go[77]; + double RHS23 = Idr[76]; + RHS23 += Idr[77]; + RHS23 += Idr[78]; + RHS23 -= go[78] * *cnV[78]; + m_A56 += gt[79]; + m_A56 += gt[80]; + m_A56 += gt[81]; + m_A56 += gt[82]; + m_A55 += go[79]; + m_A57 += go[80]; + double RHS24 = Idr[79]; + RHS24 += Idr[80]; + RHS24 += Idr[81]; + RHS24 += Idr[82]; + RHS24 -= go[81] * *cnV[81]; + RHS24 -= go[82] * *cnV[82]; + m_A59 += gt[83]; + m_A59 += gt[84]; + m_A59 += gt[85]; + m_A59 += gt[86]; + m_A58 += go[83]; + m_A60 += go[84]; + double RHS25 = Idr[83]; + RHS25 += Idr[84]; + RHS25 += Idr[85]; + RHS25 += Idr[86]; + RHS25 -= go[85] * *cnV[85]; + RHS25 -= go[86] * *cnV[86]; + m_A62 += gt[87]; + m_A62 += gt[88]; + m_A63 += go[87]; + m_A61 += go[88]; + double RHS26 = Idr[87]; + RHS26 += Idr[88]; + m_A67 += gt[89]; + m_A67 += gt[90]; + m_A67 += gt[91]; + m_A67 += gt[92]; + m_A67 += gt[93]; + m_A67 += gt[94]; + m_A64 += go[89]; + m_A65 += go[90]; + m_A69 += go[91]; + m_A68 += go[92]; + double RHS27 = Idr[89]; + RHS27 += Idr[90]; + RHS27 += Idr[91]; + RHS27 += Idr[92]; + RHS27 += Idr[93]; + RHS27 += Idr[94]; + RHS27 -= go[93] * *cnV[93]; + RHS27 -= go[94] * *cnV[94]; + m_A72 += gt[95]; + m_A72 += gt[96]; + m_A72 += gt[97]; + m_A72 += gt[98]; + m_A71 += go[95]; + m_A73 += go[96]; + double RHS28 = Idr[95]; + RHS28 += Idr[96]; + RHS28 += Idr[97]; + RHS28 += Idr[98]; + RHS28 -= go[97] * *cnV[97]; + RHS28 -= go[98] * *cnV[98]; + m_A76 += gt[99]; + m_A76 += gt[100]; + m_A76 += gt[101]; + m_A76 += gt[102]; + m_A77 += go[99]; + m_A78 += go[100]; + m_A74 += go[101]; + m_A75 += go[102]; + double RHS29 = Idr[99]; + RHS29 += Idr[100]; + RHS29 += Idr[101]; + RHS29 += Idr[102]; + m_A81 += gt[103]; + m_A81 += gt[104]; + m_A81 += gt[105]; + m_A80 += go[103]; + m_A79 += go[104]; + double RHS30 = Idr[103]; + RHS30 += Idr[104]; + RHS30 += Idr[105]; + RHS30 -= go[105] * *cnV[105]; + m_A84 += gt[106]; + m_A84 += gt[107]; + m_A82 += go[106]; + m_A83 += go[107]; + double RHS31 = Idr[106]; + RHS31 += Idr[107]; + m_A91 += gt[108]; + m_A91 += gt[109]; + m_A91 += gt[110]; + m_A91 += gt[111]; + m_A91 += gt[112]; + m_A86 += go[108]; + m_A90 += go[109]; + m_A88 += go[110]; + m_A85 += go[111]; + m_A87 += go[112]; + double RHS32 = Idr[108]; + RHS32 += Idr[109]; + RHS32 += Idr[110]; + RHS32 += Idr[111]; + RHS32 += Idr[112]; + m_A99 += gt[113]; + m_A99 += gt[114]; + m_A99 += gt[115]; + m_A99 += gt[116]; + m_A99 += gt[117]; + m_A96 += go[113]; + m_A100 += go[114]; + m_A97 += go[115]; + m_A94 += go[116]; + m_A95 += go[117]; + double RHS33 = Idr[113]; + RHS33 += Idr[114]; + RHS33 += Idr[115]; + RHS33 += Idr[116]; + RHS33 += Idr[117]; + m_A106 += gt[118]; + m_A106 += gt[119]; + m_A106 += gt[120]; + m_A106 += gt[121]; + m_A103 += go[118]; + m_A104 += go[119]; + m_A101 += go[120]; + m_A102 += go[121]; + double RHS34 = Idr[118]; + RHS34 += Idr[119]; + RHS34 += Idr[120]; + RHS34 += Idr[121]; + m_A111 += gt[122]; + m_A111 += gt[123]; + m_A111 += gt[124]; + m_A111 += gt[125]; + m_A108 += go[122]; + m_A109 += go[123]; + double RHS35 = Idr[122]; + RHS35 += Idr[123]; + RHS35 += Idr[124]; + RHS35 += Idr[125]; + RHS35 -= go[124] * *cnV[124]; + RHS35 -= go[125] * *cnV[125]; + m_A122 += gt[126]; + m_A122 += gt[127]; + m_A122 += gt[128]; + m_A122 += gt[129]; + m_A122 += gt[130]; + m_A122 += gt[131]; + m_A113 += go[126]; + m_A117 += go[127]; + m_A120 += go[128]; + m_A114 += go[129]; + double RHS36 = Idr[126]; + RHS36 += Idr[127]; + RHS36 += Idr[128]; + RHS36 += Idr[129]; + RHS36 += Idr[130]; + RHS36 += Idr[131]; + RHS36 -= go[130] * *cnV[130]; + RHS36 -= go[131] * *cnV[131]; + const double f0 = 1.0 / m_A0; + const double f0_24 = -f0 * m_A55; + m_A57 += m_A1 * f0_24; + RHS24 += f0_24 * RHS0; + const double f0_32 = -f0 * m_A85; + m_A91 += m_A1 * f0_32; + RHS32 += f0_32 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_32 = -f1 * m_A86; + m_A91 += m_A3 * f1_32; + RHS32 += f1_32 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_27 = -f2 * m_A64; + m_A66 += m_A5 * f2_27; + RHS27 += f2_27 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_25 = -f3 * m_A58; + m_A60 += m_A7 * f3_25; + RHS25 += f3_25 * RHS3; + const double f3_34 = -f3 * m_A101; + m_A106 += m_A7 * f3_34; + RHS34 += f3_34 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_20 = -f4 * m_A42; + m_A44 += m_A9 * f4_20; + RHS20 += f4_20 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_21 = -f5 * m_A45; + m_A47 += m_A11 * f5_21; + RHS21 += f5_21 * RHS5; + const double f5_32 = -f5 * m_A87; + m_A88 += m_A11 * f5_32; + RHS32 += f5_32 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_21 = -f6 * m_A46; + m_A47 += m_A13 * f6_21; + m_A48 += m_A14 * f6_21; + RHS21 += f6_21 * RHS6; + const double f6_22 = -f6 * m_A49; + m_A50 += m_A13 * f6_22; + m_A51 += m_A14 * f6_22; + RHS22 += f6_22 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_23 = -f7 * m_A52; + m_A54 += m_A16 * f7_23; + RHS23 += f7_23 * RHS7; + const double f7_34 = -f7 * m_A102; + m_A103 += m_A16 * f7_34; + RHS34 += f7_34 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_23 = -f8 * m_A53; + m_A54 += m_A18 * f8_23; + RHS23 += f8_23 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_36 = -f9 * m_A113; + m_A116 += m_A20 * f9_36; + RHS36 += f9_36 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_28 = -f10 * m_A71; + m_A73 += m_A22 * f10_28; + RHS28 += f10_28 * RHS10; + const double f10_33 = -f10 * m_A94; + m_A99 += m_A22 * f10_33; + RHS33 += f10_33 * RHS10; + const double f13 = 1.0 / m_A27; + const double f13_26 = -f13 * m_A61; + m_A62 += m_A28 * f13_26; + RHS26 += f13_26 * RHS13; + const double f13_33 = -f13 * m_A95; + m_A97 += m_A28 * f13_33; + RHS33 += f13_33 * RHS13; + const double f14 = 1.0 / m_A29; + const double f14_33 = -f14 * m_A96; + m_A99 += m_A30 * f14_33; + RHS33 += f14_33 * RHS14; + const double f15 = 1.0 / m_A31; + const double f15_31 = -f15 * m_A82; + m_A84 += m_A32 * f15_31; + RHS31 += f15_31 * RHS15; + const double f16 = 1.0 / m_A33; + const double f16_27 = -f16 * m_A65; + m_A67 += m_A34 * f16_27; + m_A70 += m_A35 * f16_27; + RHS27 += f16_27 * RHS16; + const double f16_36 = -f16 * m_A114; + m_A115 += m_A34 * f16_36; + m_A122 += m_A35 * f16_36; + RHS36 += f16_36 * RHS16; + const double f17 = 1.0 / m_A36; + const double f17_29 = -f17 * m_A74; + m_A76 += m_A37 * f17_29; + RHS29 += f17_29 * RHS17; + const double f17_35 = -f17 * m_A108; + m_A109 += m_A37 * f17_35; + RHS35 += f17_35 * RHS17; + const double f18 = 1.0 / m_A38; + const double f18_29 = -f18 * m_A75; + m_A77 += m_A39 * f18_29; + RHS29 += f18_29 * RHS18; + const double f18_30 = -f18 * m_A79; + m_A81 += m_A39 * f18_30; + RHS30 += f18_30 * RHS18; + const double f19 = 1.0 / m_A40; + const double f19_30 = -f19 * m_A80; + m_A81 += m_A41 * f19_30; + RHS30 += f19_30 * RHS19; + const double f21 = 1.0 / m_A47; + const double f21_22 = -f21 * m_A50; + m_A51 += m_A48 * f21_22; + RHS22 += f21_22 * RHS21; + const double f21_32 = -f21 * m_A88; + m_A89 += m_A48 * f21_32; + RHS32 += f21_32 * RHS21; + const double f22 = 1.0 / m_A51; + const double f22_32 = -f22 * m_A89; + RHS32 += f22_32 * RHS22; + const double f23 = 1.0 / m_A54; + const double f23_34 = -f23 * m_A103; + RHS34 += f23_34 * RHS23; + const double f24 = 1.0 / m_A56; + const double f24_27 = -f24 * m_A66; + m_A68 += m_A57 * f24_27; + RHS27 += f24_27 * RHS24; + const double f26 = 1.0 / m_A62; + const double f26_31 = -f26 * m_A83; + m_A84 += m_A63 * f26_31; + RHS31 += f26_31 * RHS26; + const double f26_33 = -f26 * m_A97; + m_A98 += m_A63 * f26_33; + RHS33 += f26_33 * RHS26; + const double f27 = 1.0 / m_A67; + const double f27_32 = -f27 * m_A90; + m_A91 += m_A68 * f27_32; + m_A92 += m_A69 * f27_32; + m_A93 += m_A70 * f27_32; + RHS32 += f27_32 * RHS27; + const double f27_34 = -f27 * m_A104; + m_A105 += m_A68 * f27_34; + m_A106 += m_A69 * f27_34; + m_A107 += m_A70 * f27_34; + RHS34 += f27_34 * RHS27; + const double f27_36 = -f27 * m_A115; + m_A119 += m_A68 * f27_36; + m_A121 += m_A69 * f27_36; + m_A122 += m_A70 * f27_36; + RHS36 += f27_36 * RHS27; + const double f28 = 1.0 / m_A72; + const double f28_36 = -f28 * m_A116; + m_A120 += m_A73 * f28_36; + RHS36 += f28_36 * RHS28; + const double f29 = 1.0 / m_A76; + const double f29_35 = -f29 * m_A109; + m_A110 += m_A77 * f29_35; + m_A112 += m_A78 * f29_35; + RHS35 += f29_35 * RHS29; + const double f29_36 = -f29 * m_A117; + m_A118 += m_A77 * f29_36; + m_A122 += m_A78 * f29_36; + RHS36 += f29_36 * RHS29; + const double f30 = 1.0 / m_A81; + const double f30_35 = -f30 * m_A110; + RHS35 += f30_35 * RHS30; + const double f30_36 = -f30 * m_A118; + RHS36 += f30_36 * RHS30; + const double f31 = 1.0 / m_A84; + const double f31_33 = -f31 * m_A98; + RHS33 += f31_33 * RHS31; + const double f32 = 1.0 / m_A91; + const double f32_34 = -f32 * m_A105; + m_A106 += m_A92 * f32_34; + m_A107 += m_A93 * f32_34; + RHS34 += f32_34 * RHS32; + const double f32_36 = -f32 * m_A119; + m_A121 += m_A92 * f32_36; + m_A122 += m_A93 * f32_36; + RHS36 += f32_36 * RHS32; + const double f33 = 1.0 / m_A99; + const double f33_36 = -f33 * m_A120; + m_A122 += m_A100 * f33_36; + RHS36 += f33_36 * RHS33; + const double f34 = 1.0 / m_A106; + const double f34_36 = -f34 * m_A121; + m_A122 += m_A107 * f34_36; + RHS36 += f34_36 * RHS34; + V[36] = RHS36 / m_A122; + double tmp35 = 0.0; + tmp35 += m_A112 * V[36]; + V[35] = (RHS35 - tmp35) / m_A111; + double tmp34 = 0.0; + tmp34 += m_A107 * V[36]; + V[34] = (RHS34 - tmp34) / m_A106; + double tmp33 = 0.0; + tmp33 += m_A100 * V[36]; + V[33] = (RHS33 - tmp33) / m_A99; + double tmp32 = 0.0; + tmp32 += m_A92 * V[34]; + tmp32 += m_A93 * V[36]; + V[32] = (RHS32 - tmp32) / m_A91; + double tmp31 = 0.0; + V[31] = (RHS31 - tmp31) / m_A84; + double tmp30 = 0.0; + V[30] = (RHS30 - tmp30) / m_A81; + double tmp29 = 0.0; + tmp29 += m_A77 * V[30]; + tmp29 += m_A78 * V[36]; + V[29] = (RHS29 - tmp29) / m_A76; + double tmp28 = 0.0; + tmp28 += m_A73 * V[33]; + V[28] = (RHS28 - tmp28) / m_A72; + double tmp27 = 0.0; + tmp27 += m_A68 * V[32]; + tmp27 += m_A69 * V[34]; + tmp27 += m_A70 * V[36]; + V[27] = (RHS27 - tmp27) / m_A67; + double tmp26 = 0.0; + tmp26 += m_A63 * V[31]; + V[26] = (RHS26 - tmp26) / m_A62; + double tmp25 = 0.0; + tmp25 += m_A60 * V[34]; + V[25] = (RHS25 - tmp25) / m_A59; + double tmp24 = 0.0; + tmp24 += m_A57 * V[32]; + V[24] = (RHS24 - tmp24) / m_A56; + double tmp23 = 0.0; + V[23] = (RHS23 - tmp23) / m_A54; + double tmp22 = 0.0; + V[22] = (RHS22 - tmp22) / m_A51; + double tmp21 = 0.0; + tmp21 += m_A48 * V[22]; + V[21] = (RHS21 - tmp21) / m_A47; + double tmp20 = 0.0; + tmp20 += m_A44 * V[25]; + V[20] = (RHS20 - tmp20) / m_A43; + double tmp19 = 0.0; + tmp19 += m_A41 * V[30]; + V[19] = (RHS19 - tmp19) / m_A40; + double tmp18 = 0.0; + tmp18 += m_A39 * V[30]; + V[18] = (RHS18 - tmp18) / m_A38; + double tmp17 = 0.0; + tmp17 += m_A37 * V[29]; + V[17] = (RHS17 - tmp17) / m_A36; + double tmp16 = 0.0; + tmp16 += m_A34 * V[27]; + tmp16 += m_A35 * V[36]; + V[16] = (RHS16 - tmp16) / m_A33; + double tmp15 = 0.0; + tmp15 += m_A32 * V[31]; + V[15] = (RHS15 - tmp15) / m_A31; + double tmp14 = 0.0; + tmp14 += m_A30 * V[33]; + V[14] = (RHS14 - tmp14) / m_A29; + double tmp13 = 0.0; + tmp13 += m_A28 * V[26]; + V[13] = (RHS13 - tmp13) / m_A27; + double tmp12 = 0.0; + tmp12 += m_A26 * V[35]; + V[12] = (RHS12 - tmp12) / m_A25; + double tmp11 = 0.0; + tmp11 += m_A24 * V[12]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A22 * V[33]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + tmp9 += m_A20 * V[28]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[23]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[23]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A13 * V[21]; + tmp6 += m_A14 * V[22]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[21]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[25]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[34]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[24]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[32]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[32]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr +static void nl_gcr_13_double_double_3e833834e5ce5aee(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + m_A0 += gt[0]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + m_A2 += gt[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[1]; + double RHS1 = Idr[1]; + RHS1 += Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[2] * *cnV[2]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A8 += gt[6]; + m_A8 += gt[7]; + m_A8 += gt[8]; + m_A9 += go[6]; + m_A7 += go[7]; + m_A6 += go[8]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 += Idr[8]; + m_A12 += gt[9]; + m_A12 += gt[10]; + m_A12 += gt[11]; + m_A10 += go[9]; + m_A11 += go[10]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + RHS4 += Idr[11]; + RHS4 -= go[11] * *cnV[11]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A6; + m_A8 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A8 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A10; + m_A12 += m_A5 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_4 = -f3 * m_A11; + m_A12 += m_A9 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[4]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr +static void nl_gcr_176_double_double_2294220d3c91e762(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[14]; + double RHS4 = Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[16]; + m_A12 += go[17]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A13 += gt[24]; + m_A14 += go[18]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + RHS6 -= go[21] * *cnV[21]; + RHS6 -= go[22] * *cnV[22]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + m_A15 += gt[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A16 += go[25]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A18 += go[28]; + m_A19 += go[29]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A21 += go[30]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 -= go[31] * *cnV[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A23 += go[32]; + double RHS10 = Idr[32]; + RHS10 += Idr[33]; + RHS10 -= go[33] * *cnV[33]; + m_A24 += gt[34]; + m_A24 += gt[35]; + m_A25 += go[34]; + double RHS11 = Idr[34]; + RHS11 += Idr[35]; + RHS11 -= go[35] * *cnV[35]; + m_A26 += gt[36]; + m_A26 += gt[37]; + m_A26 += gt[38]; + m_A26 += gt[39]; + m_A26 += gt[40]; + m_A26 += gt[41]; + m_A26 += gt[42]; + m_A27 += go[36]; + double RHS12 = Idr[36]; + RHS12 += Idr[37]; + RHS12 += Idr[38]; + RHS12 += Idr[39]; + RHS12 += Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 -= go[37] * *cnV[37]; + RHS12 -= go[38] * *cnV[38]; + RHS12 -= go[39] * *cnV[39]; + RHS12 -= go[40] * *cnV[40]; + RHS12 -= go[41] * *cnV[41]; + RHS12 -= go[42] * *cnV[42]; + m_A28 += gt[43]; + m_A28 += gt[44]; + m_A29 += go[43]; + double RHS13 = Idr[43]; + RHS13 += Idr[44]; + RHS13 -= go[44] * *cnV[44]; + m_A30 += gt[45]; + m_A30 += gt[46]; + m_A30 += gt[47]; + m_A30 += gt[48]; + m_A30 += gt[49]; + m_A30 += gt[50]; + m_A30 += gt[51]; + m_A31 += go[45]; + double RHS14 = Idr[45]; + RHS14 += Idr[46]; + RHS14 += Idr[47]; + RHS14 += Idr[48]; + RHS14 += Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 -= go[46] * *cnV[46]; + RHS14 -= go[47] * *cnV[47]; + RHS14 -= go[48] * *cnV[48]; + RHS14 -= go[49] * *cnV[49]; + RHS14 -= go[50] * *cnV[50]; + RHS14 -= go[51] * *cnV[51]; + m_A32 += gt[52]; + m_A32 += gt[53]; + m_A33 += go[52]; + double RHS15 = Idr[52]; + RHS15 += Idr[53]; + RHS15 -= go[53] * *cnV[53]; + m_A34 += gt[54]; + m_A34 += gt[55]; + m_A34 += gt[56]; + m_A34 += gt[57]; + m_A36 += go[54]; + m_A35 += go[55]; + double RHS16 = Idr[54]; + RHS16 += Idr[55]; + RHS16 += Idr[56]; + RHS16 += Idr[57]; + RHS16 -= go[56] * *cnV[56]; + RHS16 -= go[57] * *cnV[57]; + m_A37 += gt[58]; + m_A37 += gt[59]; + m_A37 += gt[60]; + m_A38 += go[58]; + double RHS17 = Idr[58]; + RHS17 += Idr[59]; + RHS17 += Idr[60]; + RHS17 -= go[59] * *cnV[59]; + RHS17 -= go[60] * *cnV[60]; + m_A39 += gt[61]; + m_A39 += gt[62]; + m_A39 += gt[63]; + m_A39 += gt[64]; + m_A40 += go[61]; + m_A41 += go[62]; + double RHS18 = Idr[61]; + RHS18 += Idr[62]; + RHS18 += Idr[63]; + RHS18 += Idr[64]; + RHS18 -= go[63] * *cnV[63]; + RHS18 -= go[64] * *cnV[64]; + m_A42 += gt[65]; + m_A42 += gt[66]; + m_A43 += go[65]; + m_A44 += go[66]; + double RHS19 = Idr[65]; + RHS19 += Idr[66]; + m_A45 += gt[67]; + m_A45 += gt[68]; + m_A45 += gt[69]; + m_A46 += go[67]; + double RHS20 = Idr[67]; + RHS20 += Idr[68]; + RHS20 += Idr[69]; + RHS20 -= go[68] * *cnV[68]; + RHS20 -= go[69] * *cnV[69]; + m_A48 += gt[70]; + m_A48 += gt[71]; + m_A47 += go[70]; + double RHS21 = Idr[70]; + RHS21 += Idr[71]; + RHS21 -= go[71] * *cnV[71]; + m_A49 += gt[72]; + m_A49 += gt[73]; + m_A50 += go[72]; + m_A51 += go[73]; + double RHS22 = Idr[72]; + RHS22 += Idr[73]; + m_A53 += gt[74]; + m_A53 += gt[75]; + m_A52 += go[74]; + double RHS23 = Idr[74]; + RHS23 += Idr[75]; + RHS23 -= go[75] * *cnV[75]; + m_A55 += gt[76]; + m_A55 += gt[77]; + m_A55 += gt[78]; + m_A55 += gt[79]; + m_A54 += go[76]; + m_A56 += go[77]; + double RHS24 = Idr[76]; + RHS24 += Idr[77]; + RHS24 += Idr[78]; + RHS24 += Idr[79]; + RHS24 -= go[78] * *cnV[78]; + RHS24 -= go[79] * *cnV[79]; + m_A58 += gt[80]; + m_A58 += gt[81]; + m_A58 += gt[82]; + m_A58 += gt[83]; + m_A58 += gt[84]; + m_A57 += go[80]; + m_A60 += go[81]; + m_A61 += go[82]; + m_A59 += go[83]; + double RHS25 = Idr[80]; + RHS25 += Idr[81]; + RHS25 += Idr[82]; + RHS25 += Idr[83]; + RHS25 += Idr[84]; + RHS25 -= go[84] * *cnV[84]; + m_A63 += gt[85]; + m_A63 += gt[86]; + m_A65 += go[85]; + m_A62 += go[86]; + double RHS26 = Idr[85]; + RHS26 += Idr[86]; + m_A67 += gt[87]; + m_A67 += gt[88]; + m_A67 += gt[89]; + m_A67 += gt[90]; + m_A66 += go[87]; + m_A68 += go[88]; + double RHS27 = Idr[87]; + RHS27 += Idr[88]; + RHS27 += Idr[89]; + RHS27 += Idr[90]; + RHS27 -= go[89] * *cnV[89]; + RHS27 -= go[90] * *cnV[90]; + m_A70 += gt[91]; + m_A70 += gt[92]; + m_A70 += gt[93]; + m_A70 += gt[94]; + m_A69 += go[91]; + m_A71 += go[92]; + double RHS28 = Idr[91]; + RHS28 += Idr[92]; + RHS28 += Idr[93]; + RHS28 += Idr[94]; + RHS28 -= go[93] * *cnV[93]; + RHS28 -= go[94] * *cnV[94]; + m_A74 += gt[95]; + m_A74 += gt[96]; + m_A73 += go[95]; + m_A75 += go[96]; + double RHS29 = Idr[95]; + RHS29 += Idr[96]; + m_A79 += gt[97]; + m_A79 += gt[98]; + m_A79 += gt[99]; + m_A79 += gt[100]; + m_A78 += go[97]; + m_A77 += go[98]; + m_A80 += go[99]; + m_A76 += go[100]; + double RHS30 = Idr[97]; + RHS30 += Idr[98]; + RHS30 += Idr[99]; + RHS30 += Idr[100]; + m_A84 += gt[101]; + m_A84 += gt[102]; + m_A83 += go[101]; + m_A82 += go[102]; + double RHS31 = Idr[101]; + RHS31 += Idr[102]; + m_A89 += gt[103]; + m_A89 += gt[104]; + m_A87 += go[103]; + m_A86 += go[104]; + double RHS32 = Idr[103]; + RHS32 += Idr[104]; + m_A91 += gt[105]; + m_A91 += gt[106]; + m_A90 += go[105]; + m_A93 += go[106]; + double RHS33 = Idr[105]; + RHS33 += Idr[106]; + m_A95 += gt[107]; + m_A95 += gt[108]; + m_A95 += gt[109]; + m_A95 += gt[110]; + m_A94 += go[107]; + m_A96 += go[108]; + double RHS34 = Idr[107]; + RHS34 += Idr[108]; + RHS34 += Idr[109]; + RHS34 += Idr[110]; + RHS34 -= go[109] * *cnV[109]; + RHS34 -= go[110] * *cnV[110]; + m_A99 += gt[111]; + m_A99 += gt[112]; + m_A97 += go[111]; + m_A101 += go[112]; + double RHS35 = Idr[111]; + RHS35 += Idr[112]; + m_A106 += gt[113]; + m_A106 += gt[114]; + m_A106 += gt[115]; + m_A106 += gt[116]; + m_A106 += gt[117]; + m_A106 += gt[118]; + m_A102 += go[113]; + m_A104 += go[114]; + m_A103 += go[115]; + m_A108 += go[116]; + double RHS36 = Idr[113]; + RHS36 += Idr[114]; + RHS36 += Idr[115]; + RHS36 += Idr[116]; + RHS36 += Idr[117]; + RHS36 += Idr[118]; + RHS36 -= go[117] * *cnV[117]; + RHS36 -= go[118] * *cnV[118]; + m_A113 += gt[119]; + m_A113 += gt[120]; + m_A113 += gt[121]; + m_A113 += gt[122]; + m_A113 += gt[123]; + m_A115 += go[119]; + m_A111 += go[120]; + m_A112 += go[121]; + m_A110 += go[122]; + m_A109 += go[123]; + double RHS37 = Idr[119]; + RHS37 += Idr[120]; + RHS37 += Idr[121]; + RHS37 += Idr[122]; + RHS37 += Idr[123]; + m_A124 += gt[124]; + m_A124 += gt[125]; + m_A124 += gt[126]; + m_A124 += gt[127]; + m_A124 += gt[128]; + m_A124 += gt[129]; + m_A119 += go[124]; + m_A118 += go[125]; + m_A121 += go[126]; + m_A120 += go[127]; + m_A117 += go[128]; + m_A116 += go[129]; + double RHS38 = Idr[124]; + RHS38 += Idr[125]; + RHS38 += Idr[126]; + RHS38 += Idr[127]; + RHS38 += Idr[128]; + RHS38 += Idr[129]; + m_A137 += gt[130]; + m_A137 += gt[131]; + m_A137 += gt[132]; + m_A137 += gt[133]; + m_A137 += gt[134]; + m_A137 += gt[135]; + m_A137 += gt[136]; + m_A137 += gt[137]; + m_A135 += go[130]; + m_A129 += go[131]; + m_A134 += go[132]; + m_A132 += go[133]; + m_A128 += go[134]; + m_A127 += go[135]; + m_A130 += go[136]; + m_A131 += go[137]; + double RHS39 = Idr[130]; + RHS39 += Idr[131]; + RHS39 += Idr[132]; + RHS39 += Idr[133]; + RHS39 += Idr[134]; + RHS39 += Idr[135]; + RHS39 += Idr[136]; + RHS39 += Idr[137]; + m_A147 += gt[138]; + m_A147 += gt[139]; + m_A147 += gt[140]; + m_A147 += gt[141]; + m_A147 += gt[142]; + m_A147 += gt[143]; + m_A140 += go[138]; + m_A141 += go[139]; + m_A150 += go[140]; + m_A142 += go[141]; + double RHS40 = Idr[138]; + RHS40 += Idr[139]; + RHS40 += Idr[140]; + RHS40 += Idr[141]; + RHS40 += Idr[142]; + RHS40 += Idr[143]; + RHS40 -= go[142] * *cnV[142]; + RHS40 -= go[143] * *cnV[143]; + m_A158 += gt[144]; + m_A158 += gt[145]; + m_A158 += gt[146]; + m_A158 += gt[147]; + m_A158 += gt[148]; + m_A158 += gt[149]; + m_A151 += go[144]; + m_A152 += go[145]; + m_A154 += go[146]; + m_A156 += go[147]; + double RHS41 = Idr[144]; + RHS41 += Idr[145]; + RHS41 += Idr[146]; + RHS41 += Idr[147]; + RHS41 += Idr[148]; + RHS41 += Idr[149]; + RHS41 -= go[148] * *cnV[148]; + RHS41 -= go[149] * *cnV[149]; + m_A166 += gt[150]; + m_A166 += gt[151]; + m_A166 += gt[152]; + m_A166 += gt[153]; + m_A161 += go[150]; + m_A162 += go[151]; + double RHS42 = Idr[150]; + RHS42 += Idr[151]; + RHS42 += Idr[152]; + RHS42 += Idr[153]; + RHS42 -= go[152] * *cnV[152]; + RHS42 -= go[153] * *cnV[153]; + m_A175 += gt[154]; + m_A175 += gt[155]; + m_A175 += gt[156]; + m_A175 += gt[157]; + m_A175 += gt[158]; + m_A172 += go[154]; + m_A170 += go[155]; + m_A169 += go[156]; + m_A168 += go[157]; + m_A171 += go[158]; + double RHS43 = Idr[154]; + RHS43 += Idr[155]; + RHS43 += Idr[156]; + RHS43 += Idr[157]; + RHS43 += Idr[158]; + const double f0 = 1.0 / m_A0; + const double f0_21 = -f0 * m_A47; + m_A48 += m_A1 * f0_21; + RHS21 += f0_21 * RHS0; + const double f0_37 = -f0 * m_A109; + m_A111 += m_A1 * f0_37; + RHS37 += f0_37 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_24 = -f1 * m_A54; + m_A56 += m_A3 * f1_24; + RHS24 += f1_24 * RHS1; + const double f1_37 = -f1 * m_A110; + m_A113 += m_A3 * f1_37; + RHS37 += f1_37 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_41 = -f2 * m_A151; + m_A153 += m_A5 * f2_41; + RHS41 += f2_41 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_25 = -f3 * m_A57; + m_A58 += m_A7 * f3_25; + RHS25 += f3_25 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_23 = -f4 * m_A52; + m_A53 += m_A9 * f4_23; + RHS23 += f4_23 * RHS4; + const double f4_43 = -f4 * m_A168; + m_A170 += m_A9 * f4_43; + RHS43 += f4_43 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_26 = -f5 * m_A62; + m_A63 += m_A11 * f5_26; + m_A64 += m_A12 * f5_26; + RHS26 += f5_26 * RHS5; + const double f5_41 = -f5 * m_A152; + m_A155 += m_A11 * f5_41; + m_A158 += m_A12 * f5_41; + RHS41 += f5_41 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_40 = -f6 * m_A140; + m_A143 += m_A14 * f6_40; + RHS40 += f6_40 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_27 = -f7 * m_A66; + m_A68 += m_A16 * f7_27; + RHS27 += f7_27 * RHS7; + const double f7_43 = -f7 * m_A169; + m_A175 += m_A16 * f7_43; + RHS43 += f7_43 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_30 = -f8 * m_A76; + m_A79 += m_A18 * f8_30; + m_A81 += m_A19 * f8_30; + RHS30 += f8_30 * RHS8; + const double f8_40 = -f8 * m_A141; + m_A144 += m_A18 * f8_40; + m_A147 += m_A19 * f8_40; + RHS40 += f8_40 * RHS8; + const double f9 = 1.0 / m_A20; + const double f9_29 = -f9 * m_A73; + m_A74 += m_A21 * f9_29; + RHS29 += f9_29 * RHS9; + const double f10 = 1.0 / m_A22; + const double f10_30 = -f10 * m_A77; + m_A79 += m_A23 * f10_30; + RHS30 += f10_30 * RHS10; + const double f11 = 1.0 / m_A24; + const double f11_30 = -f11 * m_A78; + m_A79 += m_A25 * f11_30; + RHS30 += f11_30 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_36 = -f12 * m_A102; + m_A105 += m_A27 * f12_36; + RHS36 += f12_36 * RHS12; + const double f13 = 1.0 / m_A28; + const double f13_31 = -f13 * m_A82; + m_A84 += m_A29 * f13_31; + RHS31 += f13_31 * RHS13; + const double f13_39 = -f13 * m_A127; + m_A132 += m_A29 * f13_39; + RHS39 += f13_39 * RHS13; + const double f14 = 1.0 / m_A30; + const double f14_28 = -f14 * m_A69; + m_A72 += m_A31 * f14_28; + RHS28 += f14_28 * RHS14; + const double f15 = 1.0 / m_A32; + const double f15_32 = -f15 * m_A86; + m_A89 += m_A33 * f15_32; + RHS32 += f15_32 * RHS15; + const double f15_38 = -f15 * m_A116; + m_A120 += m_A33 * f15_38; + RHS38 += f15_38 * RHS15; + const double f16 = 1.0 / m_A34; + const double f16_31 = -f16 * m_A83; + m_A84 += m_A35 * f16_31; + m_A85 += m_A36 * f16_31; + RHS31 += f16_31 * RHS16; + const double f16_32 = -f16 * m_A87; + m_A88 += m_A35 * f16_32; + m_A89 += m_A36 * f16_32; + RHS32 += f16_32 * RHS16; + const double f17 = 1.0 / m_A37; + const double f17_34 = -f17 * m_A94; + m_A96 += m_A38 * f17_34; + RHS34 += f17_34 * RHS17; + const double f17_39 = -f17 * m_A128; + m_A137 += m_A38 * f17_39; + RHS39 += f17_39 * RHS17; + const double f18 = 1.0 / m_A39; + const double f18_33 = -f18 * m_A90; + m_A91 += m_A40 * f18_33; + m_A92 += m_A41 * f18_33; + RHS33 += f18_33 * RHS18; + const double f18_35 = -f18 * m_A97; + m_A98 += m_A40 * f18_35; + m_A99 += m_A41 * f18_35; + RHS35 += f18_35 * RHS18; + const double f19 = 1.0 / m_A42; + const double f19_36 = -f19 * m_A103; + m_A106 += m_A43 * f19_36; + m_A108 += m_A44 * f19_36; + RHS36 += f19_36 * RHS19; + const double f19_39 = -f19 * m_A129; + m_A135 += m_A43 * f19_39; + m_A137 += m_A44 * f19_39; + RHS39 += f19_39 * RHS19; + const double f20 = 1.0 / m_A45; + const double f20_38 = -f20 * m_A117; + m_A124 += m_A46 * f20_38; + RHS38 += f20_38 * RHS20; + const double f20_42 = -f20 * m_A161; + m_A162 += m_A46 * f20_42; + RHS42 += f20_42 * RHS20; + const double f21 = 1.0 / m_A48; + const double f21_37 = -f21 * m_A111; + RHS37 += f21_37 * RHS21; + const double f22 = 1.0 / m_A49; + const double f22_36 = -f22 * m_A104; + m_A106 += m_A50 * f22_36; + m_A107 += m_A51 * f22_36; + RHS36 += f22_36 * RHS22; + const double f22_38 = -f22 * m_A118; + m_A123 += m_A50 * f22_38; + m_A124 += m_A51 * f22_38; + RHS38 += f22_38 * RHS22; + const double f23 = 1.0 / m_A53; + const double f23_43 = -f23 * m_A170; + RHS43 += f23_43 * RHS23; + const double f24 = 1.0 / m_A55; + const double f24_41 = -f24 * m_A153; + m_A156 += m_A56 * f24_41; + RHS41 += f24_41 * RHS24; + const double f25 = 1.0 / m_A58; + const double f25_37 = -f25 * m_A112; + m_A113 += m_A59 * f25_37; + m_A114 += m_A60 * f25_37; + m_A115 += m_A61 * f25_37; + RHS37 += f25_37 * RHS25; + const double f25_40 = -f25 * m_A142; + m_A145 += m_A59 * f25_40; + m_A147 += m_A60 * f25_40; + m_A148 += m_A61 * f25_40; + RHS40 += f25_40 * RHS25; + const double f25_41 = -f25 * m_A154; + m_A156 += m_A59 * f25_41; + m_A157 += m_A60 * f25_41; + m_A158 += m_A61 * f25_41; + RHS41 += f25_41 * RHS25; + const double f26 = 1.0 / m_A63; + const double f26_41 = -f26 * m_A155; + m_A158 += m_A64 * f26_41; + m_A160 += m_A65 * f26_41; + RHS41 += f26_41 * RHS26; + const double f26_43 = -f26 * m_A171; + m_A173 += m_A64 * f26_43; + m_A175 += m_A65 * f26_43; + RHS43 += f26_43 * RHS26; + const double f27 = 1.0 / m_A67; + const double f27_40 = -f27 * m_A143; + m_A150 += m_A68 * f27_40; + RHS40 += f27_40 * RHS27; + const double f28 = 1.0 / m_A70; + const double f28_38 = -f28 * m_A119; + m_A124 += m_A71 * f28_38; + m_A126 += m_A72 * f28_38; + RHS38 += f28_38 * RHS28; + const double f29 = 1.0 / m_A74; + const double f29_39 = -f29 * m_A130; + m_A137 += m_A75 * f29_39; + RHS39 += f29_39 * RHS29; + const double f30 = 1.0 / m_A79; + const double f30_39 = -f30 * m_A131; + m_A137 += m_A80 * f30_39; + m_A138 += m_A81 * f30_39; + RHS39 += f30_39 * RHS30; + const double f30_40 = -f30 * m_A144; + m_A146 += m_A80 * f30_40; + m_A147 += m_A81 * f30_40; + RHS40 += f30_40 * RHS30; + const double f31 = 1.0 / m_A84; + const double f31_32 = -f31 * m_A88; + m_A89 += m_A85 * f31_32; + RHS32 += f31_32 * RHS31; + const double f31_39 = -f31 * m_A132; + m_A133 += m_A85 * f31_39; + RHS39 += f31_39 * RHS31; + const double f32 = 1.0 / m_A89; + const double f32_38 = -f32 * m_A120; + RHS38 += f32_38 * RHS32; + const double f32_39 = -f32 * m_A133; + RHS39 += f32_39 * RHS32; + const double f33 = 1.0 / m_A91; + const double f33_35 = -f33 * m_A98; + m_A99 += m_A92 * f33_35; + m_A100 += m_A93 * f33_35; + RHS35 += f33_35 * RHS33; + const double f33_38 = -f33 * m_A121; + m_A122 += m_A92 * f33_38; + m_A124 += m_A93 * f33_38; + RHS38 += f33_38 * RHS33; + const double f34 = 1.0 / m_A95; + const double f34_36 = -f34 * m_A105; + m_A108 += m_A96 * f34_36; + RHS36 += f34_36 * RHS34; + const double f35 = 1.0 / m_A99; + const double f35_38 = -f35 * m_A122; + m_A124 += m_A100 * f35_38; + m_A125 += m_A101 * f35_38; + RHS38 += f35_38 * RHS35; + const double f35_39 = -f35 * m_A134; + m_A136 += m_A100 * f35_39; + m_A137 += m_A101 * f35_39; + RHS39 += f35_39 * RHS35; + const double f36 = 1.0 / m_A106; + const double f36_38 = -f36 * m_A123; + m_A124 += m_A107 * f36_38; + m_A125 += m_A108 * f36_38; + RHS38 += f36_38 * RHS36; + const double f36_39 = -f36 * m_A135; + m_A136 += m_A107 * f36_39; + m_A137 += m_A108 * f36_39; + RHS39 += f36_39 * RHS36; + const double f37 = 1.0 / m_A113; + const double f37_40 = -f37 * m_A145; + m_A147 += m_A114 * f37_40; + m_A148 += m_A115 * f37_40; + RHS40 += f37_40 * RHS37; + const double f37_41 = -f37 * m_A156; + m_A157 += m_A114 * f37_41; + m_A158 += m_A115 * f37_41; + RHS41 += f37_41 * RHS37; + const double f38 = 1.0 / m_A124; + const double f38_39 = -f38 * m_A136; + m_A137 += m_A125 * f38_39; + m_A139 += m_A126 * f38_39; + RHS39 += f38_39 * RHS38; + const double f38_42 = -f38 * m_A162; + m_A163 += m_A125 * f38_42; + m_A166 += m_A126 * f38_42; + RHS42 += f38_42 * RHS38; + const double f39 = 1.0 / m_A137; + const double f39_40 = -f39 * m_A146; + m_A147 += m_A138 * f39_40; + m_A149 += m_A139 * f39_40; + RHS40 += f39_40 * RHS39; + const double f39_42 = -f39 * m_A163; + m_A164 += m_A138 * f39_42; + m_A166 += m_A139 * f39_42; + RHS42 += f39_42 * RHS39; + const double f40 = 1.0 / m_A147; + const double f40_41 = -f40 * m_A157; + m_A158 += m_A148 * f40_41; + m_A159 += m_A149 * f40_41; + m_A160 += m_A150 * f40_41; + RHS41 += f40_41 * RHS40; + const double f40_42 = -f40 * m_A164; + m_A165 += m_A148 * f40_42; + m_A166 += m_A149 * f40_42; + m_A167 += m_A150 * f40_42; + RHS42 += f40_42 * RHS40; + const double f40_43 = -f40 * m_A172; + m_A173 += m_A148 * f40_43; + m_A174 += m_A149 * f40_43; + m_A175 += m_A150 * f40_43; + RHS43 += f40_43 * RHS40; + const double f41 = 1.0 / m_A158; + const double f41_42 = -f41 * m_A165; + m_A166 += m_A159 * f41_42; + m_A167 += m_A160 * f41_42; + RHS42 += f41_42 * RHS41; + const double f41_43 = -f41 * m_A173; + m_A174 += m_A159 * f41_43; + m_A175 += m_A160 * f41_43; + RHS43 += f41_43 * RHS41; + const double f42 = 1.0 / m_A166; + const double f42_43 = -f42 * m_A174; + m_A175 += m_A167 * f42_43; + RHS43 += f42_43 * RHS42; + V[43] = RHS43 / m_A175; + double tmp42 = 0.0; + tmp42 += m_A167 * V[43]; + V[42] = (RHS42 - tmp42) / m_A166; + double tmp41 = 0.0; + tmp41 += m_A159 * V[42]; + tmp41 += m_A160 * V[43]; + V[41] = (RHS41 - tmp41) / m_A158; + double tmp40 = 0.0; + tmp40 += m_A148 * V[41]; + tmp40 += m_A149 * V[42]; + tmp40 += m_A150 * V[43]; + V[40] = (RHS40 - tmp40) / m_A147; + double tmp39 = 0.0; + tmp39 += m_A138 * V[40]; + tmp39 += m_A139 * V[42]; + V[39] = (RHS39 - tmp39) / m_A137; + double tmp38 = 0.0; + tmp38 += m_A125 * V[39]; + tmp38 += m_A126 * V[42]; + V[38] = (RHS38 - tmp38) / m_A124; + double tmp37 = 0.0; + tmp37 += m_A114 * V[40]; + tmp37 += m_A115 * V[41]; + V[37] = (RHS37 - tmp37) / m_A113; + double tmp36 = 0.0; + tmp36 += m_A107 * V[38]; + tmp36 += m_A108 * V[39]; + V[36] = (RHS36 - tmp36) / m_A106; + double tmp35 = 0.0; + tmp35 += m_A100 * V[38]; + tmp35 += m_A101 * V[39]; + V[35] = (RHS35 - tmp35) / m_A99; + double tmp34 = 0.0; + tmp34 += m_A96 * V[39]; + V[34] = (RHS34 - tmp34) / m_A95; + double tmp33 = 0.0; + tmp33 += m_A92 * V[35]; + tmp33 += m_A93 * V[38]; + V[33] = (RHS33 - tmp33) / m_A91; + double tmp32 = 0.0; + V[32] = (RHS32 - tmp32) / m_A89; + double tmp31 = 0.0; + tmp31 += m_A85 * V[32]; + V[31] = (RHS31 - tmp31) / m_A84; + double tmp30 = 0.0; + tmp30 += m_A80 * V[39]; + tmp30 += m_A81 * V[40]; + V[30] = (RHS30 - tmp30) / m_A79; + double tmp29 = 0.0; + tmp29 += m_A75 * V[39]; + V[29] = (RHS29 - tmp29) / m_A74; + double tmp28 = 0.0; + tmp28 += m_A71 * V[38]; + tmp28 += m_A72 * V[42]; + V[28] = (RHS28 - tmp28) / m_A70; + double tmp27 = 0.0; + tmp27 += m_A68 * V[43]; + V[27] = (RHS27 - tmp27) / m_A67; + double tmp26 = 0.0; + tmp26 += m_A64 * V[41]; + tmp26 += m_A65 * V[43]; + V[26] = (RHS26 - tmp26) / m_A63; + double tmp25 = 0.0; + tmp25 += m_A59 * V[37]; + tmp25 += m_A60 * V[40]; + tmp25 += m_A61 * V[41]; + V[25] = (RHS25 - tmp25) / m_A58; + double tmp24 = 0.0; + tmp24 += m_A56 * V[37]; + V[24] = (RHS24 - tmp24) / m_A55; + double tmp23 = 0.0; + V[23] = (RHS23 - tmp23) / m_A53; + double tmp22 = 0.0; + tmp22 += m_A50 * V[36]; + tmp22 += m_A51 * V[38]; + V[22] = (RHS22 - tmp22) / m_A49; + double tmp21 = 0.0; + V[21] = (RHS21 - tmp21) / m_A48; + double tmp20 = 0.0; + tmp20 += m_A46 * V[38]; + V[20] = (RHS20 - tmp20) / m_A45; + double tmp19 = 0.0; + tmp19 += m_A43 * V[36]; + tmp19 += m_A44 * V[39]; + V[19] = (RHS19 - tmp19) / m_A42; + double tmp18 = 0.0; + tmp18 += m_A40 * V[33]; + tmp18 += m_A41 * V[35]; + V[18] = (RHS18 - tmp18) / m_A39; + double tmp17 = 0.0; + tmp17 += m_A38 * V[39]; + V[17] = (RHS17 - tmp17) / m_A37; + double tmp16 = 0.0; + tmp16 += m_A35 * V[31]; + tmp16 += m_A36 * V[32]; + V[16] = (RHS16 - tmp16) / m_A34; + double tmp15 = 0.0; + tmp15 += m_A33 * V[32]; + V[15] = (RHS15 - tmp15) / m_A32; + double tmp14 = 0.0; + tmp14 += m_A31 * V[42]; + V[14] = (RHS14 - tmp14) / m_A30; + double tmp13 = 0.0; + tmp13 += m_A29 * V[31]; + V[13] = (RHS13 - tmp13) / m_A28; + double tmp12 = 0.0; + tmp12 += m_A27 * V[34]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A25 * V[30]; + V[11] = (RHS11 - tmp11) / m_A24; + double tmp10 = 0.0; + tmp10 += m_A23 * V[30]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + tmp9 += m_A21 * V[29]; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A18 * V[30]; + tmp8 += m_A19 * V[40]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[43]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[27]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[26]; + tmp5 += m_A12 * V[41]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[23]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[25]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[24]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[37]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[21]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr,280zzzap +static void nl_gcr_57_double_double_bb501e6a23177009(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A7 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A9 += go[15]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A11 += go[22]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A14 += go[24]; + m_A13 += go[25]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A16 += go[26]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + RHS7 -= go[27] * *cnV[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A18 += go[28]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 -= go[29] * *cnV[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A19 += go[30]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 -= go[31] * *cnV[31]; + RHS9 -= go[32] * *cnV[32]; + RHS9 -= go[33] * *cnV[33]; + m_A24 += gt[34]; + m_A24 += gt[35]; + m_A23 += go[34]; + m_A22 += go[35]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + m_A27 += gt[36]; + m_A27 += gt[37]; + m_A27 += gt[38]; + m_A27 += gt[39]; + m_A26 += go[36]; + m_A28 += go[37]; + double RHS11 = Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + m_A31 += gt[40]; + m_A31 += gt[41]; + m_A31 += gt[42]; + m_A31 += gt[43]; + m_A31 += gt[44]; + m_A31 += gt[45]; + m_A29 += go[40]; + m_A33 += go[41]; + m_A32 += go[42]; + double RHS12 = Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + RHS12 += Idr[45]; + RHS12 -= go[43] * *cnV[43]; + RHS12 -= go[44] * *cnV[44]; + RHS12 -= go[45] * *cnV[45]; + m_A36 += gt[46]; + m_A36 += gt[47]; + m_A34 += go[46]; + double RHS13 = Idr[46]; + RHS13 += Idr[47]; + RHS13 -= go[47] * *cnV[47]; + m_A39 += gt[48]; + m_A39 += gt[49]; + m_A39 += gt[50]; + m_A38 += go[48]; + m_A37 += go[49]; + double RHS14 = Idr[48]; + RHS14 += Idr[49]; + RHS14 += Idr[50]; + RHS14 -= go[50] * *cnV[50]; + m_A41 += gt[51]; + m_A41 += gt[52]; + m_A41 += gt[53]; + m_A41 += gt[54]; + m_A40 += go[51]; + m_A42 += go[52]; + double RHS15 = Idr[51]; + RHS15 += Idr[52]; + RHS15 += Idr[53]; + RHS15 += Idr[54]; + RHS15 -= go[53] * *cnV[53]; + RHS15 -= go[54] * *cnV[54]; + m_A49 += gt[55]; + m_A49 += gt[56]; + m_A49 += gt[57]; + m_A49 += gt[58]; + m_A49 += gt[59]; + m_A44 += go[55]; + m_A47 += go[56]; + m_A46 += go[57]; + m_A43 += go[58]; + m_A45 += go[59]; + double RHS16 = Idr[55]; + RHS16 += Idr[56]; + RHS16 += Idr[57]; + RHS16 += Idr[58]; + RHS16 += Idr[59]; + m_A56 += gt[60]; + m_A56 += gt[61]; + m_A56 += gt[62]; + m_A56 += gt[63]; + m_A54 += go[60]; + m_A53 += go[61]; + m_A51 += go[62]; + m_A52 += go[63]; + double RHS17 = Idr[60]; + RHS17 += Idr[61]; + RHS17 += Idr[62]; + RHS17 += Idr[63]; + const double f0 = 1.0 / m_A0; + const double f0_11 = -f0 * m_A26; + m_A28 += m_A1 * f0_11; + RHS11 += f0_11 * RHS0; + const double f0_16 = -f0 * m_A43; + m_A49 += m_A1 * f0_16; + RHS16 += f0_16 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_16 = -f1 * m_A44; + m_A49 += m_A3 * f1_16; + RHS16 += f1_16 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_12 = -f2 * m_A29; + m_A30 += m_A5 * f2_12; + RHS12 += f2_12 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_15 = -f3 * m_A40; + m_A42 += m_A7 * f3_15; + RHS15 += f3_15 * RHS3; + const double f3_17 = -f3 * m_A51; + m_A56 += m_A7 * f3_17; + RHS17 += f3_17 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_9 = -f4 * m_A19; + m_A21 += m_A9 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_10 = -f5 * m_A22; + m_A24 += m_A11 * f5_10; + RHS10 += f5_10 * RHS5; + const double f5_16 = -f5 * m_A45; + m_A46 += m_A11 * f5_16; + RHS16 += f5_16 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_10 = -f6 * m_A23; + m_A24 += m_A13 * f6_10; + m_A25 += m_A14 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_13 = -f6 * m_A34; + m_A35 += m_A13 * f6_13; + m_A36 += m_A14 * f6_13; + RHS13 += f6_13 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_14 = -f7 * m_A37; + m_A39 += m_A16 * f7_14; + RHS14 += f7_14 * RHS7; + const double f7_17 = -f7 * m_A52; + m_A54 += m_A16 * f7_17; + RHS17 += f7_17 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_14 = -f8 * m_A38; + m_A39 += m_A18 * f8_14; + RHS14 += f8_14 * RHS8; + const double f10 = 1.0 / m_A24; + const double f10_13 = -f10 * m_A35; + m_A36 += m_A25 * f10_13; + RHS13 += f10_13 * RHS10; + const double f10_16 = -f10 * m_A46; + m_A48 += m_A25 * f10_16; + RHS16 += f10_16 * RHS10; + const double f11 = 1.0 / m_A27; + const double f11_12 = -f11 * m_A30; + m_A32 += m_A28 * f11_12; + RHS12 += f11_12 * RHS11; + const double f12 = 1.0 / m_A31; + const double f12_16 = -f12 * m_A47; + m_A49 += m_A32 * f12_16; + m_A50 += m_A33 * f12_16; + RHS16 += f12_16 * RHS12; + const double f12_17 = -f12 * m_A53; + m_A55 += m_A32 * f12_17; + m_A56 += m_A33 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A36; + const double f13_16 = -f13 * m_A48; + RHS16 += f13_16 * RHS13; + const double f14 = 1.0 / m_A39; + const double f14_17 = -f14 * m_A54; + RHS17 += f14_17 * RHS14; + const double f16 = 1.0 / m_A49; + const double f16_17 = -f16 * m_A55; + m_A56 += m_A50 * f16_17; + RHS17 += f16_17 * RHS16; + V[17] = RHS17 / m_A56; + double tmp16 = 0.0; + tmp16 += m_A50 * V[17]; + V[16] = (RHS16 - tmp16) / m_A49; + double tmp15 = 0.0; + tmp15 += m_A42 * V[17]; + V[15] = (RHS15 - tmp15) / m_A41; + double tmp14 = 0.0; + V[14] = (RHS14 - tmp14) / m_A39; + double tmp13 = 0.0; + V[13] = (RHS13 - tmp13) / m_A36; + double tmp12 = 0.0; + tmp12 += m_A32 * V[16]; + tmp12 += m_A33 * V[17]; + V[12] = (RHS12 - tmp12) / m_A31; + double tmp11 = 0.0; + tmp11 += m_A28 * V[16]; + V[11] = (RHS11 - tmp11) / m_A27; + double tmp10 = 0.0; + tmp10 += m_A25 * V[13]; + V[10] = (RHS10 - tmp10) / m_A24; + double tmp9 = 0.0; + tmp9 += m_A21 * V[15]; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A18 * V[14]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[14]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A13 * V[10]; + tmp6 += m_A14 * V[13]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[10]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[15]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[17]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[16]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[16]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sspeedr +static void nl_gcr_95_double_double_4a8e2b707bbac8a6(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A5 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A6 += gt[17]; + m_A6 += gt[18]; + m_A6 += gt[19]; + m_A7 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A9 += go[20]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[21] * *cnV[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A11 += go[22]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A12 += gt[26]; + m_A12 += gt[27]; + m_A13 += go[24]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + m_A14 += gt[28]; + m_A14 += gt[29]; + m_A14 += gt[30]; + m_A14 += gt[31]; + m_A15 += go[28]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 += Idr[31]; + RHS7 -= go[29] * *cnV[29]; + RHS7 -= go[30] * *cnV[30]; + RHS7 -= go[31] * *cnV[31]; + m_A16 += gt[32]; + m_A16 += gt[33]; + m_A17 += go[32]; + double RHS8 = Idr[32]; + RHS8 += Idr[33]; + RHS8 -= go[33] * *cnV[33]; + m_A18 += gt[34]; + m_A18 += gt[35]; + m_A18 += gt[36]; + m_A18 += gt[37]; + m_A19 += go[34]; + double RHS9 = Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 -= go[35] * *cnV[35]; + RHS9 -= go[36] * *cnV[36]; + RHS9 -= go[37] * *cnV[37]; + m_A20 += gt[38]; + m_A20 += gt[39]; + m_A22 += go[38]; + m_A21 += go[39]; + double RHS10 = Idr[38]; + RHS10 += Idr[39]; + m_A23 += gt[40]; + m_A23 += gt[41]; + m_A23 += gt[42]; + m_A23 += gt[43]; + m_A24 += go[40]; + double RHS11 = Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 += Idr[43]; + RHS11 -= go[41] * *cnV[41]; + RHS11 -= go[42] * *cnV[42]; + RHS11 -= go[43] * *cnV[43]; + m_A25 += gt[44]; + m_A25 += gt[45]; + m_A25 += gt[46]; + m_A27 += go[44]; + m_A28 += go[45]; + m_A26 += go[46]; + double RHS12 = Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + m_A29 += gt[47]; + m_A29 += gt[48]; + m_A31 += go[47]; + m_A30 += go[48]; + double RHS13 = Idr[47]; + RHS13 += Idr[48]; + m_A37 += gt[49]; + m_A37 += gt[50]; + m_A37 += gt[51]; + m_A37 += gt[52]; + m_A37 += gt[53]; + m_A37 += gt[54]; + m_A36 += go[49]; + m_A35 += go[50]; + m_A34 += go[51]; + m_A33 += go[52]; + m_A32 += go[53]; + double RHS14 = Idr[49]; + RHS14 += Idr[50]; + RHS14 += Idr[51]; + RHS14 += Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 -= go[54] * *cnV[54]; + m_A39 += gt[55]; + m_A39 += gt[56]; + m_A39 += gt[57]; + m_A39 += gt[58]; + m_A38 += go[55]; + m_A40 += go[56]; + double RHS15 = Idr[55]; + RHS15 += Idr[56]; + RHS15 += Idr[57]; + RHS15 += Idr[58]; + RHS15 -= go[57] * *cnV[57]; + RHS15 -= go[58] * *cnV[58]; + m_A42 += gt[59]; + m_A42 += gt[60]; + m_A42 += gt[61]; + m_A42 += gt[62]; + m_A41 += go[59]; + m_A43 += go[60]; + double RHS16 = Idr[59]; + RHS16 += Idr[60]; + RHS16 += Idr[61]; + RHS16 += Idr[62]; + RHS16 -= go[61] * *cnV[61]; + RHS16 -= go[62] * *cnV[62]; + m_A45 += gt[63]; + m_A45 += gt[64]; + m_A45 += gt[65]; + m_A46 += go[63]; + m_A44 += go[64]; + double RHS17 = Idr[63]; + RHS17 += Idr[64]; + RHS17 += Idr[65]; + RHS17 -= go[65] * *cnV[65]; + m_A52 += gt[66]; + m_A52 += gt[67]; + m_A52 += gt[68]; + m_A52 += gt[69]; + m_A52 += gt[70]; + m_A52 += gt[71]; + m_A49 += go[66]; + m_A50 += go[67]; + m_A51 += go[68]; + m_A47 += go[69]; + m_A48 += go[70]; + double RHS18 = Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + RHS18 -= go[71] * *cnV[71]; + m_A59 += gt[72]; + m_A59 += gt[73]; + m_A57 += go[72]; + m_A62 += go[73]; + double RHS19 = Idr[72]; + RHS19 += Idr[73]; + m_A66 += gt[74]; + m_A66 += gt[75]; + m_A66 += gt[76]; + m_A66 += gt[77]; + m_A66 += gt[78]; + m_A66 += gt[79]; + m_A66 += gt[80]; + m_A63 += go[74]; + m_A64 += go[75]; + m_A68 += go[76]; + m_A67 += go[77]; + m_A67 += go[78]; + double RHS20 = Idr[74]; + RHS20 += Idr[75]; + RHS20 += Idr[76]; + RHS20 += Idr[77]; + RHS20 += Idr[78]; + RHS20 += Idr[79]; + RHS20 += Idr[80]; + RHS20 -= go[79] * *cnV[79]; + RHS20 -= go[80] * *cnV[80]; + m_A73 += gt[81]; + m_A73 += gt[82]; + m_A73 += gt[83]; + m_A73 += gt[84]; + m_A73 += gt[85]; + m_A72 += go[81]; + m_A72 += go[82]; + m_A71 += go[83]; + m_A69 += go[84]; + m_A70 += go[85]; + double RHS21 = Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + RHS21 += Idr[84]; + RHS21 += Idr[85]; + m_A80 += gt[86]; + m_A80 += gt[87]; + m_A80 += gt[88]; + m_A80 += gt[89]; + m_A80 += gt[90]; + m_A80 += gt[91]; + m_A80 += gt[92]; + m_A80 += gt[93]; + m_A80 += gt[94]; + m_A80 += gt[95]; + m_A80 += gt[96]; + m_A75 += go[86]; + m_A82 += go[87]; + m_A76 += go[88]; + double RHS22 = Idr[86]; + RHS22 += Idr[87]; + RHS22 += Idr[88]; + RHS22 += Idr[89]; + RHS22 += Idr[90]; + RHS22 += Idr[91]; + RHS22 += Idr[92]; + RHS22 += Idr[93]; + RHS22 += Idr[94]; + RHS22 += Idr[95]; + RHS22 += Idr[96]; + RHS22 -= go[89] * *cnV[89]; + RHS22 -= go[90] * *cnV[90]; + RHS22 -= go[91] * *cnV[91]; + RHS22 -= go[92] * *cnV[92]; + RHS22 -= go[93] * *cnV[93]; + RHS22 -= go[94] * *cnV[94]; + RHS22 -= go[95] * *cnV[95]; + RHS22 -= go[96] * *cnV[96]; + m_A88 += gt[97]; + m_A88 += gt[98]; + m_A88 += gt[99]; + m_A88 += gt[100]; + m_A88 += gt[101]; + m_A83 += go[97]; + m_A85 += go[98]; + m_A84 += go[99]; + m_A86 += go[100]; + double RHS23 = Idr[97]; + RHS23 += Idr[98]; + RHS23 += Idr[99]; + RHS23 += Idr[100]; + RHS23 += Idr[101]; + RHS23 -= go[101] * *cnV[101]; + m_A94 += gt[102]; + m_A94 += gt[103]; + m_A94 += gt[104]; + m_A91 += go[102]; + m_A89 += go[103]; + m_A92 += go[104]; + double RHS24 = Idr[102]; + RHS24 += Idr[103]; + RHS24 += Idr[104]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A38; + m_A40 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f0_21 = -f0 * m_A69; + m_A73 += m_A1 * f0_21; + RHS21 += f0_21 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_20 = -f1 * m_A63; + m_A65 += m_A3 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_16 = -f2 * m_A41; + m_A43 += m_A5 * f2_16; + RHS16 += f2_16 * RHS2; + const double f2_18 = -f2 * m_A47; + m_A52 += m_A5 * f2_18; + RHS18 += f2_18 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_22 = -f3 * m_A75; + m_A77 += m_A7 * f3_22; + RHS22 += f3_22 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_14 = -f4 * m_A32; + m_A37 += m_A9 * f4_14; + RHS14 += f4_14 * RHS4; + const double f4_21 = -f4 * m_A70; + m_A71 += m_A9 * f4_21; + RHS21 += f4_21 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_17 = -f5 * m_A44; + m_A45 += m_A11 * f5_17; + RHS17 += f5_17 * RHS5; + const double f5_18 = -f5 * m_A48; + m_A51 += m_A11 * f5_18; + RHS18 += f5_18 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_14 = -f6 * m_A33; + m_A37 += m_A13 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_14 = -f7 * m_A34; + m_A37 += m_A15 * f7_14; + RHS14 += f7_14 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_23 = -f8 * m_A83; + m_A88 += m_A17 * f8_23; + RHS23 += f8_23 * RHS8; + const double f9 = 1.0 / m_A18; + const double f9_14 = -f9 * m_A35; + m_A37 += m_A19 * f9_14; + RHS14 += f9_14 * RHS9; + const double f10 = 1.0 / m_A20; + const double f10_20 = -f10 * m_A64; + m_A66 += m_A21 * f10_20; + m_A68 += m_A22 * f10_20; + RHS20 += f10_20 * RHS10; + const double f10_23 = -f10 * m_A84; + m_A86 += m_A21 * f10_23; + m_A88 += m_A22 * f10_23; + RHS23 += f10_23 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_14 = -f11 * m_A36; + m_A37 += m_A24 * f11_14; + RHS14 += f11_14 * RHS11; + const double f12 = 1.0 / m_A25; + const double f12_18 = -f12 * m_A49; + m_A52 += m_A26 * f12_18; + m_A53 += m_A27 * f12_18; + m_A56 += m_A28 * f12_18; + RHS18 += f12_18 * RHS12; + const double f12_19 = -f12 * m_A57; + m_A58 += m_A26 * f12_19; + m_A59 += m_A27 * f12_19; + m_A62 += m_A28 * f12_19; + RHS19 += f12_19 * RHS12; + const double f12_24 = -f12 * m_A89; + m_A90 += m_A26 * f12_24; + m_A91 += m_A27 * f12_24; + m_A94 += m_A28 * f12_24; + RHS24 += f12_24 * RHS12; + const double f13 = 1.0 / m_A29; + const double f13_18 = -f13 * m_A50; + m_A52 += m_A30 * f13_18; + m_A54 += m_A31 * f13_18; + RHS18 += f13_18 * RHS13; + const double f13_22 = -f13 * m_A76; + m_A78 += m_A30 * f13_22; + m_A80 += m_A31 * f13_22; + RHS22 += f13_22 * RHS13; + const double f14 = 1.0 / m_A37; + const double f14_21 = -f14 * m_A71; + RHS21 += f14_21 * RHS14; + const double f15 = 1.0 / m_A39; + const double f15_20 = -f15 * m_A65; + m_A67 += m_A40 * f15_20; + RHS20 += f15_20 * RHS15; + const double f16 = 1.0 / m_A42; + const double f16_22 = -f16 * m_A77; + m_A78 += m_A43 * f16_22; + RHS22 += f16_22 * RHS16; + const double f17 = 1.0 / m_A45; + const double f17_18 = -f17 * m_A51; + m_A55 += m_A46 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_23 = -f17 * m_A85; + m_A88 += m_A46 * f17_23; + RHS23 += f17_23 * RHS17; + const double f18 = 1.0 / m_A52; + const double f18_19 = -f18 * m_A58; + m_A59 += m_A53 * f18_19; + m_A60 += m_A54 * f18_19; + m_A61 += m_A55 * f18_19; + m_A62 += m_A56 * f18_19; + RHS19 += f18_19 * RHS18; + const double f18_22 = -f18 * m_A78; + m_A79 += m_A53 * f18_22; + m_A80 += m_A54 * f18_22; + m_A81 += m_A55 * f18_22; + m_A82 += m_A56 * f18_22; + RHS22 += f18_22 * RHS18; + const double f18_24 = -f18 * m_A90; + m_A91 += m_A53 * f18_24; + m_A92 += m_A54 * f18_24; + m_A93 += m_A55 * f18_24; + m_A94 += m_A56 * f18_24; + RHS24 += f18_24 * RHS18; + const double f19 = 1.0 / m_A59; + const double f19_22 = -f19 * m_A79; + m_A80 += m_A60 * f19_22; + m_A81 += m_A61 * f19_22; + m_A82 += m_A62 * f19_22; + RHS22 += f19_22 * RHS19; + const double f19_24 = -f19 * m_A91; + m_A92 += m_A60 * f19_24; + m_A93 += m_A61 * f19_24; + m_A94 += m_A62 * f19_24; + RHS24 += f19_24 * RHS19; + const double f20 = 1.0 / m_A66; + const double f20_21 = -f20 * m_A72; + m_A73 += m_A67 * f20_21; + m_A74 += m_A68 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_23 = -f20 * m_A86; + m_A87 += m_A67 * f20_23; + m_A88 += m_A68 * f20_23; + RHS23 += f20_23 * RHS20; + const double f21 = 1.0 / m_A73; + const double f21_23 = -f21 * m_A87; + m_A88 += m_A74 * f21_23; + RHS23 += f21_23 * RHS21; + const double f22 = 1.0 / m_A80; + const double f22_24 = -f22 * m_A92; + m_A93 += m_A81 * f22_24; + m_A94 += m_A82 * f22_24; + RHS24 += f22_24 * RHS22; + const double f23 = 1.0 / m_A88; + const double f23_24 = -f23 * m_A93; + RHS24 += f23_24 * RHS23; + V[24] = RHS24 / m_A94; + double tmp23 = 0.0; + V[23] = (RHS23 - tmp23) / m_A88; + double tmp22 = 0.0; + tmp22 += m_A81 * V[23]; + tmp22 += m_A82 * V[24]; + V[22] = (RHS22 - tmp22) / m_A80; + double tmp21 = 0.0; + tmp21 += m_A74 * V[23]; + V[21] = (RHS21 - tmp21) / m_A73; + double tmp20 = 0.0; + tmp20 += m_A67 * V[21]; + tmp20 += m_A68 * V[23]; + V[20] = (RHS20 - tmp20) / m_A66; + double tmp19 = 0.0; + tmp19 += m_A60 * V[22]; + tmp19 += m_A61 * V[23]; + tmp19 += m_A62 * V[24]; + V[19] = (RHS19 - tmp19) / m_A59; + double tmp18 = 0.0; + tmp18 += m_A53 * V[19]; + tmp18 += m_A54 * V[22]; + tmp18 += m_A55 * V[23]; + tmp18 += m_A56 * V[24]; + V[18] = (RHS18 - tmp18) / m_A52; + double tmp17 = 0.0; + tmp17 += m_A46 * V[23]; + V[17] = (RHS17 - tmp17) / m_A45; + double tmp16 = 0.0; + tmp16 += m_A43 * V[18]; + V[16] = (RHS16 - tmp16) / m_A42; + double tmp15 = 0.0; + tmp15 += m_A40 * V[21]; + V[15] = (RHS15 - tmp15) / m_A39; + double tmp14 = 0.0; + V[14] = (RHS14 - tmp14) / m_A37; + double tmp13 = 0.0; + tmp13 += m_A30 * V[18]; + tmp13 += m_A31 * V[22]; + V[13] = (RHS13 - tmp13) / m_A29; + double tmp12 = 0.0; + tmp12 += m_A26 * V[18]; + tmp12 += m_A27 * V[19]; + tmp12 += m_A28 * V[24]; + V[12] = (RHS12 - tmp12) / m_A25; + double tmp11 = 0.0; + tmp11 += m_A24 * V[14]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A21 * V[20]; + tmp10 += m_A22 * V[23]; + V[10] = (RHS10 - tmp10) / m_A20; + double tmp9 = 0.0; + tmp9 += m_A19 * V[14]; + V[9] = (RHS9 - tmp9) / m_A18; + double tmp8 = 0.0; + tmp8 += m_A17 * V[23]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[14]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[14]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[17]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[14]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[16]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[18]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[21]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw +static void nl_gcr_109_double_double_5d550fc7441617a2(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A10 += go[8]; + m_A9 += go[9]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 += Idr[10]; + RHS4 -= go[10] * *cnV[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A12 += go[11]; + double RHS5 = Idr[11]; + RHS5 += Idr[12]; + RHS5 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A15 += go[13]; + m_A14 += go[14]; + double RHS6 = Idr[13]; + RHS6 += Idr[14]; + RHS6 += Idr[15]; + RHS6 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A17 += go[16]; + double RHS7 = Idr[16]; + RHS7 += Idr[17]; + RHS7 += Idr[18]; + RHS7 += Idr[19]; + RHS7 -= go[17] * *cnV[17]; + RHS7 -= go[18] * *cnV[18]; + RHS7 -= go[19] * *cnV[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A19 += go[20]; + double RHS8 = Idr[20]; + RHS8 += Idr[21]; + RHS8 -= go[21] * *cnV[21]; + m_A20 += gt[22]; + m_A20 += gt[23]; + m_A20 += gt[24]; + m_A20 += gt[25]; + m_A20 += gt[26]; + m_A21 += go[22]; + m_A23 += go[23]; + m_A22 += go[24]; + double RHS9 = Idr[22]; + RHS9 += Idr[23]; + RHS9 += Idr[24]; + RHS9 += Idr[25]; + RHS9 += Idr[26]; + RHS9 -= go[25] * *cnV[25]; + RHS9 -= go[26] * *cnV[26]; + m_A24 += gt[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A24 += gt[30]; + m_A24 += gt[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A27 += go[27]; + m_A26 += go[28]; + m_A26 += go[29]; + m_A26 += go[30]; + m_A25 += go[31]; + m_A25 += go[32]; + double RHS10 = Idr[27]; + RHS10 += Idr[28]; + RHS10 += Idr[29]; + RHS10 += Idr[30]; + RHS10 += Idr[31]; + RHS10 += Idr[32]; + RHS10 += Idr[33]; + RHS10 -= go[33] * *cnV[33]; + m_A28 += gt[34]; + m_A28 += gt[35]; + m_A29 += go[34]; + double RHS11 = Idr[34]; + RHS11 += Idr[35]; + RHS11 -= go[35] * *cnV[35]; + m_A30 += gt[36]; + m_A30 += gt[37]; + m_A30 += gt[38]; + m_A30 += gt[39]; + m_A30 += gt[40]; + m_A31 += go[36]; + m_A31 += go[37]; + m_A32 += go[38]; + m_A32 += go[39]; + double RHS12 = Idr[36]; + RHS12 += Idr[37]; + RHS12 += Idr[38]; + RHS12 += Idr[39]; + RHS12 += Idr[40]; + RHS12 -= go[40] * *cnV[40]; + m_A33 += gt[41]; + m_A33 += gt[42]; + m_A33 += gt[43]; + m_A35 += go[41]; + m_A34 += go[42]; + double RHS13 = Idr[41]; + RHS13 += Idr[42]; + RHS13 += Idr[43]; + RHS13 -= go[43] * *cnV[43]; + m_A38 += gt[44]; + m_A38 += gt[45]; + m_A38 += gt[46]; + m_A37 += go[44]; + m_A36 += go[45]; + double RHS14 = Idr[44]; + RHS14 += Idr[45]; + RHS14 += Idr[46]; + RHS14 -= go[46] * *cnV[46]; + m_A42 += gt[47]; + m_A42 += gt[48]; + m_A42 += gt[49]; + m_A41 += go[47]; + m_A40 += go[48]; + double RHS15 = Idr[47]; + RHS15 += Idr[48]; + RHS15 += Idr[49]; + RHS15 -= go[49] * *cnV[49]; + m_A46 += gt[50]; + m_A46 += gt[51]; + m_A46 += gt[52]; + m_A44 += go[50]; + m_A47 += go[51]; + double RHS16 = Idr[50]; + RHS16 += Idr[51]; + RHS16 += Idr[52]; + RHS16 -= go[52] * *cnV[52]; + m_A50 += gt[53]; + m_A50 += gt[54]; + m_A50 += gt[55]; + m_A48 += go[53]; + m_A51 += go[54]; + double RHS17 = Idr[53]; + RHS17 += Idr[54]; + RHS17 += Idr[55]; + RHS17 -= go[55] * *cnV[55]; + m_A54 += gt[56]; + m_A54 += gt[57]; + m_A54 += gt[58]; + m_A54 += gt[59]; + m_A54 += gt[60]; + m_A54 += gt[61]; + m_A53 += go[56]; + m_A53 += go[57]; + m_A52 += go[58]; + double RHS18 = Idr[56]; + RHS18 += Idr[57]; + RHS18 += Idr[58]; + RHS18 += Idr[59]; + RHS18 += Idr[60]; + RHS18 += Idr[61]; + RHS18 -= go[59] * *cnV[59]; + RHS18 -= go[60] * *cnV[60]; + RHS18 -= go[61] * *cnV[61]; + m_A58 += gt[62]; + m_A58 += gt[63]; + m_A58 += gt[64]; + m_A58 += gt[65]; + m_A58 += gt[66]; + m_A58 += gt[67]; + m_A58 += gt[68]; + m_A57 += go[62]; + m_A59 += go[63]; + double RHS19 = Idr[62]; + RHS19 += Idr[63]; + RHS19 += Idr[64]; + RHS19 += Idr[65]; + RHS19 += Idr[66]; + RHS19 += Idr[67]; + RHS19 += Idr[68]; + RHS19 -= go[64] * *cnV[64]; + RHS19 -= go[65] * *cnV[65]; + RHS19 -= go[66] * *cnV[66]; + RHS19 -= go[67] * *cnV[67]; + RHS19 -= go[68] * *cnV[68]; + m_A63 += gt[69]; + m_A63 += gt[70]; + m_A63 += gt[71]; + m_A63 += gt[72]; + m_A63 += gt[73]; + m_A63 += gt[74]; + m_A64 += go[69]; + m_A64 += go[70]; + m_A61 += go[71]; + m_A61 += go[72]; + m_A61 += go[73]; + m_A60 += go[74]; + double RHS20 = Idr[69]; + RHS20 += Idr[70]; + RHS20 += Idr[71]; + RHS20 += Idr[72]; + RHS20 += Idr[73]; + RHS20 += Idr[74]; + m_A69 += gt[75]; + m_A69 += gt[76]; + m_A69 += gt[77]; + m_A69 += gt[78]; + m_A68 += go[75]; + m_A68 += go[76]; + m_A70 += go[77]; + m_A67 += go[78]; + double RHS21 = Idr[75]; + RHS21 += Idr[76]; + RHS21 += Idr[77]; + RHS21 += Idr[78]; + m_A73 += gt[79]; + m_A73 += gt[80]; + m_A73 += gt[81]; + m_A72 += go[79]; + m_A71 += go[80]; + double RHS22 = Idr[79]; + RHS22 += Idr[80]; + RHS22 += Idr[81]; + RHS22 -= go[81] * *cnV[81]; + m_A80 += gt[82]; + m_A80 += gt[83]; + m_A80 += gt[84]; + m_A80 += gt[85]; + m_A80 += gt[86]; + m_A80 += gt[87]; + m_A80 += gt[88]; + m_A80 += gt[89]; + m_A79 += go[82]; + m_A76 += go[83]; + m_A76 += go[84]; + m_A78 += go[85]; + m_A78 += go[86]; + m_A75 += go[87]; + double RHS23 = Idr[82]; + RHS23 += Idr[83]; + RHS23 += Idr[84]; + RHS23 += Idr[85]; + RHS23 += Idr[86]; + RHS23 += Idr[87]; + RHS23 += Idr[88]; + RHS23 += Idr[89]; + RHS23 -= go[88] * *cnV[88]; + RHS23 -= go[89] * *cnV[89]; + m_A87 += gt[90]; + m_A87 += gt[91]; + m_A87 += gt[92]; + m_A87 += gt[93]; + m_A84 += go[90]; + m_A89 += go[91]; + m_A83 += go[92]; + double RHS24 = Idr[90]; + RHS24 += Idr[91]; + RHS24 += Idr[92]; + RHS24 += Idr[93]; + RHS24 -= go[93] * *cnV[93]; + m_A95 += gt[94]; + m_A95 += gt[95]; + m_A95 += gt[96]; + m_A95 += gt[97]; + m_A91 += go[94]; + m_A96 += go[95]; + m_A90 += go[96]; + double RHS25 = Idr[94]; + RHS25 += Idr[95]; + RHS25 += Idr[96]; + RHS25 += Idr[97]; + RHS25 -= go[97] * *cnV[97]; + m_A99 += gt[98]; + m_A99 += gt[99]; + m_A99 += gt[100]; + m_A97 += go[98]; + m_A100 += go[99]; + double RHS26 = Idr[98]; + RHS26 += Idr[99]; + RHS26 += Idr[100]; + RHS26 -= go[100] * *cnV[100]; + m_A108 += gt[101]; + m_A108 += gt[102]; + m_A108 += gt[103]; + m_A108 += gt[104]; + m_A108 += gt[105]; + m_A108 += gt[106]; + m_A108 += gt[107]; + m_A108 += gt[108]; + m_A108 += gt[109]; + m_A104 += go[101]; + m_A101 += go[102]; + m_A107 += go[103]; + m_A103 += go[104]; + m_A102 += go[105]; + m_A106 += go[106]; + m_A105 += go[107]; + double RHS27 = Idr[101]; + RHS27 += Idr[102]; + RHS27 += Idr[103]; + RHS27 += Idr[104]; + RHS27 += Idr[105]; + RHS27 += Idr[106]; + RHS27 += Idr[107]; + RHS27 += Idr[108]; + RHS27 += Idr[109]; + RHS27 -= go[108] * *cnV[108]; + RHS27 -= go[109] * *cnV[109]; + const double f0 = 1.0 / m_A0; + const double f0_14 = -f0 * m_A36; + m_A38 += m_A1 * f0_14; + RHS14 += f0_14 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_15 = -f1 * m_A40; + m_A42 += m_A3 * f1_15; + RHS15 += f1_15 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_24 = -f2 * m_A83; + m_A87 += m_A5 * f2_24; + RHS24 += f2_24 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_25 = -f3 * m_A90; + m_A95 += m_A7 * f3_25; + RHS25 += f3_25 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_14 = -f4 * m_A37; + m_A38 += m_A9 * f4_14; + m_A39 += m_A10 * f4_14; + RHS14 += f4_14 * RHS4; + const double f4_16 = -f4 * m_A44; + m_A45 += m_A9 * f4_16; + m_A46 += m_A10 * f4_16; + RHS16 += f4_16 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_22 = -f5 * m_A71; + m_A73 += m_A12 * f5_22; + RHS22 += f5_22 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_15 = -f6 * m_A41; + m_A42 += m_A14 * f6_15; + m_A43 += m_A15 * f6_15; + RHS15 += f6_15 * RHS6; + const double f6_17 = -f6 * m_A48; + m_A49 += m_A14 * f6_17; + m_A50 += m_A15 * f6_17; + RHS17 += f6_17 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_18 = -f7 * m_A52; + m_A54 += m_A17 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A18; + const double f8_19 = -f8 * m_A57; + m_A59 += m_A19 * f8_19; + RHS19 += f8_19 * RHS8; + const double f8_27 = -f8 * m_A101; + m_A108 += m_A19 * f8_27; + RHS27 += f8_27 * RHS8; + const double f9 = 1.0 / m_A20; + const double f9_20 = -f9 * m_A60; + m_A63 += m_A21 * f9_20; + m_A65 += m_A22 * f9_20; + m_A66 += m_A23 * f9_20; + RHS20 += f9_20 * RHS9; + const double f9_24 = -f9 * m_A84; + m_A85 += m_A21 * f9_24; + m_A87 += m_A22 * f9_24; + m_A88 += m_A23 * f9_24; + RHS24 += f9_24 * RHS9; + const double f9_25 = -f9 * m_A91; + m_A92 += m_A21 * f9_25; + m_A94 += m_A22 * f9_25; + m_A95 += m_A23 * f9_25; + RHS25 += f9_25 * RHS9; + const double f10 = 1.0 / m_A24; + const double f10_18 = -f10 * m_A53; + m_A54 += m_A25 * f10_18; + m_A55 += m_A26 * f10_18; + m_A56 += m_A27 * f10_18; + RHS18 += f10_18 * RHS10; + const double f10_20 = -f10 * m_A61; + m_A62 += m_A25 * f10_20; + m_A63 += m_A26 * f10_20; + m_A64 += m_A27 * f10_20; + RHS20 += f10_20 * RHS10; + const double f10_23 = -f10 * m_A75; + m_A77 += m_A25 * f10_23; + m_A78 += m_A26 * f10_23; + m_A80 += m_A27 * f10_23; + RHS23 += f10_23 * RHS10; + const double f11 = 1.0 / m_A28; + const double f11_21 = -f11 * m_A67; + m_A69 += m_A29 * f11_21; + RHS21 += f11_21 * RHS11; + const double f12 = 1.0 / m_A30; + const double f12_21 = -f12 * m_A68; + m_A69 += m_A31 * f12_21; + m_A70 += m_A32 * f12_21; + RHS21 += f12_21 * RHS12; + const double f12_23 = -f12 * m_A76; + m_A79 += m_A31 * f12_23; + m_A80 += m_A32 * f12_23; + RHS23 += f12_23 * RHS12; + const double f13 = 1.0 / m_A33; + const double f13_22 = -f13 * m_A72; + m_A73 += m_A34 * f13_22; + m_A74 += m_A35 * f13_22; + RHS22 += f13_22 * RHS13; + const double f13_26 = -f13 * m_A97; + m_A98 += m_A34 * f13_26; + m_A99 += m_A35 * f13_26; + RHS26 += f13_26 * RHS13; + const double f14 = 1.0 / m_A38; + const double f14_16 = -f14 * m_A45; + m_A46 += m_A39 * f14_16; + RHS16 += f14_16 * RHS14; + const double f15 = 1.0 / m_A42; + const double f15_17 = -f15 * m_A49; + m_A50 += m_A43 * f15_17; + RHS17 += f15_17 * RHS15; + const double f16 = 1.0 / m_A46; + const double f16_27 = -f16 * m_A102; + m_A108 += m_A47 * f16_27; + RHS27 += f16_27 * RHS16; + const double f17 = 1.0 / m_A50; + const double f17_27 = -f17 * m_A103; + m_A108 += m_A51 * f17_27; + RHS27 += f17_27 * RHS17; + const double f18 = 1.0 / m_A54; + const double f18_20 = -f18 * m_A62; + m_A63 += m_A55 * f18_20; + m_A64 += m_A56 * f18_20; + RHS20 += f18_20 * RHS18; + const double f18_23 = -f18 * m_A77; + m_A78 += m_A55 * f18_23; + m_A80 += m_A56 * f18_23; + RHS23 += f18_23 * RHS18; + const double f19 = 1.0 / m_A58; + const double f19_27 = -f19 * m_A104; + m_A108 += m_A59 * f19_27; + RHS27 += f19_27 * RHS19; + const double f20 = 1.0 / m_A63; + const double f20_23 = -f20 * m_A78; + m_A80 += m_A64 * f20_23; + m_A81 += m_A65 * f20_23; + m_A82 += m_A66 * f20_23; + RHS23 += f20_23 * RHS20; + const double f20_24 = -f20 * m_A85; + m_A86 += m_A64 * f20_24; + m_A87 += m_A65 * f20_24; + m_A88 += m_A66 * f20_24; + RHS24 += f20_24 * RHS20; + const double f20_25 = -f20 * m_A92; + m_A93 += m_A64 * f20_25; + m_A94 += m_A65 * f20_25; + m_A95 += m_A66 * f20_25; + RHS25 += f20_25 * RHS20; + const double f21 = 1.0 / m_A69; + const double f21_23 = -f21 * m_A79; + m_A80 += m_A70 * f21_23; + RHS23 += f21_23 * RHS21; + const double f22 = 1.0 / m_A73; + const double f22_26 = -f22 * m_A98; + m_A99 += m_A74 * f22_26; + RHS26 += f22_26 * RHS22; + const double f23 = 1.0 / m_A80; + const double f23_24 = -f23 * m_A86; + m_A87 += m_A81 * f23_24; + m_A88 += m_A82 * f23_24; + RHS24 += f23_24 * RHS23; + const double f23_25 = -f23 * m_A93; + m_A94 += m_A81 * f23_25; + m_A95 += m_A82 * f23_25; + RHS25 += f23_25 * RHS23; + const double f24 = 1.0 / m_A87; + const double f24_25 = -f24 * m_A94; + m_A95 += m_A88 * f24_25; + m_A96 += m_A89 * f24_25; + RHS25 += f24_25 * RHS24; + const double f24_27 = -f24 * m_A105; + m_A106 += m_A88 * f24_27; + m_A108 += m_A89 * f24_27; + RHS27 += f24_27 * RHS24; + const double f25 = 1.0 / m_A95; + const double f25_27 = -f25 * m_A106; + m_A108 += m_A96 * f25_27; + RHS27 += f25_27 * RHS25; + const double f26 = 1.0 / m_A99; + const double f26_27 = -f26 * m_A107; + m_A108 += m_A100 * f26_27; + RHS27 += f26_27 * RHS26; + V[27] = RHS27 / m_A108; + double tmp26 = 0.0; + tmp26 += m_A100 * V[27]; + V[26] = (RHS26 - tmp26) / m_A99; + double tmp25 = 0.0; + tmp25 += m_A96 * V[27]; + V[25] = (RHS25 - tmp25) / m_A95; + double tmp24 = 0.0; + tmp24 += m_A88 * V[25]; + tmp24 += m_A89 * V[27]; + V[24] = (RHS24 - tmp24) / m_A87; + double tmp23 = 0.0; + tmp23 += m_A81 * V[24]; + tmp23 += m_A82 * V[25]; + V[23] = (RHS23 - tmp23) / m_A80; + double tmp22 = 0.0; + tmp22 += m_A74 * V[26]; + V[22] = (RHS22 - tmp22) / m_A73; + double tmp21 = 0.0; + tmp21 += m_A70 * V[23]; + V[21] = (RHS21 - tmp21) / m_A69; + double tmp20 = 0.0; + tmp20 += m_A64 * V[23]; + tmp20 += m_A65 * V[24]; + tmp20 += m_A66 * V[25]; + V[20] = (RHS20 - tmp20) / m_A63; + double tmp19 = 0.0; + tmp19 += m_A59 * V[27]; + V[19] = (RHS19 - tmp19) / m_A58; + double tmp18 = 0.0; + tmp18 += m_A55 * V[20]; + tmp18 += m_A56 * V[23]; + V[18] = (RHS18 - tmp18) / m_A54; + double tmp17 = 0.0; + tmp17 += m_A51 * V[27]; + V[17] = (RHS17 - tmp17) / m_A50; + double tmp16 = 0.0; + tmp16 += m_A47 * V[27]; + V[16] = (RHS16 - tmp16) / m_A46; + double tmp15 = 0.0; + tmp15 += m_A43 * V[17]; + V[15] = (RHS15 - tmp15) / m_A42; + double tmp14 = 0.0; + tmp14 += m_A39 * V[16]; + V[14] = (RHS14 - tmp14) / m_A38; + double tmp13 = 0.0; + tmp13 += m_A34 * V[22]; + tmp13 += m_A35 * V[26]; + V[13] = (RHS13 - tmp13) / m_A33; + double tmp12 = 0.0; + tmp12 += m_A31 * V[21]; + tmp12 += m_A32 * V[23]; + V[12] = (RHS12 - tmp12) / m_A30; + double tmp11 = 0.0; + tmp11 += m_A29 * V[21]; + V[11] = (RHS11 - tmp11) / m_A28; + double tmp10 = 0.0; + tmp10 += m_A25 * V[18]; + tmp10 += m_A26 * V[20]; + tmp10 += m_A27 * V[23]; + V[10] = (RHS10 - tmp10) / m_A24; + double tmp9 = 0.0; + tmp9 += m_A21 * V[20]; + tmp9 += m_A22 * V[24]; + tmp9 += m_A23 * V[25]; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A19 * V[27]; + V[8] = (RHS8 - tmp8) / m_A18; + double tmp7 = 0.0; + tmp7 += m_A17 * V[18]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A14 * V[15]; + tmp6 += m_A15 * V[17]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A12 * V[22]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[14]; + tmp4 += m_A10 * V[16]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[25]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[24]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[14]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw +static void nl_gcr_12_double_double_88a8ef5f6bd43d48(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A4 += go[2]; + m_A3 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A7 += gt[5]; + m_A7 += gt[6]; + m_A7 += gt[7]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A11 += gt[8]; + m_A11 += gt[9]; + m_A11 += gt[10]; + m_A9 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 -= go[9] * *cnV[9]; + RHS3 -= go[10] * *cnV[10]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A7 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A6; + m_A7 += m_A3 * f1_2; + m_A8 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A8 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A8 * V[3]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw,armora,solarq +static void nl_gcr_22_double_double_1250f340dea396ae(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A7 += go[6]; + m_A6 += go[7]; + m_A6 += go[8]; + m_A5 += go[9]; + m_A5 += go[10]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A9 += go[14]; + m_A9 += go[15]; + m_A8 += go[16]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A16 += go[20]; + m_A16 += go[21]; + m_A13 += go[22]; + m_A13 += go[23]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 -= go[24] * *cnV[24]; + m_A21 += gt[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A20 += go[25]; + m_A20 += go[26]; + m_A18 += go[27]; + m_A17 += go[28]; + double RHS5 = Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 -= go[29] * *cnV[29]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A17; + m_A21 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A9; + m_A10 += m_A5 * f2_3; + m_A11 += m_A6 * f2_3; + m_A12 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_4 = -f2 * m_A13; + m_A14 += m_A5 * f2_4; + m_A15 += m_A6 * f2_4; + m_A16 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A18; + m_A19 += m_A5 * f2_5; + m_A20 += m_A6 * f2_5; + m_A21 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + m_A16 += m_A12 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A19; + m_A20 += m_A11 * f3_5; + m_A21 += m_A12 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_5 = -f4 * m_A20; + m_A21 += m_A16 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A21; + double tmp4 = 0.0; + tmp4 += m_A16 * V[5]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + tmp3 += m_A12 * V[5]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw,boxingb +static void nl_gcr_23_double_double_ea2b6e3a05e6ef0b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A4 += go[4]; + m_A3 += go[5]; + m_A3 += go[6]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A7 += go[10]; + m_A6 += go[11]; + m_A6 += go[12]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A9 += go[14]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[15] * *cnV[15]; + m_A12 += gt[16]; + m_A12 += gt[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A11 += go[16]; + m_A11 += go[17]; + m_A10 += go[18]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A17 += gt[26]; + m_A15 += go[22]; + m_A15 += go[23]; + m_A14 += go[24]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A20 += go[27]; + m_A19 += go[28]; + double RHS6 = Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + RHS6 -= go[31] * *cnV[31]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A10; + m_A12 += m_A1 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A11; + m_A12 += m_A3 * f1_4; + m_A13 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_5 = -f1 * m_A14; + m_A16 += m_A3 * f1_5; + m_A17 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_5 = -f2 * m_A15; + m_A17 += m_A6 * f2_5; + m_A18 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_6 = -f2 * m_A19; + m_A21 += m_A6 * f2_6; + m_A22 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_6 = -f3 * m_A20; + m_A22 += m_A9 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_5 = -f4 * m_A16; + m_A17 += m_A13 * f4_5; + RHS5 += f4_5 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A18 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[6]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A13 * V[5]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A9 * V[6]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[5]; + tmp2 += m_A7 * V[6]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw,solarq +static void nl_gcr_25_double_double_4cb524006206eb1a(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A5 += go[4]; + m_A4 += go[5]; + m_A4 += go[6]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A7 += go[12]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A9 += go[14]; + m_A9 += go[15]; + m_A8 += go[16]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A15 += gt[24]; + m_A16 += go[20]; + m_A16 += go[21]; + m_A13 += go[22]; + m_A13 += go[23]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 -= go[24] * *cnV[24]; + m_A18 += gt[25]; + m_A18 += gt[26]; + m_A18 += gt[27]; + m_A19 += go[25]; + m_A17 += go[26]; + double RHS5 = Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 -= go[27] * *cnV[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A24 += gt[30]; + m_A24 += gt[31]; + m_A23 += go[28]; + m_A22 += go[29]; + m_A22 += go[30]; + m_A20 += go[31]; + double RHS6 = Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + m_A12 += m_A5 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_4 = -f1 * m_A13; + m_A14 += m_A3 * f1_4; + m_A15 += m_A4 * f1_4; + m_A16 += m_A5 * f1_4; + RHS4 += f1_4 * RHS1; + const double f1_6 = -f1 * m_A20; + m_A21 += m_A3 * f1_6; + m_A22 += m_A4 * f1_6; + m_A24 += m_A5 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_5 = -f2 * m_A17; + m_A18 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + m_A16 += m_A12 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_6 = -f3 * m_A21; + m_A22 += m_A11 * f3_6; + m_A24 += m_A12 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A15; + const double f4_6 = -f4 * m_A22; + m_A24 += m_A16 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A18; + const double f5_6 = -f5 * m_A23; + m_A24 += m_A19 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A24; + double tmp5 = 0.0; + tmp5 += m_A19 * V[6]; + V[5] = (RHS5 - tmp5) / m_A18; + double tmp4 = 0.0; + tmp4 += m_A16 * V[6]; + V[4] = (RHS4 - tmp4) / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + tmp3 += m_A12 * V[6]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A7 * V[5]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[4]; + tmp1 += m_A5 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw +static void nl_gcr_62_double_double_a582a424cb61c678(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[15]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[16] * *cnV[16]; + RHS5 -= go[17] * *cnV[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A13 += go[18]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 -= go[19] * *cnV[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A16 += go[20]; + m_A15 += go[21]; + double RHS7 = Idr[20]; + RHS7 += Idr[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A19 += go[22]; + m_A18 += go[23]; + double RHS8 = Idr[22]; + RHS8 += Idr[23]; + m_A20 += gt[24]; + m_A20 += gt[25]; + m_A21 += go[24]; + double RHS9 = Idr[24]; + RHS9 += Idr[25]; + RHS9 -= go[25] * *cnV[25]; + m_A23 += gt[26]; + m_A23 += gt[27]; + m_A23 += gt[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A23 += gt[31]; + m_A23 += gt[32]; + m_A22 += go[26]; + m_A24 += go[27]; + double RHS10 = Idr[26]; + RHS10 += Idr[27]; + RHS10 += Idr[28]; + RHS10 += Idr[29]; + RHS10 += Idr[30]; + RHS10 += Idr[31]; + RHS10 += Idr[32]; + RHS10 -= go[28] * *cnV[28]; + RHS10 -= go[29] * *cnV[29]; + RHS10 -= go[30] * *cnV[30]; + RHS10 -= go[31] * *cnV[31]; + RHS10 -= go[32] * *cnV[32]; + m_A25 += gt[33]; + m_A25 += gt[34]; + m_A25 += gt[35]; + m_A25 += gt[36]; + m_A25 += gt[37]; + m_A25 += gt[38]; + m_A25 += gt[39]; + m_A26 += go[33]; + double RHS11 = Idr[33]; + RHS11 += Idr[34]; + RHS11 += Idr[35]; + RHS11 += Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[34] * *cnV[34]; + RHS11 -= go[35] * *cnV[35]; + RHS11 -= go[36] * *cnV[36]; + RHS11 -= go[37] * *cnV[37]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + m_A30 += gt[40]; + m_A30 += gt[41]; + m_A30 += gt[42]; + m_A30 += gt[43]; + m_A29 += go[40]; + m_A28 += go[41]; + m_A27 += go[42]; + double RHS12 = Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 -= go[43] * *cnV[43]; + m_A32 += gt[44]; + m_A32 += gt[45]; + m_A33 += go[44]; + m_A34 += go[45]; + double RHS13 = Idr[44]; + RHS13 += Idr[45]; + m_A36 += gt[46]; + m_A36 += gt[47]; + m_A35 += go[46]; + m_A37 += go[47]; + double RHS14 = Idr[46]; + RHS14 += Idr[47]; + m_A42 += gt[48]; + m_A42 += gt[49]; + m_A42 += gt[50]; + m_A42 += gt[51]; + m_A42 += gt[52]; + m_A41 += go[48]; + m_A40 += go[49]; + m_A39 += go[50]; + m_A38 += go[51]; + double RHS15 = Idr[48]; + RHS15 += Idr[49]; + RHS15 += Idr[50]; + RHS15 += Idr[51]; + RHS15 += Idr[52]; + RHS15 -= go[52] * *cnV[52]; + m_A46 += gt[53]; + m_A46 += gt[54]; + m_A46 += gt[55]; + m_A46 += gt[56]; + m_A46 += gt[57]; + m_A45 += go[53]; + m_A44 += go[54]; + m_A47 += go[55]; + double RHS16 = Idr[53]; + RHS16 += Idr[54]; + RHS16 += Idr[55]; + RHS16 += Idr[56]; + RHS16 += Idr[57]; + RHS16 -= go[56] * *cnV[56]; + RHS16 -= go[57] * *cnV[57]; + m_A51 += gt[58]; + m_A51 += gt[59]; + m_A51 += gt[60]; + m_A51 += gt[61]; + m_A51 += gt[62]; + m_A49 += go[58]; + m_A48 += go[59]; + m_A50 += go[60]; + double RHS17 = Idr[58]; + RHS17 += Idr[59]; + RHS17 += Idr[60]; + RHS17 += Idr[61]; + RHS17 += Idr[62]; + RHS17 -= go[61] * *cnV[61]; + RHS17 -= go[62] * *cnV[62]; + m_A61 += gt[63]; + m_A61 += gt[64]; + m_A61 += gt[65]; + m_A61 += gt[66]; + m_A61 += gt[67]; + m_A61 += gt[68]; + m_A59 += go[63]; + m_A56 += go[64]; + m_A57 += go[65]; + m_A54 += go[66]; + m_A53 += go[67]; + double RHS18 = Idr[63]; + RHS18 += Idr[64]; + RHS18 += Idr[65]; + RHS18 += Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 -= go[68] * *cnV[68]; + const double f0 = 1.0 / m_A0; + const double f0_12 = -f0 * m_A27; + m_A30 += m_A1 * f0_12; + RHS12 += f0_12 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_12 = -f1 * m_A28; + m_A30 += m_A3 * f1_12; + RHS12 += f1_12 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_15 = -f2 * m_A38; + m_A42 += m_A5 * f2_15; + RHS15 += f2_15 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_15 = -f3 * m_A39; + m_A42 += m_A7 * f3_15; + RHS15 += f3_15 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_15 = -f4 * m_A40; + m_A42 += m_A9 * f4_15; + RHS15 += f4_15 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_14 = -f5 * m_A35; + m_A36 += m_A11 * f5_14; + RHS14 += f5_14 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_10 = -f6 * m_A22; + m_A24 += m_A13 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_17 = -f6 * m_A48; + m_A51 += m_A13 * f6_17; + RHS17 += f6_17 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_12 = -f7 * m_A29; + m_A30 += m_A15 * f7_12; + m_A31 += m_A16 * f7_12; + RHS12 += f7_12 * RHS7; + const double f7_18 = -f7 * m_A53; + m_A55 += m_A15 * f7_18; + m_A61 += m_A16 * f7_18; + RHS18 += f7_18 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_15 = -f8 * m_A41; + m_A42 += m_A18 * f8_15; + m_A43 += m_A19 * f8_15; + RHS15 += f8_15 * RHS8; + const double f8_18 = -f8 * m_A54; + m_A58 += m_A18 * f8_18; + m_A61 += m_A19 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A20; + const double f9_16 = -f9 * m_A44; + m_A46 += m_A21 * f9_16; + RHS16 += f9_16 * RHS9; + const double f10 = 1.0 / m_A23; + const double f10_17 = -f10 * m_A49; + m_A51 += m_A24 * f10_17; + RHS17 += f10_17 * RHS10; + const double f11 = 1.0 / m_A25; + const double f11_16 = -f11 * m_A45; + m_A47 += m_A26 * f11_16; + RHS16 += f11_16 * RHS11; + const double f12 = 1.0 / m_A30; + const double f12_18 = -f12 * m_A55; + m_A61 += m_A31 * f12_18; + RHS18 += f12_18 * RHS12; + const double f13 = 1.0 / m_A32; + const double f13_17 = -f13 * m_A50; + m_A51 += m_A33 * f13_17; + m_A52 += m_A34 * f13_17; + RHS17 += f13_17 * RHS13; + const double f13_18 = -f13 * m_A56; + m_A60 += m_A33 * f13_18; + m_A61 += m_A34 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A36; + const double f14_18 = -f14 * m_A57; + m_A61 += m_A37 * f14_18; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A42; + const double f15_18 = -f15 * m_A58; + m_A61 += m_A43 * f15_18; + RHS18 += f15_18 * RHS15; + const double f16 = 1.0 / m_A46; + const double f16_18 = -f16 * m_A59; + m_A61 += m_A47 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A51; + const double f17_18 = -f17 * m_A60; + m_A61 += m_A52 * f17_18; + RHS18 += f17_18 * RHS17; + V[18] = RHS18 / m_A61; + double tmp17 = 0.0; + tmp17 += m_A52 * V[18]; + V[17] = (RHS17 - tmp17) / m_A51; + double tmp16 = 0.0; + tmp16 += m_A47 * V[18]; + V[16] = (RHS16 - tmp16) / m_A46; + double tmp15 = 0.0; + tmp15 += m_A43 * V[18]; + V[15] = (RHS15 - tmp15) / m_A42; + double tmp14 = 0.0; + tmp14 += m_A37 * V[18]; + V[14] = (RHS14 - tmp14) / m_A36; + double tmp13 = 0.0; + tmp13 += m_A33 * V[17]; + tmp13 += m_A34 * V[18]; + V[13] = (RHS13 - tmp13) / m_A32; + double tmp12 = 0.0; + tmp12 += m_A31 * V[18]; + V[12] = (RHS12 - tmp12) / m_A30; + double tmp11 = 0.0; + tmp11 += m_A26 * V[18]; + V[11] = (RHS11 - tmp11) / m_A25; + double tmp10 = 0.0; + tmp10 += m_A24 * V[17]; + V[10] = (RHS10 - tmp10) / m_A23; + double tmp9 = 0.0; + tmp9 += m_A21 * V[16]; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A18 * V[15]; + tmp8 += m_A19 * V[18]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A15 * V[12]; + tmp7 += m_A16 * V[18]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[17]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[14]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[15]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[15]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[15]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[12]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[12]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw +static void nl_gcr_64_double_double_ec4f6d2dad5961b9(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A1 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A3 += go[6]; + double RHS1 = Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A6 += gt[17]; + m_A6 += gt[18]; + m_A6 += gt[19]; + m_A9 += go[12]; + m_A7 += go[13]; + m_A7 += go[14]; + m_A8 += go[15]; + m_A8 += go[16]; + m_A10 += go[17]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A11 += gt[23]; + m_A12 += go[20]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + m_A13 += gt[24]; + m_A13 += gt[25]; + m_A14 += go[24]; + double RHS5 = Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[25] * *cnV[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A15 += gt[28]; + m_A15 += gt[29]; + m_A15 += gt[30]; + m_A15 += gt[31]; + m_A15 += gt[32]; + m_A15 += gt[33]; + m_A18 += go[26]; + m_A16 += go[27]; + m_A16 += go[28]; + m_A17 += go[29]; + m_A17 += go[30]; + m_A19 += go[31]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 -= go[32] * *cnV[32]; + RHS6 -= go[33] * *cnV[33]; + m_A21 += gt[34]; + m_A21 += gt[35]; + m_A21 += gt[36]; + m_A21 += gt[37]; + m_A21 += gt[38]; + m_A23 += go[34]; + m_A23 += go[35]; + m_A20 += go[36]; + m_A20 += go[37]; + double RHS7 = Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 += Idr[38]; + RHS7 -= go[38] * *cnV[38]; + m_A26 += gt[39]; + m_A26 += gt[40]; + m_A26 += gt[41]; + m_A26 += gt[42]; + m_A26 += gt[43]; + m_A28 += go[39]; + m_A28 += go[40]; + m_A25 += go[41]; + m_A25 += go[42]; + double RHS8 = Idr[39]; + RHS8 += Idr[40]; + RHS8 += Idr[41]; + RHS8 += Idr[42]; + RHS8 += Idr[43]; + RHS8 -= go[43] * *cnV[43]; + m_A33 += gt[44]; + m_A33 += gt[45]; + m_A33 += gt[46]; + m_A33 += gt[47]; + m_A33 += gt[48]; + m_A31 += go[44]; + m_A31 += go[45]; + m_A30 += go[46]; + m_A35 += go[47]; + m_A35 += go[48]; + double RHS9 = Idr[44]; + RHS9 += Idr[45]; + RHS9 += Idr[46]; + RHS9 += Idr[47]; + RHS9 += Idr[48]; + m_A39 += gt[49]; + m_A39 += gt[50]; + m_A39 += gt[51]; + m_A39 += gt[52]; + m_A39 += gt[53]; + m_A37 += go[49]; + m_A37 += go[50]; + m_A36 += go[51]; + m_A41 += go[52]; + m_A41 += go[53]; + double RHS10 = Idr[49]; + RHS10 += Idr[50]; + RHS10 += Idr[51]; + RHS10 += Idr[52]; + RHS10 += Idr[53]; + m_A46 += gt[54]; + m_A46 += gt[55]; + m_A46 += gt[56]; + m_A46 += gt[57]; + m_A46 += gt[58]; + m_A44 += go[54]; + m_A44 += go[55]; + m_A43 += go[56]; + m_A42 += go[57]; + double RHS11 = Idr[54]; + RHS11 += Idr[55]; + RHS11 += Idr[56]; + RHS11 += Idr[57]; + RHS11 += Idr[58]; + RHS11 -= go[58] * *cnV[58]; + m_A52 += gt[59]; + m_A52 += gt[60]; + m_A52 += gt[61]; + m_A52 += gt[62]; + m_A52 += gt[63]; + m_A50 += go[59]; + m_A50 += go[60]; + m_A49 += go[61]; + m_A48 += go[62]; + double RHS12 = Idr[59]; + RHS12 += Idr[60]; + RHS12 += Idr[61]; + RHS12 += Idr[62]; + RHS12 += Idr[63]; + RHS12 -= go[63] * *cnV[63]; + m_A63 += gt[64]; + m_A63 += gt[65]; + m_A63 += gt[66]; + m_A63 += gt[67]; + m_A63 += gt[68]; + m_A63 += gt[69]; + m_A63 += gt[70]; + m_A63 += gt[71]; + m_A63 += gt[72]; + m_A63 += gt[73]; + m_A63 += gt[74]; + m_A56 += go[64]; + m_A60 += go[65]; + m_A60 += go[66]; + m_A55 += go[67]; + m_A59 += go[68]; + m_A59 += go[69]; + m_A54 += go[70]; + m_A54 += go[71]; + double RHS13 = Idr[64]; + RHS13 += Idr[65]; + RHS13 += Idr[66]; + RHS13 += Idr[67]; + RHS13 += Idr[68]; + RHS13 += Idr[69]; + RHS13 += Idr[70]; + RHS13 += Idr[71]; + RHS13 += Idr[72]; + RHS13 += Idr[73]; + RHS13 += Idr[74]; + RHS13 -= go[72] * *cnV[72]; + RHS13 -= go[73] * *cnV[73]; + RHS13 -= go[74] * *cnV[74]; + const double f0 = 1.0 / m_A0; + const double f0_13 = -f0 * m_A54; + m_A63 += m_A1 * f0_13; + RHS13 += f0_13 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_9 = -f1 * m_A30; + m_A33 += m_A3 * f1_9; + RHS9 += f1_9 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_11 = -f2 * m_A42; + m_A46 += m_A5 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_7 = -f3 * m_A20; + m_A21 += m_A7 * f3_7; + m_A22 += m_A8 * f3_7; + m_A23 += m_A9 * f3_7; + m_A24 += m_A10 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_9 = -f3 * m_A31; + m_A32 += m_A7 * f3_9; + m_A33 += m_A8 * f3_9; + m_A34 += m_A9 * f3_9; + m_A35 += m_A10 * f3_9; + RHS9 += f3_9 * RHS3; + const double f3_11 = -f3 * m_A43; + m_A44 += m_A7 * f3_11; + m_A45 += m_A8 * f3_11; + m_A46 += m_A9 * f3_11; + m_A47 += m_A10 * f3_11; + RHS11 += f3_11 * RHS3; + const double f3_13 = -f3 * m_A55; + m_A57 += m_A7 * f3_13; + m_A59 += m_A8 * f3_13; + m_A61 += m_A9 * f3_13; + m_A63 += m_A10 * f3_13; + RHS13 += f3_13 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_10 = -f4 * m_A36; + m_A39 += m_A12 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_12 = -f5 * m_A48; + m_A52 += m_A14 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_8 = -f6 * m_A25; + m_A26 += m_A16 * f6_8; + m_A27 += m_A17 * f6_8; + m_A28 += m_A18 * f6_8; + m_A29 += m_A19 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_10 = -f6 * m_A37; + m_A38 += m_A16 * f6_10; + m_A39 += m_A17 * f6_10; + m_A40 += m_A18 * f6_10; + m_A41 += m_A19 * f6_10; + RHS10 += f6_10 * RHS6; + const double f6_12 = -f6 * m_A49; + m_A50 += m_A16 * f6_12; + m_A51 += m_A17 * f6_12; + m_A52 += m_A18 * f6_12; + m_A53 += m_A19 * f6_12; + RHS12 += f6_12 * RHS6; + const double f6_13 = -f6 * m_A56; + m_A58 += m_A16 * f6_13; + m_A60 += m_A17 * f6_13; + m_A62 += m_A18 * f6_13; + m_A63 += m_A19 * f6_13; + RHS13 += f6_13 * RHS6; + const double f7 = 1.0 / m_A21; + const double f7_9 = -f7 * m_A32; + m_A33 += m_A22 * f7_9; + m_A34 += m_A23 * f7_9; + m_A35 += m_A24 * f7_9; + RHS9 += f7_9 * RHS7; + const double f7_11 = -f7 * m_A44; + m_A45 += m_A22 * f7_11; + m_A46 += m_A23 * f7_11; + m_A47 += m_A24 * f7_11; + RHS11 += f7_11 * RHS7; + const double f7_13 = -f7 * m_A57; + m_A59 += m_A22 * f7_13; + m_A61 += m_A23 * f7_13; + m_A63 += m_A24 * f7_13; + RHS13 += f7_13 * RHS7; + const double f8 = 1.0 / m_A26; + const double f8_10 = -f8 * m_A38; + m_A39 += m_A27 * f8_10; + m_A40 += m_A28 * f8_10; + m_A41 += m_A29 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_12 = -f8 * m_A50; + m_A51 += m_A27 * f8_12; + m_A52 += m_A28 * f8_12; + m_A53 += m_A29 * f8_12; + RHS12 += f8_12 * RHS8; + const double f8_13 = -f8 * m_A58; + m_A60 += m_A27 * f8_13; + m_A62 += m_A28 * f8_13; + m_A63 += m_A29 * f8_13; + RHS13 += f8_13 * RHS8; + const double f9 = 1.0 / m_A33; + const double f9_11 = -f9 * m_A45; + m_A46 += m_A34 * f9_11; + m_A47 += m_A35 * f9_11; + RHS11 += f9_11 * RHS9; + const double f9_13 = -f9 * m_A59; + m_A61 += m_A34 * f9_13; + m_A63 += m_A35 * f9_13; + RHS13 += f9_13 * RHS9; + const double f10 = 1.0 / m_A39; + const double f10_12 = -f10 * m_A51; + m_A52 += m_A40 * f10_12; + m_A53 += m_A41 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_13 = -f10 * m_A60; + m_A62 += m_A40 * f10_13; + m_A63 += m_A41 * f10_13; + RHS13 += f10_13 * RHS10; + const double f11 = 1.0 / m_A46; + const double f11_13 = -f11 * m_A61; + m_A63 += m_A47 * f11_13; + RHS13 += f11_13 * RHS11; + const double f12 = 1.0 / m_A52; + const double f12_13 = -f12 * m_A62; + m_A63 += m_A53 * f12_13; + RHS13 += f12_13 * RHS12; + V[13] = RHS13 / m_A63; + double tmp12 = 0.0; + tmp12 += m_A53 * V[13]; + V[12] = (RHS12 - tmp12) / m_A52; + double tmp11 = 0.0; + tmp11 += m_A47 * V[13]; + V[11] = (RHS11 - tmp11) / m_A46; + double tmp10 = 0.0; + tmp10 += m_A40 * V[12]; + tmp10 += m_A41 * V[13]; + V[10] = (RHS10 - tmp10) / m_A39; + double tmp9 = 0.0; + tmp9 += m_A34 * V[11]; + tmp9 += m_A35 * V[13]; + V[9] = (RHS9 - tmp9) / m_A33; + double tmp8 = 0.0; + tmp8 += m_A27 * V[10]; + tmp8 += m_A28 * V[12]; + tmp8 += m_A29 * V[13]; + V[8] = (RHS8 - tmp8) / m_A26; + double tmp7 = 0.0; + tmp7 += m_A22 * V[9]; + tmp7 += m_A23 * V[11]; + tmp7 += m_A24 * V[13]; + V[7] = (RHS7 - tmp7) / m_A21; + double tmp6 = 0.0; + tmp6 += m_A16 * V[8]; + tmp6 += m_A17 * V[10]; + tmp6 += m_A18 * V[12]; + tmp6 += m_A19 * V[13]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A14 * V[12]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A12 * V[10]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A7 * V[7]; + tmp3 += m_A8 * V[9]; + tmp3 += m_A9 * V[11]; + tmp3 += m_A10 * V[13]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[9]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[13]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcas,wotw +static void nl_gcr_65_double_double_b7344e05aac90017(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A3 += go[0]; + m_A2 += go[1]; + m_A1 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A10 += go[12]; + m_A9 += go[13]; + m_A8 += go[14]; + m_A7 += go[15]; + double RHS2 = Idr[12]; + RHS2 += Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 -= go[16] * *cnV[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A12 += go[17]; + double RHS3 = Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A13 += gt[20]; + m_A13 += gt[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A13 += gt[24]; + m_A13 += gt[25]; + m_A14 += go[20]; + m_A15 += go[21]; + m_A16 += go[22]; + m_A16 += go[23]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + m_A17 += gt[26]; + m_A17 += gt[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A19 += go[26]; + m_A18 += go[27]; + double RHS5 = Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 -= go[28] * *cnV[28]; + RHS5 -= go[29] * *cnV[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A21 += go[30]; + m_A20 += go[31]; + double RHS6 = Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 += Idr[33]; + RHS6 -= go[32] * *cnV[32]; + RHS6 -= go[33] * *cnV[33]; + m_A29 += gt[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A27 += go[34]; + m_A26 += go[35]; + double RHS7 = Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 -= go[36] * *cnV[36]; + RHS7 -= go[37] * *cnV[37]; + m_A36 += gt[38]; + m_A36 += gt[39]; + m_A36 += gt[40]; + m_A36 += gt[41]; + m_A33 += go[38]; + m_A32 += go[39]; + double RHS8 = Idr[38]; + RHS8 += Idr[39]; + RHS8 += Idr[40]; + RHS8 += Idr[41]; + RHS8 -= go[40] * *cnV[40]; + RHS8 -= go[41] * *cnV[41]; + m_A43 += gt[42]; + m_A43 += gt[43]; + m_A43 += gt[44]; + m_A43 += gt[45]; + m_A43 += gt[46]; + m_A38 += go[42]; + m_A44 += go[43]; + m_A39 += go[44]; + double RHS9 = Idr[42]; + RHS9 += Idr[43]; + RHS9 += Idr[44]; + RHS9 += Idr[45]; + RHS9 += Idr[46]; + RHS9 -= go[45] * *cnV[45]; + RHS9 -= go[46] * *cnV[46]; + m_A46 += gt[47]; + m_A46 += gt[48]; + m_A46 += gt[49]; + m_A46 += gt[50]; + m_A46 += gt[51]; + m_A46 += gt[52]; + m_A46 += gt[53]; + m_A45 += go[47]; + m_A47 += go[48]; + double RHS10 = Idr[47]; + RHS10 += Idr[48]; + RHS10 += Idr[49]; + RHS10 += Idr[50]; + RHS10 += Idr[51]; + RHS10 += Idr[52]; + RHS10 += Idr[53]; + RHS10 -= go[49] * *cnV[49]; + RHS10 -= go[50] * *cnV[50]; + RHS10 -= go[51] * *cnV[51]; + RHS10 -= go[52] * *cnV[52]; + RHS10 -= go[53] * *cnV[53]; + m_A51 += gt[54]; + m_A51 += gt[55]; + m_A51 += gt[56]; + m_A49 += go[54]; + m_A48 += go[55]; + double RHS11 = Idr[54]; + RHS11 += Idr[55]; + RHS11 += Idr[56]; + RHS11 -= go[56] * *cnV[56]; + m_A56 += gt[57]; + m_A56 += gt[58]; + m_A54 += go[57]; + double RHS12 = Idr[57]; + RHS12 += Idr[58]; + RHS12 -= go[58] * *cnV[58]; + m_A64 += gt[59]; + m_A64 += gt[60]; + m_A64 += gt[61]; + m_A64 += gt[62]; + m_A59 += go[59]; + m_A59 += go[60]; + m_A58 += go[61]; + m_A60 += go[62]; + double RHS13 = Idr[59]; + RHS13 += Idr[60]; + RHS13 += Idr[61]; + RHS13 += Idr[62]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A20; + m_A22 += m_A1 * f0_6; + m_A23 += m_A2 * f0_6; + m_A24 += m_A3 * f0_6; + RHS6 += f0_6 * RHS0; + const double f0_7 = -f0 * m_A26; + m_A28 += m_A1 * f0_7; + m_A29 += m_A2 * f0_7; + m_A30 += m_A3 * f0_7; + RHS7 += f0_7 * RHS0; + const double f0_8 = -f0 * m_A32; + m_A34 += m_A1 * f0_8; + m_A35 += m_A2 * f0_8; + m_A36 += m_A3 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A4; + const double f1_9 = -f1 * m_A38; + m_A39 += m_A5 * f1_9; + RHS9 += f1_9 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_6 = -f2 * m_A21; + m_A22 += m_A7 * f2_6; + m_A23 += m_A8 * f2_6; + m_A24 += m_A9 * f2_6; + m_A25 += m_A10 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_7 = -f2 * m_A27; + m_A28 += m_A7 * f2_7; + m_A29 += m_A8 * f2_7; + m_A30 += m_A9 * f2_7; + m_A31 += m_A10 * f2_7; + RHS7 += f2_7 * RHS2; + const double f2_8 = -f2 * m_A33; + m_A34 += m_A7 * f2_8; + m_A35 += m_A8 * f2_8; + m_A36 += m_A9 * f2_8; + m_A37 += m_A10 * f2_8; + RHS8 += f2_8 * RHS2; + const double f2_9 = -f2 * m_A39; + m_A40 += m_A7 * f2_9; + m_A41 += m_A8 * f2_9; + m_A42 += m_A9 * f2_9; + m_A43 += m_A10 * f2_9; + RHS9 += f2_9 * RHS2; + const double f3 = 1.0 / m_A11; + const double f3_10 = -f3 * m_A45; + m_A47 += m_A12 * f3_10; + RHS10 += f3_10 * RHS3; + const double f3_13 = -f3 * m_A58; + m_A64 += m_A12 * f3_13; + RHS13 += f3_13 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_11 = -f4 * m_A48; + m_A50 += m_A14 * f4_11; + m_A51 += m_A15 * f4_11; + m_A53 += m_A16 * f4_11; + RHS11 += f4_11 * RHS4; + const double f4_13 = -f4 * m_A59; + m_A61 += m_A14 * f4_13; + m_A62 += m_A15 * f4_13; + m_A64 += m_A16 * f4_13; + RHS13 += f4_13 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_11 = -f5 * m_A49; + m_A51 += m_A18 * f5_11; + m_A52 += m_A19 * f5_11; + RHS11 += f5_11 * RHS5; + const double f5_12 = -f5 * m_A54; + m_A55 += m_A18 * f5_12; + m_A56 += m_A19 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A22; + const double f6_7 = -f6 * m_A28; + m_A29 += m_A23 * f6_7; + m_A30 += m_A24 * f6_7; + m_A31 += m_A25 * f6_7; + RHS7 += f6_7 * RHS6; + const double f6_8 = -f6 * m_A34; + m_A35 += m_A23 * f6_8; + m_A36 += m_A24 * f6_8; + m_A37 += m_A25 * f6_8; + RHS8 += f6_8 * RHS6; + const double f6_9 = -f6 * m_A40; + m_A41 += m_A23 * f6_9; + m_A42 += m_A24 * f6_9; + m_A43 += m_A25 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A29; + const double f7_8 = -f7 * m_A35; + m_A36 += m_A30 * f7_8; + m_A37 += m_A31 * f7_8; + RHS8 += f7_8 * RHS7; + const double f7_9 = -f7 * m_A41; + m_A42 += m_A30 * f7_9; + m_A43 += m_A31 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A36; + const double f8_9 = -f8 * m_A42; + m_A43 += m_A37 * f8_9; + RHS9 += f8_9 * RHS8; + const double f9 = 1.0 / m_A43; + const double f9_13 = -f9 * m_A60; + m_A64 += m_A44 * f9_13; + RHS13 += f9_13 * RHS9; + const double f10 = 1.0 / m_A46; + const double f10_11 = -f10 * m_A50; + m_A53 += m_A47 * f10_11; + RHS11 += f10_11 * RHS10; + const double f10_13 = -f10 * m_A61; + m_A64 += m_A47 * f10_13; + RHS13 += f10_13 * RHS10; + const double f11 = 1.0 / m_A51; + const double f11_12 = -f11 * m_A55; + m_A56 += m_A52 * f11_12; + m_A57 += m_A53 * f11_12; + RHS12 += f11_12 * RHS11; + const double f11_13 = -f11 * m_A62; + m_A63 += m_A52 * f11_13; + m_A64 += m_A53 * f11_13; + RHS13 += f11_13 * RHS11; + const double f12 = 1.0 / m_A56; + const double f12_13 = -f12 * m_A63; + m_A64 += m_A57 * f12_13; + RHS13 += f12_13 * RHS12; + V[13] = RHS13 / m_A64; + double tmp12 = 0.0; + tmp12 += m_A57 * V[13]; + V[12] = (RHS12 - tmp12) / m_A56; + double tmp11 = 0.0; + tmp11 += m_A52 * V[12]; + tmp11 += m_A53 * V[13]; + V[11] = (RHS11 - tmp11) / m_A51; + double tmp10 = 0.0; + tmp10 += m_A47 * V[13]; + V[10] = (RHS10 - tmp10) / m_A46; + double tmp9 = 0.0; + tmp9 += m_A44 * V[13]; + V[9] = (RHS9 - tmp9) / m_A43; + double tmp8 = 0.0; + tmp8 += m_A37 * V[9]; + V[8] = (RHS8 - tmp8) / m_A36; + double tmp7 = 0.0; + tmp7 += m_A30 * V[8]; + tmp7 += m_A31 * V[9]; + V[7] = (RHS7 - tmp7) / m_A29; + double tmp6 = 0.0; + tmp6 += m_A23 * V[7]; + tmp6 += m_A24 * V[8]; + tmp6 += m_A25 * V[9]; + V[6] = (RHS6 - tmp6) / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[11]; + tmp5 += m_A19 * V[12]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A14 * V[10]; + tmp4 += m_A15 * V[11]; + tmp4 += m_A16 * V[13]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A12 * V[13]; + V[3] = (RHS3 - tmp3) / m_A11; + double tmp2 = 0.0; + tmp2 += m_A7 * V[6]; + tmp2 += m_A8 * V[7]; + tmp2 += m_A9 * V[8]; + tmp2 += m_A10 * V[9]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A5 * V[2]; + V[1] = (RHS1 - tmp1) / m_A4; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + tmp0 += m_A2 * V[7]; + tmp0 += m_A3 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcrus +static void nl_gcr_129_double_double_8d7bddf33d942482(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A4 += go[3]; + m_A3 += go[4]; + m_A3 += go[5]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A7 += go[8]; + m_A6 += go[9]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A9 += go[10]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[11] * *cnV[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A10 += gt[14]; + m_A11 += go[12]; + m_A12 += go[13]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[14] * *cnV[14]; + m_A13 += gt[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A15 += go[15]; + m_A14 += go[16]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A16 += gt[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A17 += go[18]; + m_A18 += go[19]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 -= go[20] * *cnV[20]; + RHS6 -= go[21] * *cnV[21]; + RHS6 -= go[22] * *cnV[22]; + m_A19 += gt[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A21 += go[23]; + m_A20 += go[24]; + double RHS7 = Idr[23]; + RHS7 += Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 -= go[25] * *cnV[25]; + RHS7 -= go[26] * *cnV[26]; + RHS7 -= go[27] * *cnV[27]; + RHS7 -= go[28] * *cnV[28]; + RHS7 -= go[29] * *cnV[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A24 += go[30]; + m_A23 += go[31]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + m_A25 += gt[32]; + m_A25 += gt[33]; + m_A25 += gt[34]; + m_A25 += gt[35]; + m_A25 += gt[36]; + m_A25 += gt[37]; + m_A25 += gt[38]; + m_A27 += go[32]; + m_A27 += go[33]; + m_A26 += go[34]; + m_A28 += go[35]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 += Idr[38]; + RHS9 -= go[36] * *cnV[36]; + RHS9 -= go[37] * *cnV[37]; + RHS9 -= go[38] * *cnV[38]; + m_A29 += gt[39]; + m_A29 += gt[40]; + m_A29 += gt[41]; + m_A29 += gt[42]; + m_A29 += gt[43]; + m_A29 += gt[44]; + m_A31 += go[39]; + m_A30 += go[40]; + m_A30 += go[41]; + double RHS10 = Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 += Idr[44]; + RHS10 -= go[42] * *cnV[42]; + RHS10 -= go[43] * *cnV[43]; + RHS10 -= go[44] * *cnV[44]; + m_A32 += gt[45]; + m_A32 += gt[46]; + m_A32 += gt[47]; + m_A32 += gt[48]; + m_A32 += gt[49]; + m_A33 += go[45]; + m_A33 += go[46]; + m_A34 += go[47]; + double RHS11 = Idr[45]; + RHS11 += Idr[46]; + RHS11 += Idr[47]; + RHS11 += Idr[48]; + RHS11 += Idr[49]; + RHS11 -= go[48] * *cnV[48]; + RHS11 -= go[49] * *cnV[49]; + m_A35 += gt[50]; + m_A35 += gt[51]; + m_A35 += gt[52]; + m_A35 += gt[53]; + m_A37 += go[50]; + m_A37 += go[51]; + m_A36 += go[52]; + double RHS12 = Idr[50]; + RHS12 += Idr[51]; + RHS12 += Idr[52]; + RHS12 += Idr[53]; + RHS12 -= go[53] * *cnV[53]; + m_A38 += gt[54]; + m_A38 += gt[55]; + m_A38 += gt[56]; + m_A38 += gt[57]; + m_A40 += go[54]; + m_A40 += go[55]; + m_A39 += go[56]; + double RHS13 = Idr[54]; + RHS13 += Idr[55]; + RHS13 += Idr[56]; + RHS13 += Idr[57]; + RHS13 -= go[57] * *cnV[57]; + m_A41 += gt[58]; + m_A41 += gt[59]; + m_A41 += gt[60]; + m_A41 += gt[61]; + m_A42 += go[58]; + double RHS14 = Idr[58]; + RHS14 += Idr[59]; + RHS14 += Idr[60]; + RHS14 += Idr[61]; + RHS14 -= go[59] * *cnV[59]; + RHS14 -= go[60] * *cnV[60]; + RHS14 -= go[61] * *cnV[61]; + m_A45 += gt[62]; + m_A45 += gt[63]; + m_A45 += gt[64]; + m_A45 += gt[65]; + m_A45 += gt[66]; + m_A44 += go[62]; + m_A44 += go[63]; + m_A43 += go[64]; + double RHS15 = Idr[62]; + RHS15 += Idr[63]; + RHS15 += Idr[64]; + RHS15 += Idr[65]; + RHS15 += Idr[66]; + RHS15 -= go[65] * *cnV[65]; + RHS15 -= go[66] * *cnV[66]; + m_A49 += gt[67]; + m_A49 += gt[68]; + m_A48 += go[67]; + m_A47 += go[68]; + double RHS16 = Idr[67]; + RHS16 += Idr[68]; + m_A56 += gt[69]; + m_A56 += gt[70]; + m_A56 += gt[71]; + m_A54 += go[69]; + m_A52 += go[70]; + m_A55 += go[71]; + double RHS17 = Idr[69]; + RHS17 += Idr[70]; + RHS17 += Idr[71]; + m_A63 += gt[72]; + m_A63 += gt[73]; + m_A63 += gt[74]; + m_A63 += gt[75]; + m_A61 += go[72]; + m_A61 += go[73]; + m_A60 += go[74]; + double RHS18 = Idr[72]; + RHS18 += Idr[73]; + RHS18 += Idr[74]; + RHS18 += Idr[75]; + RHS18 -= go[75] * *cnV[75]; + m_A71 += gt[76]; + m_A71 += gt[77]; + m_A71 += gt[78]; + m_A71 += gt[79]; + m_A71 += gt[80]; + m_A71 += gt[81]; + m_A71 += gt[82]; + m_A71 += gt[83]; + m_A68 += go[76]; + m_A68 += go[77]; + m_A67 += go[78]; + m_A67 += go[79]; + double RHS19 = Idr[76]; + RHS19 += Idr[77]; + RHS19 += Idr[78]; + RHS19 += Idr[79]; + RHS19 += Idr[80]; + RHS19 += Idr[81]; + RHS19 += Idr[82]; + RHS19 += Idr[83]; + RHS19 -= go[80] * *cnV[80]; + RHS19 -= go[81] * *cnV[81]; + RHS19 -= go[82] * *cnV[82]; + RHS19 -= go[83] * *cnV[83]; + m_A76 += gt[84]; + m_A76 += gt[85]; + m_A77 += go[84]; + m_A74 += go[85]; + double RHS20 = Idr[84]; + RHS20 += Idr[85]; + m_A83 += gt[86]; + m_A83 += gt[87]; + m_A83 += gt[88]; + m_A83 += gt[89]; + m_A80 += go[86]; + m_A79 += go[87]; + m_A78 += go[88]; + double RHS21 = Idr[86]; + RHS21 += Idr[87]; + RHS21 += Idr[88]; + RHS21 += Idr[89]; + RHS21 -= go[89] * *cnV[89]; + m_A89 += gt[90]; + m_A89 += gt[91]; + m_A89 += gt[92]; + m_A89 += gt[93]; + m_A89 += gt[94]; + m_A89 += gt[95]; + m_A87 += go[90]; + m_A86 += go[91]; + m_A86 += go[92]; + double RHS22 = Idr[90]; + RHS22 += Idr[91]; + RHS22 += Idr[92]; + RHS22 += Idr[93]; + RHS22 += Idr[94]; + RHS22 += Idr[95]; + RHS22 -= go[93] * *cnV[93]; + RHS22 -= go[94] * *cnV[94]; + RHS22 -= go[95] * *cnV[95]; + m_A95 += gt[96]; + m_A95 += gt[97]; + m_A95 += gt[98]; + m_A95 += gt[99]; + m_A95 += gt[100]; + m_A93 += go[96]; + m_A92 += go[97]; + m_A92 += go[98]; + double RHS23 = Idr[96]; + RHS23 += Idr[97]; + RHS23 += Idr[98]; + RHS23 += Idr[99]; + RHS23 += Idr[100]; + RHS23 -= go[99] * *cnV[99]; + RHS23 -= go[100] * *cnV[100]; + m_A98 += gt[101]; + m_A98 += gt[102]; + m_A98 += gt[103]; + m_A98 += gt[104]; + m_A98 += gt[105]; + m_A99 += go[101]; + m_A99 += go[102]; + m_A97 += go[103]; + double RHS24 = Idr[101]; + RHS24 += Idr[102]; + RHS24 += Idr[103]; + RHS24 += Idr[104]; + RHS24 += Idr[105]; + RHS24 -= go[104] * *cnV[104]; + RHS24 -= go[105] * *cnV[105]; + m_A109 += gt[106]; + m_A109 += gt[107]; + m_A109 += gt[108]; + m_A109 += gt[109]; + m_A109 += gt[110]; + m_A110 += go[106]; + m_A101 += go[107]; + m_A100 += go[108]; + double RHS25 = Idr[106]; + RHS25 += Idr[107]; + RHS25 += Idr[108]; + RHS25 += Idr[109]; + RHS25 += Idr[110]; + RHS25 -= go[109] * *cnV[109]; + RHS25 -= go[110] * *cnV[110]; + m_A115 += gt[111]; + m_A115 += gt[112]; + m_A115 += gt[113]; + m_A115 += gt[114]; + m_A115 += gt[115]; + m_A115 += gt[116]; + m_A115 += gt[117]; + m_A113 += go[111]; + m_A112 += go[112]; + double RHS26 = Idr[111]; + RHS26 += Idr[112]; + RHS26 += Idr[113]; + RHS26 += Idr[114]; + RHS26 += Idr[115]; + RHS26 += Idr[116]; + RHS26 += Idr[117]; + RHS26 -= go[113] * *cnV[113]; + RHS26 -= go[114] * *cnV[114]; + RHS26 -= go[115] * *cnV[115]; + RHS26 -= go[116] * *cnV[116]; + RHS26 -= go[117] * *cnV[117]; + m_A123 += gt[118]; + m_A123 += gt[119]; + m_A123 += gt[120]; + m_A123 += gt[121]; + m_A118 += go[118]; + m_A124 += go[119]; + m_A117 += go[120]; + m_A120 += go[121]; + double RHS27 = Idr[118]; + RHS27 += Idr[119]; + RHS27 += Idr[120]; + RHS27 += Idr[121]; + m_A128 += gt[122]; + m_A128 += gt[123]; + m_A128 += gt[124]; + m_A128 += gt[125]; + m_A128 += gt[126]; + m_A127 += go[122]; + m_A126 += go[123]; + m_A126 += go[124]; + m_A125 += go[125]; + double RHS28 = Idr[122]; + RHS28 += Idr[123]; + RHS28 += Idr[124]; + RHS28 += Idr[125]; + RHS28 += Idr[126]; + RHS28 -= go[126] * *cnV[126]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A43; + m_A45 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_15 = -f1 * m_A44; + m_A45 += m_A3 * f1_15; + m_A46 += m_A4 * f1_15; + RHS15 += f1_15 * RHS1; + const double f1_20 = -f1 * m_A74; + m_A75 += m_A3 * f1_20; + m_A76 += m_A4 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_24 = -f2 * m_A97; + m_A98 += m_A6 * f2_24; + m_A99 += m_A7 * f2_24; + RHS24 += f2_24 * RHS2; + const double f2_28 = -f2 * m_A125; + m_A126 += m_A6 * f2_28; + m_A128 += m_A7 * f2_28; + RHS28 += f2_28 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_27 = -f3 * m_A117; + m_A123 += m_A9 * f3_27; + RHS27 += f3_27 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_16 = -f4 * m_A47; + m_A49 += m_A11 * f4_16; + m_A51 += m_A12 * f4_16; + RHS16 += f4_16 * RHS4; + const double f4_26 = -f4 * m_A112; + m_A113 += m_A11 * f4_26; + m_A116 += m_A12 * f4_26; + RHS26 += f4_26 * RHS4; + const double f4_27 = -f4 * m_A118; + m_A119 += m_A11 * f4_27; + m_A123 += m_A12 * f4_27; + RHS27 += f4_27 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_16 = -f5 * m_A48; + m_A49 += m_A14 * f5_16; + m_A50 += m_A15 * f5_16; + RHS16 += f5_16 * RHS5; + const double f5_25 = -f5 * m_A100; + m_A102 += m_A14 * f5_25; + m_A109 += m_A15 * f5_25; + RHS25 += f5_25 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_17 = -f6 * m_A52; + m_A53 += m_A17 * f6_17; + m_A56 += m_A18 * f6_17; + RHS17 += f6_17 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_17 = -f7 * m_A53; + m_A55 += m_A20 * f7_17; + m_A56 += m_A21 * f7_17; + RHS17 += f7_17 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_17 = -f8 * m_A54; + m_A56 += m_A23 * f8_17; + m_A57 += m_A24 * f8_17; + RHS17 += f8_17 * RHS8; + const double f8_18 = -f8 * m_A60; + m_A62 += m_A23 * f8_18; + m_A63 += m_A24 * f8_18; + RHS18 += f8_18 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_17 = -f9 * m_A55; + m_A56 += m_A26 * f9_17; + m_A58 += m_A27 * f9_17; + m_A59 += m_A28 * f9_17; + RHS17 += f9_17 * RHS9; + const double f9_19 = -f9 * m_A67; + m_A69 += m_A26 * f9_19; + m_A71 += m_A27 * f9_19; + m_A73 += m_A28 * f9_19; + RHS19 += f9_19 * RHS9; + const double f9_25 = -f9 * m_A101; + m_A103 += m_A26 * f9_25; + m_A105 += m_A27 * f9_25; + m_A109 += m_A28 * f9_25; + RHS25 += f9_25 * RHS9; + const double f10 = 1.0 / m_A29; + const double f10_18 = -f10 * m_A61; + m_A63 += m_A30 * f10_18; + m_A65 += m_A31 * f10_18; + RHS18 += f10_18 * RHS10; + const double f10_21 = -f10 * m_A78; + m_A81 += m_A30 * f10_21; + m_A83 += m_A31 * f10_21; + RHS21 += f10_21 * RHS10; + const double f11 = 1.0 / m_A32; + const double f11_19 = -f11 * m_A68; + m_A71 += m_A33 * f11_19; + m_A72 += m_A34 * f11_19; + RHS19 += f11_19 * RHS11; + const double f11_21 = -f11 * m_A79; + m_A82 += m_A33 * f11_21; + m_A83 += m_A34 * f11_21; + RHS21 += f11_21 * RHS11; + const double f12 = 1.0 / m_A35; + const double f12_21 = -f12 * m_A80; + m_A83 += m_A36 * f12_21; + m_A84 += m_A37 * f12_21; + RHS21 += f12_21 * RHS12; + const double f12_22 = -f12 * m_A86; + m_A88 += m_A36 * f12_22; + m_A89 += m_A37 * f12_22; + RHS22 += f12_22 * RHS12; + const double f13 = 1.0 / m_A38; + const double f13_22 = -f13 * m_A87; + m_A89 += m_A39 * f13_22; + m_A90 += m_A40 * f13_22; + RHS22 += f13_22 * RHS13; + const double f13_23 = -f13 * m_A92; + m_A94 += m_A39 * f13_23; + m_A95 += m_A40 * f13_23; + RHS23 += f13_23 * RHS13; + const double f14 = 1.0 / m_A41; + const double f14_23 = -f14 * m_A93; + m_A95 += m_A42 * f14_23; + RHS23 += f14_23 * RHS14; + const double f15 = 1.0 / m_A45; + const double f15_20 = -f15 * m_A75; + m_A76 += m_A46 * f15_20; + RHS20 += f15_20 * RHS15; + const double f16 = 1.0 / m_A49; + const double f16_25 = -f16 * m_A102; + m_A109 += m_A50 * f16_25; + m_A111 += m_A51 * f16_25; + RHS25 += f16_25 * RHS16; + const double f16_26 = -f16 * m_A113; + m_A114 += m_A50 * f16_26; + m_A116 += m_A51 * f16_26; + RHS26 += f16_26 * RHS16; + const double f16_27 = -f16 * m_A119; + m_A121 += m_A50 * f16_27; + m_A123 += m_A51 * f16_27; + RHS27 += f16_27 * RHS16; + const double f17 = 1.0 / m_A56; + const double f17_18 = -f17 * m_A62; + m_A63 += m_A57 * f17_18; + m_A64 += m_A58 * f17_18; + m_A66 += m_A59 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_19 = -f17 * m_A69; + m_A70 += m_A57 * f17_19; + m_A71 += m_A58 * f17_19; + m_A73 += m_A59 * f17_19; + RHS19 += f17_19 * RHS17; + const double f17_25 = -f17 * m_A103; + m_A104 += m_A57 * f17_25; + m_A105 += m_A58 * f17_25; + m_A109 += m_A59 * f17_25; + RHS25 += f17_25 * RHS17; + const double f18 = 1.0 / m_A63; + const double f18_19 = -f18 * m_A70; + m_A71 += m_A64 * f18_19; + m_A72 += m_A65 * f18_19; + m_A73 += m_A66 * f18_19; + RHS19 += f18_19 * RHS18; + const double f18_21 = -f18 * m_A81; + m_A82 += m_A64 * f18_21; + m_A83 += m_A65 * f18_21; + m_A85 += m_A66 * f18_21; + RHS21 += f18_21 * RHS18; + const double f18_25 = -f18 * m_A104; + m_A105 += m_A64 * f18_25; + m_A106 += m_A65 * f18_25; + m_A109 += m_A66 * f18_25; + RHS25 += f18_25 * RHS18; + const double f19 = 1.0 / m_A71; + const double f19_21 = -f19 * m_A82; + m_A83 += m_A72 * f19_21; + m_A85 += m_A73 * f19_21; + RHS21 += f19_21 * RHS19; + const double f19_25 = -f19 * m_A105; + m_A106 += m_A72 * f19_25; + m_A109 += m_A73 * f19_25; + RHS25 += f19_25 * RHS19; + const double f20 = 1.0 / m_A76; + const double f20_27 = -f20 * m_A120; + m_A123 += m_A77 * f20_27; + RHS27 += f20_27 * RHS20; + const double f21 = 1.0 / m_A83; + const double f21_22 = -f21 * m_A88; + m_A89 += m_A84 * f21_22; + m_A91 += m_A85 * f21_22; + RHS22 += f21_22 * RHS21; + const double f21_25 = -f21 * m_A106; + m_A107 += m_A84 * f21_25; + m_A109 += m_A85 * f21_25; + RHS25 += f21_25 * RHS21; + const double f22 = 1.0 / m_A89; + const double f22_23 = -f22 * m_A94; + m_A95 += m_A90 * f22_23; + m_A96 += m_A91 * f22_23; + RHS23 += f22_23 * RHS22; + const double f22_25 = -f22 * m_A107; + m_A108 += m_A90 * f22_25; + m_A109 += m_A91 * f22_25; + RHS25 += f22_25 * RHS22; + const double f23 = 1.0 / m_A95; + const double f23_25 = -f23 * m_A108; + m_A109 += m_A96 * f23_25; + RHS25 += f23_25 * RHS23; + const double f24 = 1.0 / m_A98; + const double f24_28 = -f24 * m_A126; + m_A128 += m_A99 * f24_28; + RHS28 += f24_28 * RHS24; + const double f25 = 1.0 / m_A109; + const double f25_26 = -f25 * m_A114; + m_A115 += m_A110 * f25_26; + m_A116 += m_A111 * f25_26; + RHS26 += f25_26 * RHS25; + const double f25_27 = -f25 * m_A121; + m_A122 += m_A110 * f25_27; + m_A123 += m_A111 * f25_27; + RHS27 += f25_27 * RHS25; + const double f26 = 1.0 / m_A115; + const double f26_27 = -f26 * m_A122; + m_A123 += m_A116 * f26_27; + RHS27 += f26_27 * RHS26; + const double f27 = 1.0 / m_A123; + const double f27_28 = -f27 * m_A127; + m_A128 += m_A124 * f27_28; + RHS28 += f27_28 * RHS27; + V[28] = RHS28 / m_A128; + double tmp27 = 0.0; + tmp27 += m_A124 * V[28]; + V[27] = (RHS27 - tmp27) / m_A123; + double tmp26 = 0.0; + tmp26 += m_A116 * V[27]; + V[26] = (RHS26 - tmp26) / m_A115; + double tmp25 = 0.0; + tmp25 += m_A110 * V[26]; + tmp25 += m_A111 * V[27]; + V[25] = (RHS25 - tmp25) / m_A109; + double tmp24 = 0.0; + tmp24 += m_A99 * V[28]; + V[24] = (RHS24 - tmp24) / m_A98; + double tmp23 = 0.0; + tmp23 += m_A96 * V[25]; + V[23] = (RHS23 - tmp23) / m_A95; + double tmp22 = 0.0; + tmp22 += m_A90 * V[23]; + tmp22 += m_A91 * V[25]; + V[22] = (RHS22 - tmp22) / m_A89; + double tmp21 = 0.0; + tmp21 += m_A84 * V[22]; + tmp21 += m_A85 * V[25]; + V[21] = (RHS21 - tmp21) / m_A83; + double tmp20 = 0.0; + tmp20 += m_A77 * V[27]; + V[20] = (RHS20 - tmp20) / m_A76; + double tmp19 = 0.0; + tmp19 += m_A72 * V[21]; + tmp19 += m_A73 * V[25]; + V[19] = (RHS19 - tmp19) / m_A71; + double tmp18 = 0.0; + tmp18 += m_A64 * V[19]; + tmp18 += m_A65 * V[21]; + tmp18 += m_A66 * V[25]; + V[18] = (RHS18 - tmp18) / m_A63; + double tmp17 = 0.0; + tmp17 += m_A57 * V[18]; + tmp17 += m_A58 * V[19]; + tmp17 += m_A59 * V[25]; + V[17] = (RHS17 - tmp17) / m_A56; + double tmp16 = 0.0; + tmp16 += m_A50 * V[25]; + tmp16 += m_A51 * V[27]; + V[16] = (RHS16 - tmp16) / m_A49; + double tmp15 = 0.0; + tmp15 += m_A46 * V[20]; + V[15] = (RHS15 - tmp15) / m_A45; + double tmp14 = 0.0; + tmp14 += m_A42 * V[23]; + V[14] = (RHS14 - tmp14) / m_A41; + double tmp13 = 0.0; + tmp13 += m_A39 * V[22]; + tmp13 += m_A40 * V[23]; + V[13] = (RHS13 - tmp13) / m_A38; + double tmp12 = 0.0; + tmp12 += m_A36 * V[21]; + tmp12 += m_A37 * V[22]; + V[12] = (RHS12 - tmp12) / m_A35; + double tmp11 = 0.0; + tmp11 += m_A33 * V[19]; + tmp11 += m_A34 * V[21]; + V[11] = (RHS11 - tmp11) / m_A32; + double tmp10 = 0.0; + tmp10 += m_A30 * V[18]; + tmp10 += m_A31 * V[21]; + V[10] = (RHS10 - tmp10) / m_A29; + double tmp9 = 0.0; + tmp9 += m_A26 * V[17]; + tmp9 += m_A27 * V[19]; + tmp9 += m_A28 * V[25]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A23 * V[17]; + tmp8 += m_A24 * V[18]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A20 * V[9]; + tmp7 += m_A21 * V[17]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A17 * V[7]; + tmp6 += m_A18 * V[17]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[16]; + tmp5 += m_A15 * V[25]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[16]; + tmp4 += m_A12 * V[27]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[27]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[24]; + tmp2 += m_A7 * V[28]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + tmp1 += m_A4 * V[20]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[15]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcrus +static void nl_gcr_31_double_double_c2e616f3de30f15b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A7 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 -= go[8] * *cnV[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A9 += go[9]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + RHS4 -= go[10] * *cnV[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A10 += gt[14]; + m_A12 += go[11]; + m_A10 += go[12]; + m_A10 += go[13]; + m_A11 += go[14]; + double RHS5 = Idr[11]; + RHS5 += Idr[12]; + RHS5 += Idr[13]; + RHS5 += Idr[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A13 += go[15]; + m_A15 += go[16]; + double RHS6 = Idr[15]; + RHS6 += Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 -= go[17] * *cnV[17]; + RHS6 -= go[18] * *cnV[18]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + RHS6 -= go[21] * *cnV[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A17 += go[22]; + double RHS7 = Idr[22]; + RHS7 += Idr[23]; + RHS7 -= go[23] * *cnV[23]; + m_A24 += gt[24]; + m_A24 += gt[25]; + m_A24 += gt[26]; + m_A24 += gt[27]; + m_A24 += gt[28]; + m_A24 += gt[29]; + m_A24 += gt[30]; + m_A22 += go[24]; + m_A21 += go[25]; + m_A20 += go[26]; + m_A19 += go[27]; + m_A18 += go[28]; + m_A25 += go[29]; + m_A23 += go[30]; + double RHS8 = Idr[24]; + RHS8 += Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + m_A30 += gt[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A27 += go[31]; + m_A28 += go[32]; + m_A26 += go[33]; + m_A29 += go[34]; + double RHS9 = Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 -= go[35] * *cnV[35]; + RHS9 -= go[36] * *cnV[36]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A13; + m_A15 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f0_8 = -f0 * m_A18; + m_A24 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_8 = -f1 * m_A19; + m_A24 += m_A3 * f1_8; + RHS8 += f1_8 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_8 = -f2 * m_A20; + m_A24 += m_A5 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_8 = -f3 * m_A21; + m_A24 += m_A7 * f3_8; + RHS8 += f3_8 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_8 = -f4 * m_A22; + m_A24 += m_A9 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_8 = -f5 * m_A23; + m_A24 += m_A11 * f5_8; + m_A25 += m_A12 * f5_8; + RHS8 += f5_8 * RHS5; + const double f5_9 = -f5 * m_A26; + m_A29 += m_A11 * f5_9; + m_A30 += m_A12 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_9 = -f6 * m_A27; + m_A29 += m_A15 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_9 = -f7 * m_A28; + m_A30 += m_A17 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A24; + const double f8_9 = -f8 * m_A29; + m_A30 += m_A25 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A30; + double tmp8 = 0.0; + tmp8 += m_A25 * V[9]; + V[8] = (RHS8 - tmp8) / m_A24; + double tmp7 = 0.0; + tmp7 += m_A17 * V[9]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A15 * V[8]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A11 * V[8]; + tmp5 += m_A12 * V[9]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[8]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[8]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[8]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[8]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starcrus +static void nl_gcr_94_double_double_ef2f49641f433a74(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + m_A4 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + m_A5 += gt[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A6 += go[4]; + m_A7 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A9 += go[9]; + m_A10 += go[10]; + m_A10 += go[11]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[12] * *cnV[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A13 += go[13]; + m_A12 += go[14]; + m_A12 += go[15]; + double RHS4 = Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 -= go[16] * *cnV[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A15 += go[17]; + m_A15 += go[18]; + m_A16 += go[19]; + m_A16 += go[20]; + double RHS5 = Idr[17]; + RHS5 += Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A18 += go[23]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A19 += gt[28]; + m_A19 += gt[29]; + m_A21 += go[26]; + m_A20 += go[27]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 -= go[28] * *cnV[28]; + RHS7 -= go[29] * *cnV[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A24 += go[30]; + m_A23 += go[31]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + m_A25 += gt[32]; + m_A25 += gt[33]; + m_A25 += gt[34]; + m_A25 += gt[35]; + m_A26 += go[32]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 -= go[33] * *cnV[33]; + RHS9 -= go[34] * *cnV[34]; + RHS9 -= go[35] * *cnV[35]; + m_A28 += gt[36]; + m_A28 += gt[37]; + m_A27 += go[36]; + double RHS10 = Idr[36]; + RHS10 += Idr[37]; + RHS10 -= go[37] * *cnV[37]; + m_A31 += gt[38]; + m_A31 += gt[39]; + m_A31 += gt[40]; + m_A30 += go[38]; + double RHS11 = Idr[38]; + RHS11 += Idr[39]; + RHS11 += Idr[40]; + RHS11 -= go[39] * *cnV[39]; + RHS11 -= go[40] * *cnV[40]; + m_A37 += gt[41]; + m_A37 += gt[42]; + m_A37 += gt[43]; + m_A37 += gt[44]; + m_A35 += go[41]; + m_A34 += go[42]; + m_A38 += go[43]; + double RHS12 = Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + RHS12 -= go[44] * *cnV[44]; + m_A42 += gt[45]; + m_A42 += gt[46]; + m_A42 += gt[47]; + m_A42 += gt[48]; + m_A42 += gt[49]; + m_A42 += gt[50]; + m_A41 += go[45]; + m_A41 += go[46]; + m_A40 += go[47]; + double RHS13 = Idr[45]; + RHS13 += Idr[46]; + RHS13 += Idr[47]; + RHS13 += Idr[48]; + RHS13 += Idr[49]; + RHS13 += Idr[50]; + RHS13 -= go[48] * *cnV[48]; + RHS13 -= go[49] * *cnV[49]; + RHS13 -= go[50] * *cnV[50]; + m_A48 += gt[51]; + m_A48 += gt[52]; + m_A48 += gt[53]; + m_A48 += gt[54]; + m_A48 += gt[55]; + m_A45 += go[51]; + m_A45 += go[52]; + m_A46 += go[53]; + double RHS14 = Idr[51]; + RHS14 += Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 += Idr[55]; + RHS14 -= go[54] * *cnV[54]; + RHS14 -= go[55] * *cnV[55]; + m_A54 += gt[56]; + m_A54 += gt[57]; + m_A54 += gt[58]; + m_A54 += gt[59]; + m_A54 += gt[60]; + m_A55 += go[56]; + m_A51 += go[57]; + m_A52 += go[58]; + double RHS15 = Idr[56]; + RHS15 += Idr[57]; + RHS15 += Idr[58]; + RHS15 += Idr[59]; + RHS15 += Idr[60]; + RHS15 -= go[59] * *cnV[59]; + RHS15 -= go[60] * *cnV[60]; + m_A58 += gt[61]; + m_A58 += gt[62]; + m_A58 += gt[63]; + m_A57 += go[61]; + m_A56 += go[62]; + double RHS16 = Idr[61]; + RHS16 += Idr[62]; + RHS16 += Idr[63]; + RHS16 -= go[63] * *cnV[63]; + m_A63 += gt[64]; + m_A63 += gt[65]; + m_A65 += go[64]; + m_A60 += go[65]; + double RHS17 = Idr[64]; + RHS17 += Idr[65]; + m_A67 += gt[66]; + m_A67 += gt[67]; + m_A67 += gt[68]; + m_A67 += gt[69]; + m_A68 += go[66]; + m_A66 += go[67]; + m_A66 += go[68]; + double RHS18 = Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 -= go[69] * *cnV[69]; + m_A72 += gt[70]; + m_A72 += gt[71]; + m_A72 += gt[72]; + m_A72 += gt[73]; + m_A72 += gt[74]; + m_A74 += go[70]; + m_A74 += go[71]; + m_A69 += go[72]; + double RHS19 = Idr[70]; + RHS19 += Idr[71]; + RHS19 += Idr[72]; + RHS19 += Idr[73]; + RHS19 += Idr[74]; + RHS19 -= go[73] * *cnV[73]; + RHS19 -= go[74] * *cnV[74]; + m_A80 += gt[75]; + m_A80 += gt[76]; + m_A80 += gt[77]; + m_A80 += gt[78]; + m_A77 += go[75]; + m_A76 += go[76]; + m_A75 += go[77]; + double RHS20 = Idr[75]; + RHS20 += Idr[76]; + RHS20 += Idr[77]; + RHS20 += Idr[78]; + RHS20 -= go[78] * *cnV[78]; + m_A86 += gt[79]; + m_A86 += gt[80]; + m_A86 += gt[81]; + m_A86 += gt[82]; + m_A86 += gt[83]; + m_A86 += gt[84]; + m_A84 += go[79]; + m_A83 += go[80]; + m_A82 += go[81]; + m_A82 += go[82]; + double RHS21 = Idr[79]; + RHS21 += Idr[80]; + RHS21 += Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + RHS21 += Idr[84]; + RHS21 -= go[83] * *cnV[83]; + RHS21 -= go[84] * *cnV[84]; + m_A93 += gt[85]; + m_A93 += gt[86]; + m_A93 += gt[87]; + m_A93 += gt[88]; + m_A93 += gt[89]; + m_A89 += go[85]; + m_A91 += go[86]; + m_A91 += go[87]; + m_A88 += go[88]; + double RHS22 = Idr[85]; + RHS22 += Idr[86]; + RHS22 += Idr[87]; + RHS22 += Idr[88]; + RHS22 += Idr[89]; + RHS22 -= go[89] * *cnV[89]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A51; + m_A54 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A27; + m_A28 += m_A3 * f1_10; + m_A29 += m_A4 * f1_10; + RHS10 += f1_10 * RHS1; + const double f1_12 = -f1 * m_A34; + m_A36 += m_A3 * f1_12; + m_A38 += m_A4 * f1_12; + RHS12 += f1_12 * RHS1; + const double f1_15 = -f1 * m_A52; + m_A53 += m_A3 * f1_15; + m_A54 += m_A4 * f1_15; + RHS15 += f1_15 * RHS1; + const double f1_20 = -f1 * m_A75; + m_A77 += m_A3 * f1_20; + m_A79 += m_A4 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_11 = -f2 * m_A30; + m_A32 += m_A6 * f2_11; + m_A33 += m_A7 * f2_11; + RHS11 += f2_11 * RHS2; + const double f2_12 = -f2 * m_A35; + m_A37 += m_A6 * f2_12; + m_A39 += m_A7 * f2_12; + RHS12 += f2_12 * RHS2; + const double f2_20 = -f2 * m_A76; + m_A78 += m_A6 * f2_20; + m_A80 += m_A7 * f2_20; + RHS20 += f2_20 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_13 = -f3 * m_A40; + m_A42 += m_A9 * f3_13; + m_A43 += m_A10 * f3_13; + RHS13 += f3_13 * RHS3; + const double f3_14 = -f3 * m_A45; + m_A47 += m_A9 * f3_14; + m_A48 += m_A10 * f3_14; + RHS14 += f3_14 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_13 = -f4 * m_A41; + m_A42 += m_A12 * f4_13; + m_A44 += m_A13 * f4_13; + RHS13 += f4_13 * RHS4; + const double f4_17 = -f4 * m_A60; + m_A61 += m_A12 * f4_17; + m_A63 += m_A13 * f4_17; + RHS17 += f4_17 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_18 = -f5 * m_A66; + m_A67 += m_A15 * f5_18; + m_A68 += m_A16 * f5_18; + RHS18 += f5_18 * RHS5; + const double f5_21 = -f5 * m_A82; + m_A84 += m_A15 * f5_21; + m_A86 += m_A16 * f5_21; + RHS21 += f5_21 * RHS5; + const double f6 = 1.0 / m_A17; + const double f6_16 = -f6 * m_A56; + m_A58 += m_A18 * f6_16; + RHS16 += f6_16 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_14 = -f7 * m_A46; + m_A48 += m_A20 * f7_14; + m_A50 += m_A21 * f7_14; + RHS14 += f7_14 * RHS7; + const double f7_19 = -f7 * m_A69; + m_A70 += m_A20 * f7_19; + m_A72 += m_A21 * f7_19; + RHS19 += f7_19 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_16 = -f8 * m_A57; + m_A58 += m_A23 * f8_16; + m_A59 += m_A24 * f8_16; + RHS16 += f8_16 * RHS8; + const double f8_22 = -f8 * m_A88; + m_A90 += m_A23 * f8_22; + m_A93 += m_A24 * f8_22; + RHS22 += f8_22 * RHS8; + const double f9 = 1.0 / m_A25; + const double f9_22 = -f9 * m_A89; + m_A93 += m_A26 * f9_22; + RHS22 += f9_22 * RHS9; + const double f10 = 1.0 / m_A28; + const double f10_12 = -f10 * m_A36; + m_A38 += m_A29 * f10_12; + RHS12 += f10_12 * RHS10; + const double f10_15 = -f10 * m_A53; + m_A54 += m_A29 * f10_15; + RHS15 += f10_15 * RHS10; + const double f10_20 = -f10 * m_A77; + m_A79 += m_A29 * f10_20; + RHS20 += f10_20 * RHS10; + const double f12 = 1.0 / m_A37; + const double f12_20 = -f12 * m_A78; + m_A79 += m_A38 * f12_20; + m_A80 += m_A39 * f12_20; + RHS20 += f12_20 * RHS12; + const double f13 = 1.0 / m_A42; + const double f13_14 = -f13 * m_A47; + m_A48 += m_A43 * f13_14; + m_A49 += m_A44 * f13_14; + RHS14 += f13_14 * RHS13; + const double f13_17 = -f13 * m_A61; + m_A62 += m_A43 * f13_17; + m_A63 += m_A44 * f13_17; + RHS17 += f13_17 * RHS13; + const double f14 = 1.0 / m_A48; + const double f14_17 = -f14 * m_A62; + m_A63 += m_A49 * f14_17; + m_A64 += m_A50 * f14_17; + RHS17 += f14_17 * RHS14; + const double f14_19 = -f14 * m_A70; + m_A71 += m_A49 * f14_19; + m_A72 += m_A50 * f14_19; + RHS19 += f14_19 * RHS14; + const double f15 = 1.0 / m_A54; + const double f15_20 = -f15 * m_A79; + m_A81 += m_A55 * f15_20; + RHS20 += f15_20 * RHS15; + const double f16 = 1.0 / m_A58; + const double f16_22 = -f16 * m_A90; + m_A93 += m_A59 * f16_22; + RHS22 += f16_22 * RHS16; + const double f17 = 1.0 / m_A63; + const double f17_19 = -f17 * m_A71; + m_A72 += m_A64 * f17_19; + m_A73 += m_A65 * f17_19; + RHS19 += f17_19 * RHS17; + const double f17_21 = -f17 * m_A83; + m_A85 += m_A64 * f17_21; + m_A86 += m_A65 * f17_21; + RHS21 += f17_21 * RHS17; + const double f18 = 1.0 / m_A67; + const double f18_21 = -f18 * m_A84; + m_A86 += m_A68 * f18_21; + RHS21 += f18_21 * RHS18; + const double f19 = 1.0 / m_A72; + const double f19_21 = -f19 * m_A85; + m_A86 += m_A73 * f19_21; + m_A87 += m_A74 * f19_21; + RHS21 += f19_21 * RHS19; + const double f19_22 = -f19 * m_A91; + m_A92 += m_A73 * f19_22; + m_A93 += m_A74 * f19_22; + RHS22 += f19_22 * RHS19; + const double f21 = 1.0 / m_A86; + const double f21_22 = -f21 * m_A92; + m_A93 += m_A87 * f21_22; + RHS22 += f21_22 * RHS21; + V[22] = RHS22 / m_A93; + double tmp21 = 0.0; + tmp21 += m_A87 * V[22]; + V[21] = (RHS21 - tmp21) / m_A86; + double tmp20 = 0.0; + tmp20 += m_A81 * V[21]; + V[20] = (RHS20 - tmp20) / m_A80; + double tmp19 = 0.0; + tmp19 += m_A73 * V[21]; + tmp19 += m_A74 * V[22]; + V[19] = (RHS19 - tmp19) / m_A72; + double tmp18 = 0.0; + tmp18 += m_A68 * V[21]; + V[18] = (RHS18 - tmp18) / m_A67; + double tmp17 = 0.0; + tmp17 += m_A64 * V[19]; + tmp17 += m_A65 * V[21]; + V[17] = (RHS17 - tmp17) / m_A63; + double tmp16 = 0.0; + tmp16 += m_A59 * V[22]; + V[16] = (RHS16 - tmp16) / m_A58; + double tmp15 = 0.0; + tmp15 += m_A55 * V[21]; + V[15] = (RHS15 - tmp15) / m_A54; + double tmp14 = 0.0; + tmp14 += m_A49 * V[17]; + tmp14 += m_A50 * V[19]; + V[14] = (RHS14 - tmp14) / m_A48; + double tmp13 = 0.0; + tmp13 += m_A43 * V[14]; + tmp13 += m_A44 * V[17]; + V[13] = (RHS13 - tmp13) / m_A42; + double tmp12 = 0.0; + tmp12 += m_A38 * V[15]; + tmp12 += m_A39 * V[20]; + V[12] = (RHS12 - tmp12) / m_A37; + double tmp11 = 0.0; + tmp11 += m_A32 * V[12]; + tmp11 += m_A33 * V[20]; + V[11] = (RHS11 - tmp11) / m_A31; + double tmp10 = 0.0; + tmp10 += m_A29 * V[15]; + V[10] = (RHS10 - tmp10) / m_A28; + double tmp9 = 0.0; + tmp9 += m_A26 * V[22]; + V[9] = (RHS9 - tmp9) / m_A25; + double tmp8 = 0.0; + tmp8 += m_A23 * V[16]; + tmp8 += m_A24 * V[22]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A20 * V[14]; + tmp7 += m_A21 * V[19]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A18 * V[16]; + V[6] = (RHS6 - tmp6) / m_A17; + double tmp5 = 0.0; + tmp5 += m_A15 * V[18]; + tmp5 += m_A16 * V[21]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A12 * V[13]; + tmp4 += m_A13 * V[17]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[13]; + tmp3 += m_A10 * V[14]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[12]; + tmp2 += m_A7 * V[20]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[10]; + tmp1 += m_A4 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[15]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starfire +static void nl_gcr_12_double_double_aceb6035dfb557c9(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A4 += go[2]; + m_A3 += go[3]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A7 += gt[5]; + m_A7 += gt[6]; + m_A7 += gt[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A11 += gt[10]; + m_A11 += gt[11]; + m_A9 += go[10]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[11] * *cnV[11]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A7 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A6; + m_A7 += m_A3 * f1_2; + m_A8 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A8 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A8 * V[3]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starfire +static void nl_gcr_23_double_double_b75e0baeb501e907(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A3 += gt[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A3 += gt[7]; + m_A3 += gt[8]; + m_A3 += gt[9]; + m_A2 += go[3]; + m_A4 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A6 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A7 += go[14]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A12 += go[17]; + m_A11 += go[18]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + m_A14 += gt[24]; + m_A14 += gt[25]; + m_A14 += gt[26]; + m_A13 += go[24]; + double RHS5 = Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + m_A18 += gt[27]; + m_A18 += gt[28]; + m_A18 += gt[29]; + m_A18 += gt[30]; + m_A17 += go[27]; + m_A19 += go[28]; + double RHS6 = Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + m_A22 += gt[31]; + m_A22 += gt[32]; + m_A22 += gt[33]; + m_A22 += gt[34]; + m_A20 += go[31]; + m_A21 += go[32]; + double RHS7 = Idr[31]; + RHS7 += Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 -= go[33] * *cnV[33]; + RHS7 -= go[34] * *cnV[34]; + const double f0 = 1.0 / m_A0; + const double f0_1 = -f0 * m_A2; + m_A4 += m_A1 * f0_1; + RHS1 += f0_1 * RHS0; + const double f0_6 = -f0 * m_A17; + m_A18 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_7 = -f2 * m_A20; + m_A22 += m_A6 * f2_7; + RHS7 += f2_7 * RHS2; + const double f4 = 1.0 / m_A10; + const double f4_5 = -f4 * m_A13; + m_A15 += m_A11 * f4_5; + m_A16 += m_A12 * f4_5; + RHS5 += f4_5 * RHS4; + const double f6 = 1.0 / m_A18; + const double f6_7 = -f6 * m_A21; + m_A22 += m_A19 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A22; + double tmp6 = 0.0; + tmp6 += m_A19 * V[7]; + V[6] = (RHS6 - tmp6) / m_A18; + double tmp5 = 0.0; + tmp5 += m_A15 * V[6]; + tmp5 += m_A16 * V[7]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A11 * V[6]; + tmp4 += m_A12 * V[7]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[6]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A6 * V[7]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A4 * V[6]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starfire +static void nl_gcr_27_double_double_649ebca7fa6793ed(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A1 += go[0]; + m_A1 += go[1]; + m_A2 += go[2]; + m_A2 += go[3]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + m_A3 += gt[6]; + m_A3 += gt[7]; + m_A3 += gt[8]; + m_A3 += gt[9]; + m_A3 += gt[10]; + m_A3 += gt[11]; + m_A3 += gt[12]; + m_A4 += go[6]; + m_A5 += go[7]; + double RHS1 = Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 += Idr[12]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + RHS1 -= go[12] * *cnV[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A7 += go[13]; + m_A8 += go[14]; + double RHS2 = Idr[13]; + RHS2 += Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 -= go[15] * *cnV[15]; + RHS2 -= go[16] * *cnV[16]; + m_A9 += gt[17]; + m_A9 += gt[18]; + m_A10 += go[17]; + double RHS3 = Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[18] * *cnV[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A12 += go[19]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[20] * *cnV[20]; + m_A17 += gt[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A17 += gt[26]; + m_A17 += gt[27]; + m_A13 += go[21]; + m_A16 += go[22]; + m_A15 += go[23]; + m_A14 += go[24]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 -= go[25] * *cnV[25]; + RHS5 -= go[26] * *cnV[26]; + RHS5 -= go[27] * *cnV[27]; + m_A20 += gt[28]; + m_A20 += gt[29]; + m_A20 += gt[30]; + m_A20 += gt[31]; + m_A19 += go[28]; + m_A19 += go[29]; + m_A21 += go[30]; + double RHS6 = Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 -= go[31] * *cnV[31]; + m_A26 += gt[32]; + m_A26 += gt[33]; + m_A26 += gt[34]; + m_A26 += gt[35]; + m_A26 += gt[36]; + m_A26 += gt[37]; + m_A23 += go[32]; + m_A25 += go[33]; + m_A22 += go[34]; + m_A22 += go[35]; + double RHS7 = Idr[32]; + RHS7 += Idr[33]; + RHS7 += Idr[34]; + RHS7 += Idr[35]; + RHS7 += Idr[36]; + RHS7 += Idr[37]; + RHS7 -= go[36] * *cnV[36]; + RHS7 -= go[37] * *cnV[37]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A19; + m_A20 += m_A1 * f0_6; + m_A21 += m_A2 * f0_6; + RHS6 += f0_6 * RHS0; + const double f0_7 = -f0 * m_A22; + m_A25 += m_A1 * f0_7; + m_A26 += m_A2 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_5 = -f1 * m_A13; + m_A14 += m_A4 * f1_5; + m_A18 += m_A5 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_5 = -f2 * m_A14; + m_A17 += m_A7 * f2_5; + m_A18 += m_A8 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_7 = -f2 * m_A23; + m_A24 += m_A7 * f2_7; + m_A26 += m_A8 * f2_7; + RHS7 += f2_7 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_5 = -f3 * m_A15; + m_A17 += m_A10 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_5 = -f4 * m_A16; + m_A17 += m_A12 * f4_5; + RHS5 += f4_5 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_7 = -f5 * m_A24; + m_A26 += m_A18 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A20; + const double f6_7 = -f6 * m_A25; + m_A26 += m_A21 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A26; + double tmp6 = 0.0; + tmp6 += m_A21 * V[7]; + V[6] = (RHS6 - tmp6) / m_A20; + double tmp5 = 0.0; + tmp5 += m_A18 * V[7]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A12 * V[5]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A10 * V[5]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[5]; + tmp2 += m_A8 * V[7]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[2]; + tmp1 += m_A5 * V[7]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + tmp0 += m_A2 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starfire +static void nl_gcr_438_double_double_d32effa2b0ea54a1(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + double m_A198(0.0); + double m_A199(0.0); + double m_A200(0.0); + double m_A201(0.0); + double m_A202(0.0); + double m_A203(0.0); + double m_A204(0.0); + double m_A205(0.0); + double m_A206(0.0); + double m_A207(0.0); + double m_A208(0.0); + double m_A209(0.0); + double m_A210(0.0); + double m_A211(0.0); + double m_A212(0.0); + double m_A213(0.0); + double m_A214(0.0); + double m_A215(0.0); + double m_A216(0.0); + double m_A217(0.0); + double m_A218(0.0); + double m_A219(0.0); + double m_A220(0.0); + double m_A221(0.0); + double m_A222(0.0); + double m_A223(0.0); + double m_A224(0.0); + double m_A225(0.0); + double m_A226(0.0); + double m_A227(0.0); + double m_A228(0.0); + double m_A229(0.0); + double m_A230(0.0); + double m_A231(0.0); + double m_A232(0.0); + double m_A233(0.0); + double m_A234(0.0); + double m_A235(0.0); + double m_A236(0.0); + double m_A237(0.0); + double m_A238(0.0); + double m_A239(0.0); + double m_A240(0.0); + double m_A241(0.0); + double m_A242(0.0); + double m_A243(0.0); + double m_A244(0.0); + double m_A245(0.0); + double m_A246(0.0); + double m_A247(0.0); + double m_A248(0.0); + double m_A249(0.0); + double m_A250(0.0); + double m_A251(0.0); + double m_A252(0.0); + double m_A253(0.0); + double m_A254(0.0); + double m_A255(0.0); + double m_A256(0.0); + double m_A257(0.0); + double m_A258(0.0); + double m_A259(0.0); + double m_A260(0.0); + double m_A261(0.0); + double m_A262(0.0); + double m_A263(0.0); + double m_A264(0.0); + double m_A265(0.0); + double m_A266(0.0); + double m_A267(0.0); + double m_A268(0.0); + double m_A269(0.0); + double m_A270(0.0); + double m_A271(0.0); + double m_A272(0.0); + double m_A273(0.0); + double m_A274(0.0); + double m_A275(0.0); + double m_A276(0.0); + double m_A277(0.0); + double m_A278(0.0); + double m_A279(0.0); + double m_A280(0.0); + double m_A281(0.0); + double m_A282(0.0); + double m_A283(0.0); + double m_A284(0.0); + double m_A285(0.0); + double m_A286(0.0); + double m_A287(0.0); + double m_A288(0.0); + double m_A289(0.0); + double m_A290(0.0); + double m_A291(0.0); + double m_A292(0.0); + double m_A293(0.0); + double m_A294(0.0); + double m_A295(0.0); + double m_A296(0.0); + double m_A297(0.0); + double m_A298(0.0); + double m_A299(0.0); + double m_A300(0.0); + double m_A301(0.0); + double m_A302(0.0); + double m_A303(0.0); + double m_A304(0.0); + double m_A305(0.0); + double m_A306(0.0); + double m_A307(0.0); + double m_A308(0.0); + double m_A309(0.0); + double m_A310(0.0); + double m_A311(0.0); + double m_A312(0.0); + double m_A313(0.0); + double m_A314(0.0); + double m_A315(0.0); + double m_A316(0.0); + double m_A317(0.0); + double m_A318(0.0); + double m_A319(0.0); + double m_A320(0.0); + double m_A321(0.0); + double m_A322(0.0); + double m_A323(0.0); + double m_A324(0.0); + double m_A325(0.0); + double m_A326(0.0); + double m_A327(0.0); + double m_A328(0.0); + double m_A329(0.0); + double m_A330(0.0); + double m_A331(0.0); + double m_A332(0.0); + double m_A333(0.0); + double m_A334(0.0); + double m_A335(0.0); + double m_A336(0.0); + double m_A337(0.0); + double m_A338(0.0); + double m_A339(0.0); + double m_A340(0.0); + double m_A341(0.0); + double m_A342(0.0); + double m_A343(0.0); + double m_A344(0.0); + double m_A345(0.0); + double m_A346(0.0); + double m_A347(0.0); + double m_A348(0.0); + double m_A349(0.0); + double m_A350(0.0); + double m_A351(0.0); + double m_A352(0.0); + double m_A353(0.0); + double m_A354(0.0); + double m_A355(0.0); + double m_A356(0.0); + double m_A357(0.0); + double m_A358(0.0); + double m_A359(0.0); + double m_A360(0.0); + double m_A361(0.0); + double m_A362(0.0); + double m_A363(0.0); + double m_A364(0.0); + double m_A365(0.0); + double m_A366(0.0); + double m_A367(0.0); + double m_A368(0.0); + double m_A369(0.0); + double m_A370(0.0); + double m_A371(0.0); + double m_A372(0.0); + double m_A373(0.0); + double m_A374(0.0); + double m_A375(0.0); + double m_A376(0.0); + double m_A377(0.0); + double m_A378(0.0); + double m_A379(0.0); + double m_A380(0.0); + double m_A381(0.0); + double m_A382(0.0); + double m_A383(0.0); + double m_A384(0.0); + double m_A385(0.0); + double m_A386(0.0); + double m_A387(0.0); + double m_A388(0.0); + double m_A389(0.0); + double m_A390(0.0); + double m_A391(0.0); + double m_A392(0.0); + double m_A393(0.0); + double m_A394(0.0); + double m_A395(0.0); + double m_A396(0.0); + double m_A397(0.0); + double m_A398(0.0); + double m_A399(0.0); + double m_A400(0.0); + double m_A401(0.0); + double m_A402(0.0); + double m_A403(0.0); + double m_A404(0.0); + double m_A405(0.0); + double m_A406(0.0); + double m_A407(0.0); + double m_A408(0.0); + double m_A409(0.0); + double m_A410(0.0); + double m_A411(0.0); + double m_A412(0.0); + double m_A413(0.0); + double m_A414(0.0); + double m_A415(0.0); + double m_A416(0.0); + double m_A417(0.0); + double m_A418(0.0); + double m_A419(0.0); + double m_A420(0.0); + double m_A421(0.0); + double m_A422(0.0); + double m_A423(0.0); + double m_A424(0.0); + double m_A425(0.0); + double m_A426(0.0); + double m_A427(0.0); + double m_A428(0.0); + double m_A429(0.0); + double m_A430(0.0); + double m_A431(0.0); + double m_A432(0.0); + double m_A433(0.0); + double m_A434(0.0); + double m_A435(0.0); + double m_A436(0.0); + double m_A437(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A7 += go[4]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A11 += go[10]; + m_A12 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 -= go[12] * *cnV[12]; + m_A13 += gt[13]; + m_A13 += gt[14]; + m_A13 += gt[15]; + m_A14 += go[13]; + m_A15 += go[14]; + double RHS5 = Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 -= go[15] * *cnV[15]; + m_A16 += gt[16]; + m_A16 += gt[17]; + m_A17 += go[16]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 -= go[17] * *cnV[17]; + m_A18 += gt[18]; + m_A18 += gt[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A22 += go[18]; + m_A21 += go[19]; + m_A20 += go[20]; + m_A19 += go[21]; + double RHS7 = Idr[18]; + RHS7 += Idr[19]; + RHS7 += Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 -= go[22] * *cnV[22]; + RHS7 -= go[23] * *cnV[23]; + RHS7 -= go[24] * *cnV[24]; + m_A23 += gt[25]; + m_A23 += gt[26]; + m_A23 += gt[27]; + m_A23 += gt[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A23 += gt[31]; + m_A27 += go[25]; + m_A26 += go[26]; + m_A25 += go[27]; + m_A24 += go[28]; + double RHS8 = Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[29] * *cnV[29]; + RHS8 -= go[30] * *cnV[30]; + RHS8 -= go[31] * *cnV[31]; + m_A28 += gt[32]; + m_A28 += gt[33]; + m_A29 += go[32]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 -= go[33] * *cnV[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A31 += go[34]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + RHS10 -= go[35] * *cnV[35]; + m_A32 += gt[36]; + m_A32 += gt[37]; + m_A32 += gt[38]; + m_A32 += gt[39]; + m_A33 += go[36]; + m_A34 += go[37]; + double RHS11 = Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 += Idr[39]; + RHS11 -= go[38] * *cnV[38]; + RHS11 -= go[39] * *cnV[39]; + m_A35 += gt[40]; + m_A35 += gt[41]; + m_A35 += gt[42]; + m_A36 += go[40]; + m_A37 += go[41]; + double RHS12 = Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 -= go[42] * *cnV[42]; + m_A38 += gt[43]; + m_A38 += gt[44]; + m_A38 += gt[45]; + m_A39 += go[43]; + double RHS13 = Idr[43]; + RHS13 += Idr[44]; + RHS13 += Idr[45]; + RHS13 -= go[44] * *cnV[44]; + RHS13 -= go[45] * *cnV[45]; + m_A40 += gt[46]; + m_A40 += gt[47]; + m_A40 += gt[48]; + m_A42 += go[46]; + m_A41 += go[47]; + double RHS14 = Idr[46]; + RHS14 += Idr[47]; + RHS14 += Idr[48]; + RHS14 -= go[48] * *cnV[48]; + m_A43 += gt[49]; + m_A43 += gt[50]; + m_A43 += gt[51]; + m_A44 += go[49]; + m_A45 += go[50]; + double RHS15 = Idr[49]; + RHS15 += Idr[50]; + RHS15 += Idr[51]; + RHS15 -= go[51] * *cnV[51]; + m_A46 += gt[52]; + m_A46 += gt[53]; + m_A46 += gt[54]; + m_A46 += gt[55]; + m_A46 += gt[56]; + m_A46 += gt[57]; + m_A46 += gt[58]; + m_A50 += go[52]; + m_A49 += go[53]; + m_A47 += go[54]; + m_A48 += go[55]; + double RHS16 = Idr[52]; + RHS16 += Idr[53]; + RHS16 += Idr[54]; + RHS16 += Idr[55]; + RHS16 += Idr[56]; + RHS16 += Idr[57]; + RHS16 += Idr[58]; + RHS16 -= go[56] * *cnV[56]; + RHS16 -= go[57] * *cnV[57]; + RHS16 -= go[58] * *cnV[58]; + m_A51 += gt[59]; + m_A51 += gt[60]; + m_A51 += gt[61]; + m_A52 += go[59]; + double RHS17 = Idr[59]; + RHS17 += Idr[60]; + RHS17 += Idr[61]; + RHS17 -= go[60] * *cnV[60]; + RHS17 -= go[61] * *cnV[61]; + m_A53 += gt[62]; + m_A53 += gt[63]; + m_A53 += gt[64]; + m_A55 += go[62]; + m_A54 += go[63]; + double RHS18 = Idr[62]; + RHS18 += Idr[63]; + RHS18 += Idr[64]; + RHS18 -= go[64] * *cnV[64]; + m_A56 += gt[65]; + m_A56 += gt[66]; + m_A56 += gt[67]; + m_A57 += go[65]; + double RHS19 = Idr[65]; + RHS19 += Idr[66]; + RHS19 += Idr[67]; + RHS19 -= go[66] * *cnV[66]; + RHS19 -= go[67] * *cnV[67]; + m_A58 += gt[68]; + m_A58 += gt[69]; + m_A58 += gt[70]; + m_A59 += go[68]; + double RHS20 = Idr[68]; + RHS20 += Idr[69]; + RHS20 += Idr[70]; + RHS20 -= go[69] * *cnV[69]; + RHS20 -= go[70] * *cnV[70]; + m_A60 += gt[71]; + m_A60 += gt[72]; + m_A61 += go[71]; + double RHS21 = Idr[71]; + RHS21 += Idr[72]; + RHS21 -= go[72] * *cnV[72]; + m_A62 += gt[73]; + m_A62 += gt[74]; + m_A62 += gt[75]; + m_A63 += go[73]; + double RHS22 = Idr[73]; + RHS22 += Idr[74]; + RHS22 += Idr[75]; + RHS22 -= go[74] * *cnV[74]; + RHS22 -= go[75] * *cnV[75]; + m_A64 += gt[76]; + m_A64 += gt[77]; + m_A65 += go[76]; + double RHS23 = Idr[76]; + RHS23 += Idr[77]; + RHS23 -= go[77] * *cnV[77]; + m_A66 += gt[78]; + m_A66 += gt[79]; + m_A66 += gt[80]; + m_A67 += go[78]; + double RHS24 = Idr[78]; + RHS24 += Idr[79]; + RHS24 += Idr[80]; + RHS24 -= go[79] * *cnV[79]; + RHS24 -= go[80] * *cnV[80]; + m_A68 += gt[81]; + m_A68 += gt[82]; + m_A69 += go[81]; + double RHS25 = Idr[81]; + RHS25 += Idr[82]; + RHS25 -= go[82] * *cnV[82]; + m_A70 += gt[83]; + m_A70 += gt[84]; + m_A70 += gt[85]; + m_A70 += gt[86]; + m_A72 += go[83]; + m_A71 += go[84]; + m_A71 += go[85]; + double RHS26 = Idr[83]; + RHS26 += Idr[84]; + RHS26 += Idr[85]; + RHS26 += Idr[86]; + RHS26 -= go[86] * *cnV[86]; + m_A73 += gt[87]; + m_A73 += gt[88]; + m_A73 += gt[89]; + m_A73 += gt[90]; + m_A73 += gt[91]; + m_A73 += gt[92]; + m_A73 += gt[93]; + m_A74 += go[87]; + m_A75 += go[88]; + double RHS27 = Idr[87]; + RHS27 += Idr[88]; + RHS27 += Idr[89]; + RHS27 += Idr[90]; + RHS27 += Idr[91]; + RHS27 += Idr[92]; + RHS27 += Idr[93]; + RHS27 -= go[89] * *cnV[89]; + RHS27 -= go[90] * *cnV[90]; + RHS27 -= go[91] * *cnV[91]; + RHS27 -= go[92] * *cnV[92]; + RHS27 -= go[93] * *cnV[93]; + m_A76 += gt[94]; + m_A76 += gt[95]; + m_A78 += go[94]; + m_A77 += go[95]; + double RHS28 = Idr[94]; + RHS28 += Idr[95]; + m_A79 += gt[96]; + m_A79 += gt[97]; + m_A79 += gt[98]; + m_A79 += gt[99]; + m_A79 += gt[100]; + m_A79 += gt[101]; + m_A79 += gt[102]; + m_A80 += go[96]; + double RHS29 = Idr[96]; + RHS29 += Idr[97]; + RHS29 += Idr[98]; + RHS29 += Idr[99]; + RHS29 += Idr[100]; + RHS29 += Idr[101]; + RHS29 += Idr[102]; + RHS29 -= go[97] * *cnV[97]; + RHS29 -= go[98] * *cnV[98]; + RHS29 -= go[99] * *cnV[99]; + RHS29 -= go[100] * *cnV[100]; + RHS29 -= go[101] * *cnV[101]; + RHS29 -= go[102] * *cnV[102]; + m_A81 += gt[103]; + m_A81 += gt[104]; + m_A81 += gt[105]; + m_A81 += gt[106]; + m_A82 += go[103]; + m_A83 += go[104]; + double RHS30 = Idr[103]; + RHS30 += Idr[104]; + RHS30 += Idr[105]; + RHS30 += Idr[106]; + RHS30 -= go[105] * *cnV[105]; + RHS30 -= go[106] * *cnV[106]; + m_A84 += gt[107]; + m_A84 += gt[108]; + m_A85 += go[107]; + double RHS31 = Idr[107]; + RHS31 += Idr[108]; + RHS31 -= go[108] * *cnV[108]; + m_A86 += gt[109]; + m_A86 += gt[110]; + m_A86 += gt[111]; + m_A86 += gt[112]; + m_A86 += gt[113]; + m_A86 += gt[114]; + m_A86 += gt[115]; + m_A88 += go[109]; + m_A87 += go[110]; + double RHS32 = Idr[109]; + RHS32 += Idr[110]; + RHS32 += Idr[111]; + RHS32 += Idr[112]; + RHS32 += Idr[113]; + RHS32 += Idr[114]; + RHS32 += Idr[115]; + RHS32 -= go[111] * *cnV[111]; + RHS32 -= go[112] * *cnV[112]; + RHS32 -= go[113] * *cnV[113]; + RHS32 -= go[114] * *cnV[114]; + RHS32 -= go[115] * *cnV[115]; + m_A89 += gt[116]; + m_A89 += gt[117]; + m_A90 += go[116]; + double RHS33 = Idr[116]; + RHS33 += Idr[117]; + RHS33 -= go[117] * *cnV[117]; + m_A91 += gt[118]; + m_A91 += gt[119]; + m_A91 += gt[120]; + m_A91 += gt[121]; + m_A93 += go[118]; + m_A92 += go[119]; + double RHS34 = Idr[118]; + RHS34 += Idr[119]; + RHS34 += Idr[120]; + RHS34 += Idr[121]; + RHS34 -= go[120] * *cnV[120]; + RHS34 -= go[121] * *cnV[121]; + m_A94 += gt[122]; + m_A94 += gt[123]; + m_A94 += gt[124]; + m_A94 += gt[125]; + m_A94 += gt[126]; + m_A94 += gt[127]; + m_A94 += gt[128]; + m_A95 += go[122]; + double RHS35 = Idr[122]; + RHS35 += Idr[123]; + RHS35 += Idr[124]; + RHS35 += Idr[125]; + RHS35 += Idr[126]; + RHS35 += Idr[127]; + RHS35 += Idr[128]; + RHS35 -= go[123] * *cnV[123]; + RHS35 -= go[124] * *cnV[124]; + RHS35 -= go[125] * *cnV[125]; + RHS35 -= go[126] * *cnV[126]; + RHS35 -= go[127] * *cnV[127]; + RHS35 -= go[128] * *cnV[128]; + m_A96 += gt[129]; + m_A96 += gt[130]; + m_A96 += gt[131]; + m_A97 += go[129]; + m_A98 += go[130]; + double RHS36 = Idr[129]; + RHS36 += Idr[130]; + RHS36 += Idr[131]; + RHS36 -= go[131] * *cnV[131]; + m_A99 += gt[132]; + m_A99 += gt[133]; + m_A99 += gt[134]; + m_A99 += gt[135]; + m_A100 += go[132]; + m_A101 += go[133]; + double RHS37 = Idr[132]; + RHS37 += Idr[133]; + RHS37 += Idr[134]; + RHS37 += Idr[135]; + RHS37 -= go[134] * *cnV[134]; + RHS37 -= go[135] * *cnV[135]; + m_A102 += gt[136]; + m_A102 += gt[137]; + m_A102 += gt[138]; + m_A102 += gt[139]; + m_A103 += go[136]; + m_A104 += go[137]; + double RHS38 = Idr[136]; + RHS38 += Idr[137]; + RHS38 += Idr[138]; + RHS38 += Idr[139]; + RHS38 -= go[138] * *cnV[138]; + RHS38 -= go[139] * *cnV[139]; + m_A105 += gt[140]; + m_A105 += gt[141]; + m_A105 += gt[142]; + m_A107 += go[140]; + m_A106 += go[141]; + double RHS39 = Idr[140]; + RHS39 += Idr[141]; + RHS39 += Idr[142]; + RHS39 -= go[142] * *cnV[142]; + m_A108 += gt[143]; + m_A108 += gt[144]; + m_A108 += gt[145]; + m_A110 += go[143]; + m_A109 += go[144]; + double RHS40 = Idr[143]; + RHS40 += Idr[144]; + RHS40 += Idr[145]; + RHS40 -= go[145] * *cnV[145]; + m_A111 += gt[146]; + m_A111 += gt[147]; + m_A111 += gt[148]; + m_A112 += go[146]; + m_A113 += go[147]; + double RHS41 = Idr[146]; + RHS41 += Idr[147]; + RHS41 += Idr[148]; + RHS41 -= go[148] * *cnV[148]; + m_A114 += gt[149]; + m_A114 += gt[150]; + m_A114 += gt[151]; + m_A114 += gt[152]; + m_A116 += go[149]; + m_A114 += go[150]; + m_A114 += go[151]; + m_A115 += go[152]; + double RHS42 = Idr[149]; + RHS42 += Idr[150]; + RHS42 += Idr[151]; + RHS42 += Idr[152]; + m_A117 += gt[153]; + m_A117 += gt[154]; + m_A117 += gt[155]; + m_A117 += gt[156]; + m_A119 += go[153]; + m_A117 += go[154]; + m_A117 += go[155]; + m_A118 += go[156]; + double RHS43 = Idr[153]; + RHS43 += Idr[154]; + RHS43 += Idr[155]; + RHS43 += Idr[156]; + m_A120 += gt[157]; + m_A120 += gt[158]; + m_A120 += gt[159]; + m_A120 += gt[160]; + m_A122 += go[157]; + m_A120 += go[158]; + m_A120 += go[159]; + m_A121 += go[160]; + double RHS44 = Idr[157]; + RHS44 += Idr[158]; + RHS44 += Idr[159]; + RHS44 += Idr[160]; + m_A123 += gt[161]; + m_A123 += gt[162]; + m_A123 += gt[163]; + m_A124 += go[161]; + m_A125 += go[162]; + double RHS45 = Idr[161]; + RHS45 += Idr[162]; + RHS45 += Idr[163]; + RHS45 -= go[163] * *cnV[163]; + m_A128 += gt[164]; + m_A128 += gt[165]; + m_A128 += gt[166]; + m_A128 += gt[167]; + m_A127 += go[164]; + m_A126 += go[165]; + double RHS46 = Idr[164]; + RHS46 += Idr[165]; + RHS46 += Idr[166]; + RHS46 += Idr[167]; + RHS46 -= go[166] * *cnV[166]; + RHS46 -= go[167] * *cnV[167]; + m_A134 += gt[168]; + m_A134 += gt[169]; + m_A134 += gt[170]; + m_A134 += gt[171]; + m_A132 += go[168]; + m_A131 += go[169]; + double RHS47 = Idr[168]; + RHS47 += Idr[169]; + RHS47 += Idr[170]; + RHS47 += Idr[171]; + RHS47 -= go[170] * *cnV[170]; + RHS47 -= go[171] * *cnV[171]; + m_A141 += gt[172]; + m_A141 += gt[173]; + m_A141 += gt[174]; + m_A140 += go[172]; + m_A139 += go[173]; + double RHS48 = Idr[172]; + RHS48 += Idr[173]; + RHS48 += Idr[174]; + RHS48 -= go[174] * *cnV[174]; + m_A145 += gt[175]; + m_A145 += gt[176]; + m_A145 += gt[177]; + m_A144 += go[175]; + m_A143 += go[176]; + double RHS49 = Idr[175]; + RHS49 += Idr[176]; + RHS49 += Idr[177]; + RHS49 -= go[177] * *cnV[177]; + m_A148 += gt[178]; + m_A148 += gt[179]; + m_A148 += gt[180]; + m_A147 += go[178]; + m_A149 += go[179]; + double RHS50 = Idr[178]; + RHS50 += Idr[179]; + RHS50 += Idr[180]; + RHS50 -= go[180] * *cnV[180]; + m_A152 += gt[181]; + m_A152 += gt[182]; + m_A152 += gt[183]; + m_A152 += gt[184]; + m_A150 += go[181]; + m_A151 += go[182]; + m_A153 += go[183]; + double RHS51 = Idr[181]; + RHS51 += Idr[182]; + RHS51 += Idr[183]; + RHS51 += Idr[184]; + RHS51 -= go[184] * *cnV[184]; + m_A157 += gt[185]; + m_A157 += gt[186]; + m_A157 += gt[187]; + m_A156 += go[185]; + m_A155 += go[186]; + m_A154 += go[187]; + double RHS52 = Idr[185]; + RHS52 += Idr[186]; + RHS52 += Idr[187]; + m_A160 += gt[188]; + m_A160 += gt[189]; + m_A160 += gt[190]; + m_A160 += gt[191]; + m_A161 += go[188]; + m_A159 += go[189]; + double RHS53 = Idr[188]; + RHS53 += Idr[189]; + RHS53 += Idr[190]; + RHS53 += Idr[191]; + RHS53 -= go[190] * *cnV[190]; + RHS53 -= go[191] * *cnV[191]; + m_A166 += gt[192]; + m_A166 += gt[193]; + m_A166 += gt[194]; + m_A166 += gt[195]; + m_A168 += go[192]; + m_A163 += go[193]; + m_A162 += go[194]; + double RHS54 = Idr[192]; + RHS54 += Idr[193]; + RHS54 += Idr[194]; + RHS54 += Idr[195]; + RHS54 -= go[195] * *cnV[195]; + m_A173 += gt[196]; + m_A173 += gt[197]; + m_A173 += gt[198]; + m_A173 += gt[199]; + m_A173 += gt[200]; + m_A173 += gt[201]; + m_A173 += gt[202]; + m_A174 += go[196]; + m_A171 += go[197]; + double RHS55 = Idr[196]; + RHS55 += Idr[197]; + RHS55 += Idr[198]; + RHS55 += Idr[199]; + RHS55 += Idr[200]; + RHS55 += Idr[201]; + RHS55 += Idr[202]; + RHS55 -= go[198] * *cnV[198]; + RHS55 -= go[199] * *cnV[199]; + RHS55 -= go[200] * *cnV[200]; + RHS55 -= go[201] * *cnV[201]; + RHS55 -= go[202] * *cnV[202]; + m_A180 += gt[203]; + m_A180 += gt[204]; + m_A180 += gt[205]; + m_A180 += gt[206]; + m_A180 += gt[207]; + m_A180 += gt[208]; + m_A184 += go[203]; + m_A177 += go[204]; + m_A176 += go[205]; + m_A175 += go[206]; + m_A182 += go[207]; + double RHS56 = Idr[203]; + RHS56 += Idr[204]; + RHS56 += Idr[205]; + RHS56 += Idr[206]; + RHS56 += Idr[207]; + RHS56 += Idr[208]; + RHS56 -= go[208] * *cnV[208]; + m_A188 += gt[209]; + m_A188 += gt[210]; + m_A188 += gt[211]; + m_A188 += gt[212]; + m_A188 += gt[213]; + m_A188 += gt[214]; + m_A185 += go[209]; + m_A187 += go[210]; + m_A186 += go[211]; + double RHS57 = Idr[209]; + RHS57 += Idr[210]; + RHS57 += Idr[211]; + RHS57 += Idr[212]; + RHS57 += Idr[213]; + RHS57 += Idr[214]; + RHS57 -= go[212] * *cnV[212]; + RHS57 -= go[213] * *cnV[213]; + RHS57 -= go[214] * *cnV[214]; + m_A191 += gt[215]; + m_A191 += gt[216]; + m_A191 += gt[217]; + m_A190 += go[215]; + m_A192 += go[216]; + double RHS58 = Idr[215]; + RHS58 += Idr[216]; + RHS58 += Idr[217]; + RHS58 -= go[217] * *cnV[217]; + m_A193 += gt[218]; + m_A193 += gt[219]; + m_A193 += gt[220]; + m_A193 += gt[221]; + m_A195 += go[218]; + m_A193 += go[219]; + m_A193 += go[220]; + m_A194 += go[221]; + double RHS59 = Idr[218]; + RHS59 += Idr[219]; + RHS59 += Idr[220]; + RHS59 += Idr[221]; + m_A197 += gt[222]; + m_A197 += gt[223]; + m_A197 += gt[224]; + m_A197 += gt[225]; + m_A197 += gt[226]; + m_A197 += gt[227]; + m_A197 += gt[228]; + m_A201 += go[222]; + m_A200 += go[223]; + m_A199 += go[224]; + m_A196 += go[225]; + double RHS60 = Idr[222]; + RHS60 += Idr[223]; + RHS60 += Idr[224]; + RHS60 += Idr[225]; + RHS60 += Idr[226]; + RHS60 += Idr[227]; + RHS60 += Idr[228]; + RHS60 -= go[226] * *cnV[226]; + RHS60 -= go[227] * *cnV[227]; + RHS60 -= go[228] * *cnV[228]; + m_A203 += gt[229]; + m_A203 += gt[230]; + m_A203 += gt[231]; + m_A202 += go[229]; + m_A204 += go[230]; + double RHS61 = Idr[229]; + RHS61 += Idr[230]; + RHS61 += Idr[231]; + RHS61 -= go[231] * *cnV[231]; + m_A207 += gt[232]; + m_A207 += gt[233]; + m_A207 += gt[234]; + m_A207 += gt[235]; + m_A207 += gt[236]; + m_A208 += go[232]; + m_A205 += go[233]; + m_A209 += go[234]; + double RHS62 = Idr[232]; + RHS62 += Idr[233]; + RHS62 += Idr[234]; + RHS62 += Idr[235]; + RHS62 += Idr[236]; + RHS62 -= go[235] * *cnV[235]; + RHS62 -= go[236] * *cnV[236]; + m_A211 += gt[237]; + m_A211 += gt[238]; + m_A211 += gt[239]; + m_A211 += gt[240]; + m_A211 += gt[241]; + m_A211 += gt[242]; + m_A210 += go[237]; + m_A213 += go[238]; + m_A212 += go[239]; + double RHS63 = Idr[237]; + RHS63 += Idr[238]; + RHS63 += Idr[239]; + RHS63 += Idr[240]; + RHS63 += Idr[241]; + RHS63 += Idr[242]; + RHS63 -= go[240] * *cnV[240]; + RHS63 -= go[241] * *cnV[241]; + RHS63 -= go[242] * *cnV[242]; + m_A216 += gt[243]; + m_A216 += gt[244]; + m_A216 += gt[245]; + m_A216 += gt[246]; + m_A216 += gt[247]; + m_A216 += gt[248]; + m_A216 += gt[249]; + m_A217 += go[243]; + m_A217 += go[244]; + m_A215 += go[245]; + m_A215 += go[246]; + m_A214 += go[247]; + double RHS64 = Idr[243]; + RHS64 += Idr[244]; + RHS64 += Idr[245]; + RHS64 += Idr[246]; + RHS64 += Idr[247]; + RHS64 += Idr[248]; + RHS64 += Idr[249]; + RHS64 -= go[248] * *cnV[248]; + RHS64 -= go[249] * *cnV[249]; + m_A220 += gt[250]; + m_A220 += gt[251]; + m_A220 += gt[252]; + m_A220 += gt[253]; + m_A218 += go[250]; + m_A219 += go[251]; + m_A221 += go[252]; + double RHS65 = Idr[250]; + RHS65 += Idr[251]; + RHS65 += Idr[252]; + RHS65 += Idr[253]; + RHS65 -= go[253] * *cnV[253]; + m_A223 += gt[254]; + m_A223 += gt[255]; + m_A223 += gt[256]; + m_A225 += go[254]; + m_A222 += go[255]; + double RHS66 = Idr[254]; + RHS66 += Idr[255]; + RHS66 += Idr[256]; + RHS66 -= go[256] * *cnV[256]; + m_A228 += gt[257]; + m_A228 += gt[258]; + m_A228 += gt[259]; + m_A229 += go[257]; + m_A226 += go[258]; + double RHS67 = Idr[257]; + RHS67 += Idr[258]; + RHS67 += Idr[259]; + RHS67 -= go[259] * *cnV[259]; + m_A232 += gt[260]; + m_A232 += gt[261]; + m_A231 += go[260]; + m_A230 += go[261]; + double RHS68 = Idr[260]; + RHS68 += Idr[261]; + m_A234 += gt[262]; + m_A234 += gt[263]; + m_A234 += gt[264]; + m_A234 += gt[265]; + m_A234 += gt[266]; + m_A234 += gt[267]; + m_A234 += gt[268]; + m_A235 += go[262]; + double RHS69 = Idr[262]; + RHS69 += Idr[263]; + RHS69 += Idr[264]; + RHS69 += Idr[265]; + RHS69 += Idr[266]; + RHS69 += Idr[267]; + RHS69 += Idr[268]; + RHS69 -= go[263] * *cnV[263]; + RHS69 -= go[264] * *cnV[264]; + RHS69 -= go[265] * *cnV[265]; + RHS69 -= go[266] * *cnV[266]; + RHS69 -= go[267] * *cnV[267]; + RHS69 -= go[268] * *cnV[268]; + m_A238 += gt[269]; + m_A238 += gt[270]; + m_A238 += gt[271]; + m_A240 += go[269]; + m_A236 += go[270]; + double RHS70 = Idr[269]; + RHS70 += Idr[270]; + RHS70 += Idr[271]; + RHS70 -= go[271] * *cnV[271]; + m_A244 += gt[272]; + m_A244 += gt[273]; + m_A244 += gt[274]; + m_A245 += go[272]; + m_A242 += go[273]; + m_A246 += go[274]; + double RHS71 = Idr[272]; + RHS71 += Idr[273]; + RHS71 += Idr[274]; + m_A249 += gt[275]; + m_A249 += gt[276]; + m_A248 += go[275]; + m_A247 += go[276]; + double RHS72 = Idr[275]; + RHS72 += Idr[276]; + m_A254 += gt[277]; + m_A254 += gt[278]; + m_A254 += gt[279]; + m_A254 += gt[280]; + m_A255 += go[277]; + m_A254 += go[278]; + m_A254 += go[279]; + m_A252 += go[280]; + double RHS73 = Idr[277]; + RHS73 += Idr[278]; + RHS73 += Idr[279]; + RHS73 += Idr[280]; + m_A257 += gt[281]; + m_A257 += gt[282]; + m_A256 += go[281]; + double RHS74 = Idr[281]; + RHS74 += Idr[282]; + RHS74 -= go[282] * *cnV[282]; + m_A264 += gt[283]; + m_A264 += gt[284]; + m_A264 += gt[285]; + m_A264 += gt[286]; + m_A264 += gt[287]; + m_A262 += go[283]; + m_A259 += go[284]; + m_A261 += go[285]; + double RHS75 = Idr[283]; + RHS75 += Idr[284]; + RHS75 += Idr[285]; + RHS75 += Idr[286]; + RHS75 += Idr[287]; + RHS75 -= go[286] * *cnV[286]; + RHS75 -= go[287] * *cnV[287]; + m_A271 += gt[288]; + m_A271 += gt[289]; + m_A271 += gt[290]; + m_A271 += gt[291]; + m_A273 += go[288]; + m_A268 += go[289]; + m_A269 += go[290]; + double RHS76 = Idr[288]; + RHS76 += Idr[289]; + RHS76 += Idr[290]; + RHS76 += Idr[291]; + RHS76 -= go[291] * *cnV[291]; + m_A281 += gt[292]; + m_A281 += gt[293]; + m_A281 += gt[294]; + m_A281 += gt[295]; + m_A277 += go[292]; + m_A276 += go[293]; + m_A279 += go[294]; + m_A278 += go[295]; + double RHS77 = Idr[292]; + RHS77 += Idr[293]; + RHS77 += Idr[294]; + RHS77 += Idr[295]; + m_A294 += gt[296]; + m_A294 += gt[297]; + m_A294 += gt[298]; + m_A294 += gt[299]; + m_A294 += gt[300]; + m_A294 += gt[301]; + m_A289 += go[296]; + m_A296 += go[297]; + m_A287 += go[298]; + m_A285 += go[299]; + m_A286 += go[300]; + double RHS78 = Idr[296]; + RHS78 += Idr[297]; + RHS78 += Idr[298]; + RHS78 += Idr[299]; + RHS78 += Idr[300]; + RHS78 += Idr[301]; + RHS78 -= go[301] * *cnV[301]; + m_A300 += gt[302]; + m_A300 += gt[303]; + m_A300 += gt[304]; + m_A300 += gt[305]; + m_A300 += gt[306]; + m_A298 += go[302]; + m_A297 += go[303]; + m_A299 += go[304]; + double RHS79 = Idr[302]; + RHS79 += Idr[303]; + RHS79 += Idr[304]; + RHS79 += Idr[305]; + RHS79 += Idr[306]; + RHS79 -= go[305] * *cnV[305]; + RHS79 -= go[306] * *cnV[306]; + m_A304 += gt[307]; + m_A304 += gt[308]; + m_A303 += go[307]; + m_A302 += go[308]; + double RHS80 = Idr[307]; + RHS80 += Idr[308]; + m_A311 += gt[309]; + m_A311 += gt[310]; + m_A311 += gt[311]; + m_A311 += gt[312]; + m_A311 += gt[313]; + m_A311 += gt[314]; + m_A315 += go[309]; + m_A308 += go[310]; + m_A309 += go[311]; + m_A307 += go[312]; + m_A313 += go[313]; + double RHS81 = Idr[309]; + RHS81 += Idr[310]; + RHS81 += Idr[311]; + RHS81 += Idr[312]; + RHS81 += Idr[313]; + RHS81 += Idr[314]; + RHS81 -= go[314] * *cnV[314]; + m_A319 += gt[315]; + m_A319 += gt[316]; + m_A319 += gt[317]; + m_A319 += gt[318]; + m_A319 += gt[319]; + m_A319 += gt[320]; + m_A319 += gt[321]; + m_A318 += go[315]; + m_A316 += go[316]; + double RHS82 = Idr[315]; + RHS82 += Idr[316]; + RHS82 += Idr[317]; + RHS82 += Idr[318]; + RHS82 += Idr[319]; + RHS82 += Idr[320]; + RHS82 += Idr[321]; + RHS82 -= go[317] * *cnV[317]; + RHS82 -= go[318] * *cnV[318]; + RHS82 -= go[319] * *cnV[319]; + RHS82 -= go[320] * *cnV[320]; + RHS82 -= go[321] * *cnV[321]; + m_A322 += gt[322]; + m_A322 += gt[323]; + m_A322 += gt[324]; + m_A322 += gt[325]; + m_A324 += go[322]; + m_A322 += go[323]; + m_A322 += go[324]; + m_A321 += go[325]; + double RHS83 = Idr[322]; + RHS83 += Idr[323]; + RHS83 += Idr[324]; + RHS83 += Idr[325]; + m_A329 += gt[326]; + m_A329 += gt[327]; + m_A329 += gt[328]; + m_A329 += gt[329]; + m_A329 += gt[330]; + m_A329 += gt[331]; + m_A326 += go[326]; + m_A325 += go[327]; + m_A328 += go[328]; + m_A328 += go[329]; + double RHS84 = Idr[326]; + RHS84 += Idr[327]; + RHS84 += Idr[328]; + RHS84 += Idr[329]; + RHS84 += Idr[330]; + RHS84 += Idr[331]; + RHS84 -= go[330] * *cnV[330]; + RHS84 -= go[331] * *cnV[331]; + m_A335 += gt[332]; + m_A335 += gt[333]; + m_A335 += gt[334]; + m_A335 += gt[335]; + m_A335 += gt[336]; + m_A330 += go[332]; + m_A331 += go[333]; + m_A332 += go[334]; + double RHS85 = Idr[332]; + RHS85 += Idr[333]; + RHS85 += Idr[334]; + RHS85 += Idr[335]; + RHS85 += Idr[336]; + RHS85 -= go[335] * *cnV[335]; + RHS85 -= go[336] * *cnV[336]; + m_A347 += gt[337]; + m_A347 += gt[338]; + m_A347 += gt[339]; + m_A347 += gt[340]; + m_A347 += gt[341]; + m_A347 += gt[342]; + m_A347 += gt[343]; + m_A338 += go[337]; + m_A340 += go[338]; + m_A341 += go[339]; + m_A342 += go[340]; + m_A343 += go[341]; + double RHS86 = Idr[337]; + RHS86 += Idr[338]; + RHS86 += Idr[339]; + RHS86 += Idr[340]; + RHS86 += Idr[341]; + RHS86 += Idr[342]; + RHS86 += Idr[343]; + RHS86 -= go[342] * *cnV[342]; + RHS86 -= go[343] * *cnV[343]; + m_A356 += gt[344]; + m_A356 += gt[345]; + m_A356 += gt[346]; + m_A356 += gt[347]; + m_A356 += gt[348]; + m_A356 += gt[349]; + m_A351 += go[344]; + m_A352 += go[345]; + m_A354 += go[346]; + m_A353 += go[347]; + double RHS87 = Idr[344]; + RHS87 += Idr[345]; + RHS87 += Idr[346]; + RHS87 += Idr[347]; + RHS87 += Idr[348]; + RHS87 += Idr[349]; + RHS87 -= go[348] * *cnV[348]; + RHS87 -= go[349] * *cnV[349]; + m_A364 += gt[350]; + m_A364 += gt[351]; + m_A364 += gt[352]; + m_A364 += gt[353]; + m_A360 += go[350]; + m_A359 += go[351]; + m_A361 += go[352]; + double RHS88 = Idr[350]; + RHS88 += Idr[351]; + RHS88 += Idr[352]; + RHS88 += Idr[353]; + RHS88 -= go[353] * *cnV[353]; + m_A380 += gt[354]; + m_A380 += gt[355]; + m_A380 += gt[356]; + m_A380 += gt[357]; + m_A380 += gt[358]; + m_A380 += gt[359]; + m_A380 += gt[360]; + m_A380 += gt[361]; + m_A370 += go[354]; + m_A369 += go[355]; + m_A377 += go[356]; + m_A368 += go[357]; + m_A373 += go[358]; + double RHS89 = Idr[354]; + RHS89 += Idr[355]; + RHS89 += Idr[356]; + RHS89 += Idr[357]; + RHS89 += Idr[358]; + RHS89 += Idr[359]; + RHS89 += Idr[360]; + RHS89 += Idr[361]; + RHS89 -= go[359] * *cnV[359]; + RHS89 -= go[360] * *cnV[360]; + RHS89 -= go[361] * *cnV[361]; + m_A387 += gt[362]; + m_A387 += gt[363]; + m_A387 += gt[364]; + m_A387 += gt[365]; + m_A383 += go[362]; + m_A382 += go[363]; + m_A384 += go[364]; + m_A385 += go[365]; + double RHS90 = Idr[362]; + RHS90 += Idr[363]; + RHS90 += Idr[364]; + RHS90 += Idr[365]; + m_A393 += gt[366]; + m_A393 += gt[367]; + m_A393 += gt[368]; + m_A393 += gt[369]; + m_A390 += go[366]; + m_A388 += go[367]; + m_A391 += go[368]; + m_A389 += go[369]; + double RHS91 = Idr[366]; + RHS91 += Idr[367]; + RHS91 += Idr[368]; + RHS91 += Idr[369]; + m_A404 += gt[370]; + m_A404 += gt[371]; + m_A404 += gt[372]; + m_A404 += gt[373]; + m_A404 += gt[374]; + m_A404 += gt[375]; + m_A399 += go[370]; + m_A405 += go[371]; + m_A397 += go[372]; + m_A396 += go[373]; + m_A398 += go[374]; + double RHS92 = Idr[370]; + RHS92 += Idr[371]; + RHS92 += Idr[372]; + RHS92 += Idr[373]; + RHS92 += Idr[374]; + RHS92 += Idr[375]; + RHS92 -= go[375] * *cnV[375]; + m_A409 += gt[376]; + m_A409 += gt[377]; + m_A409 += gt[378]; + m_A409 += gt[379]; + m_A409 += gt[380]; + m_A407 += go[376]; + m_A406 += go[377]; + m_A410 += go[378]; + double RHS93 = Idr[376]; + RHS93 += Idr[377]; + RHS93 += Idr[378]; + RHS93 += Idr[379]; + RHS93 += Idr[380]; + RHS93 -= go[379] * *cnV[379]; + RHS93 -= go[380] * *cnV[380]; + m_A420 += gt[381]; + m_A420 += gt[382]; + m_A420 += gt[383]; + m_A420 += gt[384]; + m_A420 += gt[385]; + m_A420 += gt[386]; + m_A420 += gt[387]; + m_A420 += gt[388]; + m_A412 += go[381]; + m_A411 += go[382]; + m_A419 += go[383]; + m_A413 += go[384]; + m_A416 += go[385]; + double RHS94 = Idr[381]; + RHS94 += Idr[382]; + RHS94 += Idr[383]; + RHS94 += Idr[384]; + RHS94 += Idr[385]; + RHS94 += Idr[386]; + RHS94 += Idr[387]; + RHS94 += Idr[388]; + RHS94 -= go[386] * *cnV[386]; + RHS94 -= go[387] * *cnV[387]; + RHS94 -= go[388] * *cnV[388]; + m_A437 += gt[389]; + m_A437 += gt[390]; + m_A437 += gt[391]; + m_A437 += gt[392]; + m_A437 += gt[393]; + m_A437 += gt[394]; + m_A437 += gt[395]; + m_A437 += gt[396]; + m_A435 += go[389]; + m_A425 += go[390]; + m_A424 += go[391]; + m_A429 += go[392]; + m_A423 += go[393]; + m_A422 += go[394]; + m_A427 += go[395]; + double RHS95 = Idr[389]; + RHS95 += Idr[390]; + RHS95 += Idr[391]; + RHS95 += Idr[392]; + RHS95 += Idr[393]; + RHS95 += Idr[394]; + RHS95 += Idr[395]; + RHS95 += Idr[396]; + RHS95 -= go[396] * *cnV[396]; + const double f0 = 1.0 / m_A0; + const double f0_46 = -f0 * m_A126; + m_A128 += m_A1 * f0_46; + RHS46 += f0_46 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_50 = -f1 * m_A147; + m_A148 += m_A3 * f1_50; + RHS50 += f1_50 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_46 = -f2 * m_A127; + m_A128 += m_A5 * f2_46; + m_A129 += m_A6 * f2_46; + m_A130 += m_A7 * f2_46; + RHS46 += f2_46 * RHS2; + const double f2_47 = -f2 * m_A131; + m_A133 += m_A5 * f2_47; + m_A134 += m_A6 * f2_47; + m_A135 += m_A7 * f2_47; + RHS47 += f2_47 * RHS2; + const double f2_54 = -f2 * m_A162; + m_A164 += m_A5 * f2_54; + m_A165 += m_A6 * f2_54; + m_A166 += m_A7 * f2_54; + RHS54 += f2_54 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_51 = -f3 * m_A150; + m_A152 += m_A9 * f3_51; + RHS51 += f3_51 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_56 = -f4 * m_A175; + m_A180 += m_A11 * f4_56; + m_A182 += m_A12 * f4_56; + RHS56 += f4_56 * RHS4; + const double f4_77 = -f4 * m_A276; + m_A279 += m_A11 * f4_77; + m_A281 += m_A12 * f4_77; + RHS77 += f4_77 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_51 = -f5 * m_A151; + m_A152 += m_A14 * f5_51; + m_A153 += m_A15 * f5_51; + RHS51 += f5_51 * RHS5; + const double f5_78 = -f5 * m_A285; + m_A289 += m_A14 * f5_78; + m_A294 += m_A15 * f5_78; + RHS78 += f5_78 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_53 = -f6 * m_A159; + m_A160 += m_A17 * f6_53; + RHS53 += f6_53 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_47 = -f7 * m_A132; + m_A134 += m_A19 * f7_47; + m_A136 += m_A20 * f7_47; + m_A137 += m_A21 * f7_47; + m_A138 += m_A22 * f7_47; + RHS47 += f7_47 * RHS7; + const double f7_56 = -f7 * m_A176; + m_A178 += m_A19 * f7_56; + m_A180 += m_A20 * f7_56; + m_A183 += m_A21 * f7_56; + m_A184 += m_A22 * f7_56; + RHS56 += f7_56 * RHS7; + const double f7_78 = -f7 * m_A286; + m_A288 += m_A19 * f7_78; + m_A291 += m_A20 * f7_78; + m_A294 += m_A21 * f7_78; + m_A296 += m_A22 * f7_78; + RHS78 += f7_78 * RHS7; + const double f7_89 = -f7 * m_A368; + m_A371 += m_A19 * f7_89; + m_A373 += m_A20 * f7_89; + m_A377 += m_A21 * f7_89; + m_A380 += m_A22 * f7_89; + RHS89 += f7_89 * RHS7; + const double f8 = 1.0 / m_A23; + const double f8_54 = -f8 * m_A163; + m_A166 += m_A24 * f8_54; + m_A167 += m_A25 * f8_54; + m_A169 += m_A26 * f8_54; + m_A170 += m_A27 * f8_54; + RHS54 += f8_54 * RHS8; + const double f8_56 = -f8 * m_A177; + m_A179 += m_A24 * f8_56; + m_A180 += m_A25 * f8_56; + m_A183 += m_A26 * f8_56; + m_A184 += m_A27 * f8_56; + RHS56 += f8_56 * RHS8; + const double f8_78 = -f8 * m_A287; + m_A290 += m_A24 * f8_78; + m_A291 += m_A25 * f8_78; + m_A294 += m_A26 * f8_78; + m_A296 += m_A27 * f8_78; + RHS78 += f8_78 * RHS8; + const double f8_89 = -f8 * m_A369; + m_A372 += m_A24 * f8_89; + m_A373 += m_A25 * f8_89; + m_A377 += m_A26 * f8_89; + m_A380 += m_A27 * f8_89; + RHS89 += f8_89 * RHS8; + const double f9 = 1.0 / m_A28; + const double f9_58 = -f9 * m_A190; + m_A191 += m_A29 * f9_58; + RHS58 += f9_58 * RHS9; + const double f10 = 1.0 / m_A30; + const double f10_65 = -f10 * m_A218; + m_A220 += m_A31 * f10_65; + RHS65 += f10_65 * RHS10; + const double f11 = 1.0 / m_A32; + const double f11_60 = -f11 * m_A196; + m_A197 += m_A33 * f11_60; + m_A198 += m_A34 * f11_60; + RHS60 += f11_60 * RHS11; + const double f11_76 = -f11 * m_A268; + m_A270 += m_A33 * f11_76; + m_A271 += m_A34 * f11_76; + RHS76 += f11_76 * RHS11; + const double f12 = 1.0 / m_A35; + const double f12_65 = -f12 * m_A219; + m_A220 += m_A36 * f12_65; + m_A221 += m_A37 * f12_65; + RHS65 += f12_65 * RHS12; + const double f12_92 = -f12 * m_A396; + m_A399 += m_A36 * f12_92; + m_A404 += m_A37 * f12_92; + RHS92 += f12_92 * RHS12; + const double f13 = 1.0 / m_A38; + const double f13_48 = -f13 * m_A139; + m_A141 += m_A39 * f13_48; + RHS48 += f13_48 * RHS13; + const double f14 = 1.0 / m_A40; + const double f14_48 = -f14 * m_A140; + m_A141 += m_A41 * f14_48; + m_A142 += m_A42 * f14_48; + RHS48 += f14_48 * RHS14; + const double f14_55 = -f14 * m_A171; + m_A172 += m_A41 * f14_55; + m_A174 += m_A42 * f14_55; + RHS55 += f14_55 * RHS14; + const double f14_75 = -f14 * m_A259; + m_A260 += m_A41 * f14_75; + m_A264 += m_A42 * f14_75; + RHS75 += f14_75 * RHS14; + const double f15 = 1.0 / m_A43; + const double f15_81 = -f15 * m_A307; + m_A311 += m_A44 * f15_81; + m_A313 += m_A45 * f15_81; + RHS81 += f15_81 * RHS15; + const double f15_91 = -f15 * m_A388; + m_A391 += m_A44 * f15_91; + m_A393 += m_A45 * f15_91; + RHS91 += f15_91 * RHS15; + const double f16 = 1.0 / m_A46; + const double f16_81 = -f16 * m_A308; + m_A311 += m_A47 * f16_81; + m_A312 += m_A48 * f16_81; + m_A314 += m_A49 * f16_81; + m_A315 += m_A50 * f16_81; + RHS81 += f16_81 * RHS16; + const double f16_88 = -f16 * m_A359; + m_A362 += m_A47 * f16_88; + m_A364 += m_A48 * f16_88; + m_A366 += m_A49 * f16_88; + m_A367 += m_A50 * f16_88; + RHS88 += f16_88 * RHS16; + const double f16_92 = -f16 * m_A397; + m_A401 += m_A47 * f16_92; + m_A402 += m_A48 * f16_92; + m_A404 += m_A49 * f16_92; + m_A405 += m_A50 * f16_92; + RHS92 += f16_92 * RHS16; + const double f16_94 = -f16 * m_A411; + m_A416 += m_A47 * f16_94; + m_A417 += m_A48 * f16_94; + m_A419 += m_A49 * f16_94; + m_A420 += m_A50 * f16_94; + RHS94 += f16_94 * RHS16; + const double f17 = 1.0 / m_A51; + const double f17_49 = -f17 * m_A143; + m_A145 += m_A52 * f17_49; + RHS49 += f17_49 * RHS17; + const double f18 = 1.0 / m_A53; + const double f18_49 = -f18 * m_A144; + m_A145 += m_A54 * f18_49; + m_A146 += m_A55 * f18_49; + RHS49 += f18_49 * RHS18; + const double f18_62 = -f18 * m_A205; + m_A206 += m_A54 * f18_62; + m_A207 += m_A55 * f18_62; + RHS62 += f18_62 * RHS18; + const double f18_82 = -f18 * m_A316; + m_A317 += m_A54 * f18_82; + m_A318 += m_A55 * f18_82; + RHS82 += f18_82 * RHS18; + const double f19 = 1.0 / m_A56; + const double f19_52 = -f19 * m_A154; + m_A157 += m_A57 * f19_52; + RHS52 += f19_52 * RHS19; + const double f20 = 1.0 / m_A58; + const double f20_52 = -f20 * m_A155; + m_A157 += m_A59 * f20_52; + RHS52 += f20_52 * RHS20; + const double f21 = 1.0 / m_A60; + const double f21_61 = -f21 * m_A202; + m_A203 += m_A61 * f21_61; + RHS61 += f21_61 * RHS21; + const double f22 = 1.0 / m_A62; + const double f22_90 = -f22 * m_A382; + m_A387 += m_A63 * f22_90; + RHS90 += f22_90 * RHS22; + const double f23 = 1.0 / m_A64; + const double f23_63 = -f23 * m_A210; + m_A212 += m_A65 * f23_63; + RHS63 += f23_63 * RHS23; + const double f23_79 = -f23 * m_A297; + m_A300 += m_A65 * f23_79; + RHS79 += f23_79 * RHS23; + const double f24 = 1.0 / m_A66; + const double f24_64 = -f24 * m_A214; + m_A216 += m_A67 * f24_64; + RHS64 += f24_64 * RHS24; + const double f25 = 1.0 / m_A68; + const double f25_79 = -f25 * m_A298; + m_A300 += m_A69 * f25_79; + RHS79 += f25_79 * RHS25; + const double f25_90 = -f25 * m_A383; + m_A385 += m_A69 * f25_90; + RHS90 += f25_90 * RHS25; + const double f26 = 1.0 / m_A70; + const double f26_64 = -f26 * m_A215; + m_A216 += m_A71 * f26_64; + m_A217 += m_A72 * f26_64; + RHS64 += f26_64 * RHS26; + const double f26_84 = -f26 * m_A325; + m_A328 += m_A71 * f26_84; + m_A329 += m_A72 * f26_84; + RHS84 += f26_84 * RHS26; + const double f27 = 1.0 / m_A73; + const double f27_57 = -f27 * m_A185; + m_A186 += m_A74 * f27_57; + m_A189 += m_A75 * f27_57; + RHS57 += f27_57 * RHS27; + const double f28 = 1.0 / m_A76; + const double f28_52 = -f28 * m_A156; + m_A157 += m_A77 * f28_52; + m_A158 += m_A78 * f28_52; + RHS52 += f28_52 * RHS28; + const double f28_67 = -f28 * m_A226; + m_A227 += m_A77 * f28_67; + m_A228 += m_A78 * f28_67; + RHS67 += f28_67 * RHS28; + const double f29 = 1.0 / m_A79; + const double f29_87 = -f29 * m_A351; + m_A353 += m_A80 * f29_87; + RHS87 += f29_87 * RHS29; + const double f30 = 1.0 / m_A81; + const double f30_57 = -f30 * m_A186; + m_A188 += m_A82 * f30_57; + m_A189 += m_A83 * f30_57; + RHS57 += f30_57 * RHS30; + const double f30_84 = -f30 * m_A326; + m_A327 += m_A82 * f30_84; + m_A329 += m_A83 * f30_84; + RHS84 += f30_84 * RHS30; + const double f31 = 1.0 / m_A84; + const double f31_57 = -f31 * m_A187; + m_A188 += m_A85 * f31_57; + RHS57 += f31_57 * RHS31; + const double f32 = 1.0 / m_A86; + const double f32_86 = -f32 * m_A338; + m_A339 += m_A87 * f32_86; + m_A342 += m_A88 * f32_86; + RHS86 += f32_86 * RHS32; + const double f33 = 1.0 / m_A89; + const double f33_68 = -f33 * m_A230; + m_A232 += m_A90 * f33_68; + RHS68 += f33_68 * RHS33; + const double f34 = 1.0 / m_A91; + const double f34_70 = -f34 * m_A236; + m_A237 += m_A92 * f34_70; + m_A238 += m_A93 * f34_70; + RHS70 += f34_70 * RHS34; + const double f35 = 1.0 / m_A94; + const double f35_85 = -f35 * m_A330; + m_A332 += m_A95 * f35_85; + RHS85 += f35_85 * RHS35; + const double f36 = 1.0 / m_A96; + const double f36_66 = -f36 * m_A222; + m_A223 += m_A97 * f36_66; + m_A224 += m_A98 * f36_66; + RHS66 += f36_66 * RHS36; + const double f36_71 = -f36 * m_A242; + m_A243 += m_A97 * f36_71; + m_A244 += m_A98 * f36_71; + RHS71 += f36_71 * RHS36; + const double f36_86 = -f36 * m_A339; + m_A342 += m_A97 * f36_86; + m_A343 += m_A98 * f36_86; + RHS86 += f36_86 * RHS36; + const double f37 = 1.0 / m_A99; + const double f37_72 = -f37 * m_A247; + m_A249 += m_A100 * f37_72; + m_A250 += m_A101 * f37_72; + RHS72 += f37_72 * RHS37; + const double f37_89 = -f37 * m_A370; + m_A374 += m_A100 * f37_89; + m_A380 += m_A101 * f37_89; + RHS89 += f37_89 * RHS37; + const double f38 = 1.0 / m_A102; + const double f38_80 = -f38 * m_A302; + m_A304 += m_A103 * f38_80; + m_A305 += m_A104 * f38_80; + RHS80 += f38_80 * RHS38; + const double f38_94 = -f38 * m_A412; + m_A415 += m_A103 * f38_94; + m_A420 += m_A104 * f38_94; + RHS94 += f38_94 * RHS38; + const double f39 = 1.0 / m_A105; + const double f39_68 = -f39 * m_A231; + m_A232 += m_A106 * f39_68; + m_A233 += m_A107 * f39_68; + RHS68 += f39_68 * RHS39; + const double f39_73 = -f39 * m_A252; + m_A253 += m_A106 * f39_73; + m_A254 += m_A107 * f39_73; + RHS73 += f39_73 * RHS39; + const double f40 = 1.0 / m_A108; + const double f40_77 = -f40 * m_A277; + m_A281 += m_A109 * f40_77; + m_A283 += m_A110 * f40_77; + RHS77 += f40_77 * RHS40; + const double f40_86 = -f40 * m_A340; + m_A344 += m_A109 * f40_86; + m_A347 += m_A110 * f40_86; + RHS86 += f40_86 * RHS40; + const double f41 = 1.0 / m_A111; + const double f41_83 = -f41 * m_A321; + m_A322 += m_A112 * f41_83; + m_A323 += m_A113 * f41_83; + RHS83 += f41_83 * RHS41; + const double f41_86 = -f41 * m_A341; + m_A346 += m_A112 * f41_86; + m_A347 += m_A113 * f41_86; + RHS86 += f41_86 * RHS41; + const double f42 = 1.0 / m_A114; + const double f42_85 = -f42 * m_A331; + m_A335 += m_A115 * f42_85; + m_A337 += m_A116 * f42_85; + RHS85 += f42_85 * RHS42; + const double f42_95 = -f42 * m_A422; + m_A430 += m_A115 * f42_95; + m_A437 += m_A116 * f42_95; + RHS95 += f42_95 * RHS42; + const double f43 = 1.0 / m_A117; + const double f43_87 = -f43 * m_A352; + m_A356 += m_A118 * f43_87; + m_A358 += m_A119 * f43_87; + RHS87 += f43_87 * RHS43; + const double f43_95 = -f43 * m_A423; + m_A432 += m_A118 * f43_95; + m_A437 += m_A119 * f43_95; + RHS95 += f43_95 * RHS43; + const double f44 = 1.0 / m_A120; + const double f44_72 = -f44 * m_A248; + m_A249 += m_A121 * f44_72; + m_A251 += m_A122 * f44_72; + RHS72 += f44_72 * RHS44; + const double f44_95 = -f44 * m_A424; + m_A426 += m_A121 * f44_95; + m_A437 += m_A122 * f44_95; + RHS95 += f44_95 * RHS44; + const double f45 = 1.0 / m_A123; + const double f45_74 = -f45 * m_A256; + m_A257 += m_A124 * f45_74; + m_A258 += m_A125 * f45_74; + RHS74 += f45_74 * RHS45; + const double f45_93 = -f45 * m_A406; + m_A408 += m_A124 * f45_93; + m_A409 += m_A125 * f45_93; + RHS93 += f45_93 * RHS45; + const double f46 = 1.0 / m_A128; + const double f46_47 = -f46 * m_A133; + m_A134 += m_A129 * f46_47; + m_A135 += m_A130 * f46_47; + RHS47 += f46_47 * RHS46; + const double f46_54 = -f46 * m_A164; + m_A165 += m_A129 * f46_54; + m_A166 += m_A130 * f46_54; + RHS54 += f46_54 * RHS46; + const double f47 = 1.0 / m_A134; + const double f47_54 = -f47 * m_A165; + m_A166 += m_A135 * f47_54; + m_A167 += m_A136 * f47_54; + m_A169 += m_A137 * f47_54; + m_A170 += m_A138 * f47_54; + RHS54 += f47_54 * RHS47; + const double f47_56 = -f47 * m_A178; + m_A179 += m_A135 * f47_56; + m_A180 += m_A136 * f47_56; + m_A183 += m_A137 * f47_56; + m_A184 += m_A138 * f47_56; + RHS56 += f47_56 * RHS47; + const double f47_78 = -f47 * m_A288; + m_A290 += m_A135 * f47_78; + m_A291 += m_A136 * f47_78; + m_A294 += m_A137 * f47_78; + m_A296 += m_A138 * f47_78; + RHS78 += f47_78 * RHS47; + const double f47_89 = -f47 * m_A371; + m_A372 += m_A135 * f47_89; + m_A373 += m_A136 * f47_89; + m_A377 += m_A137 * f47_89; + m_A380 += m_A138 * f47_89; + RHS89 += f47_89 * RHS47; + const double f48 = 1.0 / m_A141; + const double f48_55 = -f48 * m_A172; + m_A174 += m_A142 * f48_55; + RHS55 += f48_55 * RHS48; + const double f48_75 = -f48 * m_A260; + m_A264 += m_A142 * f48_75; + RHS75 += f48_75 * RHS48; + const double f49 = 1.0 / m_A145; + const double f49_62 = -f49 * m_A206; + m_A207 += m_A146 * f49_62; + RHS62 += f49_62 * RHS49; + const double f49_82 = -f49 * m_A317; + m_A318 += m_A146 * f49_82; + RHS82 += f49_82 * RHS49; + const double f50 = 1.0 / m_A148; + const double f50_77 = -f50 * m_A278; + m_A281 += m_A149 * f50_77; + RHS77 += f50_77 * RHS50; + const double f51 = 1.0 / m_A152; + const double f51_78 = -f51 * m_A289; + m_A294 += m_A153 * f51_78; + RHS78 += f51_78 * RHS51; + const double f52 = 1.0 / m_A157; + const double f52_67 = -f52 * m_A227; + m_A228 += m_A158 * f52_67; + RHS67 += f52_67 * RHS52; + const double f53 = 1.0 / m_A160; + const double f53_76 = -f53 * m_A269; + m_A271 += m_A161 * f53_76; + RHS76 += f53_76 * RHS53; + const double f54 = 1.0 / m_A166; + const double f54_56 = -f54 * m_A179; + m_A180 += m_A167 * f54_56; + m_A181 += m_A168 * f54_56; + m_A183 += m_A169 * f54_56; + m_A184 += m_A170 * f54_56; + RHS56 += f54_56 * RHS54; + const double f54_75 = -f54 * m_A261; + m_A263 += m_A167 * f54_75; + m_A264 += m_A168 * f54_75; + m_A266 += m_A169 * f54_75; + m_A267 += m_A170 * f54_75; + RHS75 += f54_75 * RHS54; + const double f54_78 = -f54 * m_A290; + m_A291 += m_A167 * f54_78; + m_A292 += m_A168 * f54_78; + m_A294 += m_A169 * f54_78; + m_A296 += m_A170 * f54_78; + RHS78 += f54_78 * RHS54; + const double f54_89 = -f54 * m_A372; + m_A373 += m_A167 * f54_89; + m_A375 += m_A168 * f54_89; + m_A377 += m_A169 * f54_89; + m_A380 += m_A170 * f54_89; + RHS89 += f54_89 * RHS54; + const double f55 = 1.0 / m_A173; + const double f55_75 = -f55 * m_A262; + m_A264 += m_A174 * f55_75; + RHS75 += f55_75 * RHS55; + const double f56 = 1.0 / m_A180; + const double f56_75 = -f56 * m_A263; + m_A264 += m_A181 * f56_75; + m_A265 += m_A182 * f56_75; + m_A266 += m_A183 * f56_75; + m_A267 += m_A184 * f56_75; + RHS75 += f56_75 * RHS56; + const double f56_77 = -f56 * m_A279; + m_A280 += m_A181 * f56_77; + m_A281 += m_A182 * f56_77; + m_A282 += m_A183 * f56_77; + m_A284 += m_A184 * f56_77; + RHS77 += f56_77 * RHS56; + const double f56_78 = -f56 * m_A291; + m_A292 += m_A181 * f56_78; + m_A293 += m_A182 * f56_78; + m_A294 += m_A183 * f56_78; + m_A296 += m_A184 * f56_78; + RHS78 += f56_78 * RHS56; + const double f56_89 = -f56 * m_A373; + m_A375 += m_A181 * f56_89; + m_A376 += m_A182 * f56_89; + m_A377 += m_A183 * f56_89; + m_A380 += m_A184 * f56_89; + RHS89 += f56_89 * RHS56; + const double f57 = 1.0 / m_A188; + const double f57_79 = -f57 * m_A299; + m_A301 += m_A189 * f57_79; + RHS79 += f57_79 * RHS57; + const double f57_84 = -f57 * m_A327; + m_A329 += m_A189 * f57_84; + RHS84 += f57_84 * RHS57; + const double f58 = 1.0 / m_A191; + const double f58_91 = -f58 * m_A389; + m_A393 += m_A192 * f58_91; + RHS91 += f58_91 * RHS58; + const double f59 = 1.0 / m_A193; + const double f59_80 = -f59 * m_A303; + m_A304 += m_A194 * f59_80; + m_A306 += m_A195 * f59_80; + RHS80 += f59_80 * RHS59; + const double f59_95 = -f59 * m_A425; + m_A428 += m_A194 * f59_95; + m_A437 += m_A195 * f59_95; + RHS95 += f59_95 * RHS59; + const double f60 = 1.0 / m_A197; + const double f60_76 = -f60 * m_A270; + m_A271 += m_A198 * f60_76; + m_A272 += m_A199 * f60_76; + m_A274 += m_A200 * f60_76; + m_A275 += m_A201 * f60_76; + RHS76 += f60_76 * RHS60; + const double f60_81 = -f60 * m_A309; + m_A310 += m_A198 * f60_81; + m_A311 += m_A199 * f60_81; + m_A314 += m_A200 * f60_81; + m_A315 += m_A201 * f60_81; + RHS81 += f60_81 * RHS60; + const double f60_92 = -f60 * m_A398; + m_A400 += m_A198 * f60_92; + m_A401 += m_A199 * f60_92; + m_A404 += m_A200 * f60_92; + m_A405 += m_A201 * f60_92; + RHS92 += f60_92 * RHS60; + const double f60_94 = -f60 * m_A413; + m_A414 += m_A198 * f60_94; + m_A416 += m_A199 * f60_94; + m_A419 += m_A200 * f60_94; + m_A420 += m_A201 * f60_94; + RHS94 += f60_94 * RHS60; + const double f61 = 1.0 / m_A203; + const double f61_91 = -f61 * m_A390; + m_A393 += m_A204 * f61_91; + RHS91 += f61_91 * RHS61; + const double f62 = 1.0 / m_A207; + const double f62_82 = -f62 * m_A318; + m_A319 += m_A208 * f62_82; + m_A320 += m_A209 * f62_82; + RHS82 += f62_82 * RHS62; + const double f62_88 = -f62 * m_A360; + m_A363 += m_A208 * f62_88; + m_A364 += m_A209 * f62_88; + RHS88 += f62_88 * RHS62; + const double f63 = 1.0 / m_A211; + const double f63_70 = -f63 * m_A237; + m_A239 += m_A212 * f63_70; + m_A241 += m_A213 * f63_70; + RHS70 += f63_70 * RHS63; + const double f63_90 = -f63 * m_A384; + m_A385 += m_A212 * f63_90; + m_A387 += m_A213 * f63_90; + RHS90 += f63_90 * RHS63; + const double f64 = 1.0 / m_A216; + const double f64_84 = -f64 * m_A328; + m_A329 += m_A217 * f64_84; + RHS84 += f64_84 * RHS64; + const double f65 = 1.0 / m_A220; + const double f65_92 = -f65 * m_A399; + m_A404 += m_A221 * f65_92; + RHS92 += f65_92 * RHS65; + const double f66 = 1.0 / m_A223; + const double f66_71 = -f66 * m_A243; + m_A244 += m_A224 * f66_71; + m_A245 += m_A225 * f66_71; + RHS71 += f66_71 * RHS66; + const double f66_86 = -f66 * m_A342; + m_A343 += m_A224 * f66_86; + m_A347 += m_A225 * f66_86; + RHS86 += f66_86 * RHS66; + const double f67 = 1.0 / m_A228; + const double f67_87 = -f67 * m_A353; + m_A356 += m_A229 * f67_87; + RHS87 += f67_87 * RHS67; + const double f68 = 1.0 / m_A232; + const double f68_73 = -f68 * m_A253; + m_A254 += m_A233 * f68_73; + RHS73 += f68_73 * RHS68; + const double f69 = 1.0 / m_A234; + const double f69_93 = -f69 * m_A407; + m_A410 += m_A235 * f69_93; + RHS93 += f69_93 * RHS69; + const double f70 = 1.0 / m_A238; + const double f70_85 = -f70 * m_A332; + m_A333 += m_A239 * f70_85; + m_A335 += m_A240 * f70_85; + m_A336 += m_A241 * f70_85; + RHS85 += f70_85 * RHS70; + const double f71 = 1.0 / m_A244; + const double f71_86 = -f71 * m_A343; + m_A347 += m_A245 * f71_86; + m_A348 += m_A246 * f71_86; + RHS86 += f71_86 * RHS71; + const double f71_87 = -f71 * m_A354; + m_A355 += m_A245 * f71_87; + m_A356 += m_A246 * f71_87; + RHS87 += f71_87 * RHS71; + const double f72 = 1.0 / m_A249; + const double f72_89 = -f72 * m_A374; + m_A380 += m_A250 * f72_89; + m_A381 += m_A251 * f72_89; + RHS89 += f72_89 * RHS72; + const double f72_95 = -f72 * m_A426; + m_A433 += m_A250 * f72_95; + m_A437 += m_A251 * f72_95; + RHS95 += f72_95 * RHS72; + const double f73 = 1.0 / m_A254; + const double f73_95 = -f73 * m_A427; + m_A437 += m_A255 * f73_95; + RHS95 += f73_95 * RHS73; + const double f74 = 1.0 / m_A257; + const double f74_93 = -f74 * m_A408; + m_A409 += m_A258 * f74_93; + RHS93 += f74_93 * RHS74; + const double f75 = 1.0 / m_A264; + const double f75_77 = -f75 * m_A280; + m_A281 += m_A265 * f75_77; + m_A282 += m_A266 * f75_77; + m_A284 += m_A267 * f75_77; + RHS77 += f75_77 * RHS75; + const double f75_78 = -f75 * m_A292; + m_A293 += m_A265 * f75_78; + m_A294 += m_A266 * f75_78; + m_A296 += m_A267 * f75_78; + RHS78 += f75_78 * RHS75; + const double f75_89 = -f75 * m_A375; + m_A376 += m_A265 * f75_89; + m_A377 += m_A266 * f75_89; + m_A380 += m_A267 * f75_89; + RHS89 += f75_89 * RHS75; + const double f76 = 1.0 / m_A271; + const double f76_81 = -f76 * m_A310; + m_A311 += m_A272 * f76_81; + m_A312 += m_A273 * f76_81; + m_A314 += m_A274 * f76_81; + m_A315 += m_A275 * f76_81; + RHS81 += f76_81 * RHS76; + const double f76_88 = -f76 * m_A361; + m_A362 += m_A272 * f76_88; + m_A364 += m_A273 * f76_88; + m_A366 += m_A274 * f76_88; + m_A367 += m_A275 * f76_88; + RHS88 += f76_88 * RHS76; + const double f76_92 = -f76 * m_A400; + m_A401 += m_A272 * f76_92; + m_A402 += m_A273 * f76_92; + m_A404 += m_A274 * f76_92; + m_A405 += m_A275 * f76_92; + RHS92 += f76_92 * RHS76; + const double f76_94 = -f76 * m_A414; + m_A416 += m_A272 * f76_94; + m_A417 += m_A273 * f76_94; + m_A419 += m_A274 * f76_94; + m_A420 += m_A275 * f76_94; + RHS94 += f76_94 * RHS76; + const double f77 = 1.0 / m_A281; + const double f77_78 = -f77 * m_A293; + m_A294 += m_A282 * f77_78; + m_A295 += m_A283 * f77_78; + m_A296 += m_A284 * f77_78; + RHS78 += f77_78 * RHS77; + const double f77_86 = -f77 * m_A344; + m_A345 += m_A282 * f77_86; + m_A347 += m_A283 * f77_86; + m_A349 += m_A284 * f77_86; + RHS86 += f77_86 * RHS77; + const double f77_89 = -f77 * m_A376; + m_A377 += m_A282 * f77_89; + m_A378 += m_A283 * f77_89; + m_A380 += m_A284 * f77_89; + RHS89 += f77_89 * RHS77; + const double f78 = 1.0 / m_A294; + const double f78_86 = -f78 * m_A345; + m_A347 += m_A295 * f78_86; + m_A349 += m_A296 * f78_86; + RHS86 += f78_86 * RHS78; + const double f78_89 = -f78 * m_A377; + m_A378 += m_A295 * f78_89; + m_A380 += m_A296 * f78_89; + RHS89 += f78_89 * RHS78; + const double f79 = 1.0 / m_A300; + const double f79_85 = -f79 * m_A333; + m_A334 += m_A301 * f79_85; + RHS85 += f79_85 * RHS79; + const double f79_90 = -f79 * m_A385; + m_A386 += m_A301 * f79_90; + RHS90 += f79_90 * RHS79; + const double f80 = 1.0 / m_A304; + const double f80_94 = -f80 * m_A415; + m_A420 += m_A305 * f80_94; + m_A421 += m_A306 * f80_94; + RHS94 += f80_94 * RHS80; + const double f80_95 = -f80 * m_A428; + m_A436 += m_A305 * f80_95; + m_A437 += m_A306 * f80_95; + RHS95 += f80_95 * RHS80; + const double f81 = 1.0 / m_A311; + const double f81_88 = -f81 * m_A362; + m_A364 += m_A312 * f81_88; + m_A365 += m_A313 * f81_88; + m_A366 += m_A314 * f81_88; + m_A367 += m_A315 * f81_88; + RHS88 += f81_88 * RHS81; + const double f81_91 = -f81 * m_A391; + m_A392 += m_A312 * f81_91; + m_A393 += m_A313 * f81_91; + m_A394 += m_A314 * f81_91; + m_A395 += m_A315 * f81_91; + RHS91 += f81_91 * RHS81; + const double f81_92 = -f81 * m_A401; + m_A402 += m_A312 * f81_92; + m_A403 += m_A313 * f81_92; + m_A404 += m_A314 * f81_92; + m_A405 += m_A315 * f81_92; + RHS92 += f81_92 * RHS81; + const double f81_94 = -f81 * m_A416; + m_A417 += m_A312 * f81_94; + m_A418 += m_A313 * f81_94; + m_A419 += m_A314 * f81_94; + m_A420 += m_A315 * f81_94; + RHS94 += f81_94 * RHS81; + const double f82 = 1.0 / m_A319; + const double f82_88 = -f82 * m_A363; + m_A364 += m_A320 * f82_88; + RHS88 += f82_88 * RHS82; + const double f83 = 1.0 / m_A322; + const double f83_86 = -f83 * m_A346; + m_A347 += m_A323 * f83_86; + m_A350 += m_A324 * f83_86; + RHS86 += f83_86 * RHS83; + const double f83_95 = -f83 * m_A429; + m_A431 += m_A323 * f83_95; + m_A437 += m_A324 * f83_95; + RHS95 += f83_95 * RHS83; + const double f84 = 1.0 / m_A329; + const double f84_85 = -f84 * m_A334; + RHS85 += f84_85 * RHS84; + const double f84_90 = -f84 * m_A386; + RHS90 += f84_90 * RHS84; + const double f85 = 1.0 / m_A335; + const double f85_95 = -f85 * m_A430; + m_A434 += m_A336 * f85_95; + m_A437 += m_A337 * f85_95; + RHS95 += f85_95 * RHS85; + const double f86 = 1.0 / m_A347; + const double f86_87 = -f86 * m_A355; + m_A356 += m_A348 * f86_87; + m_A357 += m_A349 * f86_87; + m_A358 += m_A350 * f86_87; + RHS87 += f86_87 * RHS86; + const double f86_89 = -f86 * m_A378; + m_A379 += m_A348 * f86_89; + m_A380 += m_A349 * f86_89; + m_A381 += m_A350 * f86_89; + RHS89 += f86_89 * RHS86; + const double f86_95 = -f86 * m_A431; + m_A432 += m_A348 * f86_95; + m_A433 += m_A349 * f86_95; + m_A437 += m_A350 * f86_95; + RHS95 += f86_95 * RHS86; + const double f87 = 1.0 / m_A356; + const double f87_89 = -f87 * m_A379; + m_A380 += m_A357 * f87_89; + m_A381 += m_A358 * f87_89; + RHS89 += f87_89 * RHS87; + const double f87_95 = -f87 * m_A432; + m_A433 += m_A357 * f87_95; + m_A437 += m_A358 * f87_95; + RHS95 += f87_95 * RHS87; + const double f88 = 1.0 / m_A364; + const double f88_91 = -f88 * m_A392; + m_A393 += m_A365 * f88_91; + m_A394 += m_A366 * f88_91; + m_A395 += m_A367 * f88_91; + RHS91 += f88_91 * RHS88; + const double f88_92 = -f88 * m_A402; + m_A403 += m_A365 * f88_92; + m_A404 += m_A366 * f88_92; + m_A405 += m_A367 * f88_92; + RHS92 += f88_92 * RHS88; + const double f88_94 = -f88 * m_A417; + m_A418 += m_A365 * f88_94; + m_A419 += m_A366 * f88_94; + m_A420 += m_A367 * f88_94; + RHS94 += f88_94 * RHS88; + const double f89 = 1.0 / m_A380; + const double f89_95 = -f89 * m_A433; + m_A437 += m_A381 * f89_95; + RHS95 += f89_95 * RHS89; + const double f90 = 1.0 / m_A387; + const double f90_95 = -f90 * m_A434; + RHS95 += f90_95 * RHS90; + const double f91 = 1.0 / m_A393; + const double f91_92 = -f91 * m_A403; + m_A404 += m_A394 * f91_92; + m_A405 += m_A395 * f91_92; + RHS92 += f91_92 * RHS91; + const double f91_94 = -f91 * m_A418; + m_A419 += m_A394 * f91_94; + m_A420 += m_A395 * f91_94; + RHS94 += f91_94 * RHS91; + const double f92 = 1.0 / m_A404; + const double f92_94 = -f92 * m_A419; + m_A420 += m_A405 * f92_94; + RHS94 += f92_94 * RHS92; + const double f93 = 1.0 / m_A409; + const double f93_95 = -f93 * m_A435; + m_A437 += m_A410 * f93_95; + RHS95 += f93_95 * RHS93; + const double f94 = 1.0 / m_A420; + const double f94_95 = -f94 * m_A436; + m_A437 += m_A421 * f94_95; + RHS95 += f94_95 * RHS94; + V[95] = RHS95 / m_A437; + double tmp94 = 0.0; + tmp94 += m_A421 * V[95]; + V[94] = (RHS94 - tmp94) / m_A420; + double tmp93 = 0.0; + tmp93 += m_A410 * V[95]; + V[93] = (RHS93 - tmp93) / m_A409; + double tmp92 = 0.0; + tmp92 += m_A405 * V[94]; + V[92] = (RHS92 - tmp92) / m_A404; + double tmp91 = 0.0; + tmp91 += m_A394 * V[92]; + tmp91 += m_A395 * V[94]; + V[91] = (RHS91 - tmp91) / m_A393; + double tmp90 = 0.0; + V[90] = (RHS90 - tmp90) / m_A387; + double tmp89 = 0.0; + tmp89 += m_A381 * V[95]; + V[89] = (RHS89 - tmp89) / m_A380; + double tmp88 = 0.0; + tmp88 += m_A365 * V[91]; + tmp88 += m_A366 * V[92]; + tmp88 += m_A367 * V[94]; + V[88] = (RHS88 - tmp88) / m_A364; + double tmp87 = 0.0; + tmp87 += m_A357 * V[89]; + tmp87 += m_A358 * V[95]; + V[87] = (RHS87 - tmp87) / m_A356; + double tmp86 = 0.0; + tmp86 += m_A348 * V[87]; + tmp86 += m_A349 * V[89]; + tmp86 += m_A350 * V[95]; + V[86] = (RHS86 - tmp86) / m_A347; + double tmp85 = 0.0; + tmp85 += m_A336 * V[90]; + tmp85 += m_A337 * V[95]; + V[85] = (RHS85 - tmp85) / m_A335; + double tmp84 = 0.0; + V[84] = (RHS84 - tmp84) / m_A329; + double tmp83 = 0.0; + tmp83 += m_A323 * V[86]; + tmp83 += m_A324 * V[95]; + V[83] = (RHS83 - tmp83) / m_A322; + double tmp82 = 0.0; + tmp82 += m_A320 * V[88]; + V[82] = (RHS82 - tmp82) / m_A319; + double tmp81 = 0.0; + tmp81 += m_A312 * V[88]; + tmp81 += m_A313 * V[91]; + tmp81 += m_A314 * V[92]; + tmp81 += m_A315 * V[94]; + V[81] = (RHS81 - tmp81) / m_A311; + double tmp80 = 0.0; + tmp80 += m_A305 * V[94]; + tmp80 += m_A306 * V[95]; + V[80] = (RHS80 - tmp80) / m_A304; + double tmp79 = 0.0; + tmp79 += m_A301 * V[84]; + V[79] = (RHS79 - tmp79) / m_A300; + double tmp78 = 0.0; + tmp78 += m_A295 * V[86]; + tmp78 += m_A296 * V[89]; + V[78] = (RHS78 - tmp78) / m_A294; + double tmp77 = 0.0; + tmp77 += m_A282 * V[78]; + tmp77 += m_A283 * V[86]; + tmp77 += m_A284 * V[89]; + V[77] = (RHS77 - tmp77) / m_A281; + double tmp76 = 0.0; + tmp76 += m_A272 * V[81]; + tmp76 += m_A273 * V[88]; + tmp76 += m_A274 * V[92]; + tmp76 += m_A275 * V[94]; + V[76] = (RHS76 - tmp76) / m_A271; + double tmp75 = 0.0; + tmp75 += m_A265 * V[77]; + tmp75 += m_A266 * V[78]; + tmp75 += m_A267 * V[89]; + V[75] = (RHS75 - tmp75) / m_A264; + double tmp74 = 0.0; + tmp74 += m_A258 * V[93]; + V[74] = (RHS74 - tmp74) / m_A257; + double tmp73 = 0.0; + tmp73 += m_A255 * V[95]; + V[73] = (RHS73 - tmp73) / m_A254; + double tmp72 = 0.0; + tmp72 += m_A250 * V[89]; + tmp72 += m_A251 * V[95]; + V[72] = (RHS72 - tmp72) / m_A249; + double tmp71 = 0.0; + tmp71 += m_A245 * V[86]; + tmp71 += m_A246 * V[87]; + V[71] = (RHS71 - tmp71) / m_A244; + double tmp70 = 0.0; + tmp70 += m_A239 * V[79]; + tmp70 += m_A240 * V[85]; + tmp70 += m_A241 * V[90]; + V[70] = (RHS70 - tmp70) / m_A238; + double tmp69 = 0.0; + tmp69 += m_A235 * V[95]; + V[69] = (RHS69 - tmp69) / m_A234; + double tmp68 = 0.0; + tmp68 += m_A233 * V[73]; + V[68] = (RHS68 - tmp68) / m_A232; + double tmp67 = 0.0; + tmp67 += m_A229 * V[87]; + V[67] = (RHS67 - tmp67) / m_A228; + double tmp66 = 0.0; + tmp66 += m_A224 * V[71]; + tmp66 += m_A225 * V[86]; + V[66] = (RHS66 - tmp66) / m_A223; + double tmp65 = 0.0; + tmp65 += m_A221 * V[92]; + V[65] = (RHS65 - tmp65) / m_A220; + double tmp64 = 0.0; + tmp64 += m_A217 * V[84]; + V[64] = (RHS64 - tmp64) / m_A216; + double tmp63 = 0.0; + tmp63 += m_A212 * V[79]; + tmp63 += m_A213 * V[90]; + V[63] = (RHS63 - tmp63) / m_A211; + double tmp62 = 0.0; + tmp62 += m_A208 * V[82]; + tmp62 += m_A209 * V[88]; + V[62] = (RHS62 - tmp62) / m_A207; + double tmp61 = 0.0; + tmp61 += m_A204 * V[91]; + V[61] = (RHS61 - tmp61) / m_A203; + double tmp60 = 0.0; + tmp60 += m_A198 * V[76]; + tmp60 += m_A199 * V[81]; + tmp60 += m_A200 * V[92]; + tmp60 += m_A201 * V[94]; + V[60] = (RHS60 - tmp60) / m_A197; + double tmp59 = 0.0; + tmp59 += m_A194 * V[80]; + tmp59 += m_A195 * V[95]; + V[59] = (RHS59 - tmp59) / m_A193; + double tmp58 = 0.0; + tmp58 += m_A192 * V[91]; + V[58] = (RHS58 - tmp58) / m_A191; + double tmp57 = 0.0; + tmp57 += m_A189 * V[84]; + V[57] = (RHS57 - tmp57) / m_A188; + double tmp56 = 0.0; + tmp56 += m_A181 * V[75]; + tmp56 += m_A182 * V[77]; + tmp56 += m_A183 * V[78]; + tmp56 += m_A184 * V[89]; + V[56] = (RHS56 - tmp56) / m_A180; + double tmp55 = 0.0; + tmp55 += m_A174 * V[75]; + V[55] = (RHS55 - tmp55) / m_A173; + double tmp54 = 0.0; + tmp54 += m_A167 * V[56]; + tmp54 += m_A168 * V[75]; + tmp54 += m_A169 * V[78]; + tmp54 += m_A170 * V[89]; + V[54] = (RHS54 - tmp54) / m_A166; + double tmp53 = 0.0; + tmp53 += m_A161 * V[76]; + V[53] = (RHS53 - tmp53) / m_A160; + double tmp52 = 0.0; + tmp52 += m_A158 * V[67]; + V[52] = (RHS52 - tmp52) / m_A157; + double tmp51 = 0.0; + tmp51 += m_A153 * V[78]; + V[51] = (RHS51 - tmp51) / m_A152; + double tmp50 = 0.0; + tmp50 += m_A149 * V[77]; + V[50] = (RHS50 - tmp50) / m_A148; + double tmp49 = 0.0; + tmp49 += m_A146 * V[62]; + V[49] = (RHS49 - tmp49) / m_A145; + double tmp48 = 0.0; + tmp48 += m_A142 * V[75]; + V[48] = (RHS48 - tmp48) / m_A141; + double tmp47 = 0.0; + tmp47 += m_A135 * V[54]; + tmp47 += m_A136 * V[56]; + tmp47 += m_A137 * V[78]; + tmp47 += m_A138 * V[89]; + V[47] = (RHS47 - tmp47) / m_A134; + double tmp46 = 0.0; + tmp46 += m_A129 * V[47]; + tmp46 += m_A130 * V[54]; + V[46] = (RHS46 - tmp46) / m_A128; + double tmp45 = 0.0; + tmp45 += m_A124 * V[74]; + tmp45 += m_A125 * V[93]; + V[45] = (RHS45 - tmp45) / m_A123; + double tmp44 = 0.0; + tmp44 += m_A121 * V[72]; + tmp44 += m_A122 * V[95]; + V[44] = (RHS44 - tmp44) / m_A120; + double tmp43 = 0.0; + tmp43 += m_A118 * V[87]; + tmp43 += m_A119 * V[95]; + V[43] = (RHS43 - tmp43) / m_A117; + double tmp42 = 0.0; + tmp42 += m_A115 * V[85]; + tmp42 += m_A116 * V[95]; + V[42] = (RHS42 - tmp42) / m_A114; + double tmp41 = 0.0; + tmp41 += m_A112 * V[83]; + tmp41 += m_A113 * V[86]; + V[41] = (RHS41 - tmp41) / m_A111; + double tmp40 = 0.0; + tmp40 += m_A109 * V[77]; + tmp40 += m_A110 * V[86]; + V[40] = (RHS40 - tmp40) / m_A108; + double tmp39 = 0.0; + tmp39 += m_A106 * V[68]; + tmp39 += m_A107 * V[73]; + V[39] = (RHS39 - tmp39) / m_A105; + double tmp38 = 0.0; + tmp38 += m_A103 * V[80]; + tmp38 += m_A104 * V[94]; + V[38] = (RHS38 - tmp38) / m_A102; + double tmp37 = 0.0; + tmp37 += m_A100 * V[72]; + tmp37 += m_A101 * V[89]; + V[37] = (RHS37 - tmp37) / m_A99; + double tmp36 = 0.0; + tmp36 += m_A97 * V[66]; + tmp36 += m_A98 * V[71]; + V[36] = (RHS36 - tmp36) / m_A96; + double tmp35 = 0.0; + tmp35 += m_A95 * V[70]; + V[35] = (RHS35 - tmp35) / m_A94; + double tmp34 = 0.0; + tmp34 += m_A92 * V[63]; + tmp34 += m_A93 * V[70]; + V[34] = (RHS34 - tmp34) / m_A91; + double tmp33 = 0.0; + tmp33 += m_A90 * V[68]; + V[33] = (RHS33 - tmp33) / m_A89; + double tmp32 = 0.0; + tmp32 += m_A87 * V[36]; + tmp32 += m_A88 * V[66]; + V[32] = (RHS32 - tmp32) / m_A86; + double tmp31 = 0.0; + tmp31 += m_A85 * V[57]; + V[31] = (RHS31 - tmp31) / m_A84; + double tmp30 = 0.0; + tmp30 += m_A82 * V[57]; + tmp30 += m_A83 * V[84]; + V[30] = (RHS30 - tmp30) / m_A81; + double tmp29 = 0.0; + tmp29 += m_A80 * V[67]; + V[29] = (RHS29 - tmp29) / m_A79; + double tmp28 = 0.0; + tmp28 += m_A77 * V[52]; + tmp28 += m_A78 * V[67]; + V[28] = (RHS28 - tmp28) / m_A76; + double tmp27 = 0.0; + tmp27 += m_A74 * V[30]; + tmp27 += m_A75 * V[84]; + V[27] = (RHS27 - tmp27) / m_A73; + double tmp26 = 0.0; + tmp26 += m_A71 * V[64]; + tmp26 += m_A72 * V[84]; + V[26] = (RHS26 - tmp26) / m_A70; + double tmp25 = 0.0; + tmp25 += m_A69 * V[79]; + V[25] = (RHS25 - tmp25) / m_A68; + double tmp24 = 0.0; + tmp24 += m_A67 * V[64]; + V[24] = (RHS24 - tmp24) / m_A66; + double tmp23 = 0.0; + tmp23 += m_A65 * V[79]; + V[23] = (RHS23 - tmp23) / m_A64; + double tmp22 = 0.0; + tmp22 += m_A63 * V[90]; + V[22] = (RHS22 - tmp22) / m_A62; + double tmp21 = 0.0; + tmp21 += m_A61 * V[61]; + V[21] = (RHS21 - tmp21) / m_A60; + double tmp20 = 0.0; + tmp20 += m_A59 * V[52]; + V[20] = (RHS20 - tmp20) / m_A58; + double tmp19 = 0.0; + tmp19 += m_A57 * V[52]; + V[19] = (RHS19 - tmp19) / m_A56; + double tmp18 = 0.0; + tmp18 += m_A54 * V[49]; + tmp18 += m_A55 * V[62]; + V[18] = (RHS18 - tmp18) / m_A53; + double tmp17 = 0.0; + tmp17 += m_A52 * V[49]; + V[17] = (RHS17 - tmp17) / m_A51; + double tmp16 = 0.0; + tmp16 += m_A47 * V[81]; + tmp16 += m_A48 * V[88]; + tmp16 += m_A49 * V[92]; + tmp16 += m_A50 * V[94]; + V[16] = (RHS16 - tmp16) / m_A46; + double tmp15 = 0.0; + tmp15 += m_A44 * V[81]; + tmp15 += m_A45 * V[91]; + V[15] = (RHS15 - tmp15) / m_A43; + double tmp14 = 0.0; + tmp14 += m_A41 * V[48]; + tmp14 += m_A42 * V[75]; + V[14] = (RHS14 - tmp14) / m_A40; + double tmp13 = 0.0; + tmp13 += m_A39 * V[48]; + V[13] = (RHS13 - tmp13) / m_A38; + double tmp12 = 0.0; + tmp12 += m_A36 * V[65]; + tmp12 += m_A37 * V[92]; + V[12] = (RHS12 - tmp12) / m_A35; + double tmp11 = 0.0; + tmp11 += m_A33 * V[60]; + tmp11 += m_A34 * V[76]; + V[11] = (RHS11 - tmp11) / m_A32; + double tmp10 = 0.0; + tmp10 += m_A31 * V[65]; + V[10] = (RHS10 - tmp10) / m_A30; + double tmp9 = 0.0; + tmp9 += m_A29 * V[58]; + V[9] = (RHS9 - tmp9) / m_A28; + double tmp8 = 0.0; + tmp8 += m_A24 * V[54]; + tmp8 += m_A25 * V[56]; + tmp8 += m_A26 * V[78]; + tmp8 += m_A27 * V[89]; + V[8] = (RHS8 - tmp8) / m_A23; + double tmp7 = 0.0; + tmp7 += m_A19 * V[47]; + tmp7 += m_A20 * V[56]; + tmp7 += m_A21 * V[78]; + tmp7 += m_A22 * V[89]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + tmp6 += m_A17 * V[53]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A14 * V[51]; + tmp5 += m_A15 * V[78]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[56]; + tmp4 += m_A12 * V[77]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[51]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[46]; + tmp2 += m_A6 * V[47]; + tmp2 += m_A7 * V[54]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[50]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[46]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starfire +static void nl_gcr_7_double_double_feae15b80dd73620(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + m_A3 += gt[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A2 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A4 += go[7]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + const double f0 = 1.0 / m_A0; + const double f0_1 = -f0 * m_A2; + m_A3 += m_A1 * f0_1; + RHS1 += f0_1 * RHS0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_2 = -f1 * m_A5; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starfire +static void nl_gcr_9_double_double_bd1514d7defd4062(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A4 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A6 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A6; + m_A7 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A7; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A8; + double tmp2 = 0.0; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starhawk +static void nl_gcr_12_double_double_67838e11f714c455(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[6]; + m_A7 += go[7]; + m_A5 += go[8]; + m_A5 += go[9]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A10 += go[11]; + m_A10 += go[12]; + m_A9 += go[13]; + m_A8 += go[14]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A11 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + m_A7 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starhawk +static void nl_gcr_40_double_double_1f1086787c94f97c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[10]; + m_A9 += go[11]; + m_A8 += go[12]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A11 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A12 += gt[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A13 += go[19]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + RHS5 -= go[25] * *cnV[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A16 += go[26]; + m_A14 += go[27]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + m_A20 += gt[28]; + m_A20 += gt[29]; + m_A18 += go[28]; + m_A17 += go[29]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A23 += go[30]; + m_A24 += go[31]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + m_A27 += gt[32]; + m_A27 += gt[33]; + m_A27 += gt[34]; + m_A27 += gt[35]; + m_A28 += go[32]; + m_A26 += go[33]; + m_A25 += go[34]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 += Idr[35]; + RHS9 -= go[35] * *cnV[35]; + m_A31 += gt[36]; + m_A31 += gt[37]; + m_A31 += gt[38]; + m_A30 += go[36]; + m_A29 += go[37]; + double RHS10 = Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 -= go[38] * *cnV[38]; + m_A39 += gt[39]; + m_A39 += gt[40]; + m_A39 += gt[41]; + m_A39 += gt[42]; + m_A36 += go[39]; + m_A37 += go[40]; + m_A33 += go[41]; + double RHS11 = Idr[39]; + RHS11 += Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + RHS11 -= go[42] * *cnV[42]; + const double f0 = 1.0 / m_A0; + const double f0_7 = -f0 * m_A17; + m_A20 += m_A1 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A14; + m_A15 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_9 = -f2 * m_A25; + m_A27 += m_A5 * f2_9; + RHS9 += f2_9 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_7 = -f3 * m_A18; + m_A19 += m_A7 * f3_7; + m_A20 += m_A8 * f3_7; + m_A21 += m_A9 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_11 = -f3 * m_A33; + m_A34 += m_A7 * f3_11; + m_A35 += m_A8 * f3_11; + m_A39 += m_A9 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_10 = -f4 * m_A29; + m_A31 += m_A11 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_7 = -f5 * m_A19; + m_A21 += m_A13 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_11 = -f5 * m_A34; + m_A39 += m_A13 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_9 = -f6 * m_A26; + m_A27 += m_A16 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A20; + const double f7_11 = -f7 * m_A35; + m_A39 += m_A21 * f7_11; + RHS11 += f7_11 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_10 = -f8 * m_A30; + m_A31 += m_A23 * f8_10; + m_A32 += m_A24 * f8_10; + RHS10 += f8_10 * RHS8; + const double f8_11 = -f8 * m_A36; + m_A38 += m_A23 * f8_11; + m_A39 += m_A24 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A27; + const double f9_11 = -f9 * m_A37; + m_A39 += m_A28 * f9_11; + RHS11 += f9_11 * RHS9; + const double f10 = 1.0 / m_A31; + const double f10_11 = -f10 * m_A38; + m_A39 += m_A32 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A39; + double tmp10 = 0.0; + tmp10 += m_A32 * V[11]; + V[10] = (RHS10 - tmp10) / m_A31; + double tmp9 = 0.0; + tmp9 += m_A28 * V[11]; + V[9] = (RHS9 - tmp9) / m_A27; + double tmp8 = 0.0; + tmp8 += m_A23 * V[10]; + tmp8 += m_A24 * V[11]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A21 * V[11]; + V[7] = (RHS7 - tmp7) / m_A20; + double tmp6 = 0.0; + tmp6 += m_A16 * V[9]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A13 * V[11]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A11 * V[10]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A7 * V[5]; + tmp3 += m_A8 * V[7]; + tmp3 += m_A9 * V[11]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[9]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starhawk +static void nl_gcr_40_double_double_8b1ac1e181eec3fc(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A5 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A8 += go[8]; + m_A8 += go[9]; + m_A7 += go[10]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A9 += gt[17]; + m_A10 += go[11]; + double RHS4 = Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[12] * *cnV[12]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A12 += go[18]; + m_A12 += go[19]; + m_A13 += go[20]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[21] * *cnV[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A16 += go[22]; + m_A15 += go[23]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A18 += go[24]; + m_A17 += go[25]; + double RHS7 = Idr[24]; + RHS7 += Idr[25]; + RHS7 += Idr[26]; + RHS7 -= go[26] * *cnV[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A23 += go[27]; + m_A21 += go[28]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 -= go[29] * *cnV[29]; + m_A26 += gt[30]; + m_A26 += gt[31]; + m_A26 += gt[32]; + m_A25 += go[30]; + m_A24 += go[31]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 -= go[32] * *cnV[32]; + m_A32 += gt[33]; + m_A32 += gt[34]; + m_A32 += gt[35]; + m_A32 += gt[36]; + m_A32 += gt[37]; + m_A32 += gt[38]; + m_A28 += go[33]; + m_A30 += go[34]; + m_A29 += go[35]; + m_A29 += go[36]; + double RHS10 = Idr[33]; + RHS10 += Idr[34]; + RHS10 += Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 -= go[37] * *cnV[37]; + RHS10 -= go[38] * *cnV[38]; + m_A39 += gt[39]; + m_A39 += gt[40]; + m_A39 += gt[41]; + m_A39 += gt[42]; + m_A35 += go[39]; + m_A37 += go[40]; + m_A34 += go[41]; + m_A34 += go[42]; + double RHS11 = Idr[39]; + RHS11 += Idr[40]; + RHS11 += Idr[41]; + RHS11 += Idr[42]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A24; + m_A26 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A17; + m_A19 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_8 = -f2 * m_A21; + m_A22 += m_A5 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_7 = -f3 * m_A18; + m_A19 += m_A7 * f3_7; + m_A20 += m_A8 * f3_7; + RHS7 += f3_7 * RHS3; + const double f3_11 = -f3 * m_A34; + m_A36 += m_A7 * f3_11; + m_A39 += m_A8 * f3_11; + RHS11 += f3_11 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_10 = -f4 * m_A28; + m_A29 += m_A10 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_10 = -f5 * m_A29; + m_A32 += m_A12 * f5_10; + m_A33 += m_A13 * f5_10; + RHS10 += f5_10 * RHS5; + const double f5_11 = -f5 * m_A35; + m_A38 += m_A12 * f5_11; + m_A39 += m_A13 * f5_11; + RHS11 += f5_11 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_9 = -f6 * m_A25; + m_A26 += m_A15 * f6_9; + m_A27 += m_A16 * f6_9; + RHS9 += f6_9 * RHS6; + const double f6_10 = -f6 * m_A30; + m_A31 += m_A15 * f6_10; + m_A32 += m_A16 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_11 = -f7 * m_A36; + m_A39 += m_A20 * f7_11; + RHS11 += f7_11 * RHS7; + const double f8 = 1.0 / m_A22; + const double f8_11 = -f8 * m_A37; + m_A39 += m_A23 * f8_11; + RHS11 += f8_11 * RHS8; + const double f9 = 1.0 / m_A26; + const double f9_10 = -f9 * m_A31; + m_A32 += m_A27 * f9_10; + RHS10 += f9_10 * RHS9; + const double f10 = 1.0 / m_A32; + const double f10_11 = -f10 * m_A38; + m_A39 += m_A33 * f10_11; + RHS11 += f10_11 * RHS10; + V[11] = RHS11 / m_A39; + double tmp10 = 0.0; + tmp10 += m_A33 * V[11]; + V[10] = (RHS10 - tmp10) / m_A32; + double tmp9 = 0.0; + tmp9 += m_A27 * V[10]; + V[9] = (RHS9 - tmp9) / m_A26; + double tmp8 = 0.0; + tmp8 += m_A23 * V[11]; + V[8] = (RHS8 - tmp8) / m_A22; + double tmp7 = 0.0; + tmp7 += m_A20 * V[11]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A15 * V[9]; + tmp6 += m_A16 * V[10]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[10]; + tmp5 += m_A13 * V[11]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[5]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A7 * V[7]; + tmp3 += m_A8 * V[11]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[8]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starhawk +static void nl_gcr_45_double_double_528a27fe9ed07d67(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A3 += go[7]; + m_A3 += go[8]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A5 += go[11]; + double RHS2 = Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[12] * *cnV[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A7 += go[13]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A9 += go[16]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A11 += go[19]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + m_A12 += gt[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A13 += go[22]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[23] * *cnV[23]; + RHS6 -= go[24] * *cnV[24]; + m_A14 += gt[25]; + m_A14 += gt[26]; + m_A15 += go[25]; + m_A16 += go[26]; + double RHS7 = Idr[25]; + RHS7 += Idr[26]; + m_A17 += gt[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A18 += go[27]; + double RHS8 = Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 -= go[28] * *cnV[28]; + RHS8 -= go[29] * *cnV[29]; + m_A19 += gt[30]; + m_A19 += gt[31]; + m_A19 += gt[32]; + m_A20 += go[30]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 -= go[31] * *cnV[31]; + RHS9 -= go[32] * *cnV[32]; + m_A21 += gt[33]; + m_A21 += gt[34]; + m_A21 += gt[35]; + m_A22 += go[33]; + double RHS10 = Idr[33]; + RHS10 += Idr[34]; + RHS10 += Idr[35]; + RHS10 -= go[34] * *cnV[34]; + RHS10 -= go[35] * *cnV[35]; + m_A23 += gt[36]; + m_A23 += gt[37]; + m_A23 += gt[38]; + m_A24 += go[36]; + double RHS11 = Idr[36]; + RHS11 += Idr[37]; + RHS11 += Idr[38]; + RHS11 -= go[37] * *cnV[37]; + RHS11 -= go[38] * *cnV[38]; + m_A34 += gt[39]; + m_A34 += gt[40]; + m_A34 += gt[41]; + m_A34 += gt[42]; + m_A34 += gt[43]; + m_A34 += gt[44]; + m_A34 += gt[45]; + m_A34 += gt[46]; + m_A34 += gt[47]; + m_A34 += gt[48]; + m_A33 += go[39]; + m_A32 += go[40]; + m_A31 += go[41]; + m_A30 += go[42]; + m_A29 += go[43]; + m_A28 += go[44]; + m_A27 += go[45]; + m_A26 += go[46]; + m_A25 += go[47]; + double RHS12 = Idr[39]; + RHS12 += Idr[40]; + RHS12 += Idr[41]; + RHS12 += Idr[42]; + RHS12 += Idr[43]; + RHS12 += Idr[44]; + RHS12 += Idr[45]; + RHS12 += Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 -= go[48] * *cnV[48]; + m_A38 += gt[49]; + m_A38 += gt[50]; + m_A38 += gt[51]; + m_A38 += gt[52]; + m_A38 += gt[53]; + m_A38 += gt[54]; + m_A36 += go[49]; + m_A39 += go[50]; + m_A37 += go[51]; + m_A37 += go[52]; + double RHS13 = Idr[49]; + RHS13 += Idr[50]; + RHS13 += Idr[51]; + RHS13 += Idr[52]; + RHS13 += Idr[53]; + RHS13 += Idr[54]; + RHS13 -= go[53] * *cnV[53]; + RHS13 -= go[54] * *cnV[54]; + m_A44 += gt[55]; + m_A44 += gt[56]; + m_A44 += gt[57]; + m_A44 += gt[58]; + m_A44 += gt[59]; + m_A41 += go[55]; + m_A40 += go[56]; + m_A43 += go[57]; + double RHS14 = Idr[55]; + RHS14 += Idr[56]; + RHS14 += Idr[57]; + RHS14 += Idr[58]; + RHS14 += Idr[59]; + RHS14 -= go[58] * *cnV[58]; + RHS14 -= go[59] * *cnV[59]; + const double f0 = 1.0 / m_A0; + const double f0_13 = -f0 * m_A36; + m_A37 += m_A1 * f0_13; + RHS13 += f0_13 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_13 = -f1 * m_A37; + m_A38 += m_A3 * f1_13; + RHS13 += f1_13 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_14 = -f2 * m_A40; + m_A44 += m_A5 * f2_14; + RHS14 += f2_14 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_12 = -f3 * m_A25; + m_A34 += m_A7 * f3_12; + RHS12 += f3_12 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_12 = -f4 * m_A26; + m_A34 += m_A9 * f4_12; + RHS12 += f4_12 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_12 = -f5 * m_A27; + m_A34 += m_A11 * f5_12; + RHS12 += f5_12 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_12 = -f6 * m_A28; + m_A34 += m_A13 * f6_12; + RHS12 += f6_12 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_12 = -f7 * m_A29; + m_A34 += m_A15 * f7_12; + m_A35 += m_A16 * f7_12; + RHS12 += f7_12 * RHS7; + const double f7_14 = -f7 * m_A41; + m_A42 += m_A15 * f7_14; + m_A44 += m_A16 * f7_14; + RHS14 += f7_14 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_12 = -f8 * m_A30; + m_A34 += m_A18 * f8_12; + RHS12 += f8_12 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_12 = -f9 * m_A31; + m_A34 += m_A20 * f9_12; + RHS12 += f9_12 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_12 = -f10 * m_A32; + m_A34 += m_A22 * f10_12; + RHS12 += f10_12 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_12 = -f11 * m_A33; + m_A34 += m_A24 * f11_12; + RHS12 += f11_12 * RHS11; + const double f12 = 1.0 / m_A34; + const double f12_14 = -f12 * m_A42; + m_A44 += m_A35 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A38; + const double f13_14 = -f13 * m_A43; + m_A44 += m_A39 * f13_14; + RHS14 += f13_14 * RHS13; + V[14] = RHS14 / m_A44; + double tmp13 = 0.0; + tmp13 += m_A39 * V[14]; + V[13] = (RHS13 - tmp13) / m_A38; + double tmp12 = 0.0; + tmp12 += m_A35 * V[14]; + V[12] = (RHS12 - tmp12) / m_A34; + double tmp11 = 0.0; + tmp11 += m_A24 * V[12]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A22 * V[12]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + tmp9 += m_A20 * V[12]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[12]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A15 * V[12]; + tmp7 += m_A16 * V[14]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[12]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[12]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[12]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[12]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[14]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[13]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[1]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// starhawk +static void nl_gcr_7_double_double_723fa454468a93d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A5 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + RHS2 -= go[9] * *cnV[9]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// stuntcyc +static void nl_gcr_10_double_double_85652d3e3ada285a(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A8 += go[9]; + m_A7 += go[10]; + m_A6 += go[11]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 -= go[12] * *cnV[12]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A6; + m_A9 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A5 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A5 * V[3]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// stuntcyc +static void nl_gcr_20_double_double_c924fe5960b1479e(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A3 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A6 += go[8]; + m_A5 += go[9]; + double RHS2 = Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A10 += go[13]; + m_A9 += go[14]; + m_A7 += go[15]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 += Idr[19]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + RHS3 -= go[19] * *cnV[19]; + m_A14 += gt[20]; + m_A14 += gt[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A12 += go[20]; + m_A11 += go[21]; + m_A13 += go[22]; + double RHS4 = Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[23] * *cnV[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A16 += go[24]; + m_A17 += go[25]; + double RHS5 = Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 -= go[26] * *cnV[26]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A7; + m_A8 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A11; + m_A14 += m_A3 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_4 = -f2 * m_A12; + m_A14 += m_A5 * f2_4; + m_A15 += m_A6 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A16; + m_A18 += m_A5 * f2_5; + m_A19 += m_A6 * f2_5; + RHS5 += f2_5 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A9 * f3_4; + m_A15 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + const double f3_5 = -f3 * m_A17; + m_A18 += m_A9 * f3_5; + m_A19 += m_A10 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A14; + const double f4_5 = -f4 * m_A18; + m_A19 += m_A15 * f4_5; + RHS5 += f4_5 * RHS4; + V[5] = RHS5 / m_A19; + double tmp4 = 0.0; + tmp4 += m_A15 * V[5]; + V[4] = (RHS4 - tmp4) / m_A14; + double tmp3 = 0.0; + tmp3 += m_A9 * V[4]; + tmp3 += m_A10 * V[5]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + tmp2 += m_A6 * V[5]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[4]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// stuntcyc,brdrline +static void nl_gcr_7_double_double_59cb6bf7cb9d17dc(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A6 += gt[4]; + m_A6 += gt[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A5 += go[4]; + m_A4 += go[5]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sundance +static void nl_gcr_100_double_double_e02a162cb515a958(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[8] * *cnV[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A6 += gt[17]; + m_A6 += gt[18]; + m_A7 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + RHS3 -= go[18] * *cnV[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A8 += gt[22]; + m_A8 += gt[23]; + m_A8 += gt[24]; + m_A8 += gt[25]; + m_A9 += go[19]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 += Idr[25]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + RHS4 -= go[24] * *cnV[24]; + RHS4 -= go[25] * *cnV[25]; + m_A10 += gt[26]; + m_A10 += gt[27]; + m_A11 += go[26]; + double RHS5 = Idr[26]; + RHS5 += Idr[27]; + RHS5 -= go[27] * *cnV[27]; + m_A12 += gt[28]; + m_A12 += gt[29]; + m_A13 += go[28]; + double RHS6 = Idr[28]; + RHS6 += Idr[29]; + RHS6 -= go[29] * *cnV[29]; + m_A14 += gt[30]; + m_A14 += gt[31]; + m_A15 += go[30]; + double RHS7 = Idr[30]; + RHS7 += Idr[31]; + RHS7 -= go[31] * *cnV[31]; + m_A16 += gt[32]; + m_A16 += gt[33]; + m_A16 += gt[34]; + m_A16 += gt[35]; + m_A18 += go[32]; + m_A17 += go[33]; + m_A17 += go[34]; + double RHS8 = Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 -= go[35] * *cnV[35]; + m_A19 += gt[36]; + m_A19 += gt[37]; + m_A19 += gt[38]; + m_A20 += go[36]; + double RHS9 = Idr[36]; + RHS9 += Idr[37]; + RHS9 += Idr[38]; + RHS9 -= go[37] * *cnV[37]; + RHS9 -= go[38] * *cnV[38]; + m_A21 += gt[39]; + m_A21 += gt[40]; + m_A21 += gt[41]; + m_A22 += go[39]; + double RHS10 = Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 -= go[40] * *cnV[40]; + RHS10 -= go[41] * *cnV[41]; + m_A23 += gt[42]; + m_A23 += gt[43]; + m_A23 += gt[44]; + m_A23 += gt[45]; + m_A24 += go[42]; + m_A25 += go[43]; + m_A25 += go[44]; + double RHS11 = Idr[42]; + RHS11 += Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 -= go[45] * *cnV[45]; + m_A27 += gt[46]; + m_A27 += gt[47]; + m_A26 += go[46]; + double RHS12 = Idr[46]; + RHS12 += Idr[47]; + RHS12 -= go[47] * *cnV[47]; + m_A29 += gt[48]; + m_A29 += gt[49]; + m_A29 += gt[50]; + m_A29 += gt[51]; + m_A28 += go[48]; + m_A30 += go[49]; + double RHS13 = Idr[48]; + RHS13 += Idr[49]; + RHS13 += Idr[50]; + RHS13 += Idr[51]; + RHS13 -= go[50] * *cnV[50]; + RHS13 -= go[51] * *cnV[51]; + m_A31 += gt[52]; + m_A31 += gt[53]; + m_A31 += gt[54]; + m_A32 += go[52]; + double RHS14 = Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 -= go[53] * *cnV[53]; + RHS14 -= go[54] * *cnV[54]; + m_A34 += gt[55]; + m_A34 += gt[56]; + m_A35 += go[55]; + m_A33 += go[56]; + double RHS15 = Idr[55]; + RHS15 += Idr[56]; + m_A38 += gt[57]; + m_A38 += gt[58]; + m_A38 += gt[59]; + m_A39 += go[57]; + m_A37 += go[58]; + m_A36 += go[59]; + double RHS16 = Idr[57]; + RHS16 += Idr[58]; + RHS16 += Idr[59]; + m_A41 += gt[60]; + m_A41 += gt[61]; + m_A41 += gt[62]; + m_A41 += gt[63]; + m_A41 += gt[64]; + m_A41 += gt[65]; + m_A41 += gt[66]; + m_A41 += gt[67]; + m_A42 += go[60]; + m_A42 += go[61]; + m_A43 += go[62]; + m_A43 += go[63]; + m_A40 += go[64]; + m_A40 += go[65]; + double RHS17 = Idr[60]; + RHS17 += Idr[61]; + RHS17 += Idr[62]; + RHS17 += Idr[63]; + RHS17 += Idr[64]; + RHS17 += Idr[65]; + RHS17 += Idr[66]; + RHS17 += Idr[67]; + RHS17 -= go[66] * *cnV[66]; + RHS17 -= go[67] * *cnV[67]; + m_A46 += gt[68]; + m_A46 += gt[69]; + m_A46 += gt[70]; + m_A46 += gt[71]; + m_A44 += go[68]; + m_A48 += go[69]; + double RHS18 = Idr[68]; + RHS18 += Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + RHS18 -= go[70] * *cnV[70]; + RHS18 -= go[71] * *cnV[71]; + m_A52 += gt[72]; + m_A52 += gt[73]; + m_A52 += gt[74]; + m_A52 += gt[75]; + m_A50 += go[72]; + m_A51 += go[73]; + m_A51 += go[74]; + m_A49 += go[75]; + double RHS19 = Idr[72]; + RHS19 += Idr[73]; + RHS19 += Idr[74]; + RHS19 += Idr[75]; + m_A55 += gt[76]; + m_A55 += gt[77]; + m_A55 += gt[78]; + m_A55 += gt[79]; + m_A56 += go[76]; + m_A54 += go[77]; + double RHS20 = Idr[76]; + RHS20 += Idr[77]; + RHS20 += Idr[78]; + RHS20 += Idr[79]; + RHS20 -= go[78] * *cnV[78]; + RHS20 -= go[79] * *cnV[79]; + m_A60 += gt[80]; + m_A60 += gt[81]; + m_A60 += gt[82]; + m_A60 += gt[83]; + m_A60 += gt[84]; + m_A62 += go[80]; + m_A59 += go[81]; + m_A58 += go[82]; + m_A57 += go[83]; + double RHS21 = Idr[80]; + RHS21 += Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + RHS21 += Idr[84]; + RHS21 -= go[84] * *cnV[84]; + m_A64 += gt[85]; + m_A64 += gt[86]; + m_A64 += gt[87]; + m_A64 += gt[88]; + m_A65 += go[85]; + m_A63 += go[86]; + double RHS22 = Idr[85]; + RHS22 += Idr[86]; + RHS22 += Idr[87]; + RHS22 += Idr[88]; + RHS22 -= go[87] * *cnV[87]; + RHS22 -= go[88] * *cnV[88]; + m_A69 += gt[89]; + m_A69 += gt[90]; + m_A69 += gt[91]; + m_A69 += gt[92]; + m_A68 += go[89]; + m_A70 += go[90]; + m_A67 += go[91]; + m_A66 += go[92]; + double RHS23 = Idr[89]; + RHS23 += Idr[90]; + RHS23 += Idr[91]; + RHS23 += Idr[92]; + m_A77 += gt[93]; + m_A77 += gt[94]; + m_A77 += gt[95]; + m_A77 += gt[96]; + m_A77 += gt[97]; + m_A77 += gt[98]; + m_A71 += go[93]; + m_A72 += go[94]; + m_A73 += go[95]; + m_A76 += go[96]; + double RHS24 = Idr[93]; + RHS24 += Idr[94]; + RHS24 += Idr[95]; + RHS24 += Idr[96]; + RHS24 += Idr[97]; + RHS24 += Idr[98]; + RHS24 -= go[97] * *cnV[97]; + RHS24 -= go[98] * *cnV[98]; + m_A82 += gt[99]; + m_A82 += gt[100]; + m_A82 += gt[101]; + m_A82 += gt[102]; + m_A82 += gt[103]; + m_A82 += gt[104]; + m_A82 += gt[105]; + m_A82 += gt[106]; + m_A80 += go[99]; + m_A80 += go[100]; + m_A79 += go[101]; + m_A83 += go[102]; + m_A83 += go[103]; + double RHS25 = Idr[99]; + RHS25 += Idr[100]; + RHS25 += Idr[101]; + RHS25 += Idr[102]; + RHS25 += Idr[103]; + RHS25 += Idr[104]; + RHS25 += Idr[105]; + RHS25 += Idr[106]; + RHS25 -= go[104] * *cnV[104]; + RHS25 -= go[105] * *cnV[105]; + RHS25 -= go[106] * *cnV[106]; + m_A90 += gt[107]; + m_A90 += gt[108]; + m_A90 += gt[109]; + m_A90 += gt[110]; + m_A90 += gt[111]; + m_A91 += go[107]; + m_A86 += go[108]; + m_A87 += go[109]; + m_A85 += go[110]; + m_A84 += go[111]; + double RHS26 = Idr[107]; + RHS26 += Idr[108]; + RHS26 += Idr[109]; + RHS26 += Idr[110]; + RHS26 += Idr[111]; + m_A99 += gt[112]; + m_A99 += gt[113]; + m_A99 += gt[114]; + m_A99 += gt[115]; + m_A99 += gt[116]; + m_A99 += gt[117]; + m_A99 += gt[118]; + m_A99 += gt[119]; + m_A99 += gt[120]; + m_A92 += go[112]; + m_A93 += go[113]; + m_A93 += go[114]; + m_A97 += go[115]; + m_A97 += go[116]; + m_A94 += go[117]; + m_A98 += go[118]; + double RHS27 = Idr[112]; + RHS27 += Idr[113]; + RHS27 += Idr[114]; + RHS27 += Idr[115]; + RHS27 += Idr[116]; + RHS27 += Idr[117]; + RHS27 += Idr[118]; + RHS27 += Idr[119]; + RHS27 += Idr[120]; + RHS27 -= go[119] * *cnV[119]; + RHS27 -= go[120] * *cnV[120]; + const double f0 = 1.0 / m_A0; + const double f0_27 = -f0 * m_A92; + m_A95 += m_A1 * f0_27; + RHS27 += f0_27 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_12 = -f1 * m_A26; + m_A27 += m_A3 * f1_12; + RHS12 += f1_12 * RHS1; + const double f1_23 = -f1 * m_A66; + m_A68 += m_A3 * f1_23; + RHS23 += f1_23 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_13 = -f2 * m_A28; + m_A30 += m_A5 * f2_13; + RHS13 += f2_13 * RHS2; + const double f2_23 = -f2 * m_A67; + m_A69 += m_A5 * f2_23; + RHS23 += f2_23 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_18 = -f3 * m_A44; + m_A45 += m_A7 * f3_18; + RHS18 += f3_18 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_24 = -f4 * m_A71; + m_A74 += m_A9 * f4_24; + RHS24 += f4_24 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_16 = -f5 * m_A36; + m_A38 += m_A11 * f5_16; + RHS16 += f5_16 * RHS5; + const double f5_21 = -f5 * m_A57; + m_A59 += m_A11 * f5_21; + RHS21 += f5_21 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_15 = -f6 * m_A33; + m_A34 += m_A13 * f6_15; + RHS15 += f6_15 * RHS6; + const double f6_26 = -f6 * m_A84; + m_A86 += m_A13 * f6_26; + RHS26 += f6_26 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_16 = -f7 * m_A37; + m_A38 += m_A15 * f7_16; + RHS16 += f7_16 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_17 = -f8 * m_A40; + m_A41 += m_A17 * f8_17; + m_A42 += m_A18 * f8_17; + RHS17 += f8_17 * RHS8; + const double f8_19 = -f8 * m_A49; + m_A51 += m_A17 * f8_19; + m_A52 += m_A18 * f8_19; + RHS19 += f8_19 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_19 = -f9 * m_A50; + m_A52 += m_A20 * f9_19; + RHS19 += f9_19 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_22 = -f10 * m_A63; + m_A65 += m_A22 * f10_22; + RHS22 += f10_22 * RHS10; + const double f10_26 = -f10 * m_A85; + m_A90 += m_A22 * f10_26; + RHS26 += f10_26 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_25 = -f11 * m_A79; + m_A82 += m_A24 * f11_25; + m_A83 += m_A25 * f11_25; + RHS25 += f11_25 * RHS11; + const double f11_27 = -f11 * m_A93; + m_A97 += m_A24 * f11_27; + m_A99 += m_A25 * f11_27; + RHS27 += f11_27 * RHS11; + const double f12 = 1.0 / m_A27; + const double f12_23 = -f12 * m_A68; + RHS23 += f12_23 * RHS12; + const double f13 = 1.0 / m_A29; + const double f13_18 = -f13 * m_A45; + m_A47 += m_A30 * f13_18; + RHS18 += f13_18 * RHS13; + const double f14 = 1.0 / m_A31; + const double f14_20 = -f14 * m_A54; + m_A56 += m_A32 * f14_20; + RHS20 += f14_20 * RHS14; + const double f14_21 = -f14 * m_A58; + m_A60 += m_A32 * f14_21; + RHS21 += f14_21 * RHS14; + const double f15 = 1.0 / m_A34; + const double f15_24 = -f15 * m_A72; + m_A77 += m_A35 * f15_24; + RHS24 += f15_24 * RHS15; + const double f15_26 = -f15 * m_A86; + m_A89 += m_A35 * f15_26; + RHS26 += f15_26 * RHS15; + const double f16 = 1.0 / m_A38; + const double f16_21 = -f16 * m_A59; + m_A61 += m_A39 * f16_21; + RHS21 += f16_21 * RHS16; + const double f16_24 = -f16 * m_A73; + m_A77 += m_A39 * f16_24; + RHS24 += f16_24 * RHS16; + const double f17 = 1.0 / m_A41; + const double f17_19 = -f17 * m_A51; + m_A52 += m_A42 * f17_19; + m_A53 += m_A43 * f17_19; + RHS19 += f17_19 * RHS17; + const double f17_25 = -f17 * m_A80; + m_A81 += m_A42 * f17_25; + m_A82 += m_A43 * f17_25; + RHS25 += f17_25 * RHS17; + const double f18 = 1.0 / m_A46; + const double f18_26 = -f18 * m_A87; + m_A88 += m_A47 * f18_26; + m_A90 += m_A48 * f18_26; + RHS26 += f18_26 * RHS18; + const double f19 = 1.0 / m_A52; + const double f19_25 = -f19 * m_A81; + m_A82 += m_A53 * f19_25; + RHS25 += f19_25 * RHS19; + const double f20 = 1.0 / m_A55; + const double f20_24 = -f20 * m_A74; + m_A75 += m_A56 * f20_24; + RHS24 += f20_24 * RHS20; + const double f21 = 1.0 / m_A60; + const double f21_24 = -f21 * m_A75; + m_A77 += m_A61 * f21_24; + m_A78 += m_A62 * f21_24; + RHS24 += f21_24 * RHS21; + const double f21_27 = -f21 * m_A94; + m_A96 += m_A61 * f21_27; + m_A99 += m_A62 * f21_27; + RHS27 += f21_27 * RHS21; + const double f22 = 1.0 / m_A64; + const double f22_27 = -f22 * m_A95; + m_A98 += m_A65 * f22_27; + RHS27 += f22_27 * RHS22; + const double f23 = 1.0 / m_A69; + const double f23_24 = -f23 * m_A76; + m_A77 += m_A70 * f23_24; + RHS24 += f23_24 * RHS23; + const double f23_26 = -f23 * m_A88; + m_A89 += m_A70 * f23_26; + RHS26 += f23_26 * RHS23; + const double f24 = 1.0 / m_A77; + const double f24_26 = -f24 * m_A89; + m_A91 += m_A78 * f24_26; + RHS26 += f24_26 * RHS24; + const double f24_27 = -f24 * m_A96; + m_A99 += m_A78 * f24_27; + RHS27 += f24_27 * RHS24; + const double f25 = 1.0 / m_A82; + const double f25_27 = -f25 * m_A97; + m_A99 += m_A83 * f25_27; + RHS27 += f25_27 * RHS25; + const double f26 = 1.0 / m_A90; + const double f26_27 = -f26 * m_A98; + m_A99 += m_A91 * f26_27; + RHS27 += f26_27 * RHS26; + V[27] = RHS27 / m_A99; + double tmp26 = 0.0; + tmp26 += m_A91 * V[27]; + V[26] = (RHS26 - tmp26) / m_A90; + double tmp25 = 0.0; + tmp25 += m_A83 * V[27]; + V[25] = (RHS25 - tmp25) / m_A82; + double tmp24 = 0.0; + tmp24 += m_A78 * V[27]; + V[24] = (RHS24 - tmp24) / m_A77; + double tmp23 = 0.0; + tmp23 += m_A70 * V[24]; + V[23] = (RHS23 - tmp23) / m_A69; + double tmp22 = 0.0; + tmp22 += m_A65 * V[26]; + V[22] = (RHS22 - tmp22) / m_A64; + double tmp21 = 0.0; + tmp21 += m_A61 * V[24]; + tmp21 += m_A62 * V[27]; + V[21] = (RHS21 - tmp21) / m_A60; + double tmp20 = 0.0; + tmp20 += m_A56 * V[21]; + V[20] = (RHS20 - tmp20) / m_A55; + double tmp19 = 0.0; + tmp19 += m_A53 * V[25]; + V[19] = (RHS19 - tmp19) / m_A52; + double tmp18 = 0.0; + tmp18 += m_A47 * V[23]; + tmp18 += m_A48 * V[26]; + V[18] = (RHS18 - tmp18) / m_A46; + double tmp17 = 0.0; + tmp17 += m_A42 * V[19]; + tmp17 += m_A43 * V[25]; + V[17] = (RHS17 - tmp17) / m_A41; + double tmp16 = 0.0; + tmp16 += m_A39 * V[24]; + V[16] = (RHS16 - tmp16) / m_A38; + double tmp15 = 0.0; + tmp15 += m_A35 * V[24]; + V[15] = (RHS15 - tmp15) / m_A34; + double tmp14 = 0.0; + tmp14 += m_A32 * V[21]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + tmp13 += m_A30 * V[23]; + V[13] = (RHS13 - tmp13) / m_A29; + double tmp12 = 0.0; + V[12] = (RHS12 - tmp12) / m_A27; + double tmp11 = 0.0; + tmp11 += m_A24 * V[25]; + tmp11 += m_A25 * V[27]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A22 * V[26]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + tmp9 += m_A20 * V[19]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A17 * V[17]; + tmp8 += m_A18 * V[19]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[16]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[15]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[16]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[20]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[13]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[23]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[12]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[22]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sundance +static void nl_gcr_70_double_double_8446e63d7842f6a6(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 += Idr[8]; + RHS3 -= go[7] * *cnV[7]; + RHS3 -= go[8] * *cnV[8]; + m_A8 += gt[9]; + m_A8 += gt[10]; + m_A10 += go[9]; + m_A9 += go[10]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A12 += go[11]; + m_A13 += go[12]; + double RHS5 = Idr[11]; + RHS5 += Idr[12]; + RHS5 += Idr[13]; + RHS5 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A14 += gt[19]; + m_A14 += gt[20]; + m_A15 += go[14]; + double RHS6 = Idr[14]; + RHS6 += Idr[15]; + RHS6 += Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 -= go[15] * *cnV[15]; + RHS6 -= go[16] * *cnV[16]; + RHS6 -= go[17] * *cnV[17]; + RHS6 -= go[18] * *cnV[18]; + RHS6 -= go[19] * *cnV[19]; + RHS6 -= go[20] * *cnV[20]; + m_A16 += gt[21]; + m_A16 += gt[22]; + m_A16 += gt[23]; + m_A16 += gt[24]; + m_A18 += go[21]; + m_A18 += go[22]; + m_A17 += go[23]; + double RHS7 = Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 -= go[24] * *cnV[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A21 += go[25]; + m_A20 += go[26]; + double RHS8 = Idr[25]; + RHS8 += Idr[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A24 += go[27]; + m_A23 += go[28]; + double RHS9 = Idr[27]; + RHS9 += Idr[28]; + RHS9 += Idr[29]; + RHS9 -= go[29] * *cnV[29]; + m_A27 += gt[30]; + m_A27 += gt[31]; + m_A26 += go[30]; + m_A25 += go[31]; + double RHS10 = Idr[30]; + RHS10 += Idr[31]; + m_A31 += gt[32]; + m_A31 += gt[33]; + m_A31 += gt[34]; + m_A32 += go[32]; + m_A30 += go[33]; + double RHS11 = Idr[32]; + RHS11 += Idr[33]; + RHS11 += Idr[34]; + RHS11 -= go[34] * *cnV[34]; + m_A35 += gt[35]; + m_A35 += gt[36]; + m_A35 += gt[37]; + m_A34 += go[35]; + m_A33 += go[36]; + double RHS12 = Idr[35]; + RHS12 += Idr[36]; + RHS12 += Idr[37]; + RHS12 -= go[37] * *cnV[37]; + m_A40 += gt[38]; + m_A40 += gt[39]; + m_A40 += gt[40]; + m_A40 += gt[41]; + m_A43 += go[38]; + m_A38 += go[39]; + m_A37 += go[40]; + double RHS13 = Idr[38]; + RHS13 += Idr[39]; + RHS13 += Idr[40]; + RHS13 += Idr[41]; + RHS13 -= go[41] * *cnV[41]; + m_A50 += gt[42]; + m_A50 += gt[43]; + m_A50 += gt[44]; + m_A50 += gt[45]; + m_A50 += gt[46]; + m_A50 += gt[47]; + m_A44 += go[42]; + m_A46 += go[43]; + m_A45 += go[44]; + m_A45 += go[45]; + double RHS14 = Idr[42]; + RHS14 += Idr[43]; + RHS14 += Idr[44]; + RHS14 += Idr[45]; + RHS14 += Idr[46]; + RHS14 += Idr[47]; + RHS14 -= go[46] * *cnV[46]; + RHS14 -= go[47] * *cnV[47]; + m_A55 += gt[48]; + m_A55 += gt[49]; + m_A55 += gt[50]; + m_A54 += go[48]; + m_A53 += go[49]; + double RHS15 = Idr[48]; + RHS15 += Idr[49]; + RHS15 += Idr[50]; + RHS15 -= go[50] * *cnV[50]; + m_A62 += gt[51]; + m_A62 += gt[52]; + m_A62 += gt[53]; + m_A62 += gt[54]; + m_A57 += go[51]; + m_A58 += go[52]; + m_A59 += go[53]; + double RHS16 = Idr[51]; + RHS16 += Idr[52]; + RHS16 += Idr[53]; + RHS16 += Idr[54]; + RHS16 -= go[54] * *cnV[54]; + m_A69 += gt[55]; + m_A69 += gt[56]; + m_A64 += go[55]; + m_A65 += go[56]; + double RHS17 = Idr[55]; + RHS17 += Idr[56]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A53; + m_A55 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_12 = -f1 * m_A33; + m_A35 += m_A3 * f1_12; + RHS12 += f1_12 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_11 = -f2 * m_A30; + m_A31 += m_A5 * f2_11; + RHS11 += f2_11 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_16 = -f3 * m_A57; + m_A62 += m_A7 * f3_16; + RHS16 += f3_16 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_13 = -f4 * m_A37; + m_A40 += m_A9 * f4_13; + m_A42 += m_A10 * f4_13; + RHS13 += f4_13 * RHS4; + const double f4_16 = -f4 * m_A58; + m_A60 += m_A9 * f4_16; + m_A62 += m_A10 * f4_16; + RHS16 += f4_16 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_10 = -f5 * m_A25; + m_A27 += m_A12 * f5_10; + m_A28 += m_A13 * f5_10; + RHS10 += f5_10 * RHS5; + const double f5_13 = -f5 * m_A38; + m_A39 += m_A12 * f5_13; + m_A40 += m_A13 * f5_13; + RHS13 += f5_13 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_14 = -f6 * m_A44; + m_A45 += m_A15 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A16; + const double f7_10 = -f7 * m_A26; + m_A27 += m_A17 * f7_10; + m_A29 += m_A18 * f7_10; + RHS10 += f7_10 * RHS7; + const double f7_14 = -f7 * m_A45; + m_A47 += m_A17 * f7_14; + m_A50 += m_A18 * f7_14; + RHS14 += f7_14 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_12 = -f8 * m_A34; + m_A35 += m_A20 * f8_12; + m_A36 += m_A21 * f8_12; + RHS12 += f8_12 * RHS8; + const double f8_14 = -f8 * m_A46; + m_A48 += m_A20 * f8_14; + m_A50 += m_A21 * f8_14; + RHS14 += f8_14 * RHS8; + const double f9 = 1.0 / m_A22; + const double f9_15 = -f9 * m_A54; + m_A55 += m_A23 * f9_15; + m_A56 += m_A24 * f9_15; + RHS15 += f9_15 * RHS9; + const double f9_17 = -f9 * m_A64; + m_A67 += m_A23 * f9_17; + m_A69 += m_A24 * f9_17; + RHS17 += f9_17 * RHS9; + const double f10 = 1.0 / m_A27; + const double f10_13 = -f10 * m_A39; + m_A40 += m_A28 * f10_13; + m_A41 += m_A29 * f10_13; + RHS13 += f10_13 * RHS10; + const double f10_14 = -f10 * m_A47; + m_A49 += m_A28 * f10_14; + m_A50 += m_A29 * f10_14; + RHS14 += f10_14 * RHS10; + const double f11 = 1.0 / m_A31; + const double f11_16 = -f11 * m_A59; + m_A62 += m_A32 * f11_16; + RHS16 += f11_16 * RHS11; + const double f12 = 1.0 / m_A35; + const double f12_14 = -f12 * m_A48; + m_A50 += m_A36 * f12_14; + RHS14 += f12_14 * RHS12; + const double f13 = 1.0 / m_A40; + const double f13_14 = -f13 * m_A49; + m_A50 += m_A41 * f13_14; + m_A51 += m_A42 * f13_14; + m_A52 += m_A43 * f13_14; + RHS14 += f13_14 * RHS13; + const double f13_16 = -f13 * m_A60; + m_A61 += m_A41 * f13_16; + m_A62 += m_A42 * f13_16; + m_A63 += m_A43 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_17 = -f13 * m_A65; + m_A66 += m_A41 * f13_17; + m_A68 += m_A42 * f13_17; + m_A69 += m_A43 * f13_17; + RHS17 += f13_17 * RHS13; + const double f14 = 1.0 / m_A50; + const double f14_16 = -f14 * m_A61; + m_A62 += m_A51 * f14_16; + m_A63 += m_A52 * f14_16; + RHS16 += f14_16 * RHS14; + const double f14_17 = -f14 * m_A66; + m_A68 += m_A51 * f14_17; + m_A69 += m_A52 * f14_17; + RHS17 += f14_17 * RHS14; + const double f15 = 1.0 / m_A55; + const double f15_17 = -f15 * m_A67; + m_A69 += m_A56 * f15_17; + RHS17 += f15_17 * RHS15; + const double f16 = 1.0 / m_A62; + const double f16_17 = -f16 * m_A68; + m_A69 += m_A63 * f16_17; + RHS17 += f16_17 * RHS16; + V[17] = RHS17 / m_A69; + double tmp16 = 0.0; + tmp16 += m_A63 * V[17]; + V[16] = (RHS16 - tmp16) / m_A62; + double tmp15 = 0.0; + tmp15 += m_A56 * V[17]; + V[15] = (RHS15 - tmp15) / m_A55; + double tmp14 = 0.0; + tmp14 += m_A51 * V[16]; + tmp14 += m_A52 * V[17]; + V[14] = (RHS14 - tmp14) / m_A50; + double tmp13 = 0.0; + tmp13 += m_A41 * V[14]; + tmp13 += m_A42 * V[16]; + tmp13 += m_A43 * V[17]; + V[13] = (RHS13 - tmp13) / m_A40; + double tmp12 = 0.0; + tmp12 += m_A36 * V[14]; + V[12] = (RHS12 - tmp12) / m_A35; + double tmp11 = 0.0; + tmp11 += m_A32 * V[16]; + V[11] = (RHS11 - tmp11) / m_A31; + double tmp10 = 0.0; + tmp10 += m_A28 * V[13]; + tmp10 += m_A29 * V[14]; + V[10] = (RHS10 - tmp10) / m_A27; + double tmp9 = 0.0; + tmp9 += m_A23 * V[15]; + tmp9 += m_A24 * V[17]; + V[9] = (RHS9 - tmp9) / m_A22; + double tmp8 = 0.0; + tmp8 += m_A20 * V[12]; + tmp8 += m_A21 * V[14]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A17 * V[10]; + tmp7 += m_A18 * V[14]; + V[7] = (RHS7 - tmp7) / m_A16; + double tmp6 = 0.0; + tmp6 += m_A15 * V[7]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[10]; + tmp5 += m_A13 * V[13]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[13]; + tmp4 += m_A10 * V[16]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[16]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[11]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[12]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[15]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// sundance +static void nl_gcr_8_double_double_e5b7711fac1ea80c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[0] * *cnV[0]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A1 += gt[3]; + m_A1 += gt[4]; + m_A1 += gt[5]; + m_A1 += gt[6]; + m_A1 += gt[7]; + m_A1 += gt[8]; + m_A1 += gt[9]; + m_A2 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A3 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A7 += gt[14]; + m_A7 += gt[15]; + m_A7 += gt[16]; + m_A5 += go[14]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A3; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A1; + const double f1_3 = -f1 * m_A5; + m_A6 += m_A2 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_3 = -f2 * m_A6; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A7; + double tmp2 = 0.0; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A2 * V[2]; + V[1] = (RHS1 - tmp1) / m_A1; + double tmp0 = 0.0; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tailg +static void nl_gcr_119_double_double_144ed14e6bafdb(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A8 += go[6]; + m_A7 += go[7]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A10 += go[8]; + m_A11 += go[9]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + m_A12 += gt[10]; + m_A12 += gt[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A13 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 += Idr[12]; + RHS5 += Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 -= go[11] * *cnV[11]; + RHS5 -= go[12] * *cnV[12]; + RHS5 -= go[13] * *cnV[13]; + RHS5 -= go[14] * *cnV[14]; + RHS5 -= go[15] * *cnV[15]; + RHS5 -= go[16] * *cnV[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A16 += go[17]; + m_A15 += go[18]; + double RHS6 = Idr[17]; + RHS6 += Idr[18]; + m_A17 += gt[19]; + m_A17 += gt[20]; + m_A18 += go[19]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + RHS7 -= go[20] * *cnV[20]; + m_A19 += gt[21]; + m_A19 += gt[22]; + m_A19 += gt[23]; + m_A20 += go[21]; + m_A21 += go[22]; + double RHS8 = Idr[21]; + RHS8 += Idr[22]; + RHS8 += Idr[23]; + RHS8 -= go[23] * *cnV[23]; + m_A22 += gt[24]; + m_A22 += gt[25]; + m_A24 += go[24]; + m_A23 += go[25]; + double RHS9 = Idr[24]; + RHS9 += Idr[25]; + m_A25 += gt[26]; + m_A25 += gt[27]; + m_A25 += gt[28]; + m_A27 += go[26]; + m_A26 += go[27]; + double RHS10 = Idr[26]; + RHS10 += Idr[27]; + RHS10 += Idr[28]; + RHS10 -= go[28] * *cnV[28]; + m_A28 += gt[29]; + m_A28 += gt[30]; + m_A28 += gt[31]; + m_A29 += go[29]; + double RHS11 = Idr[29]; + RHS11 += Idr[30]; + RHS11 += Idr[31]; + RHS11 -= go[30] * *cnV[30]; + RHS11 -= go[31] * *cnV[31]; + m_A30 += gt[32]; + m_A30 += gt[33]; + m_A30 += gt[34]; + m_A31 += go[32]; + double RHS12 = Idr[32]; + RHS12 += Idr[33]; + RHS12 += Idr[34]; + RHS12 -= go[33] * *cnV[33]; + RHS12 -= go[34] * *cnV[34]; + m_A32 += gt[35]; + m_A32 += gt[36]; + m_A33 += go[35]; + m_A34 += go[36]; + double RHS13 = Idr[35]; + RHS13 += Idr[36]; + m_A35 += gt[37]; + m_A35 += gt[38]; + m_A35 += gt[39]; + m_A36 += go[37]; + double RHS14 = Idr[37]; + RHS14 += Idr[38]; + RHS14 += Idr[39]; + RHS14 -= go[38] * *cnV[38]; + RHS14 -= go[39] * *cnV[39]; + m_A37 += gt[40]; + m_A37 += gt[41]; + m_A37 += gt[42]; + m_A38 += go[40]; + double RHS15 = Idr[40]; + RHS15 += Idr[41]; + RHS15 += Idr[42]; + RHS15 -= go[41] * *cnV[41]; + RHS15 -= go[42] * *cnV[42]; + m_A39 += gt[43]; + m_A39 += gt[44]; + m_A40 += go[43]; + m_A41 += go[44]; + double RHS16 = Idr[43]; + RHS16 += Idr[44]; + m_A42 += gt[45]; + m_A42 += gt[46]; + m_A42 += gt[47]; + m_A44 += go[45]; + m_A43 += go[46]; + double RHS17 = Idr[45]; + RHS17 += Idr[46]; + RHS17 += Idr[47]; + RHS17 -= go[47] * *cnV[47]; + m_A47 += gt[48]; + m_A47 += gt[49]; + m_A47 += gt[50]; + m_A46 += go[48]; + m_A45 += go[49]; + double RHS18 = Idr[48]; + RHS18 += Idr[49]; + RHS18 += Idr[50]; + RHS18 -= go[50] * *cnV[50]; + m_A51 += gt[51]; + m_A51 += gt[52]; + m_A51 += gt[53]; + m_A50 += go[51]; + m_A49 += go[52]; + double RHS19 = Idr[51]; + RHS19 += Idr[52]; + RHS19 += Idr[53]; + RHS19 -= go[53] * *cnV[53]; + m_A58 += gt[54]; + m_A58 += gt[55]; + m_A58 += gt[56]; + m_A58 += gt[57]; + m_A58 += gt[58]; + m_A54 += go[54]; + m_A56 += go[55]; + m_A55 += go[56]; + m_A53 += go[57]; + double RHS20 = Idr[54]; + RHS20 += Idr[55]; + RHS20 += Idr[56]; + RHS20 += Idr[57]; + RHS20 += Idr[58]; + RHS20 -= go[58] * *cnV[58]; + m_A64 += gt[59]; + m_A64 += gt[60]; + m_A64 += gt[61]; + m_A62 += go[59]; + m_A61 += go[60]; + double RHS21 = Idr[59]; + RHS21 += Idr[60]; + RHS21 += Idr[61]; + RHS21 -= go[61] * *cnV[61]; + m_A69 += gt[62]; + m_A69 += gt[63]; + m_A67 += go[62]; + double RHS22 = Idr[62]; + RHS22 += Idr[63]; + RHS22 -= go[63] * *cnV[63]; + m_A75 += gt[64]; + m_A75 += gt[65]; + m_A75 += gt[66]; + m_A75 += gt[67]; + m_A75 += gt[68]; + m_A77 += go[64]; + m_A71 += go[65]; + m_A76 += go[66]; + double RHS23 = Idr[64]; + RHS23 += Idr[65]; + RHS23 += Idr[66]; + RHS23 += Idr[67]; + RHS23 += Idr[68]; + RHS23 -= go[67] * *cnV[67]; + RHS23 -= go[68] * *cnV[68]; + m_A81 += gt[69]; + m_A81 += gt[70]; + m_A81 += gt[71]; + m_A80 += go[69]; + m_A79 += go[70]; + m_A78 += go[71]; + double RHS24 = Idr[69]; + RHS24 += Idr[70]; + RHS24 += Idr[71]; + m_A84 += gt[72]; + m_A84 += gt[73]; + m_A84 += gt[74]; + m_A84 += gt[75]; + m_A86 += go[72]; + m_A86 += go[73]; + m_A83 += go[74]; + double RHS25 = Idr[72]; + RHS25 += Idr[73]; + RHS25 += Idr[74]; + RHS25 += Idr[75]; + RHS25 -= go[75] * *cnV[75]; + m_A90 += gt[76]; + m_A90 += gt[77]; + m_A90 += gt[78]; + m_A89 += go[76]; + m_A88 += go[77]; + m_A87 += go[78]; + double RHS26 = Idr[76]; + RHS26 += Idr[77]; + RHS26 += Idr[78]; + m_A98 += gt[79]; + m_A98 += gt[80]; + m_A98 += gt[81]; + m_A98 += gt[82]; + m_A98 += gt[83]; + m_A95 += go[79]; + m_A94 += go[80]; + m_A93 += go[81]; + m_A92 += go[82]; + double RHS27 = Idr[79]; + RHS27 += Idr[80]; + RHS27 += Idr[81]; + RHS27 += Idr[82]; + RHS27 += Idr[83]; + RHS27 -= go[83] * *cnV[83]; + m_A103 += gt[84]; + m_A103 += gt[85]; + m_A103 += gt[86]; + m_A100 += go[84]; + m_A101 += go[85]; + double RHS28 = Idr[84]; + RHS28 += Idr[85]; + RHS28 += Idr[86]; + RHS28 -= go[86] * *cnV[86]; + m_A110 += gt[87]; + m_A110 += gt[88]; + m_A106 += go[87]; + m_A107 += go[88]; + double RHS29 = Idr[87]; + RHS29 += Idr[88]; + m_A118 += gt[89]; + m_A118 += gt[90]; + m_A118 += gt[91]; + m_A118 += gt[92]; + m_A118 += gt[93]; + m_A118 += gt[94]; + m_A112 += go[89]; + m_A113 += go[90]; + m_A115 += go[91]; + m_A115 += go[92]; + double RHS30 = Idr[89]; + RHS30 += Idr[90]; + RHS30 += Idr[91]; + RHS30 += Idr[92]; + RHS30 += Idr[93]; + RHS30 += Idr[94]; + RHS30 -= go[93] * *cnV[93]; + RHS30 -= go[94] * *cnV[94]; + const double f0 = 1.0 / m_A0; + const double f0_18 = -f0 * m_A45; + m_A47 += m_A1 * f0_18; + RHS18 += f0_18 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_20 = -f1 * m_A53; + m_A58 += m_A3 * f1_20; + RHS20 += f1_20 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_27 = -f2 * m_A92; + m_A98 += m_A5 * f2_27; + RHS27 += f2_27 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_20 = -f3 * m_A54; + m_A58 += m_A7 * f3_20; + m_A60 += m_A8 * f3_20; + RHS20 += f3_20 * RHS3; + const double f3_23 = -f3 * m_A71; + m_A72 += m_A7 * f3_23; + m_A75 += m_A8 * f3_23; + RHS23 += f3_23 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_25 = -f4 * m_A83; + m_A84 += m_A10 * f4_25; + m_A85 += m_A11 * f4_25; + RHS25 += f4_25 * RHS4; + const double f4_28 = -f4 * m_A100; + m_A102 += m_A10 * f4_28; + m_A103 += m_A11 * f4_28; + RHS28 += f4_28 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_30 = -f5 * m_A112; + m_A115 += m_A13 * f5_30; + RHS30 += f5_30 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_18 = -f6 * m_A46; + m_A47 += m_A15 * f6_18; + m_A48 += m_A16 * f6_18; + RHS18 += f6_18 * RHS6; + const double f6_30 = -f6 * m_A113; + m_A114 += m_A15 * f6_30; + m_A118 += m_A16 * f6_30; + RHS30 += f6_30 * RHS6; + const double f7 = 1.0 / m_A17; + const double f7_19 = -f7 * m_A49; + m_A51 += m_A18 * f7_19; + RHS19 += f7_19 * RHS7; + const double f8 = 1.0 / m_A19; + const double f8_19 = -f8 * m_A50; + m_A51 += m_A20 * f8_19; + m_A52 += m_A21 * f8_19; + RHS19 += f8_19 * RHS8; + const double f8_20 = -f8 * m_A55; + m_A57 += m_A20 * f8_20; + m_A58 += m_A21 * f8_20; + RHS20 += f8_20 * RHS8; + const double f9 = 1.0 / m_A22; + const double f9_20 = -f9 * m_A56; + m_A58 += m_A23 * f9_20; + m_A59 += m_A24 * f9_20; + RHS20 += f9_20 * RHS9; + const double f9_21 = -f9 * m_A61; + m_A63 += m_A23 * f9_21; + m_A64 += m_A24 * f9_21; + RHS21 += f9_21 * RHS9; + const double f10 = 1.0 / m_A25; + const double f10_21 = -f10 * m_A62; + m_A64 += m_A26 * f10_21; + m_A65 += m_A27 * f10_21; + RHS21 += f10_21 * RHS10; + const double f10_22 = -f10 * m_A67; + m_A68 += m_A26 * f10_22; + m_A69 += m_A27 * f10_22; + RHS22 += f10_22 * RHS10; + const double f11 = 1.0 / m_A28; + const double f11_24 = -f11 * m_A78; + m_A81 += m_A29 * f11_24; + RHS24 += f11_24 * RHS11; + const double f12 = 1.0 / m_A30; + const double f12_24 = -f12 * m_A79; + m_A81 += m_A31 * f12_24; + RHS24 += f12_24 * RHS12; + const double f13 = 1.0 / m_A32; + const double f13_24 = -f13 * m_A80; + m_A81 += m_A33 * f13_24; + m_A82 += m_A34 * f13_24; + RHS24 += f13_24 * RHS13; + const double f13_27 = -f13 * m_A93; + m_A96 += m_A33 * f13_27; + m_A98 += m_A34 * f13_27; + RHS27 += f13_27 * RHS13; + const double f14 = 1.0 / m_A35; + const double f14_26 = -f14 * m_A87; + m_A90 += m_A36 * f14_26; + RHS26 += f14_26 * RHS14; + const double f15 = 1.0 / m_A37; + const double f15_26 = -f15 * m_A88; + m_A90 += m_A38 * f15_26; + RHS26 += f15_26 * RHS15; + const double f16 = 1.0 / m_A39; + const double f16_26 = -f16 * m_A89; + m_A90 += m_A40 * f16_26; + m_A91 += m_A41 * f16_26; + RHS26 += f16_26 * RHS16; + const double f16_27 = -f16 * m_A94; + m_A97 += m_A40 * f16_27; + m_A98 += m_A41 * f16_27; + RHS27 += f16_27 * RHS16; + const double f17 = 1.0 / m_A42; + const double f17_27 = -f17 * m_A95; + m_A98 += m_A43 * f17_27; + m_A99 += m_A44 * f17_27; + RHS27 += f17_27 * RHS17; + const double f17_29 = -f17 * m_A106; + m_A108 += m_A43 * f17_29; + m_A110 += m_A44 * f17_29; + RHS29 += f17_29 * RHS17; + const double f18 = 1.0 / m_A47; + const double f18_30 = -f18 * m_A114; + m_A118 += m_A48 * f18_30; + RHS30 += f18_30 * RHS18; + const double f19 = 1.0 / m_A51; + const double f19_20 = -f19 * m_A57; + m_A58 += m_A52 * f19_20; + RHS20 += f19_20 * RHS19; + const double f20 = 1.0 / m_A58; + const double f20_21 = -f20 * m_A63; + m_A64 += m_A59 * f20_21; + m_A66 += m_A60 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_23 = -f20 * m_A72; + m_A73 += m_A59 * f20_23; + m_A75 += m_A60 * f20_23; + RHS23 += f20_23 * RHS20; + const double f21 = 1.0 / m_A64; + const double f21_22 = -f21 * m_A68; + m_A69 += m_A65 * f21_22; + m_A70 += m_A66 * f21_22; + RHS22 += f21_22 * RHS21; + const double f21_23 = -f21 * m_A73; + m_A74 += m_A65 * f21_23; + m_A75 += m_A66 * f21_23; + RHS23 += f21_23 * RHS21; + const double f22 = 1.0 / m_A69; + const double f22_23 = -f22 * m_A74; + m_A75 += m_A70 * f22_23; + RHS23 += f22_23 * RHS22; + const double f23 = 1.0 / m_A75; + const double f23_28 = -f23 * m_A101; + m_A103 += m_A76 * f23_28; + m_A104 += m_A77 * f23_28; + RHS28 += f23_28 * RHS23; + const double f23_29 = -f23 * m_A107; + m_A109 += m_A76 * f23_29; + m_A110 += m_A77 * f23_29; + RHS29 += f23_29 * RHS23; + const double f24 = 1.0 / m_A81; + const double f24_27 = -f24 * m_A96; + m_A98 += m_A82 * f24_27; + RHS27 += f24_27 * RHS24; + const double f25 = 1.0 / m_A84; + const double f25_28 = -f25 * m_A102; + m_A103 += m_A85 * f25_28; + m_A105 += m_A86 * f25_28; + RHS28 += f25_28 * RHS25; + const double f25_30 = -f25 * m_A115; + m_A116 += m_A85 * f25_30; + m_A118 += m_A86 * f25_30; + RHS30 += f25_30 * RHS25; + const double f26 = 1.0 / m_A90; + const double f26_27 = -f26 * m_A97; + m_A98 += m_A91 * f26_27; + RHS27 += f26_27 * RHS26; + const double f27 = 1.0 / m_A98; + const double f27_29 = -f27 * m_A108; + m_A110 += m_A99 * f27_29; + RHS29 += f27_29 * RHS27; + const double f28 = 1.0 / m_A103; + const double f28_29 = -f28 * m_A109; + m_A110 += m_A104 * f28_29; + m_A111 += m_A105 * f28_29; + RHS29 += f28_29 * RHS28; + const double f28_30 = -f28 * m_A116; + m_A117 += m_A104 * f28_30; + m_A118 += m_A105 * f28_30; + RHS30 += f28_30 * RHS28; + const double f29 = 1.0 / m_A110; + const double f29_30 = -f29 * m_A117; + m_A118 += m_A111 * f29_30; + RHS30 += f29_30 * RHS29; + V[30] = RHS30 / m_A118; + double tmp29 = 0.0; + tmp29 += m_A111 * V[30]; + V[29] = (RHS29 - tmp29) / m_A110; + double tmp28 = 0.0; + tmp28 += m_A104 * V[29]; + tmp28 += m_A105 * V[30]; + V[28] = (RHS28 - tmp28) / m_A103; + double tmp27 = 0.0; + tmp27 += m_A99 * V[29]; + V[27] = (RHS27 - tmp27) / m_A98; + double tmp26 = 0.0; + tmp26 += m_A91 * V[27]; + V[26] = (RHS26 - tmp26) / m_A90; + double tmp25 = 0.0; + tmp25 += m_A85 * V[28]; + tmp25 += m_A86 * V[30]; + V[25] = (RHS25 - tmp25) / m_A84; + double tmp24 = 0.0; + tmp24 += m_A82 * V[27]; + V[24] = (RHS24 - tmp24) / m_A81; + double tmp23 = 0.0; + tmp23 += m_A76 * V[28]; + tmp23 += m_A77 * V[29]; + V[23] = (RHS23 - tmp23) / m_A75; + double tmp22 = 0.0; + tmp22 += m_A70 * V[23]; + V[22] = (RHS22 - tmp22) / m_A69; + double tmp21 = 0.0; + tmp21 += m_A65 * V[22]; + tmp21 += m_A66 * V[23]; + V[21] = (RHS21 - tmp21) / m_A64; + double tmp20 = 0.0; + tmp20 += m_A59 * V[21]; + tmp20 += m_A60 * V[23]; + V[20] = (RHS20 - tmp20) / m_A58; + double tmp19 = 0.0; + tmp19 += m_A52 * V[20]; + V[19] = (RHS19 - tmp19) / m_A51; + double tmp18 = 0.0; + tmp18 += m_A48 * V[30]; + V[18] = (RHS18 - tmp18) / m_A47; + double tmp17 = 0.0; + tmp17 += m_A43 * V[27]; + tmp17 += m_A44 * V[29]; + V[17] = (RHS17 - tmp17) / m_A42; + double tmp16 = 0.0; + tmp16 += m_A40 * V[26]; + tmp16 += m_A41 * V[27]; + V[16] = (RHS16 - tmp16) / m_A39; + double tmp15 = 0.0; + tmp15 += m_A38 * V[26]; + V[15] = (RHS15 - tmp15) / m_A37; + double tmp14 = 0.0; + tmp14 += m_A36 * V[26]; + V[14] = (RHS14 - tmp14) / m_A35; + double tmp13 = 0.0; + tmp13 += m_A33 * V[24]; + tmp13 += m_A34 * V[27]; + V[13] = (RHS13 - tmp13) / m_A32; + double tmp12 = 0.0; + tmp12 += m_A31 * V[24]; + V[12] = (RHS12 - tmp12) / m_A30; + double tmp11 = 0.0; + tmp11 += m_A29 * V[24]; + V[11] = (RHS11 - tmp11) / m_A28; + double tmp10 = 0.0; + tmp10 += m_A26 * V[21]; + tmp10 += m_A27 * V[22]; + V[10] = (RHS10 - tmp10) / m_A25; + double tmp9 = 0.0; + tmp9 += m_A23 * V[20]; + tmp9 += m_A24 * V[21]; + V[9] = (RHS9 - tmp9) / m_A22; + double tmp8 = 0.0; + tmp8 += m_A20 * V[19]; + tmp8 += m_A21 * V[20]; + V[8] = (RHS8 - tmp8) / m_A19; + double tmp7 = 0.0; + tmp7 += m_A18 * V[19]; + V[7] = (RHS7 - tmp7) / m_A17; + double tmp6 = 0.0; + tmp6 += m_A15 * V[18]; + tmp6 += m_A16 * V[30]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A13 * V[25]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A10 * V[25]; + tmp4 += m_A11 * V[28]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A7 * V[20]; + tmp3 += m_A8 * V[23]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[27]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[20]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[18]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tailg +static void nl_gcr_12_double_double_7388106355fb27c3(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[7]; + m_A7 += go[8]; + m_A5 += go[9]; + m_A5 += go[10]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A10 += go[12]; + m_A10 += go[13]; + m_A9 += go[14]; + m_A8 += go[15]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A11 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + m_A7 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tailg +static void nl_gcr_15_double_double_a46301cd3479b8db(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A2 += go[0]; + m_A1 += go[1]; + m_A1 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + m_A3 += gt[5]; + m_A3 += gt[6]; + m_A4 += go[5]; + double RHS1 = Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[7]; + m_A7 += go[8]; + m_A5 += go[9]; + m_A5 += go[10]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A10 += go[12]; + m_A8 += go[13]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[14] * *cnV[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A13 += go[15]; + m_A12 += go[16]; + m_A12 += go[17]; + m_A11 += go[18]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A6 += m_A1 * f0_2; + m_A7 += m_A2 * f0_2; + RHS2 += f0_2 * RHS0; + const double f0_4 = -f0 * m_A11; + m_A12 += m_A1 * f0_4; + m_A14 += m_A2 * f0_4; + RHS4 += f0_4 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_4 = -f2 * m_A12; + m_A14 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_4 = -f3 * m_A13; + m_A14 += m_A10 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A14; + double tmp3 = 0.0; + tmp3 += m_A10 * V[4]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A7 * V[4]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + tmp0 += m_A2 * V[4]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tailg +static void nl_gcr_23_double_double_c4cec7aed23b7b94(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A7 += go[7]; + m_A6 += go[8]; + m_A6 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A9 += gt[16]; + m_A9 += gt[17]; + m_A10 += go[13]; + m_A10 += go[14]; + m_A8 += go[15]; + m_A8 += go[16]; + double RHS3 = Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[17] * *cnV[17]; + m_A12 += gt[18]; + m_A12 += gt[19]; + m_A12 += gt[20]; + m_A12 += gt[21]; + m_A12 += gt[22]; + m_A13 += go[18]; + m_A13 += go[19]; + m_A11 += go[20]; + m_A11 += go[21]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 -= go[22] * *cnV[22]; + m_A17 += gt[23]; + m_A17 += gt[24]; + m_A17 += gt[25]; + m_A17 += gt[26]; + m_A17 += gt[27]; + m_A17 += gt[28]; + m_A18 += go[23]; + m_A16 += go[24]; + m_A16 += go[25]; + m_A15 += go[26]; + m_A14 += go[27]; + double RHS5 = Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 -= go[28] * *cnV[28]; + m_A22 += gt[29]; + m_A22 += gt[30]; + m_A22 += gt[31]; + m_A22 += gt[32]; + m_A20 += go[29]; + m_A20 += go[30]; + m_A19 += go[31]; + m_A21 += go[32]; + double RHS6 = Idr[29]; + RHS6 += Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A14; + m_A17 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A8; + m_A9 += m_A3 * f1_3; + m_A10 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_5 = -f1 * m_A15; + m_A16 += m_A3 * f1_5; + m_A17 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A11; + m_A12 += m_A6 * f2_4; + m_A13 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_6 = -f2 * m_A19; + m_A20 += m_A6 * f2_6; + m_A22 += m_A7 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A9; + const double f3_5 = -f3 * m_A16; + m_A17 += m_A10 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A12; + const double f4_6 = -f4 * m_A20; + m_A22 += m_A13 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A17; + const double f5_6 = -f5 * m_A21; + m_A22 += m_A18 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A22; + double tmp5 = 0.0; + tmp5 += m_A18 * V[6]; + V[5] = (RHS5 - tmp5) / m_A17; + double tmp4 = 0.0; + tmp4 += m_A13 * V[6]; + V[4] = (RHS4 - tmp4) / m_A12; + double tmp3 = 0.0; + tmp3 += m_A10 * V[5]; + V[3] = (RHS3 - tmp3) / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[6]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tailg +static void nl_gcr_31_double_double_5ccf7da1202da2e5(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A0 += gt[7]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 += Idr[7]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + RHS0 -= go[7] * *cnV[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A3 += go[8]; + double RHS1 = Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + m_A4 += gt[11]; + m_A4 += gt[12]; + m_A4 += gt[13]; + m_A5 += go[11]; + double RHS2 = Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A7 += go[14]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + m_A8 += gt[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A9 += go[17]; + double RHS4 = Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A10 += gt[22]; + m_A11 += go[20]; + double RHS5 = Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + m_A12 += gt[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A13 += go[23]; + double RHS6 = Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 -= go[24] * *cnV[24]; + RHS6 -= go[25] * *cnV[25]; + m_A14 += gt[26]; + m_A14 += gt[27]; + m_A14 += gt[28]; + m_A15 += go[26]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + RHS7 += Idr[28]; + RHS7 -= go[27] * *cnV[27]; + RHS7 -= go[28] * *cnV[28]; + m_A16 += gt[29]; + m_A16 += gt[30]; + m_A16 += gt[31]; + m_A17 += go[29]; + double RHS8 = Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 -= go[30] * *cnV[30]; + RHS8 -= go[31] * *cnV[31]; + m_A19 += gt[32]; + m_A19 += gt[33]; + m_A20 += go[32]; + m_A18 += go[33]; + double RHS9 = Idr[32]; + RHS9 += Idr[33]; + m_A30 += gt[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A30 += gt[37]; + m_A30 += gt[38]; + m_A30 += gt[39]; + m_A30 += gt[40]; + m_A30 += gt[41]; + m_A30 += gt[42]; + m_A30 += gt[43]; + m_A28 += go[34]; + m_A27 += go[35]; + m_A26 += go[36]; + m_A25 += go[37]; + m_A29 += go[38]; + m_A24 += go[39]; + m_A23 += go[40]; + m_A22 += go[41]; + m_A21 += go[42]; + double RHS10 = Idr[34]; + RHS10 += Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 -= go[43] * *cnV[43]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A18; + m_A19 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_10 = -f1 * m_A21; + m_A30 += m_A3 * f1_10; + RHS10 += f1_10 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_10 = -f2 * m_A22; + m_A30 += m_A5 * f2_10; + RHS10 += f2_10 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_10 = -f3 * m_A23; + m_A30 += m_A7 * f3_10; + RHS10 += f3_10 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_10 = -f4 * m_A24; + m_A30 += m_A9 * f4_10; + RHS10 += f4_10 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_10 = -f5 * m_A25; + m_A30 += m_A11 * f5_10; + RHS10 += f5_10 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_10 = -f6 * m_A26; + m_A30 += m_A13 * f6_10; + RHS10 += f6_10 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_10 = -f7 * m_A27; + m_A30 += m_A15 * f7_10; + RHS10 += f7_10 * RHS7; + const double f8 = 1.0 / m_A16; + const double f8_10 = -f8 * m_A28; + m_A30 += m_A17 * f8_10; + RHS10 += f8_10 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_10 = -f9 * m_A29; + m_A30 += m_A20 * f9_10; + RHS10 += f9_10 * RHS9; + V[10] = RHS10 / m_A30; + double tmp9 = 0.0; + tmp9 += m_A20 * V[10]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A17 * V[10]; + V[8] = (RHS8 - tmp8) / m_A16; + double tmp7 = 0.0; + tmp7 += m_A15 * V[10]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[10]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[10]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[10]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[10]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[10]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[10]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tank,gamemachine +static void nl_gcr_19_double_double_491f95430bfdfd05(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[7] * *cnV[7]; + RHS2 -= go[8] * *cnV[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[9]; + double RHS3 = Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[10] * *cnV[10]; + RHS3 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[15]; + double RHS5 = Idr[15]; + RHS5 += Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[16] * *cnV[16]; + RHS5 -= go[17] * *cnV[17]; + m_A18 += gt[18]; + m_A18 += gt[19]; + m_A18 += gt[20]; + m_A18 += gt[21]; + m_A18 += gt[22]; + m_A18 += gt[23]; + m_A18 += gt[24]; + m_A17 += go[18]; + m_A16 += go[19]; + m_A15 += go[20]; + m_A14 += go[21]; + m_A13 += go[22]; + m_A12 += go[23]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 += Idr[20]; + RHS6 += Idr[21]; + RHS6 += Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 -= go[24] * *cnV[24]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A12; + m_A18 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A13; + m_A18 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A14; + m_A18 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A15; + m_A18 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_6 = -f4 * m_A16; + m_A18 += m_A9 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_6 = -f5 * m_A17; + m_A18 += m_A11 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A18; + double tmp5 = 0.0; + tmp5 += m_A11 * V[6]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[6]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[6]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tank +static void nl_gcr_328_double_double_930b64361c2cdba8(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + double m_A178(0.0); + double m_A179(0.0); + double m_A180(0.0); + double m_A181(0.0); + double m_A182(0.0); + double m_A183(0.0); + double m_A184(0.0); + double m_A185(0.0); + double m_A186(0.0); + double m_A187(0.0); + double m_A188(0.0); + double m_A189(0.0); + double m_A190(0.0); + double m_A191(0.0); + double m_A192(0.0); + double m_A193(0.0); + double m_A194(0.0); + double m_A195(0.0); + double m_A196(0.0); + double m_A197(0.0); + double m_A198(0.0); + double m_A199(0.0); + double m_A200(0.0); + double m_A201(0.0); + double m_A202(0.0); + double m_A203(0.0); + double m_A204(0.0); + double m_A205(0.0); + double m_A206(0.0); + double m_A207(0.0); + double m_A208(0.0); + double m_A209(0.0); + double m_A210(0.0); + double m_A211(0.0); + double m_A212(0.0); + double m_A213(0.0); + double m_A214(0.0); + double m_A215(0.0); + double m_A216(0.0); + double m_A217(0.0); + double m_A218(0.0); + double m_A219(0.0); + double m_A220(0.0); + double m_A221(0.0); + double m_A222(0.0); + double m_A223(0.0); + double m_A224(0.0); + double m_A225(0.0); + double m_A226(0.0); + double m_A227(0.0); + double m_A228(0.0); + double m_A229(0.0); + double m_A230(0.0); + double m_A231(0.0); + double m_A232(0.0); + double m_A233(0.0); + double m_A234(0.0); + double m_A235(0.0); + double m_A236(0.0); + double m_A237(0.0); + double m_A238(0.0); + double m_A239(0.0); + double m_A240(0.0); + double m_A241(0.0); + double m_A242(0.0); + double m_A243(0.0); + double m_A244(0.0); + double m_A245(0.0); + double m_A246(0.0); + double m_A247(0.0); + double m_A248(0.0); + double m_A249(0.0); + double m_A250(0.0); + double m_A251(0.0); + double m_A252(0.0); + double m_A253(0.0); + double m_A254(0.0); + double m_A255(0.0); + double m_A256(0.0); + double m_A257(0.0); + double m_A258(0.0); + double m_A259(0.0); + double m_A260(0.0); + double m_A261(0.0); + double m_A262(0.0); + double m_A263(0.0); + double m_A264(0.0); + double m_A265(0.0); + double m_A266(0.0); + double m_A267(0.0); + double m_A268(0.0); + double m_A269(0.0); + double m_A270(0.0); + double m_A271(0.0); + double m_A272(0.0); + double m_A273(0.0); + double m_A274(0.0); + double m_A275(0.0); + double m_A276(0.0); + double m_A277(0.0); + double m_A278(0.0); + double m_A279(0.0); + double m_A280(0.0); + double m_A281(0.0); + double m_A282(0.0); + double m_A283(0.0); + double m_A284(0.0); + double m_A285(0.0); + double m_A286(0.0); + double m_A287(0.0); + double m_A288(0.0); + double m_A289(0.0); + double m_A290(0.0); + double m_A291(0.0); + double m_A292(0.0); + double m_A293(0.0); + double m_A294(0.0); + double m_A295(0.0); + double m_A296(0.0); + double m_A297(0.0); + double m_A298(0.0); + double m_A299(0.0); + double m_A300(0.0); + double m_A301(0.0); + double m_A302(0.0); + double m_A303(0.0); + double m_A304(0.0); + double m_A305(0.0); + double m_A306(0.0); + double m_A307(0.0); + double m_A308(0.0); + double m_A309(0.0); + double m_A310(0.0); + double m_A311(0.0); + double m_A312(0.0); + double m_A313(0.0); + double m_A314(0.0); + double m_A315(0.0); + double m_A316(0.0); + double m_A317(0.0); + double m_A318(0.0); + double m_A319(0.0); + double m_A320(0.0); + double m_A321(0.0); + double m_A322(0.0); + double m_A323(0.0); + double m_A324(0.0); + double m_A325(0.0); + double m_A326(0.0); + double m_A327(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A1 += go[0]; + m_A1 += go[1]; + m_A1 += go[2]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 -= go[3] * *cnV[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[4]; + double RHS1 = Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A5 += go[6]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A9 += go[8]; + m_A8 += go[9]; + m_A7 += go[10]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 += Idr[10]; + RHS3 += Idr[11]; + RHS3 -= go[11] * *cnV[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A11 += go[12]; + double RHS4 = Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[13] * *cnV[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A14 += go[14]; + m_A15 += go[15]; + m_A13 += go[16]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + m_A16 += gt[17]; + m_A16 += gt[18]; + m_A16 += gt[19]; + m_A17 += go[17]; + m_A18 += go[18]; + double RHS6 = Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + RHS6 -= go[19] * *cnV[19]; + m_A19 += gt[20]; + m_A19 += gt[21]; + m_A19 += gt[22]; + m_A20 += go[20]; + double RHS7 = Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 -= go[21] * *cnV[21]; + RHS7 -= go[22] * *cnV[22]; + m_A21 += gt[23]; + m_A21 += gt[24]; + m_A21 += gt[25]; + m_A21 += gt[26]; + m_A21 += gt[27]; + m_A21 += gt[28]; + m_A21 += gt[29]; + m_A23 += go[23]; + m_A24 += go[24]; + m_A25 += go[25]; + m_A22 += go[26]; + double RHS8 = Idr[23]; + RHS8 += Idr[24]; + RHS8 += Idr[25]; + RHS8 += Idr[26]; + RHS8 += Idr[27]; + RHS8 += Idr[28]; + RHS8 += Idr[29]; + RHS8 -= go[27] * *cnV[27]; + RHS8 -= go[28] * *cnV[28]; + RHS8 -= go[29] * *cnV[29]; + m_A26 += gt[30]; + m_A26 += gt[31]; + m_A26 += gt[32]; + m_A26 += gt[33]; + m_A26 += gt[34]; + m_A27 += go[30]; + m_A27 += go[31]; + m_A29 += go[32]; + m_A28 += go[33]; + double RHS9 = Idr[30]; + RHS9 += Idr[31]; + RHS9 += Idr[32]; + RHS9 += Idr[33]; + RHS9 += Idr[34]; + RHS9 -= go[34] * *cnV[34]; + m_A30 += gt[35]; + m_A30 += gt[36]; + m_A30 += gt[37]; + m_A30 += gt[38]; + m_A30 += gt[39]; + m_A30 += gt[40]; + m_A30 += gt[41]; + m_A32 += go[35]; + m_A33 += go[36]; + m_A34 += go[37]; + m_A31 += go[38]; + double RHS10 = Idr[35]; + RHS10 += Idr[36]; + RHS10 += Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 -= go[39] * *cnV[39]; + RHS10 -= go[40] * *cnV[40]; + RHS10 -= go[41] * *cnV[41]; + m_A35 += gt[42]; + m_A35 += gt[43]; + m_A35 += gt[44]; + m_A36 += go[42]; + double RHS11 = Idr[42]; + RHS11 += Idr[43]; + RHS11 += Idr[44]; + RHS11 -= go[43] * *cnV[43]; + RHS11 -= go[44] * *cnV[44]; + m_A37 += gt[45]; + m_A37 += gt[46]; + m_A37 += gt[47]; + m_A37 += gt[48]; + m_A37 += gt[49]; + m_A40 += go[45]; + m_A39 += go[46]; + m_A38 += go[47]; + double RHS12 = Idr[45]; + RHS12 += Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 += Idr[49]; + RHS12 -= go[48] * *cnV[48]; + RHS12 -= go[49] * *cnV[49]; + m_A41 += gt[50]; + m_A41 += gt[51]; + m_A41 += gt[52]; + m_A41 += gt[53]; + m_A43 += go[50]; + m_A42 += go[51]; + double RHS13 = Idr[50]; + RHS13 += Idr[51]; + RHS13 += Idr[52]; + RHS13 += Idr[53]; + RHS13 -= go[52] * *cnV[52]; + RHS13 -= go[53] * *cnV[53]; + m_A44 += gt[54]; + m_A44 += gt[55]; + m_A44 += gt[56]; + m_A45 += go[54]; + m_A46 += go[55]; + double RHS14 = Idr[54]; + RHS14 += Idr[55]; + RHS14 += Idr[56]; + RHS14 -= go[56] * *cnV[56]; + m_A47 += gt[57]; + m_A47 += gt[58]; + m_A47 += gt[59]; + m_A47 += gt[60]; + m_A48 += go[57]; + m_A48 += go[58]; + m_A49 += go[59]; + double RHS15 = Idr[57]; + RHS15 += Idr[58]; + RHS15 += Idr[59]; + RHS15 += Idr[60]; + RHS15 -= go[60] * *cnV[60]; + m_A50 += gt[61]; + m_A50 += gt[62]; + m_A51 += go[61]; + m_A52 += go[62]; + double RHS16 = Idr[61]; + RHS16 += Idr[62]; + m_A53 += gt[63]; + m_A53 += gt[64]; + m_A53 += gt[65]; + m_A54 += go[63]; + m_A55 += go[64]; + m_A56 += go[65]; + double RHS17 = Idr[63]; + RHS17 += Idr[64]; + RHS17 += Idr[65]; + m_A57 += gt[66]; + m_A57 += gt[67]; + m_A57 += gt[68]; + m_A57 += gt[69]; + m_A59 += go[66]; + m_A58 += go[67]; + m_A60 += go[68]; + double RHS18 = Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 -= go[69] * *cnV[69]; + m_A61 += gt[70]; + m_A61 += gt[71]; + m_A61 += gt[72]; + m_A61 += gt[73]; + m_A61 += gt[74]; + m_A61 += gt[75]; + m_A62 += go[70]; + m_A66 += go[71]; + m_A65 += go[72]; + m_A63 += go[73]; + m_A64 += go[74]; + double RHS19 = Idr[70]; + RHS19 += Idr[71]; + RHS19 += Idr[72]; + RHS19 += Idr[73]; + RHS19 += Idr[74]; + RHS19 += Idr[75]; + RHS19 -= go[75] * *cnV[75]; + m_A67 += gt[76]; + m_A67 += gt[77]; + m_A67 += gt[78]; + m_A67 += gt[79]; + m_A68 += go[76]; + m_A70 += go[77]; + m_A69 += go[78]; + double RHS20 = Idr[76]; + RHS20 += Idr[77]; + RHS20 += Idr[78]; + RHS20 += Idr[79]; + RHS20 -= go[79] * *cnV[79]; + m_A71 += gt[80]; + m_A71 += gt[81]; + m_A71 += gt[82]; + m_A71 += gt[83]; + m_A73 += go[80]; + m_A72 += go[81]; + double RHS21 = Idr[80]; + RHS21 += Idr[81]; + RHS21 += Idr[82]; + RHS21 += Idr[83]; + RHS21 -= go[82] * *cnV[82]; + RHS21 -= go[83] * *cnV[83]; + m_A74 += gt[84]; + m_A74 += gt[85]; + m_A74 += gt[86]; + m_A74 += gt[87]; + m_A75 += go[84]; + m_A76 += go[85]; + double RHS22 = Idr[84]; + RHS22 += Idr[85]; + RHS22 += Idr[86]; + RHS22 += Idr[87]; + RHS22 -= go[86] * *cnV[86]; + RHS22 -= go[87] * *cnV[87]; + m_A78 += gt[88]; + m_A78 += gt[89]; + m_A78 += gt[90]; + m_A77 += go[88]; + m_A77 += go[89]; + m_A77 += go[90]; + double RHS23 = Idr[88]; + RHS23 += Idr[89]; + RHS23 += Idr[90]; + m_A81 += gt[91]; + m_A81 += gt[92]; + m_A81 += gt[93]; + m_A81 += gt[94]; + m_A80 += go[91]; + m_A79 += go[92]; + double RHS24 = Idr[91]; + RHS24 += Idr[92]; + RHS24 += Idr[93]; + RHS24 += Idr[94]; + RHS24 -= go[93] * *cnV[93]; + RHS24 -= go[94] * *cnV[94]; + m_A84 += gt[95]; + m_A84 += gt[96]; + m_A84 += gt[97]; + m_A84 += gt[98]; + m_A85 += go[95]; + m_A86 += go[96]; + double RHS25 = Idr[95]; + RHS25 += Idr[96]; + RHS25 += Idr[97]; + RHS25 += Idr[98]; + RHS25 -= go[97] * *cnV[97]; + RHS25 -= go[98] * *cnV[98]; + m_A89 += gt[99]; + m_A89 += gt[100]; + m_A89 += gt[101]; + m_A87 += go[99]; + m_A88 += go[100]; + double RHS26 = Idr[99]; + RHS26 += Idr[100]; + RHS26 += Idr[101]; + RHS26 -= go[101] * *cnV[101]; + m_A95 += gt[102]; + m_A95 += gt[103]; + m_A95 += gt[104]; + m_A95 += gt[105]; + m_A93 += go[102]; + m_A92 += go[103]; + double RHS27 = Idr[102]; + RHS27 += Idr[103]; + RHS27 += Idr[104]; + RHS27 += Idr[105]; + RHS27 -= go[104] * *cnV[104]; + RHS27 -= go[105] * *cnV[105]; + m_A102 += gt[106]; + m_A102 += gt[107]; + m_A102 += gt[108]; + m_A102 += gt[109]; + m_A102 += gt[110]; + m_A102 += gt[111]; + m_A102 += gt[112]; + m_A100 += go[106]; + m_A101 += go[107]; + m_A101 += go[108]; + double RHS28 = Idr[106]; + RHS28 += Idr[107]; + RHS28 += Idr[108]; + RHS28 += Idr[109]; + RHS28 += Idr[110]; + RHS28 += Idr[111]; + RHS28 += Idr[112]; + RHS28 -= go[109] * *cnV[109]; + RHS28 -= go[110] * *cnV[110]; + RHS28 -= go[111] * *cnV[111]; + RHS28 -= go[112] * *cnV[112]; + m_A107 += gt[113]; + m_A107 += gt[114]; + m_A107 += gt[115]; + m_A108 += go[113]; + m_A105 += go[114]; + double RHS29 = Idr[113]; + RHS29 += Idr[114]; + RHS29 += Idr[115]; + RHS29 -= go[115] * *cnV[115]; + m_A115 += gt[116]; + m_A115 += gt[117]; + m_A115 += gt[118]; + m_A115 += gt[119]; + m_A110 += go[116]; + m_A111 += go[117]; + m_A109 += go[118]; + double RHS30 = Idr[116]; + RHS30 += Idr[117]; + RHS30 += Idr[118]; + RHS30 += Idr[119]; + RHS30 -= go[119] * *cnV[119]; + m_A122 += gt[120]; + m_A122 += gt[121]; + m_A122 += gt[122]; + m_A122 += gt[123]; + m_A120 += go[120]; + m_A121 += go[121]; + m_A123 += go[122]; + double RHS31 = Idr[120]; + RHS31 += Idr[121]; + RHS31 += Idr[122]; + RHS31 += Idr[123]; + RHS31 -= go[123] * *cnV[123]; + m_A128 += gt[124]; + m_A128 += gt[125]; + m_A128 += gt[126]; + m_A128 += gt[127]; + m_A124 += go[124]; + m_A125 += go[125]; + double RHS32 = Idr[124]; + RHS32 += Idr[125]; + RHS32 += Idr[126]; + RHS32 += Idr[127]; + RHS32 -= go[126] * *cnV[126]; + RHS32 -= go[127] * *cnV[127]; + m_A136 += gt[128]; + m_A136 += gt[129]; + m_A136 += gt[130]; + m_A136 += gt[131]; + m_A141 += go[128]; + m_A134 += go[129]; + double RHS33 = Idr[128]; + RHS33 += Idr[129]; + RHS33 += Idr[130]; + RHS33 += Idr[131]; + RHS33 -= go[130] * *cnV[130]; + RHS33 -= go[131] * *cnV[131]; + m_A144 += gt[132]; + m_A144 += gt[133]; + m_A144 += gt[134]; + m_A144 += gt[135]; + m_A144 += gt[136]; + m_A144 += gt[137]; + m_A144 += gt[138]; + m_A143 += go[132]; + m_A143 += go[133]; + m_A142 += go[134]; + double RHS34 = Idr[132]; + RHS34 += Idr[133]; + RHS34 += Idr[134]; + RHS34 += Idr[135]; + RHS34 += Idr[136]; + RHS34 += Idr[137]; + RHS34 += Idr[138]; + RHS34 -= go[135] * *cnV[135]; + RHS34 -= go[136] * *cnV[136]; + RHS34 -= go[137] * *cnV[137]; + RHS34 -= go[138] * *cnV[138]; + m_A148 += gt[139]; + m_A148 += gt[140]; + m_A148 += gt[141]; + m_A148 += gt[142]; + m_A146 += go[139]; + m_A150 += go[140]; + m_A149 += go[141]; + double RHS35 = Idr[139]; + RHS35 += Idr[140]; + RHS35 += Idr[141]; + RHS35 += Idr[142]; + RHS35 -= go[142] * *cnV[142]; + m_A152 += gt[143]; + m_A152 += gt[144]; + m_A154 += go[143]; + m_A151 += go[144]; + double RHS36 = Idr[143]; + RHS36 += Idr[144]; + m_A157 += gt[145]; + m_A157 += gt[146]; + m_A157 += gt[147]; + m_A157 += gt[148]; + m_A157 += gt[149]; + m_A157 += gt[150]; + m_A157 += gt[151]; + m_A156 += go[145]; + m_A155 += go[146]; + double RHS37 = Idr[145]; + RHS37 += Idr[146]; + RHS37 += Idr[147]; + RHS37 += Idr[148]; + RHS37 += Idr[149]; + RHS37 += Idr[150]; + RHS37 += Idr[151]; + RHS37 -= go[147] * *cnV[147]; + RHS37 -= go[148] * *cnV[148]; + RHS37 -= go[149] * *cnV[149]; + RHS37 -= go[150] * *cnV[150]; + RHS37 -= go[151] * *cnV[151]; + m_A166 += gt[152]; + m_A166 += gt[153]; + m_A166 += gt[154]; + m_A166 += gt[155]; + m_A166 += gt[156]; + m_A166 += gt[157]; + m_A166 += gt[158]; + m_A166 += gt[159]; + m_A160 += go[152]; + m_A159 += go[153]; + m_A168 += go[154]; + m_A158 += go[155]; + m_A169 += go[156]; + double RHS38 = Idr[152]; + RHS38 += Idr[153]; + RHS38 += Idr[154]; + RHS38 += Idr[155]; + RHS38 += Idr[156]; + RHS38 += Idr[157]; + RHS38 += Idr[158]; + RHS38 += Idr[159]; + RHS38 -= go[157] * *cnV[157]; + RHS38 -= go[158] * *cnV[158]; + RHS38 -= go[159] * *cnV[159]; + m_A173 += gt[160]; + m_A173 += gt[161]; + m_A173 += gt[162]; + m_A173 += gt[163]; + m_A171 += go[160]; + m_A174 += go[161]; + m_A172 += go[162]; + double RHS39 = Idr[160]; + RHS39 += Idr[161]; + RHS39 += Idr[162]; + RHS39 += Idr[163]; + RHS39 -= go[163] * *cnV[163]; + m_A183 += gt[164]; + m_A183 += gt[165]; + m_A183 += gt[166]; + m_A181 += go[164]; + m_A180 += go[165]; + m_A179 += go[166]; + double RHS40 = Idr[164]; + RHS40 += Idr[165]; + RHS40 += Idr[166]; + m_A189 += gt[167]; + m_A189 += gt[168]; + m_A188 += go[167]; + m_A191 += go[168]; + double RHS41 = Idr[167]; + RHS41 += Idr[168]; + m_A196 += gt[169]; + m_A196 += gt[170]; + m_A196 += gt[171]; + m_A194 += go[169]; + m_A193 += go[170]; + m_A192 += go[171]; + double RHS42 = Idr[169]; + RHS42 += Idr[170]; + RHS42 += Idr[171]; + m_A203 += gt[172]; + m_A203 += gt[173]; + m_A203 += gt[174]; + m_A203 += gt[175]; + m_A203 += gt[176]; + m_A203 += gt[177]; + m_A208 += go[172]; + m_A206 += go[173]; + m_A205 += go[174]; + m_A202 += go[175]; + m_A204 += go[176]; + double RHS43 = Idr[172]; + RHS43 += Idr[173]; + RHS43 += Idr[174]; + RHS43 += Idr[175]; + RHS43 += Idr[176]; + RHS43 += Idr[177]; + RHS43 -= go[177] * *cnV[177]; + m_A213 += gt[178]; + m_A213 += gt[179]; + m_A213 += gt[180]; + m_A213 += gt[181]; + m_A211 += go[178]; + m_A210 += go[179]; + m_A209 += go[180]; + double RHS44 = Idr[178]; + RHS44 += Idr[179]; + RHS44 += Idr[180]; + RHS44 += Idr[181]; + RHS44 -= go[181] * *cnV[181]; + m_A229 += gt[182]; + m_A229 += gt[183]; + m_A229 += gt[184]; + m_A229 += gt[185]; + m_A229 += gt[186]; + m_A229 += gt[187]; + m_A222 += go[182]; + m_A226 += go[183]; + m_A219 += go[184]; + m_A217 += go[185]; + m_A218 += go[186]; + double RHS45 = Idr[182]; + RHS45 += Idr[183]; + RHS45 += Idr[184]; + RHS45 += Idr[185]; + RHS45 += Idr[186]; + RHS45 += Idr[187]; + RHS45 -= go[187] * *cnV[187]; + m_A248 += gt[188]; + m_A248 += gt[189]; + m_A248 += gt[190]; + m_A248 += gt[191]; + m_A248 += gt[192]; + m_A248 += gt[193]; + m_A244 += go[188]; + m_A236 += go[189]; + m_A235 += go[190]; + m_A239 += go[191]; + m_A234 += go[192]; + double RHS46 = Idr[188]; + RHS46 += Idr[189]; + RHS46 += Idr[190]; + RHS46 += Idr[191]; + RHS46 += Idr[192]; + RHS46 += Idr[193]; + RHS46 -= go[193] * *cnV[193]; + m_A254 += gt[194]; + m_A254 += gt[195]; + m_A254 += gt[196]; + m_A253 += go[194]; + m_A252 += go[195]; + m_A257 += go[196]; + double RHS47 = Idr[194]; + RHS47 += Idr[195]; + RHS47 += Idr[196]; + m_A270 += gt[197]; + m_A270 += gt[198]; + m_A270 += gt[199]; + m_A270 += gt[200]; + m_A261 += go[197]; + m_A260 += go[198]; + m_A267 += go[199]; + m_A259 += go[200]; + double RHS48 = Idr[197]; + RHS48 += Idr[198]; + RHS48 += Idr[199]; + RHS48 += Idr[200]; + m_A282 += gt[201]; + m_A282 += gt[202]; + m_A282 += gt[203]; + m_A282 += gt[204]; + m_A282 += gt[205]; + m_A282 += gt[206]; + m_A282 += gt[207]; + m_A285 += go[201]; + m_A276 += go[202]; + m_A278 += go[203]; + m_A275 += go[204]; + m_A284 += go[205]; + double RHS49 = Idr[201]; + RHS49 += Idr[202]; + RHS49 += Idr[203]; + RHS49 += Idr[204]; + RHS49 += Idr[205]; + RHS49 += Idr[206]; + RHS49 += Idr[207]; + RHS49 -= go[206] * *cnV[206]; + RHS49 -= go[207] * *cnV[207]; + m_A294 += gt[208]; + m_A294 += gt[209]; + m_A294 += gt[210]; + m_A294 += gt[211]; + m_A294 += gt[212]; + m_A294 += gt[213]; + m_A294 += gt[214]; + m_A296 += go[208]; + m_A286 += go[209]; + m_A289 += go[210]; + m_A287 += go[211]; + m_A295 += go[212]; + double RHS50 = Idr[208]; + RHS50 += Idr[209]; + RHS50 += Idr[210]; + RHS50 += Idr[211]; + RHS50 += Idr[212]; + RHS50 += Idr[213]; + RHS50 += Idr[214]; + RHS50 -= go[213] * *cnV[213]; + RHS50 -= go[214] * *cnV[214]; + m_A313 += gt[215]; + m_A313 += gt[216]; + m_A313 += gt[217]; + m_A313 += gt[218]; + m_A313 += gt[219]; + m_A313 += gt[220]; + m_A313 += gt[221]; + m_A313 += gt[222]; + m_A313 += gt[223]; + m_A297 += go[215]; + m_A300 += go[216]; + m_A312 += go[217]; + m_A309 += go[218]; + m_A311 += go[219]; + m_A298 += go[220]; + m_A303 += go[221]; + m_A299 += go[222]; + m_A301 += go[223]; + double RHS51 = Idr[215]; + RHS51 += Idr[216]; + RHS51 += Idr[217]; + RHS51 += Idr[218]; + RHS51 += Idr[219]; + RHS51 += Idr[220]; + RHS51 += Idr[221]; + RHS51 += Idr[222]; + RHS51 += Idr[223]; + m_A327 += gt[224]; + m_A327 += gt[225]; + m_A327 += gt[226]; + m_A327 += gt[227]; + m_A327 += gt[228]; + m_A327 += gt[229]; + m_A327 += gt[230]; + m_A327 += gt[231]; + m_A316 += go[224]; + m_A325 += go[225]; + m_A315 += go[226]; + m_A324 += go[227]; + m_A319 += go[228]; + double RHS52 = Idr[224]; + RHS52 += Idr[225]; + RHS52 += Idr[226]; + RHS52 += Idr[227]; + RHS52 += Idr[228]; + RHS52 += Idr[229]; + RHS52 += Idr[230]; + RHS52 += Idr[231]; + RHS52 -= go[229] * *cnV[229]; + RHS52 -= go[230] * *cnV[230]; + RHS52 -= go[231] * *cnV[231]; + const double f0 = 1.0 / m_A0; + const double f0_23 = -f0 * m_A77; + m_A78 += m_A1 * f0_23; + RHS23 += f0_23 * RHS0; + const double f0_37 = -f0 * m_A155; + m_A156 += m_A1 * f0_37; + RHS37 += f0_37 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_24 = -f1 * m_A79; + m_A81 += m_A3 * f1_24; + RHS24 += f1_24 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_26 = -f2 * m_A87; + m_A89 += m_A5 * f2_26; + RHS26 += f2_26 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_24 = -f3 * m_A80; + m_A81 += m_A7 * f3_24; + m_A82 += m_A8 * f3_24; + m_A83 += m_A9 * f3_24; + RHS24 += f3_24 * RHS3; + const double f3_27 = -f3 * m_A92; + m_A94 += m_A7 * f3_27; + m_A95 += m_A8 * f3_27; + m_A96 += m_A9 * f3_27; + RHS27 += f3_27 * RHS3; + const double f3_30 = -f3 * m_A109; + m_A112 += m_A7 * f3_30; + m_A113 += m_A8 * f3_30; + m_A115 += m_A9 * f3_30; + RHS30 += f3_30 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_31 = -f4 * m_A120; + m_A122 += m_A11 * f4_31; + RHS31 += f4_31 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_26 = -f5 * m_A88; + m_A89 += m_A13 * f5_26; + m_A90 += m_A14 * f5_26; + m_A91 += m_A15 * f5_26; + RHS26 += f5_26 * RHS5; + const double f5_29 = -f5 * m_A105; + m_A106 += m_A13 * f5_29; + m_A107 += m_A14 * f5_29; + m_A108 += m_A15 * f5_29; + RHS29 += f5_29 * RHS5; + const double f5_46 = -f5 * m_A234; + m_A237 += m_A13 * f5_46; + m_A239 += m_A14 * f5_46; + m_A248 += m_A15 * f5_46; + RHS46 += f5_46 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_31 = -f6 * m_A121; + m_A122 += m_A17 * f6_31; + m_A123 += m_A18 * f6_31; + RHS31 += f6_31 * RHS6; + const double f6_45 = -f6 * m_A217; + m_A222 += m_A17 * f6_45; + m_A229 += m_A18 * f6_45; + RHS45 += f6_45 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_28 = -f7 * m_A100; + m_A102 += m_A20 * f7_28; + RHS28 += f7_28 * RHS7; + const double f8 = 1.0 / m_A21; + const double f8_27 = -f8 * m_A93; + m_A95 += m_A22 * f8_27; + m_A97 += m_A23 * f8_27; + m_A98 += m_A24 * f8_27; + m_A99 += m_A25 * f8_27; + RHS27 += f8_27 * RHS8; + const double f8_38 = -f8 * m_A158; + m_A161 += m_A22 * f8_38; + m_A166 += m_A23 * f8_38; + m_A168 += m_A24 * f8_38; + m_A169 += m_A25 * f8_38; + RHS38 += f8_38 * RHS8; + const double f8_45 = -f8 * m_A218; + m_A220 += m_A22 * f8_45; + m_A226 += m_A23 * f8_45; + m_A229 += m_A24 * f8_45; + m_A230 += m_A25 * f8_45; + RHS45 += f8_45 * RHS8; + const double f8_46 = -f8 * m_A235; + m_A238 += m_A22 * f8_46; + m_A244 += m_A23 * f8_46; + m_A247 += m_A24 * f8_46; + m_A248 += m_A25 * f8_46; + RHS46 += f8_46 * RHS8; + const double f9 = 1.0 / m_A26; + const double f9_28 = -f9 * m_A101; + m_A102 += m_A27 * f9_28; + m_A103 += m_A28 * f9_28; + m_A104 += m_A29 * f9_28; + RHS28 += f9_28 * RHS9; + const double f9_30 = -f9 * m_A110; + m_A114 += m_A27 * f9_30; + m_A115 += m_A28 * f9_30; + m_A116 += m_A29 * f9_30; + RHS30 += f9_30 * RHS9; + const double f9_32 = -f9 * m_A124; + m_A126 += m_A27 * f9_32; + m_A127 += m_A28 * f9_32; + m_A128 += m_A29 * f9_32; + RHS32 += f9_32 * RHS9; + const double f10 = 1.0 / m_A30; + const double f10_30 = -f10 * m_A111; + m_A115 += m_A31 * f10_30; + m_A117 += m_A32 * f10_30; + m_A118 += m_A33 * f10_30; + m_A119 += m_A34 * f10_30; + RHS30 += f10_30 * RHS10; + const double f10_38 = -f10 * m_A159; + m_A162 += m_A31 * f10_38; + m_A166 += m_A32 * f10_38; + m_A168 += m_A33 * f10_38; + m_A169 += m_A34 * f10_38; + RHS38 += f10_38 * RHS10; + const double f10_45 = -f10 * m_A219; + m_A221 += m_A31 * f10_45; + m_A226 += m_A32 * f10_45; + m_A229 += m_A33 * f10_45; + m_A230 += m_A34 * f10_45; + RHS45 += f10_45 * RHS10; + const double f10_46 = -f10 * m_A236; + m_A240 += m_A31 * f10_46; + m_A244 += m_A32 * f10_46; + m_A247 += m_A33 * f10_46; + m_A248 += m_A34 * f10_46; + RHS46 += f10_46 * RHS10; + const double f11 = 1.0 / m_A35; + const double f11_34 = -f11 * m_A142; + m_A144 += m_A36 * f11_34; + RHS34 += f11_34 * RHS11; + const double f12 = 1.0 / m_A37; + const double f12_32 = -f12 * m_A125; + m_A128 += m_A38 * f12_32; + m_A129 += m_A39 * f12_32; + m_A130 += m_A40 * f12_32; + RHS32 += f12_32 * RHS12; + const double f12_33 = -f12 * m_A134; + m_A135 += m_A38 * f12_33; + m_A136 += m_A39 * f12_33; + m_A137 += m_A40 * f12_33; + RHS33 += f12_33 * RHS12; + const double f13 = 1.0 / m_A41; + const double f13_36 = -f13 * m_A151; + m_A152 += m_A42 * f13_36; + m_A153 += m_A43 * f13_36; + RHS36 += f13_36 * RHS13; + const double f13_44 = -f13 * m_A209; + m_A212 += m_A42 * f13_44; + m_A213 += m_A43 * f13_44; + RHS44 += f13_44 * RHS13; + const double f14 = 1.0 / m_A44; + const double f14_41 = -f14 * m_A188; + m_A189 += m_A45 * f14_41; + m_A190 += m_A46 * f14_41; + RHS41 += f14_41 * RHS14; + const double f14_48 = -f14 * m_A259; + m_A265 += m_A45 * f14_48; + m_A270 += m_A46 * f14_48; + RHS48 += f14_48 * RHS14; + const double f15 = 1.0 / m_A47; + const double f15_34 = -f15 * m_A143; + m_A144 += m_A48 * f15_34; + m_A145 += m_A49 * f15_34; + RHS34 += f15_34 * RHS15; + const double f15_35 = -f15 * m_A146; + m_A147 += m_A48 * f15_35; + m_A148 += m_A49 * f15_35; + RHS35 += f15_35 * RHS15; + const double f16 = 1.0 / m_A50; + const double f16_39 = -f16 * m_A171; + m_A173 += m_A51 * f16_39; + m_A177 += m_A52 * f16_39; + RHS39 += f16_39 * RHS16; + const double f16_51 = -f16 * m_A297; + m_A302 += m_A51 * f16_51; + m_A313 += m_A52 * f16_51; + RHS51 += f16_51 * RHS16; + const double f17 = 1.0 / m_A53; + const double f17_43 = -f17 * m_A202; + m_A203 += m_A54 * f17_43; + m_A204 += m_A55 * f17_43; + m_A207 += m_A56 * f17_43; + RHS43 += f17_43 * RHS17; + const double f17_48 = -f17 * m_A260; + m_A267 += m_A54 * f17_48; + m_A270 += m_A55 * f17_48; + m_A273 += m_A56 * f17_48; + RHS48 += f17_48 * RHS17; + const double f17_51 = -f17 * m_A298; + m_A305 += m_A54 * f17_51; + m_A310 += m_A55 * f17_51; + m_A313 += m_A56 * f17_51; + RHS51 += f17_51 * RHS17; + const double f18 = 1.0 / m_A57; + const double f18_44 = -f18 * m_A210; + m_A213 += m_A58 * f18_44; + m_A214 += m_A59 * f18_44; + m_A216 += m_A60 * f18_44; + RHS44 += f18_44 * RHS18; + const double f18_49 = -f18 * m_A275; + m_A279 += m_A58 * f18_49; + m_A282 += m_A59 * f18_49; + m_A284 += m_A60 * f18_49; + RHS49 += f18_49 * RHS18; + const double f18_51 = -f18 * m_A299; + m_A306 += m_A58 * f18_51; + m_A311 += m_A59 * f18_51; + m_A313 += m_A60 * f18_51; + RHS51 += f18_51 * RHS18; + const double f19 = 1.0 / m_A61; + const double f19_39 = -f19 * m_A172; + m_A173 += m_A62 * f19_39; + m_A174 += m_A63 * f19_39; + m_A175 += m_A64 * f19_39; + m_A176 += m_A65 * f19_39; + m_A178 += m_A66 * f19_39; + RHS39 += f19_39 * RHS19; + const double f19_47 = -f19 * m_A252; + m_A253 += m_A62 * f19_47; + m_A254 += m_A63 * f19_47; + m_A255 += m_A64 * f19_47; + m_A256 += m_A65 * f19_47; + m_A258 += m_A66 * f19_47; + RHS47 += f19_47 * RHS19; + const double f19_49 = -f19 * m_A276; + m_A277 += m_A62 * f19_49; + m_A280 += m_A63 * f19_49; + m_A282 += m_A64 * f19_49; + m_A283 += m_A65 * f19_49; + m_A285 += m_A66 * f19_49; + RHS49 += f19_49 * RHS19; + const double f19_50 = -f19 * m_A286; + m_A288 += m_A62 * f19_50; + m_A291 += m_A63 * f19_50; + m_A293 += m_A64 * f19_50; + m_A294 += m_A65 * f19_50; + m_A296 += m_A66 * f19_50; + RHS50 += f19_50 * RHS19; + const double f19_52 = -f19 * m_A315; + m_A317 += m_A62 * f19_52; + m_A322 += m_A63 * f19_52; + m_A324 += m_A64 * f19_52; + m_A325 += m_A65 * f19_52; + m_A327 += m_A66 * f19_52; + RHS52 += f19_52 * RHS19; + const double f20 = 1.0 / m_A67; + const double f20_42 = -f20 * m_A192; + m_A196 += m_A68 * f20_42; + m_A200 += m_A69 * f20_42; + m_A201 += m_A70 * f20_42; + RHS42 += f20_42 * RHS20; + const double f20_51 = -f20 * m_A300; + m_A304 += m_A68 * f20_51; + m_A313 += m_A69 * f20_51; + m_A314 += m_A70 * f20_51; + RHS51 += f20_51 * RHS20; + const double f20_52 = -f20 * m_A316; + m_A318 += m_A68 * f20_52; + m_A326 += m_A69 * f20_52; + m_A327 += m_A70 * f20_52; + RHS52 += f20_52 * RHS20; + const double f21 = 1.0 / m_A71; + const double f21_38 = -f21 * m_A160; + m_A166 += m_A72 * f21_38; + m_A167 += m_A73 * f21_38; + RHS38 += f21_38 * RHS21; + const double f21_40 = -f21 * m_A179; + m_A182 += m_A72 * f21_40; + m_A183 += m_A73 * f21_40; + RHS40 += f21_40 * RHS21; + const double f22 = 1.0 / m_A74; + const double f22_40 = -f22 * m_A180; + m_A183 += m_A75 * f22_40; + m_A184 += m_A76 * f22_40; + RHS40 += f22_40 * RHS22; + const double f22_42 = -f22 * m_A193; + m_A195 += m_A75 * f22_42; + m_A196 += m_A76 * f22_42; + RHS42 += f22_42 * RHS22; + const double f23 = 1.0 / m_A78; + const double f23_37 = -f23 * m_A156; + RHS37 += f23_37 * RHS23; + const double f24 = 1.0 / m_A81; + const double f24_27 = -f24 * m_A94; + m_A95 += m_A82 * f24_27; + m_A96 += m_A83 * f24_27; + RHS27 += f24_27 * RHS24; + const double f24_30 = -f24 * m_A112; + m_A113 += m_A82 * f24_30; + m_A115 += m_A83 * f24_30; + RHS30 += f24_30 * RHS24; + const double f25 = 1.0 / m_A84; + const double f25_40 = -f25 * m_A181; + m_A183 += m_A85 * f25_40; + m_A184 += m_A86 * f25_40; + RHS40 += f25_40 * RHS25; + const double f25_42 = -f25 * m_A194; + m_A195 += m_A85 * f25_42; + m_A196 += m_A86 * f25_42; + RHS42 += f25_42 * RHS25; + const double f26 = 1.0 / m_A89; + const double f26_29 = -f26 * m_A106; + m_A107 += m_A90 * f26_29; + m_A108 += m_A91 * f26_29; + RHS29 += f26_29 * RHS26; + const double f26_46 = -f26 * m_A237; + m_A239 += m_A90 * f26_46; + m_A248 += m_A91 * f26_46; + RHS46 += f26_46 * RHS26; + const double f27 = 1.0 / m_A95; + const double f27_30 = -f27 * m_A113; + m_A115 += m_A96 * f27_30; + m_A117 += m_A97 * f27_30; + m_A118 += m_A98 * f27_30; + m_A119 += m_A99 * f27_30; + RHS30 += f27_30 * RHS27; + const double f27_38 = -f27 * m_A161; + m_A162 += m_A96 * f27_38; + m_A166 += m_A97 * f27_38; + m_A168 += m_A98 * f27_38; + m_A169 += m_A99 * f27_38; + RHS38 += f27_38 * RHS27; + const double f27_45 = -f27 * m_A220; + m_A221 += m_A96 * f27_45; + m_A226 += m_A97 * f27_45; + m_A229 += m_A98 * f27_45; + m_A230 += m_A99 * f27_45; + RHS45 += f27_45 * RHS27; + const double f27_46 = -f27 * m_A238; + m_A240 += m_A96 * f27_46; + m_A244 += m_A97 * f27_46; + m_A247 += m_A98 * f27_46; + m_A248 += m_A99 * f27_46; + RHS46 += f27_46 * RHS27; + const double f28 = 1.0 / m_A102; + const double f28_30 = -f28 * m_A114; + m_A115 += m_A103 * f28_30; + m_A116 += m_A104 * f28_30; + RHS30 += f28_30 * RHS28; + const double f28_32 = -f28 * m_A126; + m_A127 += m_A103 * f28_32; + m_A128 += m_A104 * f28_32; + RHS32 += f28_32 * RHS28; + const double f29 = 1.0 / m_A107; + const double f29_46 = -f29 * m_A239; + m_A248 += m_A108 * f29_46; + RHS46 += f29_46 * RHS29; + const double f30 = 1.0 / m_A115; + const double f30_32 = -f30 * m_A127; + m_A128 += m_A116 * f30_32; + m_A131 += m_A117 * f30_32; + m_A132 += m_A118 * f30_32; + m_A133 += m_A119 * f30_32; + RHS32 += f30_32 * RHS30; + const double f30_38 = -f30 * m_A162; + m_A163 += m_A116 * f30_38; + m_A166 += m_A117 * f30_38; + m_A168 += m_A118 * f30_38; + m_A169 += m_A119 * f30_38; + RHS38 += f30_38 * RHS30; + const double f30_45 = -f30 * m_A221; + m_A223 += m_A116 * f30_45; + m_A226 += m_A117 * f30_45; + m_A229 += m_A118 * f30_45; + m_A230 += m_A119 * f30_45; + RHS45 += f30_45 * RHS30; + const double f30_46 = -f30 * m_A240; + m_A241 += m_A116 * f30_46; + m_A244 += m_A117 * f30_46; + m_A247 += m_A118 * f30_46; + m_A248 += m_A119 * f30_46; + RHS46 += f30_46 * RHS30; + const double f31 = 1.0 / m_A122; + const double f31_45 = -f31 * m_A222; + m_A229 += m_A123 * f31_45; + RHS45 += f31_45 * RHS31; + const double f32 = 1.0 / m_A128; + const double f32_33 = -f32 * m_A135; + m_A136 += m_A129 * f32_33; + m_A137 += m_A130 * f32_33; + m_A138 += m_A131 * f32_33; + m_A139 += m_A132 * f32_33; + m_A140 += m_A133 * f32_33; + RHS33 += f32_33 * RHS32; + const double f32_38 = -f32 * m_A163; + m_A164 += m_A129 * f32_38; + m_A165 += m_A130 * f32_38; + m_A166 += m_A131 * f32_38; + m_A168 += m_A132 * f32_38; + m_A169 += m_A133 * f32_38; + RHS38 += f32_38 * RHS32; + const double f32_45 = -f32 * m_A223; + m_A224 += m_A129 * f32_45; + m_A225 += m_A130 * f32_45; + m_A226 += m_A131 * f32_45; + m_A229 += m_A132 * f32_45; + m_A230 += m_A133 * f32_45; + RHS45 += f32_45 * RHS32; + const double f32_46 = -f32 * m_A241; + m_A242 += m_A129 * f32_46; + m_A243 += m_A130 * f32_46; + m_A244 += m_A131 * f32_46; + m_A247 += m_A132 * f32_46; + m_A248 += m_A133 * f32_46; + RHS46 += f32_46 * RHS32; + const double f33 = 1.0 / m_A136; + const double f33_38 = -f33 * m_A164; + m_A165 += m_A137 * f33_38; + m_A166 += m_A138 * f33_38; + m_A168 += m_A139 * f33_38; + m_A169 += m_A140 * f33_38; + m_A170 += m_A141 * f33_38; + RHS38 += f33_38 * RHS33; + const double f33_45 = -f33 * m_A224; + m_A225 += m_A137 * f33_45; + m_A226 += m_A138 * f33_45; + m_A229 += m_A139 * f33_45; + m_A230 += m_A140 * f33_45; + m_A231 += m_A141 * f33_45; + RHS45 += f33_45 * RHS33; + const double f33_46 = -f33 * m_A242; + m_A243 += m_A137 * f33_46; + m_A244 += m_A138 * f33_46; + m_A247 += m_A139 * f33_46; + m_A248 += m_A140 * f33_46; + m_A249 += m_A141 * f33_46; + RHS46 += f33_46 * RHS33; + const double f33_48 = -f33 * m_A261; + m_A262 += m_A137 * f33_48; + m_A263 += m_A138 * f33_48; + m_A268 += m_A139 * f33_48; + m_A269 += m_A140 * f33_48; + m_A270 += m_A141 * f33_48; + RHS48 += f33_48 * RHS33; + const double f34 = 1.0 / m_A144; + const double f34_35 = -f34 * m_A147; + m_A148 += m_A145 * f34_35; + RHS35 += f34_35 * RHS34; + const double f35 = 1.0 / m_A148; + const double f35_44 = -f35 * m_A211; + m_A213 += m_A149 * f35_44; + m_A215 += m_A150 * f35_44; + RHS44 += f35_44 * RHS35; + const double f35_50 = -f35 * m_A287; + m_A290 += m_A149 * f35_50; + m_A294 += m_A150 * f35_50; + RHS50 += f35_50 * RHS35; + const double f36 = 1.0 / m_A152; + const double f36_44 = -f36 * m_A212; + m_A213 += m_A153 * f36_44; + m_A216 += m_A154 * f36_44; + RHS44 += f36_44 * RHS36; + const double f36_51 = -f36 * m_A301; + m_A306 += m_A153 * f36_51; + m_A313 += m_A154 * f36_51; + RHS51 += f36_51 * RHS36; + const double f37 = 1.0 / m_A157; + const double f37_38 = -f37 * m_A165; + RHS38 += f37_38 * RHS37; + const double f37_45 = -f37 * m_A225; + RHS45 += f37_45 * RHS37; + const double f37_46 = -f37 * m_A243; + RHS46 += f37_46 * RHS37; + const double f37_48 = -f37 * m_A262; + RHS48 += f37_48 * RHS37; + const double f38 = 1.0 / m_A166; + const double f38_40 = -f38 * m_A182; + m_A183 += m_A167 * f38_40; + m_A185 += m_A168 * f38_40; + m_A186 += m_A169 * f38_40; + m_A187 += m_A170 * f38_40; + RHS40 += f38_40 * RHS38; + const double f38_45 = -f38 * m_A226; + m_A227 += m_A167 * f38_45; + m_A229 += m_A168 * f38_45; + m_A230 += m_A169 * f38_45; + m_A231 += m_A170 * f38_45; + RHS45 += f38_45 * RHS38; + const double f38_46 = -f38 * m_A244; + m_A245 += m_A167 * f38_46; + m_A247 += m_A168 * f38_46; + m_A248 += m_A169 * f38_46; + m_A249 += m_A170 * f38_46; + RHS46 += f38_46 * RHS38; + const double f38_48 = -f38 * m_A263; + m_A264 += m_A167 * f38_48; + m_A268 += m_A168 * f38_48; + m_A269 += m_A169 * f38_48; + m_A270 += m_A170 * f38_48; + RHS48 += f38_48 * RHS38; + const double f39 = 1.0 / m_A173; + const double f39_47 = -f39 * m_A253; + m_A254 += m_A174 * f39_47; + m_A255 += m_A175 * f39_47; + m_A256 += m_A176 * f39_47; + m_A257 += m_A177 * f39_47; + m_A258 += m_A178 * f39_47; + RHS47 += f39_47 * RHS39; + const double f39_49 = -f39 * m_A277; + m_A280 += m_A174 * f39_49; + m_A282 += m_A175 * f39_49; + m_A283 += m_A176 * f39_49; + m_A284 += m_A177 * f39_49; + m_A285 += m_A178 * f39_49; + RHS49 += f39_49 * RHS39; + const double f39_50 = -f39 * m_A288; + m_A291 += m_A174 * f39_50; + m_A293 += m_A175 * f39_50; + m_A294 += m_A176 * f39_50; + m_A295 += m_A177 * f39_50; + m_A296 += m_A178 * f39_50; + RHS50 += f39_50 * RHS39; + const double f39_51 = -f39 * m_A302; + m_A309 += m_A174 * f39_51; + m_A311 += m_A175 * f39_51; + m_A312 += m_A176 * f39_51; + m_A313 += m_A177 * f39_51; + m_A314 += m_A178 * f39_51; + RHS51 += f39_51 * RHS39; + const double f39_52 = -f39 * m_A317; + m_A322 += m_A174 * f39_52; + m_A324 += m_A175 * f39_52; + m_A325 += m_A176 * f39_52; + m_A326 += m_A177 * f39_52; + m_A327 += m_A178 * f39_52; + RHS52 += f39_52 * RHS39; + const double f40 = 1.0 / m_A183; + const double f40_42 = -f40 * m_A195; + m_A196 += m_A184 * f40_42; + m_A197 += m_A185 * f40_42; + m_A198 += m_A186 * f40_42; + m_A199 += m_A187 * f40_42; + RHS42 += f40_42 * RHS40; + const double f40_45 = -f40 * m_A227; + m_A228 += m_A184 * f40_45; + m_A229 += m_A185 * f40_45; + m_A230 += m_A186 * f40_45; + m_A231 += m_A187 * f40_45; + RHS45 += f40_45 * RHS40; + const double f40_46 = -f40 * m_A245; + m_A246 += m_A184 * f40_46; + m_A247 += m_A185 * f40_46; + m_A248 += m_A186 * f40_46; + m_A249 += m_A187 * f40_46; + RHS46 += f40_46 * RHS40; + const double f40_48 = -f40 * m_A264; + m_A266 += m_A184 * f40_48; + m_A268 += m_A185 * f40_48; + m_A269 += m_A186 * f40_48; + m_A270 += m_A187 * f40_48; + RHS48 += f40_48 * RHS40; + const double f41 = 1.0 / m_A189; + const double f41_48 = -f41 * m_A265; + m_A270 += m_A190 * f41_48; + m_A273 += m_A191 * f41_48; + RHS48 += f41_48 * RHS41; + const double f41_51 = -f41 * m_A303; + m_A310 += m_A190 * f41_51; + m_A313 += m_A191 * f41_51; + RHS51 += f41_51 * RHS41; + const double f42 = 1.0 / m_A196; + const double f42_45 = -f42 * m_A228; + m_A229 += m_A197 * f42_45; + m_A230 += m_A198 * f42_45; + m_A231 += m_A199 * f42_45; + m_A232 += m_A200 * f42_45; + m_A233 += m_A201 * f42_45; + RHS45 += f42_45 * RHS42; + const double f42_46 = -f42 * m_A246; + m_A247 += m_A197 * f42_46; + m_A248 += m_A198 * f42_46; + m_A249 += m_A199 * f42_46; + m_A250 += m_A200 * f42_46; + m_A251 += m_A201 * f42_46; + RHS46 += f42_46 * RHS42; + const double f42_48 = -f42 * m_A266; + m_A268 += m_A197 * f42_48; + m_A269 += m_A198 * f42_48; + m_A270 += m_A199 * f42_48; + m_A273 += m_A200 * f42_48; + m_A274 += m_A201 * f42_48; + RHS48 += f42_48 * RHS42; + const double f42_51 = -f42 * m_A304; + m_A307 += m_A197 * f42_51; + m_A308 += m_A198 * f42_51; + m_A310 += m_A199 * f42_51; + m_A313 += m_A200 * f42_51; + m_A314 += m_A201 * f42_51; + RHS51 += f42_51 * RHS42; + const double f42_52 = -f42 * m_A318; + m_A320 += m_A197 * f42_52; + m_A321 += m_A198 * f42_52; + m_A323 += m_A199 * f42_52; + m_A326 += m_A200 * f42_52; + m_A327 += m_A201 * f42_52; + RHS52 += f42_52 * RHS42; + const double f43 = 1.0 / m_A203; + const double f43_48 = -f43 * m_A267; + m_A270 += m_A204 * f43_48; + m_A271 += m_A205 * f43_48; + m_A272 += m_A206 * f43_48; + m_A273 += m_A207 * f43_48; + m_A274 += m_A208 * f43_48; + RHS48 += f43_48 * RHS43; + const double f43_49 = -f43 * m_A278; + m_A281 += m_A204 * f43_49; + m_A282 += m_A205 * f43_49; + m_A283 += m_A206 * f43_49; + m_A284 += m_A207 * f43_49; + m_A285 += m_A208 * f43_49; + RHS49 += f43_49 * RHS43; + const double f43_50 = -f43 * m_A289; + m_A292 += m_A204 * f43_50; + m_A293 += m_A205 * f43_50; + m_A294 += m_A206 * f43_50; + m_A295 += m_A207 * f43_50; + m_A296 += m_A208 * f43_50; + RHS50 += f43_50 * RHS43; + const double f43_51 = -f43 * m_A305; + m_A310 += m_A204 * f43_51; + m_A311 += m_A205 * f43_51; + m_A312 += m_A206 * f43_51; + m_A313 += m_A207 * f43_51; + m_A314 += m_A208 * f43_51; + RHS51 += f43_51 * RHS43; + const double f43_52 = -f43 * m_A319; + m_A323 += m_A204 * f43_52; + m_A324 += m_A205 * f43_52; + m_A325 += m_A206 * f43_52; + m_A326 += m_A207 * f43_52; + m_A327 += m_A208 * f43_52; + RHS52 += f43_52 * RHS43; + const double f44 = 1.0 / m_A213; + const double f44_49 = -f44 * m_A279; + m_A282 += m_A214 * f44_49; + m_A283 += m_A215 * f44_49; + m_A284 += m_A216 * f44_49; + RHS49 += f44_49 * RHS44; + const double f44_50 = -f44 * m_A290; + m_A293 += m_A214 * f44_50; + m_A294 += m_A215 * f44_50; + m_A295 += m_A216 * f44_50; + RHS50 += f44_50 * RHS44; + const double f44_51 = -f44 * m_A306; + m_A311 += m_A214 * f44_51; + m_A312 += m_A215 * f44_51; + m_A313 += m_A216 * f44_51; + RHS51 += f44_51 * RHS44; + const double f45 = 1.0 / m_A229; + const double f45_46 = -f45 * m_A247; + m_A248 += m_A230 * f45_46; + m_A249 += m_A231 * f45_46; + m_A250 += m_A232 * f45_46; + m_A251 += m_A233 * f45_46; + RHS46 += f45_46 * RHS45; + const double f45_48 = -f45 * m_A268; + m_A269 += m_A230 * f45_48; + m_A270 += m_A231 * f45_48; + m_A273 += m_A232 * f45_48; + m_A274 += m_A233 * f45_48; + RHS48 += f45_48 * RHS45; + const double f45_51 = -f45 * m_A307; + m_A308 += m_A230 * f45_51; + m_A310 += m_A231 * f45_51; + m_A313 += m_A232 * f45_51; + m_A314 += m_A233 * f45_51; + RHS51 += f45_51 * RHS45; + const double f45_52 = -f45 * m_A320; + m_A321 += m_A230 * f45_52; + m_A323 += m_A231 * f45_52; + m_A326 += m_A232 * f45_52; + m_A327 += m_A233 * f45_52; + RHS52 += f45_52 * RHS45; + const double f46 = 1.0 / m_A248; + const double f46_48 = -f46 * m_A269; + m_A270 += m_A249 * f46_48; + m_A273 += m_A250 * f46_48; + m_A274 += m_A251 * f46_48; + RHS48 += f46_48 * RHS46; + const double f46_51 = -f46 * m_A308; + m_A310 += m_A249 * f46_51; + m_A313 += m_A250 * f46_51; + m_A314 += m_A251 * f46_51; + RHS51 += f46_51 * RHS46; + const double f46_52 = -f46 * m_A321; + m_A323 += m_A249 * f46_52; + m_A326 += m_A250 * f46_52; + m_A327 += m_A251 * f46_52; + RHS52 += f46_52 * RHS46; + const double f47 = 1.0 / m_A254; + const double f47_49 = -f47 * m_A280; + m_A282 += m_A255 * f47_49; + m_A283 += m_A256 * f47_49; + m_A284 += m_A257 * f47_49; + m_A285 += m_A258 * f47_49; + RHS49 += f47_49 * RHS47; + const double f47_50 = -f47 * m_A291; + m_A293 += m_A255 * f47_50; + m_A294 += m_A256 * f47_50; + m_A295 += m_A257 * f47_50; + m_A296 += m_A258 * f47_50; + RHS50 += f47_50 * RHS47; + const double f47_51 = -f47 * m_A309; + m_A311 += m_A255 * f47_51; + m_A312 += m_A256 * f47_51; + m_A313 += m_A257 * f47_51; + m_A314 += m_A258 * f47_51; + RHS51 += f47_51 * RHS47; + const double f47_52 = -f47 * m_A322; + m_A324 += m_A255 * f47_52; + m_A325 += m_A256 * f47_52; + m_A326 += m_A257 * f47_52; + m_A327 += m_A258 * f47_52; + RHS52 += f47_52 * RHS47; + const double f48 = 1.0 / m_A270; + const double f48_49 = -f48 * m_A281; + m_A282 += m_A271 * f48_49; + m_A283 += m_A272 * f48_49; + m_A284 += m_A273 * f48_49; + m_A285 += m_A274 * f48_49; + RHS49 += f48_49 * RHS48; + const double f48_50 = -f48 * m_A292; + m_A293 += m_A271 * f48_50; + m_A294 += m_A272 * f48_50; + m_A295 += m_A273 * f48_50; + m_A296 += m_A274 * f48_50; + RHS50 += f48_50 * RHS48; + const double f48_51 = -f48 * m_A310; + m_A311 += m_A271 * f48_51; + m_A312 += m_A272 * f48_51; + m_A313 += m_A273 * f48_51; + m_A314 += m_A274 * f48_51; + RHS51 += f48_51 * RHS48; + const double f48_52 = -f48 * m_A323; + m_A324 += m_A271 * f48_52; + m_A325 += m_A272 * f48_52; + m_A326 += m_A273 * f48_52; + m_A327 += m_A274 * f48_52; + RHS52 += f48_52 * RHS48; + const double f49 = 1.0 / m_A282; + const double f49_50 = -f49 * m_A293; + m_A294 += m_A283 * f49_50; + m_A295 += m_A284 * f49_50; + m_A296 += m_A285 * f49_50; + RHS50 += f49_50 * RHS49; + const double f49_51 = -f49 * m_A311; + m_A312 += m_A283 * f49_51; + m_A313 += m_A284 * f49_51; + m_A314 += m_A285 * f49_51; + RHS51 += f49_51 * RHS49; + const double f49_52 = -f49 * m_A324; + m_A325 += m_A283 * f49_52; + m_A326 += m_A284 * f49_52; + m_A327 += m_A285 * f49_52; + RHS52 += f49_52 * RHS49; + const double f50 = 1.0 / m_A294; + const double f50_51 = -f50 * m_A312; + m_A313 += m_A295 * f50_51; + m_A314 += m_A296 * f50_51; + RHS51 += f50_51 * RHS50; + const double f50_52 = -f50 * m_A325; + m_A326 += m_A295 * f50_52; + m_A327 += m_A296 * f50_52; + RHS52 += f50_52 * RHS50; + const double f51 = 1.0 / m_A313; + const double f51_52 = -f51 * m_A326; + m_A327 += m_A314 * f51_52; + RHS52 += f51_52 * RHS51; + V[52] = RHS52 / m_A327; + double tmp51 = 0.0; + tmp51 += m_A314 * V[52]; + V[51] = (RHS51 - tmp51) / m_A313; + double tmp50 = 0.0; + tmp50 += m_A295 * V[51]; + tmp50 += m_A296 * V[52]; + V[50] = (RHS50 - tmp50) / m_A294; + double tmp49 = 0.0; + tmp49 += m_A283 * V[50]; + tmp49 += m_A284 * V[51]; + tmp49 += m_A285 * V[52]; + V[49] = (RHS49 - tmp49) / m_A282; + double tmp48 = 0.0; + tmp48 += m_A271 * V[49]; + tmp48 += m_A272 * V[50]; + tmp48 += m_A273 * V[51]; + tmp48 += m_A274 * V[52]; + V[48] = (RHS48 - tmp48) / m_A270; + double tmp47 = 0.0; + tmp47 += m_A255 * V[49]; + tmp47 += m_A256 * V[50]; + tmp47 += m_A257 * V[51]; + tmp47 += m_A258 * V[52]; + V[47] = (RHS47 - tmp47) / m_A254; + double tmp46 = 0.0; + tmp46 += m_A249 * V[48]; + tmp46 += m_A250 * V[51]; + tmp46 += m_A251 * V[52]; + V[46] = (RHS46 - tmp46) / m_A248; + double tmp45 = 0.0; + tmp45 += m_A230 * V[46]; + tmp45 += m_A231 * V[48]; + tmp45 += m_A232 * V[51]; + tmp45 += m_A233 * V[52]; + V[45] = (RHS45 - tmp45) / m_A229; + double tmp44 = 0.0; + tmp44 += m_A214 * V[49]; + tmp44 += m_A215 * V[50]; + tmp44 += m_A216 * V[51]; + V[44] = (RHS44 - tmp44) / m_A213; + double tmp43 = 0.0; + tmp43 += m_A204 * V[48]; + tmp43 += m_A205 * V[49]; + tmp43 += m_A206 * V[50]; + tmp43 += m_A207 * V[51]; + tmp43 += m_A208 * V[52]; + V[43] = (RHS43 - tmp43) / m_A203; + double tmp42 = 0.0; + tmp42 += m_A197 * V[45]; + tmp42 += m_A198 * V[46]; + tmp42 += m_A199 * V[48]; + tmp42 += m_A200 * V[51]; + tmp42 += m_A201 * V[52]; + V[42] = (RHS42 - tmp42) / m_A196; + double tmp41 = 0.0; + tmp41 += m_A190 * V[48]; + tmp41 += m_A191 * V[51]; + V[41] = (RHS41 - tmp41) / m_A189; + double tmp40 = 0.0; + tmp40 += m_A184 * V[42]; + tmp40 += m_A185 * V[45]; + tmp40 += m_A186 * V[46]; + tmp40 += m_A187 * V[48]; + V[40] = (RHS40 - tmp40) / m_A183; + double tmp39 = 0.0; + tmp39 += m_A174 * V[47]; + tmp39 += m_A175 * V[49]; + tmp39 += m_A176 * V[50]; + tmp39 += m_A177 * V[51]; + tmp39 += m_A178 * V[52]; + V[39] = (RHS39 - tmp39) / m_A173; + double tmp38 = 0.0; + tmp38 += m_A167 * V[40]; + tmp38 += m_A168 * V[45]; + tmp38 += m_A169 * V[46]; + tmp38 += m_A170 * V[48]; + V[38] = (RHS38 - tmp38) / m_A166; + double tmp37 = 0.0; + V[37] = (RHS37 - tmp37) / m_A157; + double tmp36 = 0.0; + tmp36 += m_A153 * V[44]; + tmp36 += m_A154 * V[51]; + V[36] = (RHS36 - tmp36) / m_A152; + double tmp35 = 0.0; + tmp35 += m_A149 * V[44]; + tmp35 += m_A150 * V[50]; + V[35] = (RHS35 - tmp35) / m_A148; + double tmp34 = 0.0; + tmp34 += m_A145 * V[35]; + V[34] = (RHS34 - tmp34) / m_A144; + double tmp33 = 0.0; + tmp33 += m_A137 * V[37]; + tmp33 += m_A138 * V[38]; + tmp33 += m_A139 * V[45]; + tmp33 += m_A140 * V[46]; + tmp33 += m_A141 * V[48]; + V[33] = (RHS33 - tmp33) / m_A136; + double tmp32 = 0.0; + tmp32 += m_A129 * V[33]; + tmp32 += m_A130 * V[37]; + tmp32 += m_A131 * V[38]; + tmp32 += m_A132 * V[45]; + tmp32 += m_A133 * V[46]; + V[32] = (RHS32 - tmp32) / m_A128; + double tmp31 = 0.0; + tmp31 += m_A123 * V[45]; + V[31] = (RHS31 - tmp31) / m_A122; + double tmp30 = 0.0; + tmp30 += m_A116 * V[32]; + tmp30 += m_A117 * V[38]; + tmp30 += m_A118 * V[45]; + tmp30 += m_A119 * V[46]; + V[30] = (RHS30 - tmp30) / m_A115; + double tmp29 = 0.0; + tmp29 += m_A108 * V[46]; + V[29] = (RHS29 - tmp29) / m_A107; + double tmp28 = 0.0; + tmp28 += m_A103 * V[30]; + tmp28 += m_A104 * V[32]; + V[28] = (RHS28 - tmp28) / m_A102; + double tmp27 = 0.0; + tmp27 += m_A96 * V[30]; + tmp27 += m_A97 * V[38]; + tmp27 += m_A98 * V[45]; + tmp27 += m_A99 * V[46]; + V[27] = (RHS27 - tmp27) / m_A95; + double tmp26 = 0.0; + tmp26 += m_A90 * V[29]; + tmp26 += m_A91 * V[46]; + V[26] = (RHS26 - tmp26) / m_A89; + double tmp25 = 0.0; + tmp25 += m_A85 * V[40]; + tmp25 += m_A86 * V[42]; + V[25] = (RHS25 - tmp25) / m_A84; + double tmp24 = 0.0; + tmp24 += m_A82 * V[27]; + tmp24 += m_A83 * V[30]; + V[24] = (RHS24 - tmp24) / m_A81; + double tmp23 = 0.0; + V[23] = (RHS23 - tmp23) / m_A78; + double tmp22 = 0.0; + tmp22 += m_A75 * V[40]; + tmp22 += m_A76 * V[42]; + V[22] = (RHS22 - tmp22) / m_A74; + double tmp21 = 0.0; + tmp21 += m_A72 * V[38]; + tmp21 += m_A73 * V[40]; + V[21] = (RHS21 - tmp21) / m_A71; + double tmp20 = 0.0; + tmp20 += m_A68 * V[42]; + tmp20 += m_A69 * V[51]; + tmp20 += m_A70 * V[52]; + V[20] = (RHS20 - tmp20) / m_A67; + double tmp19 = 0.0; + tmp19 += m_A62 * V[39]; + tmp19 += m_A63 * V[47]; + tmp19 += m_A64 * V[49]; + tmp19 += m_A65 * V[50]; + tmp19 += m_A66 * V[52]; + V[19] = (RHS19 - tmp19) / m_A61; + double tmp18 = 0.0; + tmp18 += m_A58 * V[44]; + tmp18 += m_A59 * V[49]; + tmp18 += m_A60 * V[51]; + V[18] = (RHS18 - tmp18) / m_A57; + double tmp17 = 0.0; + tmp17 += m_A54 * V[43]; + tmp17 += m_A55 * V[48]; + tmp17 += m_A56 * V[51]; + V[17] = (RHS17 - tmp17) / m_A53; + double tmp16 = 0.0; + tmp16 += m_A51 * V[39]; + tmp16 += m_A52 * V[51]; + V[16] = (RHS16 - tmp16) / m_A50; + double tmp15 = 0.0; + tmp15 += m_A48 * V[34]; + tmp15 += m_A49 * V[35]; + V[15] = (RHS15 - tmp15) / m_A47; + double tmp14 = 0.0; + tmp14 += m_A45 * V[41]; + tmp14 += m_A46 * V[48]; + V[14] = (RHS14 - tmp14) / m_A44; + double tmp13 = 0.0; + tmp13 += m_A42 * V[36]; + tmp13 += m_A43 * V[44]; + V[13] = (RHS13 - tmp13) / m_A41; + double tmp12 = 0.0; + tmp12 += m_A38 * V[32]; + tmp12 += m_A39 * V[33]; + tmp12 += m_A40 * V[37]; + V[12] = (RHS12 - tmp12) / m_A37; + double tmp11 = 0.0; + tmp11 += m_A36 * V[34]; + V[11] = (RHS11 - tmp11) / m_A35; + double tmp10 = 0.0; + tmp10 += m_A31 * V[30]; + tmp10 += m_A32 * V[38]; + tmp10 += m_A33 * V[45]; + tmp10 += m_A34 * V[46]; + V[10] = (RHS10 - tmp10) / m_A30; + double tmp9 = 0.0; + tmp9 += m_A27 * V[28]; + tmp9 += m_A28 * V[30]; + tmp9 += m_A29 * V[32]; + V[9] = (RHS9 - tmp9) / m_A26; + double tmp8 = 0.0; + tmp8 += m_A22 * V[27]; + tmp8 += m_A23 * V[38]; + tmp8 += m_A24 * V[45]; + tmp8 += m_A25 * V[46]; + V[8] = (RHS8 - tmp8) / m_A21; + double tmp7 = 0.0; + tmp7 += m_A20 * V[28]; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A17 * V[31]; + tmp6 += m_A18 * V[45]; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A13 * V[26]; + tmp5 += m_A14 * V[29]; + tmp5 += m_A15 * V[46]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A11 * V[31]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A7 * V[24]; + tmp3 += m_A8 * V[27]; + tmp3 += m_A9 * V[30]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[26]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[24]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[23]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tank +static void nl_gcr_36_double_double_a63d1344e34bef4b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + m_A1 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A6 += go[5]; + m_A6 += go[6]; + m_A7 += go[7]; + m_A7 += go[8]; + m_A5 += go[9]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + m_A8 += gt[10]; + m_A8 += gt[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[10]; + m_A9 += go[11]; + m_A10 += go[12]; + double RHS3 = Idr[10]; + RHS3 += Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A11 += gt[18]; + m_A12 += go[15]; + m_A12 += go[16]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + m_A15 += gt[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A14 += go[19]; + m_A13 += go[20]; + m_A13 += go[21]; + double RHS5 = Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A19 += gt[26]; + m_A19 += gt[27]; + m_A18 += go[24]; + m_A20 += go[25]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + m_A23 += gt[28]; + m_A23 += gt[29]; + m_A23 += gt[30]; + m_A24 += go[28]; + m_A21 += go[29]; + m_A21 += go[30]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + m_A27 += gt[31]; + m_A27 += gt[32]; + m_A27 += gt[33]; + m_A27 += gt[34]; + m_A27 += gt[35]; + m_A27 += gt[36]; + m_A27 += gt[37]; + m_A27 += gt[38]; + m_A26 += go[31]; + m_A26 += go[32]; + m_A25 += go[33]; + m_A25 += go[34]; + double RHS8 = Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 += Idr[38]; + RHS8 -= go[35] * *cnV[35]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + RHS8 -= go[38] * *cnV[38]; + m_A35 += gt[39]; + m_A35 += gt[40]; + m_A35 += gt[41]; + m_A35 += gt[42]; + m_A35 += gt[43]; + m_A33 += go[39]; + m_A30 += go[40]; + m_A32 += go[41]; + m_A29 += go[42]; + m_A29 += go[43]; + double RHS9 = Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + RHS9 += Idr[42]; + RHS9 += Idr[43]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A13; + m_A15 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_6 = -f1 * m_A18; + m_A19 += m_A3 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_5 = -f2 * m_A14; + m_A15 += m_A5 * f2_5; + m_A16 += m_A6 * f2_5; + m_A17 += m_A7 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_7 = -f2 * m_A21; + m_A22 += m_A5 * f2_7; + m_A23 += m_A6 * f2_7; + m_A24 += m_A7 * f2_7; + RHS7 += f2_7 * RHS2; + const double f2_9 = -f2 * m_A29; + m_A31 += m_A5 * f2_9; + m_A33 += m_A6 * f2_9; + m_A35 += m_A7 * f2_9; + RHS9 += f2_9 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_8 = -f3 * m_A25; + m_A27 += m_A9 * f3_8; + m_A28 += m_A10 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A30; + m_A34 += m_A9 * f3_9; + m_A35 += m_A10 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A11; + const double f4_8 = -f4 * m_A26; + m_A27 += m_A12 * f4_8; + RHS8 += f4_8 * RHS4; + const double f5 = 1.0 / m_A15; + const double f5_7 = -f5 * m_A22; + m_A23 += m_A16 * f5_7; + m_A24 += m_A17 * f5_7; + RHS7 += f5_7 * RHS5; + const double f5_9 = -f5 * m_A31; + m_A33 += m_A16 * f5_9; + m_A35 += m_A17 * f5_9; + RHS9 += f5_9 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_9 = -f6 * m_A32; + m_A35 += m_A20 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A23; + const double f7_9 = -f7 * m_A33; + m_A35 += m_A24 * f7_9; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A27; + const double f8_9 = -f8 * m_A34; + m_A35 += m_A28 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A35; + double tmp8 = 0.0; + tmp8 += m_A28 * V[9]; + V[8] = (RHS8 - tmp8) / m_A27; + double tmp7 = 0.0; + tmp7 += m_A24 * V[9]; + V[7] = (RHS7 - tmp7) / m_A23; + double tmp6 = 0.0; + tmp6 += m_A20 * V[9]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A16 * V[7]; + tmp5 += m_A17 * V[9]; + V[5] = (RHS5 - tmp5) / m_A15; + double tmp4 = 0.0; + tmp4 += m_A12 * V[8]; + V[4] = (RHS4 - tmp4) / m_A11; + double tmp3 = 0.0; + tmp3 += m_A9 * V[8]; + tmp3 += m_A10 * V[9]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[5]; + tmp2 += m_A6 * V[7]; + tmp2 += m_A7 * V[9]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[6]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tankbatt +static void nl_gcr_137_double_double_328d886b444b586b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A4 += gt[7]; + m_A4 += gt[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[7]; + m_A7 += go[8]; + m_A6 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + m_A8 += gt[12]; + m_A8 += gt[13]; + m_A8 += gt[14]; + m_A9 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A10 += gt[18]; + m_A10 += gt[19]; + m_A10 += gt[20]; + m_A10 += gt[21]; + m_A11 += go[15]; + m_A12 += go[16]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[17] * *cnV[17]; + RHS4 -= go[18] * *cnV[18]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A13 += gt[22]; + m_A13 += gt[23]; + m_A13 += gt[24]; + m_A14 += go[22]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 -= go[23] * *cnV[23]; + RHS5 -= go[24] * *cnV[24]; + m_A15 += gt[25]; + m_A15 += gt[26]; + m_A15 += gt[27]; + m_A16 += go[25]; + double RHS6 = Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + m_A17 += gt[28]; + m_A17 += gt[29]; + m_A17 += gt[30]; + m_A19 += go[28]; + m_A18 += go[29]; + double RHS7 = Idr[28]; + RHS7 += Idr[29]; + RHS7 += Idr[30]; + RHS7 -= go[30] * *cnV[30]; + m_A20 += gt[31]; + m_A20 += gt[32]; + m_A20 += gt[33]; + m_A21 += go[31]; + double RHS8 = Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 -= go[32] * *cnV[32]; + RHS8 -= go[33] * *cnV[33]; + m_A22 += gt[34]; + m_A22 += gt[35]; + m_A22 += gt[36]; + m_A24 += go[34]; + m_A23 += go[35]; + double RHS9 = Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 -= go[36] * *cnV[36]; + m_A25 += gt[37]; + m_A25 += gt[38]; + m_A25 += gt[39]; + m_A25 += gt[40]; + m_A25 += gt[41]; + m_A25 += gt[42]; + m_A25 += gt[43]; + m_A27 += go[37]; + m_A26 += go[38]; + double RHS10 = Idr[37]; + RHS10 += Idr[38]; + RHS10 += Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 += Idr[43]; + RHS10 -= go[39] * *cnV[39]; + RHS10 -= go[40] * *cnV[40]; + RHS10 -= go[41] * *cnV[41]; + RHS10 -= go[42] * *cnV[42]; + RHS10 -= go[43] * *cnV[43]; + m_A28 += gt[44]; + m_A28 += gt[45]; + m_A28 += gt[46]; + m_A28 += gt[47]; + m_A28 += gt[48]; + m_A28 += gt[49]; + m_A30 += go[44]; + m_A31 += go[45]; + m_A29 += go[46]; + double RHS11 = Idr[44]; + RHS11 += Idr[45]; + RHS11 += Idr[46]; + RHS11 += Idr[47]; + RHS11 += Idr[48]; + RHS11 += Idr[49]; + RHS11 -= go[47] * *cnV[47]; + RHS11 -= go[48] * *cnV[48]; + RHS11 -= go[49] * *cnV[49]; + m_A32 += gt[50]; + m_A32 += gt[51]; + m_A32 += gt[52]; + m_A32 += gt[53]; + m_A35 += go[50]; + m_A34 += go[51]; + m_A33 += go[52]; + double RHS12 = Idr[50]; + RHS12 += Idr[51]; + RHS12 += Idr[52]; + RHS12 += Idr[53]; + RHS12 -= go[53] * *cnV[53]; + m_A36 += gt[54]; + m_A36 += gt[55]; + m_A36 += gt[56]; + m_A37 += go[54]; + double RHS13 = Idr[54]; + RHS13 += Idr[55]; + RHS13 += Idr[56]; + RHS13 -= go[55] * *cnV[55]; + RHS13 -= go[56] * *cnV[56]; + m_A38 += gt[57]; + m_A38 += gt[58]; + m_A38 += gt[59]; + m_A39 += go[57]; + double RHS14 = Idr[57]; + RHS14 += Idr[58]; + RHS14 += Idr[59]; + RHS14 -= go[58] * *cnV[58]; + RHS14 -= go[59] * *cnV[59]; + m_A44 += gt[60]; + m_A44 += gt[61]; + m_A41 += go[60]; + m_A40 += go[61]; + double RHS15 = Idr[60]; + RHS15 += Idr[61]; + m_A50 += gt[62]; + m_A50 += gt[63]; + m_A49 += go[62]; + m_A48 += go[63]; + double RHS16 = Idr[62]; + RHS16 += Idr[63]; + m_A52 += gt[64]; + m_A52 += gt[65]; + m_A52 += gt[66]; + m_A52 += gt[67]; + m_A55 += go[64]; + m_A54 += go[65]; + m_A53 += go[66]; + double RHS17 = Idr[64]; + RHS17 += Idr[65]; + RHS17 += Idr[66]; + RHS17 += Idr[67]; + RHS17 -= go[67] * *cnV[67]; + m_A58 += gt[68]; + m_A58 += gt[69]; + m_A57 += go[68]; + m_A56 += go[69]; + double RHS18 = Idr[68]; + RHS18 += Idr[69]; + m_A60 += gt[70]; + m_A60 += gt[71]; + m_A60 += gt[72]; + m_A61 += go[70]; + double RHS19 = Idr[70]; + RHS19 += Idr[71]; + RHS19 += Idr[72]; + RHS19 -= go[71] * *cnV[71]; + RHS19 -= go[72] * *cnV[72]; + m_A63 += gt[73]; + m_A63 += gt[74]; + m_A64 += go[73]; + m_A62 += go[74]; + double RHS20 = Idr[73]; + RHS20 += Idr[74]; + m_A66 += gt[75]; + m_A66 += gt[76]; + m_A67 += go[75]; + m_A65 += go[76]; + double RHS21 = Idr[75]; + RHS21 += Idr[76]; + m_A73 += gt[77]; + m_A73 += gt[78]; + m_A73 += gt[79]; + m_A73 += gt[80]; + m_A71 += go[77]; + m_A69 += go[78]; + m_A68 += go[79]; + m_A68 += go[80]; + double RHS22 = Idr[77]; + RHS22 += Idr[78]; + RHS22 += Idr[79]; + RHS22 += Idr[80]; + m_A79 += gt[81]; + m_A79 += gt[82]; + m_A77 += go[81]; + m_A76 += go[82]; + double RHS23 = Idr[81]; + RHS23 += Idr[82]; + m_A84 += gt[83]; + m_A84 += gt[84]; + m_A84 += gt[85]; + m_A84 += gt[86]; + m_A84 += gt[87]; + m_A84 += gt[88]; + m_A84 += gt[89]; + m_A85 += go[83]; + m_A82 += go[84]; + double RHS24 = Idr[83]; + RHS24 += Idr[84]; + RHS24 += Idr[85]; + RHS24 += Idr[86]; + RHS24 += Idr[87]; + RHS24 += Idr[88]; + RHS24 += Idr[89]; + RHS24 -= go[85] * *cnV[85]; + RHS24 -= go[86] * *cnV[86]; + RHS24 -= go[87] * *cnV[87]; + RHS24 -= go[88] * *cnV[88]; + RHS24 -= go[89] * *cnV[89]; + m_A91 += gt[90]; + m_A91 += gt[91]; + m_A91 += gt[92]; + m_A93 += go[90]; + m_A88 += go[91]; + m_A87 += go[92]; + double RHS25 = Idr[90]; + RHS25 += Idr[91]; + RHS25 += Idr[92]; + m_A97 += gt[93]; + m_A97 += gt[94]; + m_A96 += go[93]; + m_A94 += go[94]; + double RHS26 = Idr[93]; + RHS26 += Idr[94]; + m_A105 += gt[95]; + m_A105 += gt[96]; + m_A105 += gt[97]; + m_A107 += go[95]; + m_A101 += go[96]; + m_A100 += go[97]; + double RHS27 = Idr[95]; + RHS27 += Idr[96]; + RHS27 += Idr[97]; + m_A111 += gt[98]; + m_A111 += gt[99]; + m_A111 += gt[100]; + m_A111 += gt[101]; + m_A111 += gt[102]; + m_A112 += go[98]; + m_A110 += go[99]; + m_A109 += go[100]; + m_A108 += go[101]; + double RHS28 = Idr[98]; + RHS28 += Idr[99]; + RHS28 += Idr[100]; + RHS28 += Idr[101]; + RHS28 += Idr[102]; + RHS28 -= go[102] * *cnV[102]; + m_A118 += gt[103]; + m_A118 += gt[104]; + m_A118 += gt[105]; + m_A118 += gt[106]; + m_A118 += gt[107]; + m_A118 += gt[108]; + m_A115 += go[103]; + m_A120 += go[104]; + m_A116 += go[105]; + m_A113 += go[106]; + double RHS29 = Idr[103]; + RHS29 += Idr[104]; + RHS29 += Idr[105]; + RHS29 += Idr[106]; + RHS29 += Idr[107]; + RHS29 += Idr[108]; + RHS29 -= go[107] * *cnV[107]; + RHS29 -= go[108] * *cnV[108]; + m_A129 += gt[109]; + m_A129 += gt[110]; + m_A129 += gt[111]; + m_A129 += gt[112]; + m_A129 += gt[113]; + m_A129 += gt[114]; + m_A121 += go[109]; + m_A130 += go[110]; + m_A127 += go[111]; + m_A123 += go[112]; + double RHS30 = Idr[109]; + RHS30 += Idr[110]; + RHS30 += Idr[111]; + RHS30 += Idr[112]; + RHS30 += Idr[113]; + RHS30 += Idr[114]; + RHS30 -= go[113] * *cnV[113]; + RHS30 -= go[114] * *cnV[114]; + m_A136 += gt[115]; + m_A136 += gt[116]; + m_A136 += gt[117]; + m_A136 += gt[118]; + m_A136 += gt[119]; + m_A133 += go[115]; + m_A134 += go[116]; + m_A135 += go[117]; + m_A132 += go[118]; + m_A131 += go[119]; + double RHS31 = Idr[115]; + RHS31 += Idr[116]; + RHS31 += Idr[117]; + RHS31 += Idr[118]; + RHS31 += Idr[119]; + const double f0 = 1.0 / m_A0; + const double f0_15 = -f0 * m_A40; + m_A44 += m_A1 * f0_15; + RHS15 += f0_15 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_22 = -f1 * m_A68; + m_A73 += m_A3 * f1_22; + RHS22 += f1_22 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_15 = -f2 * m_A41; + m_A42 += m_A5 * f2_15; + m_A44 += m_A6 * f2_15; + m_A45 += m_A7 * f2_15; + RHS15 += f2_15 * RHS2; + const double f2_22 = -f2 * m_A69; + m_A70 += m_A5 * f2_22; + m_A72 += m_A6 * f2_22; + m_A73 += m_A7 * f2_22; + RHS22 += f2_22 * RHS2; + const double f3 = 1.0 / m_A8; + const double f3_16 = -f3 * m_A48; + m_A50 += m_A9 * f3_16; + RHS16 += f3_16 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_15 = -f4 * m_A42; + m_A43 += m_A11 * f4_15; + m_A45 += m_A12 * f4_15; + RHS15 += f4_15 * RHS4; + const double f4_22 = -f4 * m_A70; + m_A71 += m_A11 * f4_22; + m_A73 += m_A12 * f4_22; + RHS22 += f4_22 * RHS4; + const double f5 = 1.0 / m_A13; + const double f5_20 = -f5 * m_A62; + m_A63 += m_A14 * f5_20; + RHS20 += f5_20 * RHS5; + const double f6 = 1.0 / m_A15; + const double f6_18 = -f6 * m_A56; + m_A58 += m_A16 * f6_18; + RHS18 += f6_18 * RHS6; + const double f7 = 1.0 / m_A17; + const double f7_16 = -f7 * m_A49; + m_A50 += m_A18 * f7_16; + m_A51 += m_A19 * f7_16; + RHS16 += f7_16 * RHS7; + const double f7_26 = -f7 * m_A94; + m_A95 += m_A18 * f7_26; + m_A97 += m_A19 * f7_26; + RHS26 += f7_26 * RHS7; + const double f8 = 1.0 / m_A20; + const double f8_21 = -f8 * m_A65; + m_A66 += m_A21 * f8_21; + RHS21 += f8_21 * RHS8; + const double f9 = 1.0 / m_A22; + const double f9_18 = -f9 * m_A57; + m_A58 += m_A23 * f9_18; + m_A59 += m_A24 * f9_18; + RHS18 += f9_18 * RHS9; + const double f9_23 = -f9 * m_A76; + m_A78 += m_A23 * f9_23; + m_A79 += m_A24 * f9_23; + RHS23 += f9_23 * RHS9; + const double f10 = 1.0 / m_A25; + const double f10_30 = -f10 * m_A121; + m_A122 += m_A26 * f10_30; + m_A127 += m_A27 * f10_30; + RHS30 += f10_30 * RHS10; + const double f11 = 1.0 / m_A28; + const double f11_15 = -f11 * m_A43; + m_A45 += m_A29 * f11_15; + m_A46 += m_A30 * f11_15; + m_A47 += m_A31 * f11_15; + RHS15 += f11_15 * RHS11; + const double f11_22 = -f11 * m_A71; + m_A73 += m_A29 * f11_22; + m_A74 += m_A30 * f11_22; + m_A75 += m_A31 * f11_22; + RHS22 += f11_22 * RHS11; + const double f11_24 = -f11 * m_A82; + m_A83 += m_A29 * f11_24; + m_A85 += m_A30 * f11_24; + m_A86 += m_A31 * f11_24; + RHS24 += f11_24 * RHS11; + const double f11_25 = -f11 * m_A87; + m_A89 += m_A29 * f11_25; + m_A91 += m_A30 * f11_25; + m_A92 += m_A31 * f11_25; + RHS25 += f11_25 * RHS11; + const double f11_27 = -f11 * m_A100; + m_A102 += m_A29 * f11_27; + m_A103 += m_A30 * f11_27; + m_A105 += m_A31 * f11_27; + RHS27 += f11_27 * RHS11; + const double f11_30 = -f11 * m_A122; + m_A124 += m_A29 * f11_30; + m_A125 += m_A30 * f11_30; + m_A127 += m_A31 * f11_30; + RHS30 += f11_30 * RHS11; + const double f12 = 1.0 / m_A32; + const double f12_23 = -f12 * m_A77; + m_A79 += m_A33 * f12_23; + m_A80 += m_A34 * f12_23; + m_A81 += m_A35 * f12_23; + RHS23 += f12_23 * RHS12; + const double f12_25 = -f12 * m_A88; + m_A90 += m_A33 * f12_25; + m_A91 += m_A34 * f12_25; + m_A93 += m_A35 * f12_25; + RHS25 += f12_25 * RHS12; + const double f12_29 = -f12 * m_A113; + m_A114 += m_A33 * f12_29; + m_A116 += m_A34 * f12_29; + m_A118 += m_A35 * f12_29; + RHS29 += f12_29 * RHS12; + const double f13 = 1.0 / m_A36; + const double f13_28 = -f13 * m_A108; + m_A111 += m_A37 * f13_28; + RHS28 += f13_28 * RHS13; + const double f14 = 1.0 / m_A38; + const double f14_28 = -f14 * m_A109; + m_A111 += m_A39 * f14_28; + RHS28 += f14_28 * RHS14; + const double f15 = 1.0 / m_A44; + const double f15_22 = -f15 * m_A72; + m_A73 += m_A45 * f15_22; + m_A74 += m_A46 * f15_22; + m_A75 += m_A47 * f15_22; + RHS22 += f15_22 * RHS15; + const double f16 = 1.0 / m_A50; + const double f16_26 = -f16 * m_A95; + m_A97 += m_A51 * f16_26; + RHS26 += f16_26 * RHS16; + const double f17 = 1.0 / m_A52; + const double f17_26 = -f17 * m_A96; + m_A97 += m_A53 * f17_26; + m_A98 += m_A54 * f17_26; + m_A99 += m_A55 * f17_26; + RHS26 += f17_26 * RHS17; + const double f17_27 = -f17 * m_A101; + m_A104 += m_A53 * f17_27; + m_A105 += m_A54 * f17_27; + m_A107 += m_A55 * f17_27; + RHS27 += f17_27 * RHS17; + const double f17_30 = -f17 * m_A123; + m_A126 += m_A53 * f17_30; + m_A127 += m_A54 * f17_30; + m_A129 += m_A55 * f17_30; + RHS30 += f17_30 * RHS17; + const double f18 = 1.0 / m_A58; + const double f18_23 = -f18 * m_A78; + m_A79 += m_A59 * f18_23; + RHS23 += f18_23 * RHS18; + const double f19 = 1.0 / m_A60; + const double f19_28 = -f19 * m_A110; + m_A111 += m_A61 * f19_28; + RHS28 += f19_28 * RHS19; + const double f20 = 1.0 / m_A63; + const double f20_31 = -f20 * m_A131; + m_A136 += m_A64 * f20_31; + RHS31 += f20_31 * RHS20; + const double f21 = 1.0 / m_A66; + const double f21_31 = -f21 * m_A132; + m_A136 += m_A67 * f21_31; + RHS31 += f21_31 * RHS21; + const double f22 = 1.0 / m_A73; + const double f22_24 = -f22 * m_A83; + m_A85 += m_A74 * f22_24; + m_A86 += m_A75 * f22_24; + RHS24 += f22_24 * RHS22; + const double f22_25 = -f22 * m_A89; + m_A91 += m_A74 * f22_25; + m_A92 += m_A75 * f22_25; + RHS25 += f22_25 * RHS22; + const double f22_27 = -f22 * m_A102; + m_A103 += m_A74 * f22_27; + m_A105 += m_A75 * f22_27; + RHS27 += f22_27 * RHS22; + const double f22_30 = -f22 * m_A124; + m_A125 += m_A74 * f22_30; + m_A127 += m_A75 * f22_30; + RHS30 += f22_30 * RHS22; + const double f23 = 1.0 / m_A79; + const double f23_25 = -f23 * m_A90; + m_A91 += m_A80 * f23_25; + m_A93 += m_A81 * f23_25; + RHS25 += f23_25 * RHS23; + const double f23_29 = -f23 * m_A114; + m_A116 += m_A80 * f23_29; + m_A118 += m_A81 * f23_29; + RHS29 += f23_29 * RHS23; + const double f24 = 1.0 / m_A84; + const double f24_29 = -f24 * m_A115; + m_A116 += m_A85 * f24_29; + m_A117 += m_A86 * f24_29; + RHS29 += f24_29 * RHS24; + const double f25 = 1.0 / m_A91; + const double f25_27 = -f25 * m_A103; + m_A105 += m_A92 * f25_27; + m_A106 += m_A93 * f25_27; + RHS27 += f25_27 * RHS25; + const double f25_29 = -f25 * m_A116; + m_A117 += m_A92 * f25_29; + m_A118 += m_A93 * f25_29; + RHS29 += f25_29 * RHS25; + const double f25_30 = -f25 * m_A125; + m_A127 += m_A92 * f25_30; + m_A128 += m_A93 * f25_30; + RHS30 += f25_30 * RHS25; + const double f26 = 1.0 / m_A97; + const double f26_27 = -f26 * m_A104; + m_A105 += m_A98 * f26_27; + m_A107 += m_A99 * f26_27; + RHS27 += f26_27 * RHS26; + const double f26_30 = -f26 * m_A126; + m_A127 += m_A98 * f26_30; + m_A129 += m_A99 * f26_30; + RHS30 += f26_30 * RHS26; + const double f27 = 1.0 / m_A105; + const double f27_29 = -f27 * m_A117; + m_A118 += m_A106 * f27_29; + m_A119 += m_A107 * f27_29; + RHS29 += f27_29 * RHS27; + const double f27_30 = -f27 * m_A127; + m_A128 += m_A106 * f27_30; + m_A129 += m_A107 * f27_30; + RHS30 += f27_30 * RHS27; + const double f28 = 1.0 / m_A111; + const double f28_31 = -f28 * m_A133; + m_A136 += m_A112 * f28_31; + RHS31 += f28_31 * RHS28; + const double f29 = 1.0 / m_A118; + const double f29_30 = -f29 * m_A128; + m_A129 += m_A119 * f29_30; + m_A130 += m_A120 * f29_30; + RHS30 += f29_30 * RHS29; + const double f29_31 = -f29 * m_A134; + m_A135 += m_A119 * f29_31; + m_A136 += m_A120 * f29_31; + RHS31 += f29_31 * RHS29; + const double f30 = 1.0 / m_A129; + const double f30_31 = -f30 * m_A135; + m_A136 += m_A130 * f30_31; + RHS31 += f30_31 * RHS30; + V[31] = RHS31 / m_A136; + double tmp30 = 0.0; + tmp30 += m_A130 * V[31]; + V[30] = (RHS30 - tmp30) / m_A129; + double tmp29 = 0.0; + tmp29 += m_A119 * V[30]; + tmp29 += m_A120 * V[31]; + V[29] = (RHS29 - tmp29) / m_A118; + double tmp28 = 0.0; + tmp28 += m_A112 * V[31]; + V[28] = (RHS28 - tmp28) / m_A111; + double tmp27 = 0.0; + tmp27 += m_A106 * V[29]; + tmp27 += m_A107 * V[30]; + V[27] = (RHS27 - tmp27) / m_A105; + double tmp26 = 0.0; + tmp26 += m_A98 * V[27]; + tmp26 += m_A99 * V[30]; + V[26] = (RHS26 - tmp26) / m_A97; + double tmp25 = 0.0; + tmp25 += m_A92 * V[27]; + tmp25 += m_A93 * V[29]; + V[25] = (RHS25 - tmp25) / m_A91; + double tmp24 = 0.0; + tmp24 += m_A85 * V[25]; + tmp24 += m_A86 * V[27]; + V[24] = (RHS24 - tmp24) / m_A84; + double tmp23 = 0.0; + tmp23 += m_A80 * V[25]; + tmp23 += m_A81 * V[29]; + V[23] = (RHS23 - tmp23) / m_A79; + double tmp22 = 0.0; + tmp22 += m_A74 * V[25]; + tmp22 += m_A75 * V[27]; + V[22] = (RHS22 - tmp22) / m_A73; + double tmp21 = 0.0; + tmp21 += m_A67 * V[31]; + V[21] = (RHS21 - tmp21) / m_A66; + double tmp20 = 0.0; + tmp20 += m_A64 * V[31]; + V[20] = (RHS20 - tmp20) / m_A63; + double tmp19 = 0.0; + tmp19 += m_A61 * V[28]; + V[19] = (RHS19 - tmp19) / m_A60; + double tmp18 = 0.0; + tmp18 += m_A59 * V[23]; + V[18] = (RHS18 - tmp18) / m_A58; + double tmp17 = 0.0; + tmp17 += m_A53 * V[26]; + tmp17 += m_A54 * V[27]; + tmp17 += m_A55 * V[30]; + V[17] = (RHS17 - tmp17) / m_A52; + double tmp16 = 0.0; + tmp16 += m_A51 * V[26]; + V[16] = (RHS16 - tmp16) / m_A50; + double tmp15 = 0.0; + tmp15 += m_A45 * V[22]; + tmp15 += m_A46 * V[25]; + tmp15 += m_A47 * V[27]; + V[15] = (RHS15 - tmp15) / m_A44; + double tmp14 = 0.0; + tmp14 += m_A39 * V[28]; + V[14] = (RHS14 - tmp14) / m_A38; + double tmp13 = 0.0; + tmp13 += m_A37 * V[28]; + V[13] = (RHS13 - tmp13) / m_A36; + double tmp12 = 0.0; + tmp12 += m_A33 * V[23]; + tmp12 += m_A34 * V[25]; + tmp12 += m_A35 * V[29]; + V[12] = (RHS12 - tmp12) / m_A32; + double tmp11 = 0.0; + tmp11 += m_A29 * V[22]; + tmp11 += m_A30 * V[25]; + tmp11 += m_A31 * V[27]; + V[11] = (RHS11 - tmp11) / m_A28; + double tmp10 = 0.0; + tmp10 += m_A26 * V[11]; + tmp10 += m_A27 * V[27]; + V[10] = (RHS10 - tmp10) / m_A25; + double tmp9 = 0.0; + tmp9 += m_A23 * V[18]; + tmp9 += m_A24 * V[23]; + V[9] = (RHS9 - tmp9) / m_A22; + double tmp8 = 0.0; + tmp8 += m_A21 * V[21]; + V[8] = (RHS8 - tmp8) / m_A20; + double tmp7 = 0.0; + tmp7 += m_A18 * V[16]; + tmp7 += m_A19 * V[26]; + V[7] = (RHS7 - tmp7) / m_A17; + double tmp6 = 0.0; + tmp6 += m_A16 * V[18]; + V[6] = (RHS6 - tmp6) / m_A15; + double tmp5 = 0.0; + tmp5 += m_A14 * V[20]; + V[5] = (RHS5 - tmp5) / m_A13; + double tmp4 = 0.0; + tmp4 += m_A11 * V[11]; + tmp4 += m_A12 * V[22]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A9 * V[16]; + V[3] = (RHS3 - tmp3) / m_A8; + double tmp2 = 0.0; + tmp2 += m_A5 * V[4]; + tmp2 += m_A6 * V[15]; + tmp2 += m_A7 * V[22]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[22]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[15]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tankbatt +static void nl_gcr_16_double_double_124f7aa10f044582(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A3 += go[3]; + m_A4 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A5 += gt[10]; + m_A5 += gt[11]; + m_A5 += gt[12]; + m_A5 += gt[13]; + m_A7 += go[10]; + m_A6 += go[11]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A10 += gt[16]; + m_A10 += gt[17]; + m_A11 += go[14]; + m_A9 += go[15]; + m_A8 += go[16]; + double RHS3 = Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[17] * *cnV[17]; + m_A15 += gt[18]; + m_A15 += gt[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A15 += gt[22]; + m_A15 += gt[23]; + m_A12 += go[18]; + m_A13 += go[19]; + m_A14 += go[20]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A10 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_4 = -f1 * m_A12; + m_A13 += m_A3 * f1_4; + m_A14 += m_A4 * f1_4; + RHS4 += f1_4 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A9; + m_A10 += m_A6 * f2_3; + m_A11 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + const double f2_4 = -f2 * m_A13; + m_A14 += m_A6 * f2_4; + m_A15 += m_A7 * f2_4; + RHS4 += f2_4 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_4 = -f3 * m_A14; + m_A15 += m_A11 * f3_4; + RHS4 += f3_4 * RHS3; + V[4] = RHS4 / m_A15; + double tmp3 = 0.0; + tmp3 += m_A11 * V[4]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + tmp2 += m_A7 * V[4]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tp1985 +static void nl_gcr_10_double_double_73f2ba8ad4a45b26(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A6 += go[6]; + m_A4 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A7 += go[8]; + m_A8 += go[9]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tp1985 +static void nl_gcr_26_double_double_a4540ffea06b4346(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + m_A2 += go[1]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + m_A3 += gt[2]; + m_A3 += gt[3]; + m_A3 += gt[4]; + m_A4 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A6 += go[5]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[6] * *cnV[6]; + RHS2 -= go[7] * *cnV[7]; + m_A7 += gt[8]; + m_A7 += gt[9]; + m_A8 += go[8]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + RHS3 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A11 += go[10]; + m_A9 += go[11]; + double RHS4 = Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 -= go[12] * *cnV[12]; + RHS4 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A13 += go[14]; + m_A15 += go[15]; + double RHS5 = Idr[14]; + RHS5 += Idr[15]; + m_A19 += gt[16]; + m_A19 += gt[17]; + m_A19 += gt[18]; + m_A19 += gt[19]; + m_A17 += go[16]; + m_A16 += go[17]; + m_A18 += go[18]; + m_A20 += go[19]; + double RHS6 = Idr[16]; + RHS6 += Idr[17]; + RHS6 += Idr[18]; + RHS6 += Idr[19]; + m_A25 += gt[20]; + m_A25 += gt[21]; + m_A25 += gt[22]; + m_A25 += gt[23]; + m_A25 += gt[24]; + m_A23 += go[20]; + m_A24 += go[21]; + m_A21 += go[22]; + double RHS7 = Idr[20]; + RHS7 += Idr[21]; + RHS7 += Idr[22]; + RHS7 += Idr[23]; + RHS7 += Idr[24]; + RHS7 -= go[23] * *cnV[23]; + RHS7 -= go[24] * *cnV[24]; + const double f0 = 1.0 / m_A0; + const double f0_4 = -f0 * m_A9; + m_A10 += m_A1 * f0_4; + m_A12 += m_A2 * f0_4; + RHS4 += f0_4 * RHS0; + const double f0_7 = -f0 * m_A21; + m_A22 += m_A1 * f0_7; + m_A25 += m_A2 * f0_7; + RHS7 += f0_7 * RHS0; + const double f1 = 1.0 / m_A3; + const double f1_6 = -f1 * m_A16; + m_A19 += m_A4 * f1_6; + RHS6 += f1_6 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_6 = -f2 * m_A17; + m_A19 += m_A6 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_5 = -f3 * m_A13; + m_A14 += m_A8 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A10; + const double f4_6 = -f4 * m_A18; + m_A19 += m_A11 * f4_6; + m_A20 += m_A12 * f4_6; + RHS6 += f4_6 * RHS4; + const double f4_7 = -f4 * m_A22; + m_A24 += m_A11 * f4_7; + m_A25 += m_A12 * f4_7; + RHS7 += f4_7 * RHS4; + const double f5 = 1.0 / m_A14; + const double f5_7 = -f5 * m_A23; + m_A25 += m_A15 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A19; + const double f6_7 = -f6 * m_A24; + m_A25 += m_A20 * f6_7; + RHS7 += f6_7 * RHS6; + V[7] = RHS7 / m_A25; + double tmp6 = 0.0; + tmp6 += m_A20 * V[7]; + V[6] = (RHS6 - tmp6) / m_A19; + double tmp5 = 0.0; + tmp5 += m_A15 * V[7]; + V[5] = (RHS5 - tmp5) / m_A14; + double tmp4 = 0.0; + tmp4 += m_A11 * V[6]; + tmp4 += m_A12 * V[7]; + V[4] = (RHS4 - tmp4) / m_A10; + double tmp3 = 0.0; + tmp3 += m_A8 * V[5]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A6 * V[6]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A4 * V[6]; + V[1] = (RHS1 - tmp1) / m_A3; + double tmp0 = 0.0; + tmp0 += m_A1 * V[4]; + tmp0 += m_A2 * V[7]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// tp1985 +static void nl_gcr_7_double_double_74349e9889a2630b(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A5 += go[6]; + m_A4 += go[7]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 -= go[8] * *cnV[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// warrior +static void nl_gcr_10_double_double_8003d4625273fa4d(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + m_A5 += gt[5]; + m_A5 += gt[6]; + m_A5 += gt[7]; + m_A6 += go[5]; + m_A4 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A7 += go[8]; + m_A8 += go[9]; + double RHS3 = Idr[8]; + RHS3 += Idr[9]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A5 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A7; + m_A9 += m_A3 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_3 = -f2 * m_A8; + m_A9 += m_A6 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A9; + double tmp2 = 0.0; + tmp2 += m_A6 * V[3]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// warrior,ripoff,sundance +static void nl_gcr_12_double_double_295cf2e2f3d489bf(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A7 += go[6]; + m_A7 += go[7]; + m_A5 += go[8]; + m_A5 += go[9]; + double RHS2 = Idr[6]; + RHS2 += Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A11 += gt[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A10 += go[11]; + m_A10 += go[12]; + m_A9 += go[13]; + m_A8 += go[14]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[15] * *cnV[15]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A11 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + m_A7 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// warrior +static void nl_gcr_12_double_double_42a31ce5c187b308(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + m_A7 += gt[5]; + m_A7 += gt[6]; + m_A7 += gt[7]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + RHS2 += Idr[7]; + RHS2 -= go[7] * *cnV[7]; + m_A11 += gt[8]; + m_A9 += go[8]; + double RHS3 = Idr[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A7 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A6; + m_A7 += m_A3 * f1_2; + m_A8 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A8 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A8 * V[3]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// warrior,sundance +static void nl_gcr_12_double_double_ad6dba01ff2425c3(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A7 += go[7]; + m_A7 += go[8]; + m_A5 += go[9]; + m_A5 += go[10]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A11 += gt[12]; + m_A11 += gt[13]; + m_A11 += gt[14]; + m_A11 += gt[15]; + m_A11 += gt[16]; + m_A10 += go[12]; + m_A10 += go[13]; + m_A9 += go[14]; + m_A8 += go[15]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 -= go[16] * *cnV[16]; + const double f0 = 1.0 / m_A0; + const double f0_3 = -f0 * m_A8; + m_A11 += m_A1 * f0_3; + RHS3 += f0_3 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + m_A7 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A6; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A7 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A7 * V[3]; + V[2] = (RHS2 - tmp2) / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[3]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// warrior +static void nl_gcr_27_double_double_da598f43329e823(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A4 += go[2]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A5 += gt[7]; + m_A5 += gt[8]; + m_A5 += gt[9]; + m_A5 += gt[10]; + m_A8 += go[7]; + m_A6 += go[8]; + m_A6 += go[9]; + m_A7 += go[10]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + m_A10 += gt[11]; + m_A10 += gt[12]; + m_A10 += gt[13]; + m_A10 += gt[14]; + m_A10 += gt[15]; + m_A11 += go[11]; + m_A11 += go[12]; + m_A9 += go[13]; + m_A9 += go[14]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 -= go[15] * *cnV[15]; + m_A13 += gt[16]; + m_A13 += gt[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A13 += gt[20]; + m_A15 += go[16]; + m_A15 += go[17]; + m_A12 += go[18]; + m_A12 += go[19]; + double RHS4 = Idr[16]; + RHS4 += Idr[17]; + RHS4 += Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 -= go[20] * *cnV[20]; + m_A21 += gt[21]; + m_A21 += gt[22]; + m_A21 += gt[23]; + m_A21 += gt[24]; + m_A21 += gt[25]; + m_A18 += go[21]; + m_A19 += go[22]; + m_A19 += go[23]; + m_A17 += go[24]; + m_A16 += go[25]; + double RHS5 = Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 += Idr[24]; + RHS5 += Idr[25]; + m_A26 += gt[26]; + m_A26 += gt[27]; + m_A26 += gt[28]; + m_A26 += gt[29]; + m_A26 += gt[30]; + m_A24 += go[26]; + m_A24 += go[27]; + m_A23 += go[28]; + double RHS6 = Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 += Idr[29]; + RHS6 += Idr[30]; + RHS6 -= go[29] * *cnV[29]; + RHS6 -= go[30] * *cnV[30]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A16; + m_A21 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f1_5 = -f1 * m_A17; + m_A19 += m_A3 * f1_5; + m_A21 += m_A4 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A5; + const double f2_4 = -f2 * m_A12; + m_A13 += m_A6 * f2_4; + m_A14 += m_A7 * f2_4; + m_A15 += m_A8 * f2_4; + RHS4 += f2_4 * RHS2; + const double f2_5 = -f2 * m_A18; + m_A20 += m_A6 * f2_5; + m_A21 += m_A7 * f2_5; + m_A22 += m_A8 * f2_5; + RHS5 += f2_5 * RHS2; + const double f2_6 = -f2 * m_A23; + m_A24 += m_A6 * f2_6; + m_A25 += m_A7 * f2_6; + m_A26 += m_A8 * f2_6; + RHS6 += f2_6 * RHS2; + const double f3 = 1.0 / m_A10; + const double f3_5 = -f3 * m_A19; + m_A21 += m_A11 * f3_5; + RHS5 += f3_5 * RHS3; + const double f4 = 1.0 / m_A13; + const double f4_5 = -f4 * m_A20; + m_A21 += m_A14 * f4_5; + m_A22 += m_A15 * f4_5; + RHS5 += f4_5 * RHS4; + const double f4_6 = -f4 * m_A24; + m_A25 += m_A14 * f4_6; + m_A26 += m_A15 * f4_6; + RHS6 += f4_6 * RHS4; + const double f5 = 1.0 / m_A21; + const double f5_6 = -f5 * m_A25; + m_A26 += m_A22 * f5_6; + RHS6 += f5_6 * RHS5; + V[6] = RHS6 / m_A26; + double tmp5 = 0.0; + tmp5 += m_A22 * V[6]; + V[5] = (RHS5 - tmp5) / m_A21; + double tmp4 = 0.0; + tmp4 += m_A14 * V[5]; + tmp4 += m_A15 * V[6]; + V[4] = (RHS4 - tmp4) / m_A13; + double tmp3 = 0.0; + tmp3 += m_A11 * V[5]; + V[3] = (RHS3 - tmp3) / m_A10; + double tmp2 = 0.0; + tmp2 += m_A6 * V[4]; + tmp2 += m_A7 * V[5]; + tmp2 += m_A8 * V[6]; + V[2] = (RHS2 - tmp2) / m_A5; + double tmp1 = 0.0; + tmp1 += m_A3 * V[3]; + tmp1 += m_A4 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[5]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// warrior +static void nl_gcr_7_double_double_9c975530a1a529d6(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + m_A6 += gt[3]; + m_A6 += gt[4]; + m_A5 += go[3]; + m_A4 += go[4]; + double RHS2 = Idr[3]; + RHS2 += Idr[4]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// warrior +static void nl_gcr_89_double_double_bff07f8d339f7cc4(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + m_A8 += go[7]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + m_A9 += gt[8]; + m_A9 += gt[9]; + m_A11 += go[8]; + m_A10 += go[9]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + m_A12 += gt[10]; + m_A12 += gt[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A12 += gt[14]; + m_A12 += gt[15]; + m_A12 += gt[16]; + m_A13 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 += Idr[12]; + RHS5 += Idr[13]; + RHS5 += Idr[14]; + RHS5 += Idr[15]; + RHS5 += Idr[16]; + RHS5 -= go[11] * *cnV[11]; + RHS5 -= go[12] * *cnV[12]; + RHS5 -= go[13] * *cnV[13]; + RHS5 -= go[14] * *cnV[14]; + RHS5 -= go[15] * *cnV[15]; + RHS5 -= go[16] * *cnV[16]; + m_A14 += gt[17]; + m_A14 += gt[18]; + m_A16 += go[17]; + m_A15 += go[18]; + double RHS6 = Idr[17]; + RHS6 += Idr[18]; + m_A17 += gt[19]; + m_A17 += gt[20]; + m_A19 += go[19]; + m_A18 += go[20]; + double RHS7 = Idr[19]; + RHS7 += Idr[20]; + m_A20 += gt[21]; + m_A20 += gt[22]; + m_A21 += go[21]; + double RHS8 = Idr[21]; + RHS8 += Idr[22]; + RHS8 -= go[22] * *cnV[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A22 += gt[25]; + m_A24 += go[23]; + m_A23 += go[24]; + double RHS9 = Idr[23]; + RHS9 += Idr[24]; + RHS9 += Idr[25]; + RHS9 -= go[25] * *cnV[25]; + m_A25 += gt[26]; + m_A25 += gt[27]; + m_A26 += go[26]; + double RHS10 = Idr[26]; + RHS10 += Idr[27]; + RHS10 -= go[27] * *cnV[27]; + m_A27 += gt[28]; + m_A27 += gt[29]; + m_A27 += gt[30]; + m_A28 += go[28]; + m_A29 += go[29]; + double RHS11 = Idr[28]; + RHS11 += Idr[29]; + RHS11 += Idr[30]; + RHS11 -= go[30] * *cnV[30]; + m_A32 += gt[31]; + m_A32 += gt[32]; + m_A32 += gt[33]; + m_A31 += go[31]; + m_A30 += go[32]; + double RHS12 = Idr[31]; + RHS12 += Idr[32]; + RHS12 += Idr[33]; + RHS12 -= go[33] * *cnV[33]; + m_A35 += gt[34]; + m_A35 += gt[35]; + m_A35 += gt[36]; + m_A34 += go[34]; + m_A37 += go[35]; + double RHS13 = Idr[34]; + RHS13 += Idr[35]; + RHS13 += Idr[36]; + RHS13 -= go[36] * *cnV[36]; + m_A40 += gt[37]; + m_A40 += gt[38]; + m_A40 += gt[39]; + m_A39 += go[37]; + m_A38 += go[38]; + double RHS14 = Idr[37]; + RHS14 += Idr[38]; + RHS14 += Idr[39]; + RHS14 -= go[39] * *cnV[39]; + m_A43 += gt[40]; + m_A43 += gt[41]; + m_A43 += gt[42]; + m_A44 += go[40]; + m_A42 += go[41]; + double RHS15 = Idr[40]; + RHS15 += Idr[41]; + RHS15 += Idr[42]; + RHS15 -= go[42] * *cnV[42]; + m_A47 += gt[43]; + m_A47 += gt[44]; + m_A47 += gt[45]; + m_A47 += gt[46]; + m_A49 += go[43]; + m_A49 += go[44]; + m_A45 += go[45]; + double RHS16 = Idr[43]; + RHS16 += Idr[44]; + RHS16 += Idr[45]; + RHS16 += Idr[46]; + RHS16 -= go[46] * *cnV[46]; + m_A52 += gt[47]; + m_A52 += gt[48]; + m_A50 += go[47]; + m_A53 += go[48]; + double RHS17 = Idr[47]; + RHS17 += Idr[48]; + m_A56 += gt[49]; + m_A56 += gt[50]; + m_A56 += gt[51]; + m_A55 += go[49]; + m_A54 += go[50]; + double RHS18 = Idr[49]; + RHS18 += Idr[50]; + RHS18 += Idr[51]; + RHS18 -= go[51] * *cnV[51]; + m_A62 += gt[52]; + m_A62 += gt[53]; + m_A62 += gt[54]; + m_A62 += gt[55]; + m_A58 += go[52]; + m_A59 += go[53]; + m_A60 += go[54]; + double RHS19 = Idr[52]; + RHS19 += Idr[53]; + RHS19 += Idr[54]; + RHS19 += Idr[55]; + RHS19 -= go[55] * *cnV[55]; + m_A69 += gt[56]; + m_A69 += gt[57]; + m_A69 += gt[58]; + m_A66 += go[56]; + m_A67 += go[57]; + double RHS20 = Idr[56]; + RHS20 += Idr[57]; + RHS20 += Idr[58]; + RHS20 -= go[58] * *cnV[58]; + m_A78 += gt[59]; + m_A78 += gt[60]; + m_A78 += gt[61]; + m_A78 += gt[62]; + m_A78 += gt[63]; + m_A78 += gt[64]; + m_A72 += go[59]; + m_A73 += go[60]; + m_A75 += go[61]; + m_A75 += go[62]; + double RHS21 = Idr[59]; + RHS21 += Idr[60]; + RHS21 += Idr[61]; + RHS21 += Idr[62]; + RHS21 += Idr[63]; + RHS21 += Idr[64]; + RHS21 -= go[63] * *cnV[63]; + RHS21 -= go[64] * *cnV[64]; + m_A88 += gt[65]; + m_A88 += gt[66]; + m_A88 += gt[67]; + m_A88 += gt[68]; + m_A88 += gt[69]; + m_A83 += go[65]; + m_A81 += go[66]; + m_A82 += go[67]; + m_A80 += go[68]; + double RHS22 = Idr[65]; + RHS22 += Idr[66]; + RHS22 += Idr[67]; + RHS22 += Idr[68]; + RHS22 += Idr[69]; + RHS22 -= go[69] * *cnV[69]; + const double f0 = 1.0 / m_A0; + const double f0_12 = -f0 * m_A30; + m_A32 += m_A1 * f0_12; + RHS12 += f0_12 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_15 = -f1 * m_A42; + m_A43 += m_A3 * f1_15; + RHS15 += f1_15 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_22 = -f2 * m_A80; + m_A88 += m_A5 * f2_22; + RHS22 += f2_22 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_19 = -f3 * m_A58; + m_A62 += m_A7 * f3_19; + m_A65 += m_A8 * f3_19; + RHS19 += f3_19 * RHS3; + const double f3_22 = -f3 * m_A81; + m_A85 += m_A7 * f3_22; + m_A88 += m_A8 * f3_22; + RHS22 += f3_22 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_13 = -f4 * m_A34; + m_A35 += m_A10 * f4_13; + m_A36 += m_A11 * f4_13; + RHS13 += f4_13 * RHS4; + const double f4_16 = -f4 * m_A45; + m_A46 += m_A10 * f4_16; + m_A47 += m_A11 * f4_16; + RHS16 += f4_16 * RHS4; + const double f5 = 1.0 / m_A12; + const double f5_21 = -f5 * m_A72; + m_A75 += m_A13 * f5_21; + RHS21 += f5_21 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_12 = -f6 * m_A31; + m_A32 += m_A15 * f6_12; + m_A33 += m_A16 * f6_12; + RHS12 += f6_12 * RHS6; + const double f6_21 = -f6 * m_A73; + m_A74 += m_A15 * f6_21; + m_A78 += m_A16 * f6_21; + RHS21 += f6_21 * RHS6; + const double f7 = 1.0 / m_A17; + const double f7_19 = -f7 * m_A59; + m_A62 += m_A18 * f7_19; + m_A63 += m_A19 * f7_19; + RHS19 += f7_19 * RHS7; + const double f7_20 = -f7 * m_A66; + m_A68 += m_A18 * f7_20; + m_A69 += m_A19 * f7_20; + RHS20 += f7_20 * RHS7; + const double f8 = 1.0 / m_A20; + const double f8_14 = -f8 * m_A38; + m_A40 += m_A21 * f8_14; + RHS14 += f8_14 * RHS8; + const double f9 = 1.0 / m_A22; + const double f9_14 = -f9 * m_A39; + m_A40 += m_A23 * f9_14; + m_A41 += m_A24 * f9_14; + RHS14 += f9_14 * RHS9; + const double f9_17 = -f9 * m_A50; + m_A51 += m_A23 * f9_17; + m_A52 += m_A24 * f9_17; + RHS17 += f9_17 * RHS9; + const double f10 = 1.0 / m_A25; + const double f10_18 = -f10 * m_A54; + m_A56 += m_A26 * f10_18; + RHS18 += f10_18 * RHS10; + const double f11 = 1.0 / m_A27; + const double f11_18 = -f11 * m_A55; + m_A56 += m_A28 * f11_18; + m_A57 += m_A29 * f11_18; + RHS18 += f11_18 * RHS11; + const double f11_22 = -f11 * m_A82; + m_A84 += m_A28 * f11_22; + m_A88 += m_A29 * f11_22; + RHS22 += f11_22 * RHS11; + const double f12 = 1.0 / m_A32; + const double f12_21 = -f12 * m_A74; + m_A78 += m_A33 * f12_21; + RHS21 += f12_21 * RHS12; + const double f13 = 1.0 / m_A35; + const double f13_16 = -f13 * m_A46; + m_A47 += m_A36 * f13_16; + m_A48 += m_A37 * f13_16; + RHS16 += f13_16 * RHS13; + const double f13_19 = -f13 * m_A60; + m_A61 += m_A36 * f13_19; + m_A62 += m_A37 * f13_19; + RHS19 += f13_19 * RHS13; + const double f14 = 1.0 / m_A40; + const double f14_17 = -f14 * m_A51; + m_A52 += m_A41 * f14_17; + RHS17 += f14_17 * RHS14; + const double f15 = 1.0 / m_A43; + const double f15_20 = -f15 * m_A67; + m_A69 += m_A44 * f15_20; + RHS20 += f15_20 * RHS15; + const double f16 = 1.0 / m_A47; + const double f16_19 = -f16 * m_A61; + m_A62 += m_A48 * f16_19; + m_A64 += m_A49 * f16_19; + RHS19 += f16_19 * RHS16; + const double f16_21 = -f16 * m_A75; + m_A76 += m_A48 * f16_21; + m_A78 += m_A49 * f16_21; + RHS21 += f16_21 * RHS16; + const double f17 = 1.0 / m_A52; + const double f17_22 = -f17 * m_A83; + m_A88 += m_A53 * f17_22; + RHS22 += f17_22 * RHS17; + const double f18 = 1.0 / m_A56; + const double f18_22 = -f18 * m_A84; + m_A88 += m_A57 * f18_22; + RHS22 += f18_22 * RHS18; + const double f19 = 1.0 / m_A62; + const double f19_20 = -f19 * m_A68; + m_A69 += m_A63 * f19_20; + m_A70 += m_A64 * f19_20; + m_A71 += m_A65 * f19_20; + RHS20 += f19_20 * RHS19; + const double f19_21 = -f19 * m_A76; + m_A77 += m_A63 * f19_21; + m_A78 += m_A64 * f19_21; + m_A79 += m_A65 * f19_21; + RHS21 += f19_21 * RHS19; + const double f19_22 = -f19 * m_A85; + m_A86 += m_A63 * f19_22; + m_A87 += m_A64 * f19_22; + m_A88 += m_A65 * f19_22; + RHS22 += f19_22 * RHS19; + const double f20 = 1.0 / m_A69; + const double f20_21 = -f20 * m_A77; + m_A78 += m_A70 * f20_21; + m_A79 += m_A71 * f20_21; + RHS21 += f20_21 * RHS20; + const double f20_22 = -f20 * m_A86; + m_A87 += m_A70 * f20_22; + m_A88 += m_A71 * f20_22; + RHS22 += f20_22 * RHS20; + const double f21 = 1.0 / m_A78; + const double f21_22 = -f21 * m_A87; + m_A88 += m_A79 * f21_22; + RHS22 += f21_22 * RHS21; + V[22] = RHS22 / m_A88; + double tmp21 = 0.0; + tmp21 += m_A79 * V[22]; + V[21] = (RHS21 - tmp21) / m_A78; + double tmp20 = 0.0; + tmp20 += m_A70 * V[21]; + tmp20 += m_A71 * V[22]; + V[20] = (RHS20 - tmp20) / m_A69; + double tmp19 = 0.0; + tmp19 += m_A63 * V[20]; + tmp19 += m_A64 * V[21]; + tmp19 += m_A65 * V[22]; + V[19] = (RHS19 - tmp19) / m_A62; + double tmp18 = 0.0; + tmp18 += m_A57 * V[22]; + V[18] = (RHS18 - tmp18) / m_A56; + double tmp17 = 0.0; + tmp17 += m_A53 * V[22]; + V[17] = (RHS17 - tmp17) / m_A52; + double tmp16 = 0.0; + tmp16 += m_A48 * V[19]; + tmp16 += m_A49 * V[21]; + V[16] = (RHS16 - tmp16) / m_A47; + double tmp15 = 0.0; + tmp15 += m_A44 * V[20]; + V[15] = (RHS15 - tmp15) / m_A43; + double tmp14 = 0.0; + tmp14 += m_A41 * V[17]; + V[14] = (RHS14 - tmp14) / m_A40; + double tmp13 = 0.0; + tmp13 += m_A36 * V[16]; + tmp13 += m_A37 * V[19]; + V[13] = (RHS13 - tmp13) / m_A35; + double tmp12 = 0.0; + tmp12 += m_A33 * V[21]; + V[12] = (RHS12 - tmp12) / m_A32; + double tmp11 = 0.0; + tmp11 += m_A28 * V[18]; + tmp11 += m_A29 * V[22]; + V[11] = (RHS11 - tmp11) / m_A27; + double tmp10 = 0.0; + tmp10 += m_A26 * V[18]; + V[10] = (RHS10 - tmp10) / m_A25; + double tmp9 = 0.0; + tmp9 += m_A23 * V[14]; + tmp9 += m_A24 * V[17]; + V[9] = (RHS9 - tmp9) / m_A22; + double tmp8 = 0.0; + tmp8 += m_A21 * V[14]; + V[8] = (RHS8 - tmp8) / m_A20; + double tmp7 = 0.0; + tmp7 += m_A18 * V[19]; + tmp7 += m_A19 * V[20]; + V[7] = (RHS7 - tmp7) / m_A17; + double tmp6 = 0.0; + tmp6 += m_A15 * V[12]; + tmp6 += m_A16 * V[21]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A13 * V[16]; + V[5] = (RHS5 - tmp5) / m_A12; + double tmp4 = 0.0; + tmp4 += m_A10 * V[13]; + tmp4 += m_A11 * V[16]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A7 * V[19]; + tmp3 += m_A8 * V[22]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[22]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[12]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zac1b11142 +static void nl_gcr_12_double_double_861d39f81d29d51(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A4 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + m_A7 += gt[5]; + m_A7 += gt[6]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + m_A11 += gt[7]; + m_A11 += gt[8]; + m_A9 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 -= go[8] * *cnV[8]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A5; + m_A7 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A6; + m_A7 += m_A3 * f1_2; + m_A8 += m_A4 * f1_2; + RHS2 += f1_2 * RHS1; + const double f1_3 = -f1 * m_A9; + m_A10 += m_A3 * f1_3; + m_A11 += m_A4 * f1_3; + RHS3 += f1_3 * RHS1; + const double f2 = 1.0 / m_A7; + const double f2_3 = -f2 * m_A10; + m_A11 += m_A8 * f2_3; + RHS3 += f2_3 * RHS2; + V[3] = RHS3 / m_A11; + double tmp2 = 0.0; + tmp2 += m_A8 * V[3]; + V[2] = (RHS2 - tmp2) / m_A7; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + tmp1 += m_A4 * V[3]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zac1b11142 +static void nl_gcr_178_double_double_6041272373b8603c(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + double m_A144(0.0); + double m_A145(0.0); + double m_A146(0.0); + double m_A147(0.0); + double m_A148(0.0); + double m_A149(0.0); + double m_A150(0.0); + double m_A151(0.0); + double m_A152(0.0); + double m_A153(0.0); + double m_A154(0.0); + double m_A155(0.0); + double m_A156(0.0); + double m_A157(0.0); + double m_A158(0.0); + double m_A159(0.0); + double m_A160(0.0); + double m_A161(0.0); + double m_A162(0.0); + double m_A163(0.0); + double m_A164(0.0); + double m_A165(0.0); + double m_A166(0.0); + double m_A167(0.0); + double m_A168(0.0); + double m_A169(0.0); + double m_A170(0.0); + double m_A171(0.0); + double m_A172(0.0); + double m_A173(0.0); + double m_A174(0.0); + double m_A175(0.0); + double m_A176(0.0); + double m_A177(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A3 += go[3]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 -= go[4] * *cnV[4]; + m_A4 += gt[5]; + m_A4 += gt[6]; + m_A6 += go[5]; + m_A5 += go[6]; + double RHS2 = Idr[5]; + RHS2 += Idr[6]; + m_A7 += gt[7]; + m_A7 += gt[8]; + m_A8 += go[7]; + double RHS3 = Idr[7]; + RHS3 += Idr[8]; + RHS3 -= go[8] * *cnV[8]; + m_A9 += gt[9]; + m_A9 += gt[10]; + m_A9 += gt[11]; + m_A9 += gt[12]; + m_A9 += gt[13]; + m_A9 += gt[14]; + m_A9 += gt[15]; + m_A10 += go[9]; + double RHS4 = Idr[9]; + RHS4 += Idr[10]; + RHS4 += Idr[11]; + RHS4 += Idr[12]; + RHS4 += Idr[13]; + RHS4 += Idr[14]; + RHS4 += Idr[15]; + RHS4 -= go[10] * *cnV[10]; + RHS4 -= go[11] * *cnV[11]; + RHS4 -= go[12] * *cnV[12]; + RHS4 -= go[13] * *cnV[13]; + RHS4 -= go[14] * *cnV[14]; + RHS4 -= go[15] * *cnV[15]; + m_A11 += gt[16]; + m_A11 += gt[17]; + m_A12 += go[16]; + double RHS5 = Idr[16]; + RHS5 += Idr[17]; + RHS5 -= go[17] * *cnV[17]; + m_A13 += gt[18]; + m_A13 += gt[19]; + m_A14 += go[18]; + double RHS6 = Idr[18]; + RHS6 += Idr[19]; + RHS6 -= go[19] * *cnV[19]; + m_A15 += gt[20]; + m_A15 += gt[21]; + m_A16 += go[20]; + double RHS7 = Idr[20]; + RHS7 += Idr[21]; + RHS7 -= go[21] * *cnV[21]; + m_A17 += gt[22]; + m_A17 += gt[23]; + m_A18 += go[22]; + double RHS8 = Idr[22]; + RHS8 += Idr[23]; + RHS8 -= go[23] * *cnV[23]; + m_A19 += gt[24]; + m_A19 += gt[25]; + m_A20 += go[24]; + m_A21 += go[25]; + double RHS9 = Idr[24]; + RHS9 += Idr[25]; + m_A22 += gt[26]; + m_A22 += gt[27]; + m_A22 += gt[28]; + m_A22 += gt[29]; + m_A23 += go[26]; + m_A23 += go[27]; + double RHS10 = Idr[26]; + RHS10 += Idr[27]; + RHS10 += Idr[28]; + RHS10 += Idr[29]; + RHS10 -= go[28] * *cnV[28]; + RHS10 -= go[29] * *cnV[29]; + m_A24 += gt[30]; + m_A24 += gt[31]; + m_A24 += gt[32]; + m_A24 += gt[33]; + m_A25 += go[30]; + m_A25 += go[31]; + double RHS11 = Idr[30]; + RHS11 += Idr[31]; + RHS11 += Idr[32]; + RHS11 += Idr[33]; + RHS11 -= go[32] * *cnV[32]; + RHS11 -= go[33] * *cnV[33]; + m_A26 += gt[34]; + m_A26 += gt[35]; + m_A26 += gt[36]; + m_A26 += gt[37]; + m_A27 += go[34]; + m_A27 += go[35]; + double RHS12 = Idr[34]; + RHS12 += Idr[35]; + RHS12 += Idr[36]; + RHS12 += Idr[37]; + RHS12 -= go[36] * *cnV[36]; + RHS12 -= go[37] * *cnV[37]; + m_A28 += gt[38]; + m_A28 += gt[39]; + m_A29 += go[38]; + double RHS13 = Idr[38]; + RHS13 += Idr[39]; + RHS13 -= go[39] * *cnV[39]; + m_A30 += gt[40]; + m_A30 += gt[41]; + m_A30 += gt[42]; + m_A31 += go[40]; + double RHS14 = Idr[40]; + RHS14 += Idr[41]; + RHS14 += Idr[42]; + RHS14 -= go[41] * *cnV[41]; + RHS14 -= go[42] * *cnV[42]; + m_A32 += gt[43]; + m_A32 += gt[44]; + m_A32 += gt[45]; + m_A33 += go[43]; + double RHS15 = Idr[43]; + RHS15 += Idr[44]; + RHS15 += Idr[45]; + RHS15 -= go[44] * *cnV[44]; + RHS15 -= go[45] * *cnV[45]; + m_A34 += gt[46]; + m_A34 += gt[47]; + m_A34 += gt[48]; + m_A35 += go[46]; + double RHS16 = Idr[46]; + RHS16 += Idr[47]; + RHS16 += Idr[48]; + RHS16 -= go[47] * *cnV[47]; + RHS16 -= go[48] * *cnV[48]; + m_A36 += gt[49]; + m_A36 += gt[50]; + m_A37 += go[49]; + double RHS17 = Idr[49]; + RHS17 += Idr[50]; + RHS17 -= go[50] * *cnV[50]; + m_A38 += gt[51]; + m_A38 += gt[52]; + m_A38 += gt[53]; + m_A38 += gt[54]; + m_A39 += go[51]; + double RHS18 = Idr[51]; + RHS18 += Idr[52]; + RHS18 += Idr[53]; + RHS18 += Idr[54]; + RHS18 -= go[52] * *cnV[52]; + RHS18 -= go[53] * *cnV[53]; + RHS18 -= go[54] * *cnV[54]; + m_A40 += gt[55]; + m_A40 += gt[56]; + m_A40 += gt[57]; + m_A40 += gt[58]; + m_A40 += gt[59]; + m_A41 += go[55]; + double RHS19 = Idr[55]; + RHS19 += Idr[56]; + RHS19 += Idr[57]; + RHS19 += Idr[58]; + RHS19 += Idr[59]; + RHS19 -= go[56] * *cnV[56]; + RHS19 -= go[57] * *cnV[57]; + RHS19 -= go[58] * *cnV[58]; + RHS19 -= go[59] * *cnV[59]; + m_A42 += gt[60]; + m_A42 += gt[61]; + m_A42 += gt[62]; + m_A42 += gt[63]; + m_A42 += gt[64]; + m_A42 += gt[65]; + m_A42 += gt[66]; + m_A43 += go[60]; + double RHS20 = Idr[60]; + RHS20 += Idr[61]; + RHS20 += Idr[62]; + RHS20 += Idr[63]; + RHS20 += Idr[64]; + RHS20 += Idr[65]; + RHS20 += Idr[66]; + RHS20 -= go[61] * *cnV[61]; + RHS20 -= go[62] * *cnV[62]; + RHS20 -= go[63] * *cnV[63]; + RHS20 -= go[64] * *cnV[64]; + RHS20 -= go[65] * *cnV[65]; + RHS20 -= go[66] * *cnV[66]; + m_A44 += gt[67]; + m_A44 += gt[68]; + m_A44 += gt[69]; + m_A45 += go[67]; + double RHS21 = Idr[67]; + RHS21 += Idr[68]; + RHS21 += Idr[69]; + RHS21 -= go[68] * *cnV[68]; + RHS21 -= go[69] * *cnV[69]; + m_A46 += gt[70]; + m_A46 += gt[71]; + m_A48 += go[70]; + m_A47 += go[71]; + double RHS22 = Idr[70]; + RHS22 += Idr[71]; + m_A49 += gt[72]; + m_A49 += gt[73]; + m_A49 += gt[74]; + m_A51 += go[72]; + m_A50 += go[73]; + double RHS23 = Idr[72]; + RHS23 += Idr[73]; + RHS23 += Idr[74]; + RHS23 -= go[74] * *cnV[74]; + m_A52 += gt[75]; + m_A52 += gt[76]; + m_A52 += gt[77]; + m_A53 += go[75]; + double RHS24 = Idr[75]; + RHS24 += Idr[76]; + RHS24 += Idr[77]; + RHS24 -= go[76] * *cnV[76]; + RHS24 -= go[77] * *cnV[77]; + m_A54 += gt[78]; + m_A54 += gt[79]; + m_A54 += gt[80]; + m_A54 += gt[81]; + m_A55 += go[78]; + m_A55 += go[79]; + m_A56 += go[80]; + double RHS25 = Idr[78]; + RHS25 += Idr[79]; + RHS25 += Idr[80]; + RHS25 += Idr[81]; + RHS25 -= go[81] * *cnV[81]; + m_A60 += gt[82]; + m_A60 += gt[83]; + m_A60 += gt[84]; + m_A59 += go[82]; + m_A58 += go[83]; + m_A57 += go[84]; + double RHS26 = Idr[82]; + RHS26 += Idr[83]; + RHS26 += Idr[84]; + m_A62 += gt[85]; + m_A62 += gt[86]; + m_A63 += go[85]; + m_A64 += go[86]; + double RHS27 = Idr[85]; + RHS27 += Idr[86]; + m_A65 += gt[87]; + m_A65 += gt[88]; + m_A65 += gt[89]; + m_A66 += go[87]; + double RHS28 = Idr[87]; + RHS28 += Idr[88]; + RHS28 += Idr[89]; + RHS28 -= go[88] * *cnV[88]; + RHS28 -= go[89] * *cnV[89]; + m_A67 += gt[90]; + m_A67 += gt[91]; + m_A67 += gt[92]; + m_A69 += go[90]; + m_A68 += go[91]; + double RHS29 = Idr[90]; + RHS29 += Idr[91]; + RHS29 += Idr[92]; + RHS29 -= go[92] * *cnV[92]; + m_A70 += gt[93]; + m_A70 += gt[94]; + m_A72 += go[93]; + m_A71 += go[94]; + double RHS30 = Idr[93]; + RHS30 += Idr[94]; + m_A74 += gt[95]; + m_A74 += gt[96]; + m_A73 += go[95]; + double RHS31 = Idr[95]; + RHS31 += Idr[96]; + RHS31 -= go[96] * *cnV[96]; + m_A82 += gt[97]; + m_A82 += gt[98]; + m_A82 += gt[99]; + m_A82 += gt[100]; + m_A82 += gt[101]; + m_A82 += gt[102]; + m_A82 += gt[103]; + m_A82 += gt[104]; + m_A82 += gt[105]; + m_A82 += gt[106]; + m_A81 += go[97]; + m_A80 += go[98]; + m_A79 += go[99]; + m_A78 += go[100]; + m_A78 += go[101]; + m_A77 += go[102]; + m_A77 += go[103]; + m_A76 += go[104]; + m_A76 += go[105]; + m_A75 += go[106]; + double RHS32 = Idr[97]; + RHS32 += Idr[98]; + RHS32 += Idr[99]; + RHS32 += Idr[100]; + RHS32 += Idr[101]; + RHS32 += Idr[102]; + RHS32 += Idr[103]; + RHS32 += Idr[104]; + RHS32 += Idr[105]; + RHS32 += Idr[106]; + m_A86 += gt[107]; + m_A86 += gt[108]; + m_A86 += gt[109]; + m_A86 += gt[110]; + m_A86 += gt[111]; + m_A86 += gt[112]; + m_A86 += gt[113]; + m_A85 += go[107]; + m_A84 += go[108]; + double RHS33 = Idr[107]; + RHS33 += Idr[108]; + RHS33 += Idr[109]; + RHS33 += Idr[110]; + RHS33 += Idr[111]; + RHS33 += Idr[112]; + RHS33 += Idr[113]; + RHS33 -= go[109] * *cnV[109]; + RHS33 -= go[110] * *cnV[110]; + RHS33 -= go[111] * *cnV[111]; + RHS33 -= go[112] * *cnV[112]; + RHS33 -= go[113] * *cnV[113]; + m_A90 += gt[114]; + m_A90 += gt[115]; + m_A91 += go[114]; + m_A88 += go[115]; + double RHS34 = Idr[114]; + RHS34 += Idr[115]; + m_A94 += gt[116]; + m_A94 += gt[117]; + m_A94 += gt[118]; + m_A94 += gt[119]; + m_A94 += gt[120]; + m_A92 += go[116]; + m_A93 += go[117]; + m_A93 += go[118]; + double RHS35 = Idr[116]; + RHS35 += Idr[117]; + RHS35 += Idr[118]; + RHS35 += Idr[119]; + RHS35 += Idr[120]; + RHS35 -= go[119] * *cnV[119]; + RHS35 -= go[120] * *cnV[120]; + m_A97 += gt[121]; + m_A97 += gt[122]; + m_A98 += go[121]; + m_A96 += go[122]; + double RHS36 = Idr[121]; + RHS36 += Idr[122]; + m_A100 += gt[123]; + m_A100 += gt[124]; + m_A99 += go[123]; + m_A102 += go[124]; + double RHS37 = Idr[123]; + RHS37 += Idr[124]; + m_A105 += gt[125]; + m_A105 += gt[126]; + m_A107 += go[125]; + m_A103 += go[126]; + double RHS38 = Idr[125]; + RHS38 += Idr[126]; + m_A111 += gt[127]; + m_A111 += gt[128]; + m_A111 += gt[129]; + m_A109 += go[127]; + m_A108 += go[128]; + double RHS39 = Idr[127]; + RHS39 += Idr[128]; + RHS39 += Idr[129]; + RHS39 -= go[129] * *cnV[129]; + m_A116 += gt[130]; + m_A116 += gt[131]; + m_A116 += gt[132]; + m_A114 += go[130]; + m_A113 += go[131]; + m_A118 += go[132]; + double RHS40 = Idr[130]; + RHS40 += Idr[131]; + RHS40 += Idr[132]; + m_A120 += gt[133]; + m_A120 += gt[134]; + m_A120 += gt[135]; + m_A120 += gt[136]; + m_A121 += go[133]; + m_A119 += go[134]; + double RHS41 = Idr[133]; + RHS41 += Idr[134]; + RHS41 += Idr[135]; + RHS41 += Idr[136]; + RHS41 -= go[135] * *cnV[135]; + RHS41 -= go[136] * *cnV[136]; + m_A124 += gt[137]; + m_A124 += gt[138]; + m_A123 += go[137]; + m_A122 += go[138]; + double RHS42 = Idr[137]; + RHS42 += Idr[138]; + m_A131 += gt[139]; + m_A131 += gt[140]; + m_A131 += gt[141]; + m_A131 += gt[142]; + m_A131 += gt[143]; + m_A131 += gt[144]; + m_A132 += go[139]; + m_A132 += go[140]; + m_A129 += go[141]; + m_A128 += go[142]; + m_A127 += go[143]; + m_A126 += go[144]; + double RHS43 = Idr[139]; + RHS43 += Idr[140]; + RHS43 += Idr[141]; + RHS43 += Idr[142]; + RHS43 += Idr[143]; + RHS43 += Idr[144]; + m_A141 += gt[145]; + m_A141 += gt[146]; + m_A141 += gt[147]; + m_A141 += gt[148]; + m_A141 += gt[149]; + m_A141 += gt[150]; + m_A141 += gt[151]; + m_A136 += go[145]; + m_A135 += go[146]; + m_A134 += go[147]; + m_A133 += go[148]; + m_A140 += go[149]; + m_A137 += go[150]; + m_A139 += go[151]; + double RHS44 = Idr[145]; + RHS44 += Idr[146]; + RHS44 += Idr[147]; + RHS44 += Idr[148]; + RHS44 += Idr[149]; + RHS44 += Idr[150]; + RHS44 += Idr[151]; + m_A143 += gt[152]; + m_A143 += gt[153]; + m_A143 += gt[154]; + m_A143 += gt[155]; + m_A144 += go[152]; + m_A142 += go[153]; + double RHS45 = Idr[152]; + RHS45 += Idr[153]; + RHS45 += Idr[154]; + RHS45 += Idr[155]; + RHS45 -= go[154] * *cnV[154]; + RHS45 -= go[155] * *cnV[155]; + m_A147 += gt[156]; + m_A147 += gt[157]; + m_A145 += go[156]; + m_A148 += go[157]; + double RHS46 = Idr[156]; + RHS46 += Idr[157]; + m_A155 += gt[158]; + m_A155 += gt[159]; + m_A155 += gt[160]; + m_A155 += gt[161]; + m_A155 += gt[162]; + m_A155 += gt[163]; + m_A150 += go[158]; + m_A151 += go[159]; + m_A154 += go[160]; + m_A154 += go[161]; + double RHS47 = Idr[158]; + RHS47 += Idr[159]; + RHS47 += Idr[160]; + RHS47 += Idr[161]; + RHS47 += Idr[162]; + RHS47 += Idr[163]; + RHS47 -= go[162] * *cnV[162]; + RHS47 -= go[163] * *cnV[163]; + m_A162 += gt[164]; + m_A162 += gt[165]; + m_A162 += gt[166]; + m_A162 += gt[167]; + m_A162 += gt[168]; + m_A163 += go[164]; + m_A159 += go[165]; + m_A160 += go[166]; + m_A158 += go[167]; + m_A157 += go[168]; + double RHS48 = Idr[164]; + RHS48 += Idr[165]; + RHS48 += Idr[166]; + RHS48 += Idr[167]; + RHS48 += Idr[168]; + m_A169 += gt[169]; + m_A169 += gt[170]; + m_A169 += gt[171]; + m_A169 += gt[172]; + m_A167 += go[169]; + m_A164 += go[170]; + m_A165 += go[171]; + double RHS49 = Idr[169]; + RHS49 += Idr[170]; + RHS49 += Idr[171]; + RHS49 += Idr[172]; + RHS49 -= go[172] * *cnV[172]; + m_A177 += gt[173]; + m_A177 += gt[174]; + m_A177 += gt[175]; + m_A177 += gt[176]; + m_A177 += gt[177]; + m_A171 += go[173]; + m_A172 += go[174]; + m_A175 += go[175]; + double RHS50 = Idr[173]; + RHS50 += Idr[174]; + RHS50 += Idr[175]; + RHS50 += Idr[176]; + RHS50 += Idr[177]; + RHS50 -= go[176] * *cnV[176]; + RHS50 -= go[177] * *cnV[177]; + const double f0 = 1.0 / m_A0; + const double f0_26 = -f0 * m_A57; + m_A60 += m_A1 * f0_26; + RHS26 += f0_26 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_26 = -f1 * m_A58; + m_A60 += m_A3 * f1_26; + RHS26 += f1_26 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_26 = -f2 * m_A59; + m_A60 += m_A5 * f2_26; + m_A61 += m_A6 * f2_26; + RHS26 += f2_26 * RHS2; + const double f2_34 = -f2 * m_A88; + m_A89 += m_A5 * f2_34; + m_A90 += m_A6 * f2_34; + RHS34 += f2_34 * RHS2; + const double f3 = 1.0 / m_A7; + const double f3_36 = -f3 * m_A96; + m_A97 += m_A8 * f3_36; + RHS36 += f3_36 * RHS3; + const double f3_48 = -f3 * m_A157; + m_A160 += m_A8 * f3_48; + RHS48 += f3_48 * RHS3; + const double f4 = 1.0 / m_A9; + const double f4_50 = -f4 * m_A171; + m_A173 += m_A10 * f4_50; + RHS50 += f4_50 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_44 = -f5 * m_A133; + m_A141 += m_A12 * f5_44; + RHS44 += f5_44 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_44 = -f6 * m_A134; + m_A141 += m_A14 * f6_44; + RHS44 += f6_44 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_44 = -f7 * m_A135; + m_A141 += m_A16 * f7_44; + RHS44 += f7_44 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_44 = -f8 * m_A136; + m_A141 += m_A18 * f8_44; + RHS44 += f8_44 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_32 = -f9 * m_A75; + m_A82 += m_A20 * f9_32; + m_A83 += m_A21 * f9_32; + RHS32 += f9_32 * RHS9; + const double f9_44 = -f9 * m_A137; + m_A138 += m_A20 * f9_44; + m_A141 += m_A21 * f9_44; + RHS44 += f9_44 * RHS9; + const double f10 = 1.0 / m_A22; + const double f10_32 = -f10 * m_A76; + m_A82 += m_A23 * f10_32; + RHS32 += f10_32 * RHS10; + const double f11 = 1.0 / m_A24; + const double f11_32 = -f11 * m_A77; + m_A82 += m_A25 * f11_32; + RHS32 += f11_32 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_32 = -f12 * m_A78; + m_A82 += m_A27 * f12_32; + RHS32 += f12_32 * RHS12; + const double f13 = 1.0 / m_A28; + const double f13_31 = -f13 * m_A73; + m_A74 += m_A29 * f13_31; + RHS31 += f13_31 * RHS13; + const double f13_43 = -f13 * m_A126; + m_A129 += m_A29 * f13_43; + RHS43 += f13_43 * RHS13; + const double f14 = 1.0 / m_A30; + const double f14_32 = -f14 * m_A79; + m_A82 += m_A31 * f14_32; + RHS32 += f14_32 * RHS14; + const double f15 = 1.0 / m_A32; + const double f15_35 = -f15 * m_A92; + m_A94 += m_A33 * f15_35; + RHS35 += f15_35 * RHS15; + const double f16 = 1.0 / m_A34; + const double f16_32 = -f16 * m_A80; + m_A82 += m_A35 * f16_32; + RHS32 += f16_32 * RHS16; + const double f17 = 1.0 / m_A36; + const double f17_32 = -f17 * m_A81; + m_A82 += m_A37 * f17_32; + RHS32 += f17_32 * RHS17; + const double f18 = 1.0 / m_A38; + const double f18_42 = -f18 * m_A122; + m_A124 += m_A39 * f18_42; + RHS42 += f18_42 * RHS18; + const double f19 = 1.0 / m_A40; + const double f19_33 = -f19 * m_A84; + m_A86 += m_A41 * f19_33; + RHS33 += f19_33 * RHS19; + const double f20 = 1.0 / m_A42; + const double f20_47 = -f20 * m_A150; + m_A153 += m_A43 * f20_47; + RHS47 += f20_47 * RHS20; + const double f21 = 1.0 / m_A44; + const double f21_45 = -f21 * m_A142; + m_A144 += m_A45 * f21_45; + RHS45 += f21_45 * RHS21; + const double f21_48 = -f21 * m_A158; + m_A162 += m_A45 * f21_48; + RHS48 += f21_48 * RHS21; + const double f22 = 1.0 / m_A46; + const double f22_33 = -f22 * m_A85; + m_A86 += m_A47 * f22_33; + m_A87 += m_A48 * f22_33; + RHS33 += f22_33 * RHS22; + const double f22_39 = -f22 * m_A108; + m_A110 += m_A47 * f22_39; + m_A111 += m_A48 * f22_39; + RHS39 += f22_39 * RHS22; + const double f23 = 1.0 / m_A49; + const double f23_37 = -f23 * m_A99; + m_A100 += m_A50 * f23_37; + m_A101 += m_A51 * f23_37; + RHS37 += f23_37 * RHS23; + const double f23_38 = -f23 * m_A103; + m_A104 += m_A50 * f23_38; + m_A105 += m_A51 * f23_38; + RHS38 += f23_38 * RHS23; + const double f24 = 1.0 / m_A52; + const double f24_48 = -f24 * m_A159; + m_A162 += m_A53 * f24_48; + RHS48 += f24_48 * RHS24; + const double f25 = 1.0 / m_A54; + const double f25_35 = -f25 * m_A93; + m_A94 += m_A55 * f25_35; + m_A95 += m_A56 * f25_35; + RHS35 += f25_35 * RHS25; + const double f25_40 = -f25 * m_A113; + m_A115 += m_A55 * f25_40; + m_A116 += m_A56 * f25_40; + RHS40 += f25_40 * RHS25; + const double f26 = 1.0 / m_A60; + const double f26_34 = -f26 * m_A89; + m_A90 += m_A61 * f26_34; + RHS34 += f26_34 * RHS26; + const double f27 = 1.0 / m_A62; + const double f27_39 = -f27 * m_A109; + m_A111 += m_A63 * f27_39; + m_A112 += m_A64 * f27_39; + RHS39 += f27_39 * RHS27; + const double f27_49 = -f27 * m_A164; + m_A166 += m_A63 * f27_49; + m_A169 += m_A64 * f27_49; + RHS49 += f27_49 * RHS27; + const double f28 = 1.0 / m_A65; + const double f28_41 = -f28 * m_A119; + m_A121 += m_A66 * f28_41; + RHS41 += f28_41 * RHS28; + const double f28_43 = -f28 * m_A127; + m_A131 += m_A66 * f28_43; + RHS43 += f28_43 * RHS28; + const double f29 = 1.0 / m_A67; + const double f29_40 = -f29 * m_A114; + m_A116 += m_A68 * f29_40; + m_A117 += m_A69 * f29_40; + RHS40 += f29_40 * RHS29; + const double f29_46 = -f29 * m_A145; + m_A146 += m_A68 * f29_46; + m_A147 += m_A69 * f29_46; + RHS46 += f29_46 * RHS29; + const double f30 = 1.0 / m_A70; + const double f30_42 = -f30 * m_A123; + m_A124 += m_A71 * f30_42; + m_A125 += m_A72 * f30_42; + RHS42 += f30_42 * RHS30; + const double f30_43 = -f30 * m_A128; + m_A130 += m_A71 * f30_43; + m_A131 += m_A72 * f30_43; + RHS43 += f30_43 * RHS30; + const double f31 = 1.0 / m_A74; + const double f31_43 = -f31 * m_A129; + RHS43 += f31_43 * RHS31; + const double f32 = 1.0 / m_A82; + const double f32_44 = -f32 * m_A138; + m_A141 += m_A83 * f32_44; + RHS44 += f32_44 * RHS32; + const double f33 = 1.0 / m_A86; + const double f33_39 = -f33 * m_A110; + m_A111 += m_A87 * f33_39; + RHS39 += f33_39 * RHS33; + const double f34 = 1.0 / m_A90; + const double f34_44 = -f34 * m_A139; + m_A141 += m_A91 * f34_44; + RHS44 += f34_44 * RHS34; + const double f35 = 1.0 / m_A94; + const double f35_40 = -f35 * m_A115; + m_A116 += m_A95 * f35_40; + RHS40 += f35_40 * RHS35; + const double f36 = 1.0 / m_A97; + const double f36_44 = -f36 * m_A140; + m_A141 += m_A98 * f36_44; + RHS44 += f36_44 * RHS36; + const double f36_48 = -f36 * m_A160; + m_A161 += m_A98 * f36_48; + RHS48 += f36_48 * RHS36; + const double f37 = 1.0 / m_A100; + const double f37_38 = -f37 * m_A104; + m_A105 += m_A101 * f37_38; + m_A106 += m_A102 * f37_38; + RHS38 += f37_38 * RHS37; + const double f37_47 = -f37 * m_A151; + m_A152 += m_A101 * f37_47; + m_A155 += m_A102 * f37_47; + RHS47 += f37_47 * RHS37; + const double f38 = 1.0 / m_A105; + const double f38_47 = -f38 * m_A152; + m_A155 += m_A106 * f38_47; + m_A156 += m_A107 * f38_47; + RHS47 += f38_47 * RHS38; + const double f38_49 = -f38 * m_A165; + m_A168 += m_A106 * f38_49; + m_A169 += m_A107 * f38_49; + RHS49 += f38_49 * RHS38; + const double f39 = 1.0 / m_A111; + const double f39_49 = -f39 * m_A166; + m_A169 += m_A112 * f39_49; + RHS49 += f39_49 * RHS39; + const double f40 = 1.0 / m_A116; + const double f40_46 = -f40 * m_A146; + m_A147 += m_A117 * f40_46; + m_A149 += m_A118 * f40_46; + RHS46 += f40_46 * RHS40; + const double f40_50 = -f40 * m_A172; + m_A174 += m_A117 * f40_50; + m_A177 += m_A118 * f40_50; + RHS50 += f40_50 * RHS40; + const double f41 = 1.0 / m_A120; + const double f41_47 = -f41 * m_A153; + m_A154 += m_A121 * f41_47; + RHS47 += f41_47 * RHS41; + const double f42 = 1.0 / m_A124; + const double f42_43 = -f42 * m_A130; + m_A131 += m_A125 * f42_43; + RHS43 += f42_43 * RHS42; + const double f43 = 1.0 / m_A131; + const double f43_47 = -f43 * m_A154; + m_A155 += m_A132 * f43_47; + RHS47 += f43_47 * RHS43; + const double f44 = 1.0 / m_A141; + const double f44_48 = -f44 * m_A161; + RHS48 += f44_48 * RHS44; + const double f45 = 1.0 / m_A143; + const double f45_50 = -f45 * m_A173; + m_A175 += m_A144 * f45_50; + RHS50 += f45_50 * RHS45; + const double f46 = 1.0 / m_A147; + const double f46_49 = -f46 * m_A167; + m_A169 += m_A148 * f46_49; + m_A170 += m_A149 * f46_49; + RHS49 += f46_49 * RHS46; + const double f46_50 = -f46 * m_A174; + m_A176 += m_A148 * f46_50; + m_A177 += m_A149 * f46_50; + RHS50 += f46_50 * RHS46; + const double f47 = 1.0 / m_A155; + const double f47_49 = -f47 * m_A168; + m_A169 += m_A156 * f47_49; + RHS49 += f47_49 * RHS47; + const double f48 = 1.0 / m_A162; + const double f48_50 = -f48 * m_A175; + m_A177 += m_A163 * f48_50; + RHS50 += f48_50 * RHS48; + const double f49 = 1.0 / m_A169; + const double f49_50 = -f49 * m_A176; + m_A177 += m_A170 * f49_50; + RHS50 += f49_50 * RHS49; + V[50] = RHS50 / m_A177; + double tmp49 = 0.0; + tmp49 += m_A170 * V[50]; + V[49] = (RHS49 - tmp49) / m_A169; + double tmp48 = 0.0; + tmp48 += m_A163 * V[50]; + V[48] = (RHS48 - tmp48) / m_A162; + double tmp47 = 0.0; + tmp47 += m_A156 * V[49]; + V[47] = (RHS47 - tmp47) / m_A155; + double tmp46 = 0.0; + tmp46 += m_A148 * V[49]; + tmp46 += m_A149 * V[50]; + V[46] = (RHS46 - tmp46) / m_A147; + double tmp45 = 0.0; + tmp45 += m_A144 * V[48]; + V[45] = (RHS45 - tmp45) / m_A143; + double tmp44 = 0.0; + V[44] = (RHS44 - tmp44) / m_A141; + double tmp43 = 0.0; + tmp43 += m_A132 * V[47]; + V[43] = (RHS43 - tmp43) / m_A131; + double tmp42 = 0.0; + tmp42 += m_A125 * V[43]; + V[42] = (RHS42 - tmp42) / m_A124; + double tmp41 = 0.0; + tmp41 += m_A121 * V[43]; + V[41] = (RHS41 - tmp41) / m_A120; + double tmp40 = 0.0; + tmp40 += m_A117 * V[46]; + tmp40 += m_A118 * V[50]; + V[40] = (RHS40 - tmp40) / m_A116; + double tmp39 = 0.0; + tmp39 += m_A112 * V[49]; + V[39] = (RHS39 - tmp39) / m_A111; + double tmp38 = 0.0; + tmp38 += m_A106 * V[47]; + tmp38 += m_A107 * V[49]; + V[38] = (RHS38 - tmp38) / m_A105; + double tmp37 = 0.0; + tmp37 += m_A101 * V[38]; + tmp37 += m_A102 * V[47]; + V[37] = (RHS37 - tmp37) / m_A100; + double tmp36 = 0.0; + tmp36 += m_A98 * V[44]; + V[36] = (RHS36 - tmp36) / m_A97; + double tmp35 = 0.0; + tmp35 += m_A95 * V[40]; + V[35] = (RHS35 - tmp35) / m_A94; + double tmp34 = 0.0; + tmp34 += m_A91 * V[44]; + V[34] = (RHS34 - tmp34) / m_A90; + double tmp33 = 0.0; + tmp33 += m_A87 * V[39]; + V[33] = (RHS33 - tmp33) / m_A86; + double tmp32 = 0.0; + tmp32 += m_A83 * V[44]; + V[32] = (RHS32 - tmp32) / m_A82; + double tmp31 = 0.0; + V[31] = (RHS31 - tmp31) / m_A74; + double tmp30 = 0.0; + tmp30 += m_A71 * V[42]; + tmp30 += m_A72 * V[43]; + V[30] = (RHS30 - tmp30) / m_A70; + double tmp29 = 0.0; + tmp29 += m_A68 * V[40]; + tmp29 += m_A69 * V[46]; + V[29] = (RHS29 - tmp29) / m_A67; + double tmp28 = 0.0; + tmp28 += m_A66 * V[43]; + V[28] = (RHS28 - tmp28) / m_A65; + double tmp27 = 0.0; + tmp27 += m_A63 * V[39]; + tmp27 += m_A64 * V[49]; + V[27] = (RHS27 - tmp27) / m_A62; + double tmp26 = 0.0; + tmp26 += m_A61 * V[34]; + V[26] = (RHS26 - tmp26) / m_A60; + double tmp25 = 0.0; + tmp25 += m_A55 * V[35]; + tmp25 += m_A56 * V[40]; + V[25] = (RHS25 - tmp25) / m_A54; + double tmp24 = 0.0; + tmp24 += m_A53 * V[48]; + V[24] = (RHS24 - tmp24) / m_A52; + double tmp23 = 0.0; + tmp23 += m_A50 * V[37]; + tmp23 += m_A51 * V[38]; + V[23] = (RHS23 - tmp23) / m_A49; + double tmp22 = 0.0; + tmp22 += m_A47 * V[33]; + tmp22 += m_A48 * V[39]; + V[22] = (RHS22 - tmp22) / m_A46; + double tmp21 = 0.0; + tmp21 += m_A45 * V[48]; + V[21] = (RHS21 - tmp21) / m_A44; + double tmp20 = 0.0; + tmp20 += m_A43 * V[41]; + V[20] = (RHS20 - tmp20) / m_A42; + double tmp19 = 0.0; + tmp19 += m_A41 * V[33]; + V[19] = (RHS19 - tmp19) / m_A40; + double tmp18 = 0.0; + tmp18 += m_A39 * V[42]; + V[18] = (RHS18 - tmp18) / m_A38; + double tmp17 = 0.0; + tmp17 += m_A37 * V[32]; + V[17] = (RHS17 - tmp17) / m_A36; + double tmp16 = 0.0; + tmp16 += m_A35 * V[32]; + V[16] = (RHS16 - tmp16) / m_A34; + double tmp15 = 0.0; + tmp15 += m_A33 * V[35]; + V[15] = (RHS15 - tmp15) / m_A32; + double tmp14 = 0.0; + tmp14 += m_A31 * V[32]; + V[14] = (RHS14 - tmp14) / m_A30; + double tmp13 = 0.0; + tmp13 += m_A29 * V[31]; + V[13] = (RHS13 - tmp13) / m_A28; + double tmp12 = 0.0; + tmp12 += m_A27 * V[32]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A25 * V[32]; + V[11] = (RHS11 - tmp11) / m_A24; + double tmp10 = 0.0; + tmp10 += m_A23 * V[32]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + tmp9 += m_A20 * V[32]; + tmp9 += m_A21 * V[44]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[44]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[44]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[44]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A12 * V[44]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A10 * V[45]; + V[4] = (RHS4 - tmp4) / m_A9; + double tmp3 = 0.0; + tmp3 += m_A8 * V[36]; + V[3] = (RHS3 - tmp3) / m_A7; + double tmp2 = 0.0; + tmp2 += m_A5 * V[26]; + tmp2 += m_A6 * V[34]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[26]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[26]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zac1b11142 +static void nl_gcr_30_double_double_1fad5cda2646cf42(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A7 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A9 += go[15]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A12 += go[18]; + m_A10 += go[19]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 -= go[20] * *cnV[20]; + RHS5 -= go[21] * *cnV[21]; + m_A14 += gt[22]; + m_A14 += gt[23]; + m_A14 += gt[24]; + m_A14 += gt[25]; + m_A14 += gt[26]; + m_A14 += gt[27]; + m_A14 += gt[28]; + m_A13 += go[22]; + m_A16 += go[23]; + m_A16 += go[24]; + m_A16 += go[25]; + double RHS6 = Idr[22]; + RHS6 += Idr[23]; + RHS6 += Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 += Idr[27]; + RHS6 += Idr[28]; + RHS6 -= go[26] * *cnV[26]; + RHS6 -= go[27] * *cnV[27]; + RHS6 -= go[28] * *cnV[28]; + m_A19 += gt[29]; + m_A19 += gt[30]; + m_A18 += go[29]; + m_A17 += go[30]; + double RHS7 = Idr[29]; + RHS7 += Idr[30]; + m_A21 += gt[31]; + m_A21 += gt[32]; + m_A21 += gt[33]; + m_A21 += gt[34]; + m_A22 += go[31]; + m_A20 += go[32]; + double RHS8 = Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 -= go[33] * *cnV[33]; + RHS8 -= go[34] * *cnV[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A29 += gt[38]; + m_A29 += gt[39]; + m_A29 += gt[40]; + m_A29 += gt[41]; + m_A26 += go[35]; + m_A26 += go[36]; + m_A26 += go[37]; + m_A27 += go[38]; + m_A25 += go[39]; + m_A24 += go[40]; + m_A23 += go[41]; + double RHS9 = Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 += Idr[38]; + RHS9 += Idr[39]; + RHS9 += Idr[40]; + RHS9 += Idr[41]; + const double f0 = 1.0 / m_A0; + const double f0_6 = -f0 * m_A13; + m_A15 += m_A1 * f0_6; + RHS6 += f0_6 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_5 = -f1 * m_A10; + m_A11 += m_A3 * f1_5; + RHS5 += f1_5 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_7 = -f2 * m_A17; + m_A19 += m_A5 * f2_7; + RHS7 += f2_7 * RHS2; + const double f2_9 = -f2 * m_A23; + m_A27 += m_A5 * f2_9; + RHS9 += f2_9 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_8 = -f3 * m_A20; + m_A22 += m_A7 * f3_8; + RHS8 += f3_8 * RHS3; + const double f3_9 = -f3 * m_A24; + m_A29 += m_A7 * f3_9; + RHS9 += f3_9 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_9 = -f4 * m_A25; + m_A29 += m_A9 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_7 = -f5 * m_A18; + m_A19 += m_A12 * f5_7; + RHS7 += f5_7 * RHS5; + const double f6 = 1.0 / m_A14; + const double f6_9 = -f6 * m_A26; + m_A28 += m_A15 * f6_9; + m_A29 += m_A16 * f6_9; + RHS9 += f6_9 * RHS6; + const double f7 = 1.0 / m_A19; + const double f7_9 = -f7 * m_A27; + RHS9 += f7_9 * RHS7; + const double f8 = 1.0 / m_A21; + const double f8_9 = -f8 * m_A28; + m_A29 += m_A22 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A29; + double tmp8 = 0.0; + tmp8 += m_A22 * V[9]; + V[8] = (RHS8 - tmp8) / m_A21; + double tmp7 = 0.0; + V[7] = (RHS7 - tmp7) / m_A19; + double tmp6 = 0.0; + tmp6 += m_A15 * V[8]; + tmp6 += m_A16 * V[9]; + V[6] = (RHS6 - tmp6) / m_A14; + double tmp5 = 0.0; + tmp5 += m_A12 * V[7]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[9]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[9]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[7]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[5]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[8]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zac1b11142 +static void nl_gcr_30_double_double_7425594cec8024ad(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + m_A4 += gt[10]; + m_A4 += gt[11]; + m_A5 += go[10]; + double RHS2 = Idr[10]; + RHS2 += Idr[11]; + RHS2 -= go[11] * *cnV[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A7 += go[12]; + double RHS3 = Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + m_A8 += gt[15]; + m_A8 += gt[16]; + m_A8 += gt[17]; + m_A9 += go[15]; + double RHS4 = Idr[15]; + RHS4 += Idr[16]; + RHS4 += Idr[17]; + RHS4 -= go[16] * *cnV[16]; + RHS4 -= go[17] * *cnV[17]; + m_A11 += gt[18]; + m_A11 += gt[19]; + m_A11 += gt[20]; + m_A11 += gt[21]; + m_A11 += gt[22]; + m_A11 += gt[23]; + m_A10 += go[18]; + m_A12 += go[19]; + m_A12 += go[20]; + double RHS5 = Idr[18]; + RHS5 += Idr[19]; + RHS5 += Idr[20]; + RHS5 += Idr[21]; + RHS5 += Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[21] * *cnV[21]; + RHS5 -= go[22] * *cnV[22]; + RHS5 -= go[23] * *cnV[23]; + m_A16 += gt[24]; + m_A16 += gt[25]; + m_A15 += go[24]; + m_A14 += go[25]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + m_A18 += gt[26]; + m_A18 += gt[27]; + m_A19 += go[26]; + m_A17 += go[27]; + double RHS7 = Idr[26]; + RHS7 += Idr[27]; + m_A25 += gt[28]; + m_A25 += gt[29]; + m_A25 += gt[30]; + m_A25 += gt[31]; + m_A25 += gt[32]; + m_A25 += gt[33]; + m_A23 += go[28]; + m_A22 += go[29]; + m_A22 += go[30]; + m_A24 += go[31]; + m_A21 += go[32]; + m_A20 += go[33]; + double RHS8 = Idr[28]; + RHS8 += Idr[29]; + RHS8 += Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + m_A29 += gt[34]; + m_A29 += gt[35]; + m_A29 += gt[36]; + m_A29 += gt[37]; + m_A28 += go[34]; + m_A27 += go[35]; + double RHS9 = Idr[34]; + RHS9 += Idr[35]; + RHS9 += Idr[36]; + RHS9 += Idr[37]; + RHS9 -= go[36] * *cnV[36]; + RHS9 -= go[37] * *cnV[37]; + const double f0 = 1.0 / m_A0; + const double f0_5 = -f0 * m_A10; + m_A13 += m_A1 * f0_5; + RHS5 += f0_5 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_7 = -f1 * m_A17; + m_A18 += m_A3 * f1_7; + RHS7 += f1_7 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_6 = -f2 * m_A14; + m_A16 += m_A5 * f2_6; + RHS6 += f2_6 * RHS2; + const double f2_8 = -f2 * m_A20; + m_A23 += m_A5 * f2_8; + RHS8 += f2_8 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_6 = -f3 * m_A15; + m_A16 += m_A7 * f3_6; + RHS6 += f3_6 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_8 = -f4 * m_A21; + m_A25 += m_A9 * f4_8; + RHS8 += f4_8 * RHS4; + const double f4_9 = -f4 * m_A27; + m_A28 += m_A9 * f4_9; + RHS9 += f4_9 * RHS4; + const double f5 = 1.0 / m_A11; + const double f5_8 = -f5 * m_A22; + m_A25 += m_A12 * f5_8; + m_A26 += m_A13 * f5_8; + RHS8 += f5_8 * RHS5; + const double f6 = 1.0 / m_A16; + const double f6_8 = -f6 * m_A23; + RHS8 += f6_8 * RHS6; + const double f7 = 1.0 / m_A18; + const double f7_8 = -f7 * m_A24; + m_A25 += m_A19 * f7_8; + RHS8 += f7_8 * RHS7; + const double f8 = 1.0 / m_A25; + const double f8_9 = -f8 * m_A28; + m_A29 += m_A26 * f8_9; + RHS9 += f8_9 * RHS8; + V[9] = RHS9 / m_A29; + double tmp8 = 0.0; + tmp8 += m_A26 * V[9]; + V[8] = (RHS8 - tmp8) / m_A25; + double tmp7 = 0.0; + tmp7 += m_A19 * V[8]; + V[7] = (RHS7 - tmp7) / m_A18; + double tmp6 = 0.0; + V[6] = (RHS6 - tmp6) / m_A16; + double tmp5 = 0.0; + tmp5 += m_A12 * V[8]; + tmp5 += m_A13 * V[9]; + V[5] = (RHS5 - tmp5) / m_A11; + double tmp4 = 0.0; + tmp4 += m_A9 * V[8]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[6]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[6]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[7]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zac1b11142 +static void nl_gcr_71_double_double_cfd3bbf5fbba4765(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A0 += gt[3]; + m_A0 += gt[4]; + m_A0 += gt[5]; + m_A0 += gt[6]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 += Idr[3]; + RHS0 += Idr[4]; + RHS0 += Idr[5]; + RHS0 += Idr[6]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + RHS0 -= go[3] * *cnV[3]; + RHS0 -= go[4] * *cnV[4]; + RHS0 -= go[5] * *cnV[5]; + RHS0 -= go[6] * *cnV[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A2 += gt[9]; + m_A2 += gt[10]; + m_A2 += gt[11]; + m_A2 += gt[12]; + m_A2 += gt[13]; + m_A3 += go[7]; + double RHS1 = Idr[7]; + RHS1 += Idr[8]; + RHS1 += Idr[9]; + RHS1 += Idr[10]; + RHS1 += Idr[11]; + RHS1 += Idr[12]; + RHS1 += Idr[13]; + RHS1 -= go[8] * *cnV[8]; + RHS1 -= go[9] * *cnV[9]; + RHS1 -= go[10] * *cnV[10]; + RHS1 -= go[11] * *cnV[11]; + RHS1 -= go[12] * *cnV[12]; + RHS1 -= go[13] * *cnV[13]; + m_A4 += gt[14]; + m_A4 += gt[15]; + m_A4 += gt[16]; + m_A5 += go[14]; + double RHS2 = Idr[14]; + RHS2 += Idr[15]; + RHS2 += Idr[16]; + RHS2 -= go[15] * *cnV[15]; + RHS2 -= go[16] * *cnV[16]; + m_A6 += gt[17]; + m_A6 += gt[18]; + m_A7 += go[17]; + double RHS3 = Idr[17]; + RHS3 += Idr[18]; + RHS3 -= go[18] * *cnV[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A9 += go[19]; + double RHS4 = Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + m_A10 += gt[22]; + m_A10 += gt[23]; + m_A11 += go[22]; + double RHS5 = Idr[22]; + RHS5 += Idr[23]; + RHS5 -= go[23] * *cnV[23]; + m_A12 += gt[24]; + m_A12 += gt[25]; + m_A12 += gt[26]; + m_A13 += go[24]; + double RHS6 = Idr[24]; + RHS6 += Idr[25]; + RHS6 += Idr[26]; + RHS6 -= go[25] * *cnV[25]; + RHS6 -= go[26] * *cnV[26]; + m_A14 += gt[27]; + m_A14 += gt[28]; + m_A14 += gt[29]; + m_A15 += go[27]; + double RHS7 = Idr[27]; + RHS7 += Idr[28]; + RHS7 += Idr[29]; + RHS7 -= go[28] * *cnV[28]; + RHS7 -= go[29] * *cnV[29]; + m_A17 += gt[30]; + m_A17 += gt[31]; + m_A17 += gt[32]; + m_A17 += gt[33]; + m_A17 += gt[34]; + m_A17 += gt[35]; + m_A16 += go[30]; + m_A18 += go[31]; + m_A19 += go[32]; + m_A19 += go[33]; + double RHS8 = Idr[30]; + RHS8 += Idr[31]; + RHS8 += Idr[32]; + RHS8 += Idr[33]; + RHS8 += Idr[34]; + RHS8 += Idr[35]; + RHS8 -= go[34] * *cnV[34]; + RHS8 -= go[35] * *cnV[35]; + m_A21 += gt[36]; + m_A21 += gt[37]; + m_A21 += gt[38]; + m_A22 += go[36]; + double RHS9 = Idr[36]; + RHS9 += Idr[37]; + RHS9 += Idr[38]; + RHS9 -= go[37] * *cnV[37]; + RHS9 -= go[38] * *cnV[38]; + m_A23 += gt[39]; + m_A23 += gt[40]; + m_A23 += gt[41]; + m_A25 += go[39]; + m_A24 += go[40]; + double RHS10 = Idr[39]; + RHS10 += Idr[40]; + RHS10 += Idr[41]; + RHS10 -= go[41] * *cnV[41]; + m_A27 += gt[42]; + m_A27 += gt[43]; + m_A27 += gt[44]; + m_A27 += gt[45]; + m_A27 += gt[46]; + m_A27 += gt[47]; + m_A26 += go[42]; + m_A29 += go[43]; + m_A29 += go[44]; + double RHS11 = Idr[42]; + RHS11 += Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 += Idr[46]; + RHS11 += Idr[47]; + RHS11 -= go[45] * *cnV[45]; + RHS11 -= go[46] * *cnV[46]; + RHS11 -= go[47] * *cnV[47]; + m_A31 += gt[48]; + m_A31 += gt[49]; + m_A32 += go[48]; + m_A30 += go[49]; + double RHS12 = Idr[48]; + RHS12 += Idr[49]; + m_A35 += gt[50]; + m_A35 += gt[51]; + m_A34 += go[50]; + m_A33 += go[51]; + double RHS13 = Idr[50]; + RHS13 += Idr[51]; + m_A38 += gt[52]; + m_A38 += gt[53]; + m_A37 += go[52]; + m_A36 += go[53]; + double RHS14 = Idr[52]; + RHS14 += Idr[53]; + m_A40 += gt[54]; + m_A40 += gt[55]; + m_A40 += gt[56]; + m_A40 += gt[57]; + m_A41 += go[54]; + m_A39 += go[55]; + double RHS15 = Idr[54]; + RHS15 += Idr[55]; + RHS15 += Idr[56]; + RHS15 += Idr[57]; + RHS15 -= go[56] * *cnV[56]; + RHS15 -= go[57] * *cnV[57]; + m_A44 += gt[58]; + m_A44 += gt[59]; + m_A43 += go[58]; + m_A42 += go[59]; + double RHS16 = Idr[58]; + RHS16 += Idr[59]; + m_A54 += gt[60]; + m_A54 += gt[61]; + m_A54 += gt[62]; + m_A54 += gt[63]; + m_A54 += gt[64]; + m_A54 += gt[65]; + m_A52 += go[60]; + m_A50 += go[61]; + m_A50 += go[62]; + m_A51 += go[63]; + m_A49 += go[64]; + m_A48 += go[65]; + double RHS17 = Idr[60]; + RHS17 += Idr[61]; + RHS17 += Idr[62]; + RHS17 += Idr[63]; + RHS17 += Idr[64]; + RHS17 += Idr[65]; + m_A65 += gt[66]; + m_A65 += gt[67]; + m_A65 += gt[68]; + m_A65 += gt[69]; + m_A65 += gt[70]; + m_A65 += gt[71]; + m_A61 += go[66]; + m_A60 += go[67]; + m_A60 += go[68]; + m_A59 += go[69]; + m_A58 += go[70]; + m_A57 += go[71]; + double RHS18 = Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 += Idr[69]; + RHS18 += Idr[70]; + RHS18 += Idr[71]; + m_A70 += gt[72]; + m_A70 += gt[73]; + m_A70 += gt[74]; + m_A70 += gt[75]; + m_A68 += go[72]; + m_A67 += go[73]; + double RHS19 = Idr[72]; + RHS19 += Idr[73]; + RHS19 += Idr[74]; + RHS19 += Idr[75]; + RHS19 -= go[74] * *cnV[74]; + RHS19 -= go[75] * *cnV[75]; + const double f0 = 1.0 / m_A0; + const double f0_8 = -f0 * m_A16; + m_A20 += m_A1 * f0_8; + RHS8 += f0_8 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_11 = -f1 * m_A26; + m_A28 += m_A3 * f1_11; + RHS11 += f1_11 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_12 = -f2 * m_A30; + m_A31 += m_A5 * f2_12; + RHS12 += f2_12 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_13 = -f3 * m_A33; + m_A35 += m_A7 * f3_13; + RHS13 += f3_13 * RHS3; + const double f3_17 = -f3 * m_A48; + m_A52 += m_A7 * f3_17; + RHS17 += f3_17 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_13 = -f4 * m_A34; + m_A35 += m_A9 * f4_13; + RHS13 += f4_13 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_14 = -f5 * m_A36; + m_A38 += m_A11 * f5_14; + RHS14 += f5_14 * RHS5; + const double f5_18 = -f5 * m_A57; + m_A61 += m_A11 * f5_18; + RHS18 += f5_18 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_14 = -f6 * m_A37; + m_A38 += m_A13 * f6_14; + RHS14 += f6_14 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_17 = -f7 * m_A49; + m_A54 += m_A15 * f7_17; + RHS17 += f7_17 * RHS7; + const double f7_19 = -f7 * m_A67; + m_A68 += m_A15 * f7_19; + RHS19 += f7_19 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_16 = -f8 * m_A42; + m_A44 += m_A18 * f8_16; + m_A45 += m_A19 * f8_16; + m_A47 += m_A20 * f8_16; + RHS16 += f8_16 * RHS8; + const double f8_17 = -f8 * m_A50; + m_A53 += m_A18 * f8_17; + m_A54 += m_A19 * f8_17; + m_A56 += m_A20 * f8_17; + RHS17 += f8_17 * RHS8; + const double f9 = 1.0 / m_A21; + const double f9_15 = -f9 * m_A39; + m_A41 += m_A22 * f9_15; + RHS15 += f9_15 * RHS9; + const double f9_18 = -f9 * m_A58; + m_A65 += m_A22 * f9_18; + RHS18 += f9_18 * RHS9; + const double f10 = 1.0 / m_A23; + const double f10_16 = -f10 * m_A43; + m_A44 += m_A24 * f10_16; + m_A46 += m_A25 * f10_16; + RHS16 += f10_16 * RHS10; + const double f10_18 = -f10 * m_A59; + m_A63 += m_A24 * f10_18; + m_A65 += m_A25 * f10_18; + RHS18 += f10_18 * RHS10; + const double f11 = 1.0 / m_A27; + const double f11_18 = -f11 * m_A60; + m_A62 += m_A28 * f11_18; + m_A65 += m_A29 * f11_18; + RHS18 += f11_18 * RHS11; + const double f12 = 1.0 / m_A31; + const double f12_17 = -f12 * m_A51; + m_A54 += m_A32 * f12_17; + RHS17 += f12_17 * RHS12; + const double f13 = 1.0 / m_A35; + const double f13_17 = -f13 * m_A52; + RHS17 += f13_17 * RHS13; + const double f14 = 1.0 / m_A38; + const double f14_18 = -f14 * m_A61; + RHS18 += f14_18 * RHS14; + const double f15 = 1.0 / m_A40; + const double f15_18 = -f15 * m_A62; + m_A65 += m_A41 * f15_18; + RHS18 += f15_18 * RHS15; + const double f16 = 1.0 / m_A44; + const double f16_17 = -f16 * m_A53; + m_A54 += m_A45 * f16_17; + m_A55 += m_A46 * f16_17; + m_A56 += m_A47 * f16_17; + RHS17 += f16_17 * RHS16; + const double f16_18 = -f16 * m_A63; + m_A64 += m_A45 * f16_18; + m_A65 += m_A46 * f16_18; + m_A66 += m_A47 * f16_18; + RHS18 += f16_18 * RHS16; + const double f17 = 1.0 / m_A54; + const double f17_18 = -f17 * m_A64; + m_A65 += m_A55 * f17_18; + m_A66 += m_A56 * f17_18; + RHS18 += f17_18 * RHS17; + const double f17_19 = -f17 * m_A68; + m_A69 += m_A55 * f17_19; + m_A70 += m_A56 * f17_19; + RHS19 += f17_19 * RHS17; + const double f18 = 1.0 / m_A65; + const double f18_19 = -f18 * m_A69; + m_A70 += m_A66 * f18_19; + RHS19 += f18_19 * RHS18; + V[19] = RHS19 / m_A70; + double tmp18 = 0.0; + tmp18 += m_A66 * V[19]; + V[18] = (RHS18 - tmp18) / m_A65; + double tmp17 = 0.0; + tmp17 += m_A55 * V[18]; + tmp17 += m_A56 * V[19]; + V[17] = (RHS17 - tmp17) / m_A54; + double tmp16 = 0.0; + tmp16 += m_A45 * V[17]; + tmp16 += m_A46 * V[18]; + tmp16 += m_A47 * V[19]; + V[16] = (RHS16 - tmp16) / m_A44; + double tmp15 = 0.0; + tmp15 += m_A41 * V[18]; + V[15] = (RHS15 - tmp15) / m_A40; + double tmp14 = 0.0; + V[14] = (RHS14 - tmp14) / m_A38; + double tmp13 = 0.0; + V[13] = (RHS13 - tmp13) / m_A35; + double tmp12 = 0.0; + tmp12 += m_A32 * V[17]; + V[12] = (RHS12 - tmp12) / m_A31; + double tmp11 = 0.0; + tmp11 += m_A28 * V[15]; + tmp11 += m_A29 * V[18]; + V[11] = (RHS11 - tmp11) / m_A27; + double tmp10 = 0.0; + tmp10 += m_A24 * V[16]; + tmp10 += m_A25 * V[18]; + V[10] = (RHS10 - tmp10) / m_A23; + double tmp9 = 0.0; + tmp9 += m_A22 * V[18]; + V[9] = (RHS9 - tmp9) / m_A21; + double tmp8 = 0.0; + tmp8 += m_A18 * V[16]; + tmp8 += m_A19 * V[17]; + tmp8 += m_A20 * V[19]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A15 * V[17]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[14]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[14]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[13]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[13]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[12]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[15]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[19]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zac1b11142 +static void nl_gcr_7_double_double_87cb2c78a2628efd(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A0 += gt[2]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 += Idr[2]; + RHS0 -= go[1] * *cnV[1]; + RHS0 -= go[2] * *cnV[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A3 += go[3]; + m_A3 += go[4]; + double RHS1 = Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + m_A6 += gt[7]; + m_A6 += gt[8]; + m_A6 += gt[9]; + m_A6 += gt[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A5 += go[7]; + m_A5 += go[8]; + m_A4 += go[9]; + double RHS2 = Idr[7]; + RHS2 += Idr[8]; + RHS2 += Idr[9]; + RHS2 += Idr[10]; + RHS2 += Idr[11]; + RHS2 += Idr[12]; + RHS2 += Idr[13]; + RHS2 -= go[10] * *cnV[10]; + RHS2 -= go[11] * *cnV[11]; + RHS2 -= go[12] * *cnV[12]; + RHS2 -= go[13] * *cnV[13]; + const double f0 = 1.0 / m_A0; + const double f0_2 = -f0 * m_A4; + m_A6 += m_A1 * f0_2; + RHS2 += f0_2 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_2 = -f1 * m_A5; + m_A6 += m_A3 * f1_2; + RHS2 += f1_2 * RHS1; + V[2] = RHS2 / m_A6; + double tmp1 = 0.0; + tmp1 += m_A3 * V[2]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[2]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zac1b11142 +static void nl_gcr_96_double_double_287a160e7c36b5b0(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A2 += gt[4]; + m_A2 += gt[5]; + m_A2 += gt[6]; + m_A2 += gt[7]; + m_A2 += gt[8]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 += Idr[4]; + RHS1 += Idr[5]; + RHS1 += Idr[6]; + RHS1 += Idr[7]; + RHS1 += Idr[8]; + RHS1 -= go[3] * *cnV[3]; + RHS1 -= go[4] * *cnV[4]; + RHS1 -= go[5] * *cnV[5]; + RHS1 -= go[6] * *cnV[6]; + RHS1 -= go[7] * *cnV[7]; + RHS1 -= go[8] * *cnV[8]; + m_A4 += gt[9]; + m_A4 += gt[10]; + m_A5 += go[9]; + double RHS2 = Idr[9]; + RHS2 += Idr[10]; + RHS2 -= go[10] * *cnV[10]; + m_A6 += gt[11]; + m_A6 += gt[12]; + m_A6 += gt[13]; + m_A6 += gt[14]; + m_A6 += gt[15]; + m_A6 += gt[16]; + m_A6 += gt[17]; + m_A7 += go[11]; + double RHS3 = Idr[11]; + RHS3 += Idr[12]; + RHS3 += Idr[13]; + RHS3 += Idr[14]; + RHS3 += Idr[15]; + RHS3 += Idr[16]; + RHS3 += Idr[17]; + RHS3 -= go[12] * *cnV[12]; + RHS3 -= go[13] * *cnV[13]; + RHS3 -= go[14] * *cnV[14]; + RHS3 -= go[15] * *cnV[15]; + RHS3 -= go[16] * *cnV[16]; + RHS3 -= go[17] * *cnV[17]; + m_A8 += gt[18]; + m_A8 += gt[19]; + m_A8 += gt[20]; + m_A8 += gt[21]; + m_A8 += gt[22]; + m_A8 += gt[23]; + m_A8 += gt[24]; + m_A9 += go[18]; + double RHS4 = Idr[18]; + RHS4 += Idr[19]; + RHS4 += Idr[20]; + RHS4 += Idr[21]; + RHS4 += Idr[22]; + RHS4 += Idr[23]; + RHS4 += Idr[24]; + RHS4 -= go[19] * *cnV[19]; + RHS4 -= go[20] * *cnV[20]; + RHS4 -= go[21] * *cnV[21]; + RHS4 -= go[22] * *cnV[22]; + RHS4 -= go[23] * *cnV[23]; + RHS4 -= go[24] * *cnV[24]; + m_A10 += gt[25]; + m_A10 += gt[26]; + m_A10 += gt[27]; + m_A10 += gt[28]; + m_A10 += gt[29]; + m_A11 += go[25]; + m_A12 += go[26]; + double RHS5 = Idr[25]; + RHS5 += Idr[26]; + RHS5 += Idr[27]; + RHS5 += Idr[28]; + RHS5 += Idr[29]; + RHS5 -= go[27] * *cnV[27]; + RHS5 -= go[28] * *cnV[28]; + RHS5 -= go[29] * *cnV[29]; + m_A13 += gt[30]; + m_A13 += gt[31]; + m_A13 += gt[32]; + m_A14 += go[30]; + double RHS6 = Idr[30]; + RHS6 += Idr[31]; + RHS6 += Idr[32]; + RHS6 -= go[31] * *cnV[31]; + RHS6 -= go[32] * *cnV[32]; + m_A15 += gt[33]; + m_A15 += gt[34]; + m_A16 += go[33]; + double RHS7 = Idr[33]; + RHS7 += Idr[34]; + RHS7 -= go[34] * *cnV[34]; + m_A17 += gt[35]; + m_A17 += gt[36]; + m_A17 += gt[37]; + m_A18 += go[35]; + double RHS8 = Idr[35]; + RHS8 += Idr[36]; + RHS8 += Idr[37]; + RHS8 -= go[36] * *cnV[36]; + RHS8 -= go[37] * *cnV[37]; + m_A20 += gt[38]; + m_A20 += gt[39]; + m_A19 += go[38]; + double RHS9 = Idr[38]; + RHS9 += Idr[39]; + RHS9 -= go[39] * *cnV[39]; + m_A21 += gt[40]; + m_A21 += gt[41]; + m_A21 += gt[42]; + m_A22 += go[40]; + double RHS10 = Idr[40]; + RHS10 += Idr[41]; + RHS10 += Idr[42]; + RHS10 -= go[41] * *cnV[41]; + RHS10 -= go[42] * *cnV[42]; + m_A23 += gt[43]; + m_A23 += gt[44]; + m_A23 += gt[45]; + m_A24 += go[43]; + m_A25 += go[44]; + double RHS11 = Idr[43]; + RHS11 += Idr[44]; + RHS11 += Idr[45]; + RHS11 -= go[45] * *cnV[45]; + m_A26 += gt[46]; + m_A26 += gt[47]; + m_A26 += gt[48]; + m_A27 += go[46]; + double RHS12 = Idr[46]; + RHS12 += Idr[47]; + RHS12 += Idr[48]; + RHS12 -= go[47] * *cnV[47]; + RHS12 -= go[48] * *cnV[48]; + m_A29 += gt[49]; + m_A29 += gt[50]; + m_A28 += go[49]; + double RHS13 = Idr[49]; + RHS13 += Idr[50]; + RHS13 -= go[50] * *cnV[50]; + m_A31 += gt[51]; + m_A31 += gt[52]; + m_A31 += gt[53]; + m_A31 += gt[54]; + m_A31 += gt[55]; + m_A30 += go[51]; + m_A33 += go[52]; + double RHS14 = Idr[51]; + RHS14 += Idr[52]; + RHS14 += Idr[53]; + RHS14 += Idr[54]; + RHS14 += Idr[55]; + RHS14 -= go[53] * *cnV[53]; + RHS14 -= go[54] * *cnV[54]; + RHS14 -= go[55] * *cnV[55]; + m_A35 += gt[56]; + m_A35 += gt[57]; + m_A35 += gt[58]; + m_A37 += go[56]; + m_A34 += go[57]; + double RHS15 = Idr[56]; + RHS15 += Idr[57]; + RHS15 += Idr[58]; + RHS15 -= go[58] * *cnV[58]; + m_A39 += gt[59]; + m_A39 += gt[60]; + m_A39 += gt[61]; + m_A39 += gt[62]; + m_A39 += gt[63]; + m_A38 += go[59]; + m_A41 += go[60]; + double RHS16 = Idr[59]; + RHS16 += Idr[60]; + RHS16 += Idr[61]; + RHS16 += Idr[62]; + RHS16 += Idr[63]; + RHS16 -= go[61] * *cnV[61]; + RHS16 -= go[62] * *cnV[62]; + RHS16 -= go[63] * *cnV[63]; + m_A44 += gt[64]; + m_A44 += gt[65]; + m_A43 += go[64]; + m_A42 += go[65]; + double RHS17 = Idr[64]; + RHS17 += Idr[65]; + m_A47 += gt[66]; + m_A47 += gt[67]; + m_A47 += gt[68]; + m_A48 += go[66]; + m_A45 += go[67]; + double RHS18 = Idr[66]; + RHS18 += Idr[67]; + RHS18 += Idr[68]; + RHS18 -= go[68] * *cnV[68]; + m_A51 += gt[69]; + m_A51 += gt[70]; + m_A51 += gt[71]; + m_A51 += gt[72]; + m_A52 += go[69]; + m_A50 += go[70]; + double RHS19 = Idr[69]; + RHS19 += Idr[70]; + RHS19 += Idr[71]; + RHS19 += Idr[72]; + RHS19 -= go[71] * *cnV[71]; + RHS19 -= go[72] * *cnV[72]; + m_A54 += gt[73]; + m_A54 += gt[74]; + m_A56 += go[73]; + m_A53 += go[74]; + double RHS20 = Idr[73]; + RHS20 += Idr[74]; + m_A58 += gt[75]; + m_A58 += gt[76]; + m_A58 += gt[77]; + m_A58 += gt[78]; + m_A59 += go[75]; + m_A57 += go[76]; + double RHS21 = Idr[75]; + RHS21 += Idr[76]; + RHS21 += Idr[77]; + RHS21 += Idr[78]; + RHS21 -= go[77] * *cnV[77]; + RHS21 -= go[78] * *cnV[78]; + m_A64 += gt[79]; + m_A64 += gt[80]; + m_A64 += gt[81]; + m_A64 += gt[82]; + m_A64 += gt[83]; + m_A64 += gt[84]; + m_A60 += go[79]; + m_A61 += go[80]; + m_A66 += go[81]; + m_A66 += go[82]; + double RHS22 = Idr[79]; + RHS22 += Idr[80]; + RHS22 += Idr[81]; + RHS22 += Idr[82]; + RHS22 += Idr[83]; + RHS22 += Idr[84]; + RHS22 -= go[83] * *cnV[83]; + RHS22 -= go[84] * *cnV[84]; + m_A73 += gt[85]; + m_A73 += gt[86]; + m_A73 += gt[87]; + m_A73 += gt[88]; + m_A73 += gt[89]; + m_A69 += go[85]; + m_A70 += go[86]; + m_A71 += go[87]; + m_A68 += go[88]; + m_A67 += go[89]; + double RHS23 = Idr[85]; + RHS23 += Idr[86]; + RHS23 += Idr[87]; + RHS23 += Idr[88]; + RHS23 += Idr[89]; + m_A76 += gt[90]; + m_A76 += gt[91]; + m_A76 += gt[92]; + m_A76 += gt[93]; + m_A77 += go[90]; + m_A75 += go[91]; + double RHS24 = Idr[90]; + RHS24 += Idr[91]; + RHS24 += Idr[92]; + RHS24 += Idr[93]; + RHS24 -= go[92] * *cnV[92]; + RHS24 -= go[93] * *cnV[93]; + m_A85 += gt[94]; + m_A85 += gt[95]; + m_A85 += gt[96]; + m_A85 += gt[97]; + m_A85 += gt[98]; + m_A81 += go[94]; + m_A80 += go[95]; + m_A82 += go[96]; + m_A79 += go[97]; + m_A78 += go[98]; + double RHS25 = Idr[94]; + RHS25 += Idr[95]; + RHS25 += Idr[96]; + RHS25 += Idr[97]; + RHS25 += Idr[98]; + m_A95 += gt[99]; + m_A95 += gt[100]; + m_A95 += gt[101]; + m_A95 += gt[102]; + m_A95 += gt[103]; + m_A95 += gt[104]; + m_A95 += gt[105]; + m_A95 += gt[106]; + m_A89 += go[99]; + m_A92 += go[100]; + m_A92 += go[101]; + m_A90 += go[102]; + m_A88 += go[103]; + m_A87 += go[104]; + double RHS26 = Idr[99]; + RHS26 += Idr[100]; + RHS26 += Idr[101]; + RHS26 += Idr[102]; + RHS26 += Idr[103]; + RHS26 += Idr[104]; + RHS26 += Idr[105]; + RHS26 += Idr[106]; + RHS26 -= go[105] * *cnV[105]; + RHS26 -= go[106] * *cnV[106]; + const double f0 = 1.0 / m_A0; + const double f0_9 = -f0 * m_A19; + m_A20 += m_A1 * f0_9; + RHS9 += f0_9 * RHS0; + const double f0_23 = -f0 * m_A67; + m_A69 += m_A1 * f0_23; + RHS23 += f0_23 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_16 = -f1 * m_A38; + m_A40 += m_A3 * f1_16; + RHS16 += f1_16 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_13 = -f2 * m_A28; + m_A29 += m_A5 * f2_13; + RHS13 += f2_13 * RHS2; + const double f2_26 = -f2 * m_A87; + m_A89 += m_A5 * f2_26; + RHS26 += f2_26 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_22 = -f3 * m_A60; + m_A63 += m_A7 * f3_22; + RHS22 += f3_22 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_14 = -f4 * m_A30; + m_A32 += m_A9 * f4_14; + RHS14 += f4_14 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_15 = -f5 * m_A34; + m_A35 += m_A11 * f5_15; + m_A36 += m_A12 * f5_15; + RHS15 += f5_15 * RHS5; + const double f5_18 = -f5 * m_A45; + m_A46 += m_A11 * f5_18; + m_A47 += m_A12 * f5_18; + RHS18 += f5_18 * RHS5; + const double f6 = 1.0 / m_A13; + const double f6_19 = -f6 * m_A50; + m_A52 += m_A14 * f6_19; + RHS19 += f6_19 * RHS6; + const double f6_23 = -f6 * m_A68; + m_A73 += m_A14 * f6_23; + RHS23 += f6_23 * RHS6; + const double f7 = 1.0 / m_A15; + const double f7_17 = -f7 * m_A42; + m_A44 += m_A16 * f7_17; + RHS17 += f7_17 * RHS7; + const double f7_25 = -f7 * m_A78; + m_A81 += m_A16 * f7_25; + RHS25 += f7_25 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_17 = -f8 * m_A43; + m_A44 += m_A18 * f8_17; + RHS17 += f8_17 * RHS8; + const double f9 = 1.0 / m_A20; + const double f9_23 = -f9 * m_A69; + RHS23 += f9_23 * RHS9; + const double f10 = 1.0 / m_A21; + const double f10_21 = -f10 * m_A57; + m_A59 += m_A22 * f10_21; + RHS21 += f10_21 * RHS10; + const double f10_26 = -f10 * m_A88; + m_A95 += m_A22 * f10_26; + RHS26 += f10_26 * RHS10; + const double f11 = 1.0 / m_A23; + const double f11_20 = -f11 * m_A53; + m_A54 += m_A24 * f11_20; + m_A55 += m_A25 * f11_20; + RHS20 += f11_20 * RHS11; + const double f11_22 = -f11 * m_A61; + m_A62 += m_A24 * f11_22; + m_A64 += m_A25 * f11_22; + RHS22 += f11_22 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_24 = -f12 * m_A75; + m_A77 += m_A27 * f12_24; + RHS24 += f12_24 * RHS12; + const double f12_25 = -f12 * m_A79; + m_A85 += m_A27 * f12_25; + RHS25 += f12_25 * RHS12; + const double f13 = 1.0 / m_A29; + const double f13_26 = -f13 * m_A89; + RHS26 += f13_26 * RHS13; + const double f14 = 1.0 / m_A31; + const double f14_25 = -f14 * m_A80; + m_A84 += m_A32 * f14_25; + m_A85 += m_A33 * f14_25; + RHS25 += f14_25 * RHS14; + const double f15 = 1.0 / m_A35; + const double f15_18 = -f15 * m_A46; + m_A47 += m_A36 * f15_18; + m_A49 += m_A37 * f15_18; + RHS18 += f15_18 * RHS15; + const double f15_26 = -f15 * m_A90; + m_A91 += m_A36 * f15_26; + m_A95 += m_A37 * f15_26; + RHS26 += f15_26 * RHS15; + const double f16 = 1.0 / m_A39; + const double f16_23 = -f16 * m_A70; + m_A72 += m_A40 * f16_23; + m_A73 += m_A41 * f16_23; + RHS23 += f16_23 * RHS16; + const double f17 = 1.0 / m_A44; + const double f17_25 = -f17 * m_A81; + RHS25 += f17_25 * RHS17; + const double f18 = 1.0 / m_A47; + const double f18_23 = -f18 * m_A71; + m_A73 += m_A48 * f18_23; + m_A74 += m_A49 * f18_23; + RHS23 += f18_23 * RHS18; + const double f18_26 = -f18 * m_A91; + m_A93 += m_A48 * f18_26; + m_A95 += m_A49 * f18_26; + RHS26 += f18_26 * RHS18; + const double f19 = 1.0 / m_A51; + const double f19_23 = -f19 * m_A72; + m_A73 += m_A52 * f19_23; + RHS23 += f19_23 * RHS19; + const double f20 = 1.0 / m_A54; + const double f20_22 = -f20 * m_A62; + m_A64 += m_A55 * f20_22; + m_A65 += m_A56 * f20_22; + RHS22 += f20_22 * RHS20; + const double f20_25 = -f20 * m_A82; + m_A83 += m_A55 * f20_25; + m_A85 += m_A56 * f20_25; + RHS25 += f20_25 * RHS20; + const double f21 = 1.0 / m_A58; + const double f21_22 = -f21 * m_A63; + m_A66 += m_A59 * f21_22; + RHS22 += f21_22 * RHS21; + const double f22 = 1.0 / m_A64; + const double f22_25 = -f22 * m_A83; + m_A85 += m_A65 * f22_25; + m_A86 += m_A66 * f22_25; + RHS25 += f22_25 * RHS22; + const double f22_26 = -f22 * m_A92; + m_A94 += m_A65 * f22_26; + m_A95 += m_A66 * f22_26; + RHS26 += f22_26 * RHS22; + const double f23 = 1.0 / m_A73; + const double f23_26 = -f23 * m_A93; + m_A95 += m_A74 * f23_26; + RHS26 += f23_26 * RHS23; + const double f24 = 1.0 / m_A76; + const double f24_25 = -f24 * m_A84; + m_A85 += m_A77 * f24_25; + RHS25 += f24_25 * RHS24; + const double f25 = 1.0 / m_A85; + const double f25_26 = -f25 * m_A94; + m_A95 += m_A86 * f25_26; + RHS26 += f25_26 * RHS25; + V[26] = RHS26 / m_A95; + double tmp25 = 0.0; + tmp25 += m_A86 * V[26]; + V[25] = (RHS25 - tmp25) / m_A85; + double tmp24 = 0.0; + tmp24 += m_A77 * V[25]; + V[24] = (RHS24 - tmp24) / m_A76; + double tmp23 = 0.0; + tmp23 += m_A74 * V[26]; + V[23] = (RHS23 - tmp23) / m_A73; + double tmp22 = 0.0; + tmp22 += m_A65 * V[25]; + tmp22 += m_A66 * V[26]; + V[22] = (RHS22 - tmp22) / m_A64; + double tmp21 = 0.0; + tmp21 += m_A59 * V[26]; + V[21] = (RHS21 - tmp21) / m_A58; + double tmp20 = 0.0; + tmp20 += m_A55 * V[22]; + tmp20 += m_A56 * V[25]; + V[20] = (RHS20 - tmp20) / m_A54; + double tmp19 = 0.0; + tmp19 += m_A52 * V[23]; + V[19] = (RHS19 - tmp19) / m_A51; + double tmp18 = 0.0; + tmp18 += m_A48 * V[23]; + tmp18 += m_A49 * V[26]; + V[18] = (RHS18 - tmp18) / m_A47; + double tmp17 = 0.0; + V[17] = (RHS17 - tmp17) / m_A44; + double tmp16 = 0.0; + tmp16 += m_A40 * V[19]; + tmp16 += m_A41 * V[23]; + V[16] = (RHS16 - tmp16) / m_A39; + double tmp15 = 0.0; + tmp15 += m_A36 * V[18]; + tmp15 += m_A37 * V[26]; + V[15] = (RHS15 - tmp15) / m_A35; + double tmp14 = 0.0; + tmp14 += m_A32 * V[24]; + tmp14 += m_A33 * V[25]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + V[13] = (RHS13 - tmp13) / m_A29; + double tmp12 = 0.0; + tmp12 += m_A27 * V[25]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A24 * V[20]; + tmp11 += m_A25 * V[22]; + V[11] = (RHS11 - tmp11) / m_A23; + double tmp10 = 0.0; + tmp10 += m_A22 * V[26]; + V[10] = (RHS10 - tmp10) / m_A21; + double tmp9 = 0.0; + V[9] = (RHS9 - tmp9) / m_A20; + double tmp8 = 0.0; + tmp8 += m_A18 * V[17]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A16 * V[17]; + V[7] = (RHS7 - tmp7) / m_A15; + double tmp6 = 0.0; + tmp6 += m_A14 * V[23]; + V[6] = (RHS6 - tmp6) / m_A13; + double tmp5 = 0.0; + tmp5 += m_A11 * V[15]; + tmp5 += m_A12 * V[18]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[24]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[21]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[13]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[19]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[9]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +// zektor +static void nl_gcr_144_double_double_fbff020f5f5d5a5(double * __restrict V, const double * __restrict go, const double * __restrict gt, const double * __restrict Idr, const double * const * __restrict cnV) + +{ + + plib::unused_var(cnV); + double m_A0(0.0); + double m_A1(0.0); + double m_A2(0.0); + double m_A3(0.0); + double m_A4(0.0); + double m_A5(0.0); + double m_A6(0.0); + double m_A7(0.0); + double m_A8(0.0); + double m_A9(0.0); + double m_A10(0.0); + double m_A11(0.0); + double m_A12(0.0); + double m_A13(0.0); + double m_A14(0.0); + double m_A15(0.0); + double m_A16(0.0); + double m_A17(0.0); + double m_A18(0.0); + double m_A19(0.0); + double m_A20(0.0); + double m_A21(0.0); + double m_A22(0.0); + double m_A23(0.0); + double m_A24(0.0); + double m_A25(0.0); + double m_A26(0.0); + double m_A27(0.0); + double m_A28(0.0); + double m_A29(0.0); + double m_A30(0.0); + double m_A31(0.0); + double m_A32(0.0); + double m_A33(0.0); + double m_A34(0.0); + double m_A35(0.0); + double m_A36(0.0); + double m_A37(0.0); + double m_A38(0.0); + double m_A39(0.0); + double m_A40(0.0); + double m_A41(0.0); + double m_A42(0.0); + double m_A43(0.0); + double m_A44(0.0); + double m_A45(0.0); + double m_A46(0.0); + double m_A47(0.0); + double m_A48(0.0); + double m_A49(0.0); + double m_A50(0.0); + double m_A51(0.0); + double m_A52(0.0); + double m_A53(0.0); + double m_A54(0.0); + double m_A55(0.0); + double m_A56(0.0); + double m_A57(0.0); + double m_A58(0.0); + double m_A59(0.0); + double m_A60(0.0); + double m_A61(0.0); + double m_A62(0.0); + double m_A63(0.0); + double m_A64(0.0); + double m_A65(0.0); + double m_A66(0.0); + double m_A67(0.0); + double m_A68(0.0); + double m_A69(0.0); + double m_A70(0.0); + double m_A71(0.0); + double m_A72(0.0); + double m_A73(0.0); + double m_A74(0.0); + double m_A75(0.0); + double m_A76(0.0); + double m_A77(0.0); + double m_A78(0.0); + double m_A79(0.0); + double m_A80(0.0); + double m_A81(0.0); + double m_A82(0.0); + double m_A83(0.0); + double m_A84(0.0); + double m_A85(0.0); + double m_A86(0.0); + double m_A87(0.0); + double m_A88(0.0); + double m_A89(0.0); + double m_A90(0.0); + double m_A91(0.0); + double m_A92(0.0); + double m_A93(0.0); + double m_A94(0.0); + double m_A95(0.0); + double m_A96(0.0); + double m_A97(0.0); + double m_A98(0.0); + double m_A99(0.0); + double m_A100(0.0); + double m_A101(0.0); + double m_A102(0.0); + double m_A103(0.0); + double m_A104(0.0); + double m_A105(0.0); + double m_A106(0.0); + double m_A107(0.0); + double m_A108(0.0); + double m_A109(0.0); + double m_A110(0.0); + double m_A111(0.0); + double m_A112(0.0); + double m_A113(0.0); + double m_A114(0.0); + double m_A115(0.0); + double m_A116(0.0); + double m_A117(0.0); + double m_A118(0.0); + double m_A119(0.0); + double m_A120(0.0); + double m_A121(0.0); + double m_A122(0.0); + double m_A123(0.0); + double m_A124(0.0); + double m_A125(0.0); + double m_A126(0.0); + double m_A127(0.0); + double m_A128(0.0); + double m_A129(0.0); + double m_A130(0.0); + double m_A131(0.0); + double m_A132(0.0); + double m_A133(0.0); + double m_A134(0.0); + double m_A135(0.0); + double m_A136(0.0); + double m_A137(0.0); + double m_A138(0.0); + double m_A139(0.0); + double m_A140(0.0); + double m_A141(0.0); + double m_A142(0.0); + double m_A143(0.0); + m_A0 += gt[0]; + m_A0 += gt[1]; + m_A1 += go[0]; + double RHS0 = Idr[0]; + RHS0 += Idr[1]; + RHS0 -= go[1] * *cnV[1]; + m_A2 += gt[2]; + m_A2 += gt[3]; + m_A3 += go[2]; + double RHS1 = Idr[2]; + RHS1 += Idr[3]; + RHS1 -= go[3] * *cnV[3]; + m_A4 += gt[4]; + m_A4 += gt[5]; + m_A5 += go[4]; + double RHS2 = Idr[4]; + RHS2 += Idr[5]; + RHS2 -= go[5] * *cnV[5]; + m_A6 += gt[6]; + m_A6 += gt[7]; + m_A7 += go[6]; + double RHS3 = Idr[6]; + RHS3 += Idr[7]; + RHS3 -= go[7] * *cnV[7]; + m_A8 += gt[8]; + m_A8 += gt[9]; + m_A9 += go[8]; + double RHS4 = Idr[8]; + RHS4 += Idr[9]; + RHS4 -= go[9] * *cnV[9]; + m_A10 += gt[10]; + m_A10 += gt[11]; + m_A11 += go[10]; + double RHS5 = Idr[10]; + RHS5 += Idr[11]; + RHS5 -= go[11] * *cnV[11]; + m_A12 += gt[12]; + m_A12 += gt[13]; + m_A13 += go[12]; + double RHS6 = Idr[12]; + RHS6 += Idr[13]; + RHS6 -= go[13] * *cnV[13]; + m_A14 += gt[14]; + m_A14 += gt[15]; + m_A14 += gt[16]; + m_A16 += go[14]; + m_A15 += go[15]; + double RHS7 = Idr[14]; + RHS7 += Idr[15]; + RHS7 += Idr[16]; + RHS7 -= go[16] * *cnV[16]; + m_A17 += gt[17]; + m_A17 += gt[18]; + m_A18 += go[17]; + double RHS8 = Idr[17]; + RHS8 += Idr[18]; + RHS8 -= go[18] * *cnV[18]; + m_A19 += gt[19]; + m_A19 += gt[20]; + m_A19 += gt[21]; + m_A21 += go[19]; + m_A20 += go[20]; + double RHS9 = Idr[19]; + RHS9 += Idr[20]; + RHS9 += Idr[21]; + RHS9 -= go[21] * *cnV[21]; + m_A22 += gt[22]; + m_A22 += gt[23]; + m_A22 += gt[24]; + m_A23 += go[22]; + double RHS10 = Idr[22]; + RHS10 += Idr[23]; + RHS10 += Idr[24]; + RHS10 -= go[23] * *cnV[23]; + RHS10 -= go[24] * *cnV[24]; + m_A24 += gt[25]; + m_A24 += gt[26]; + m_A25 += go[25]; + double RHS11 = Idr[25]; + RHS11 += Idr[26]; + RHS11 -= go[26] * *cnV[26]; + m_A26 += gt[27]; + m_A26 += gt[28]; + m_A27 += go[27]; + double RHS12 = Idr[27]; + RHS12 += Idr[28]; + RHS12 -= go[28] * *cnV[28]; + m_A28 += gt[29]; + m_A28 += gt[30]; + m_A28 += gt[31]; + m_A28 += gt[32]; + m_A30 += go[29]; + m_A29 += go[30]; + double RHS13 = Idr[29]; + RHS13 += Idr[30]; + RHS13 += Idr[31]; + RHS13 += Idr[32]; + RHS13 -= go[31] * *cnV[31]; + RHS13 -= go[32] * *cnV[32]; + m_A31 += gt[33]; + m_A31 += gt[34]; + m_A31 += gt[35]; + m_A32 += go[33]; + double RHS14 = Idr[33]; + RHS14 += Idr[34]; + RHS14 += Idr[35]; + RHS14 -= go[34] * *cnV[34]; + RHS14 -= go[35] * *cnV[35]; + m_A33 += gt[36]; + m_A33 += gt[37]; + m_A34 += go[36]; + m_A35 += go[37]; + double RHS15 = Idr[36]; + RHS15 += Idr[37]; + m_A36 += gt[38]; + m_A36 += gt[39]; + m_A38 += go[38]; + m_A37 += go[39]; + double RHS16 = Idr[38]; + RHS16 += Idr[39]; + m_A39 += gt[40]; + m_A39 += gt[41]; + m_A39 += gt[42]; + m_A40 += go[40]; + double RHS17 = Idr[40]; + RHS17 += Idr[41]; + RHS17 += Idr[42]; + RHS17 -= go[41] * *cnV[41]; + RHS17 -= go[42] * *cnV[42]; + m_A41 += gt[43]; + m_A41 += gt[44]; + m_A41 += gt[45]; + m_A43 += go[43]; + m_A42 += go[44]; + double RHS18 = Idr[43]; + RHS18 += Idr[44]; + RHS18 += Idr[45]; + RHS18 -= go[45] * *cnV[45]; + m_A44 += gt[46]; + m_A44 += gt[47]; + m_A44 += gt[48]; + m_A44 += gt[49]; + m_A44 += gt[50]; + m_A44 += gt[51]; + m_A45 += go[46]; + m_A46 += go[47]; + double RHS19 = Idr[46]; + RHS19 += Idr[47]; + RHS19 += Idr[48]; + RHS19 += Idr[49]; + RHS19 += Idr[50]; + RHS19 += Idr[51]; + RHS19 -= go[48] * *cnV[48]; + RHS19 -= go[49] * *cnV[49]; + RHS19 -= go[50] * *cnV[50]; + RHS19 -= go[51] * *cnV[51]; + m_A47 += gt[52]; + m_A47 += gt[53]; + m_A47 += gt[54]; + m_A49 += go[52]; + m_A48 += go[53]; + double RHS20 = Idr[52]; + RHS20 += Idr[53]; + RHS20 += Idr[54]; + RHS20 -= go[54] * *cnV[54]; + m_A50 += gt[55]; + m_A50 += gt[56]; + m_A50 += gt[57]; + m_A50 += gt[58]; + m_A50 += gt[59]; + m_A50 += gt[60]; + m_A50 += gt[61]; + m_A52 += go[55]; + m_A51 += go[56]; + double RHS21 = Idr[55]; + RHS21 += Idr[56]; + RHS21 += Idr[57]; + RHS21 += Idr[58]; + RHS21 += Idr[59]; + RHS21 += Idr[60]; + RHS21 += Idr[61]; + RHS21 -= go[57] * *cnV[57]; + RHS21 -= go[58] * *cnV[58]; + RHS21 -= go[59] * *cnV[59]; + RHS21 -= go[60] * *cnV[60]; + RHS21 -= go[61] * *cnV[61]; + m_A53 += gt[62]; + m_A53 += gt[63]; + m_A53 += gt[64]; + m_A54 += go[62]; + m_A55 += go[63]; + double RHS22 = Idr[62]; + RHS22 += Idr[63]; + RHS22 += Idr[64]; + RHS22 -= go[64] * *cnV[64]; + m_A58 += gt[65]; + m_A58 += gt[66]; + m_A58 += gt[67]; + m_A57 += go[65]; + m_A56 += go[66]; + double RHS23 = Idr[65]; + RHS23 += Idr[66]; + RHS23 += Idr[67]; + RHS23 -= go[67] * *cnV[67]; + m_A61 += gt[68]; + m_A61 += gt[69]; + m_A61 += gt[70]; + m_A62 += go[68]; + m_A60 += go[69]; + double RHS24 = Idr[68]; + RHS24 += Idr[69]; + RHS24 += Idr[70]; + RHS24 -= go[70] * *cnV[70]; + m_A65 += gt[71]; + m_A65 += gt[72]; + m_A65 += gt[73]; + m_A63 += go[71]; + m_A66 += go[72]; + double RHS25 = Idr[71]; + RHS25 += Idr[72]; + RHS25 += Idr[73]; + RHS25 -= go[73] * *cnV[73]; + m_A69 += gt[74]; + m_A69 += gt[75]; + m_A69 += gt[76]; + m_A68 += go[74]; + m_A67 += go[75]; + double RHS26 = Idr[74]; + RHS26 += Idr[75]; + RHS26 += Idr[76]; + RHS26 -= go[76] * *cnV[76]; + m_A74 += gt[77]; + m_A74 += gt[78]; + m_A74 += gt[79]; + m_A74 += gt[80]; + m_A72 += go[77]; + m_A71 += go[78]; + m_A73 += go[79]; + double RHS27 = Idr[77]; + RHS27 += Idr[78]; + RHS27 += Idr[79]; + RHS27 += Idr[80]; + RHS27 -= go[80] * *cnV[80]; + m_A78 += gt[81]; + m_A78 += gt[82]; + m_A78 += gt[83]; + m_A77 += go[81]; + m_A76 += go[82]; + double RHS28 = Idr[81]; + RHS28 += Idr[82]; + RHS28 += Idr[83]; + RHS28 -= go[83] * *cnV[83]; + m_A81 += gt[84]; + m_A81 += gt[85]; + m_A81 += gt[86]; + m_A82 += go[84]; + m_A80 += go[85]; + double RHS29 = Idr[84]; + RHS29 += Idr[85]; + RHS29 += Idr[86]; + RHS29 -= go[86] * *cnV[86]; + m_A85 += gt[87]; + m_A85 += gt[88]; + m_A85 += gt[89]; + m_A84 += go[87]; + m_A83 += go[88]; + double RHS30 = Idr[87]; + RHS30 += Idr[88]; + RHS30 += Idr[89]; + RHS30 -= go[89] * *cnV[89]; + m_A90 += gt[90]; + m_A90 += gt[91]; + m_A90 += gt[92]; + m_A90 += gt[93]; + m_A90 += gt[94]; + m_A88 += go[90]; + m_A87 += go[91]; + m_A92 += go[92]; + double RHS31 = Idr[90]; + RHS31 += Idr[91]; + RHS31 += Idr[92]; + RHS31 += Idr[93]; + RHS31 += Idr[94]; + RHS31 -= go[93] * *cnV[93]; + RHS31 -= go[94] * *cnV[94]; + m_A95 += gt[95]; + m_A95 += gt[96]; + m_A95 += gt[97]; + m_A95 += gt[98]; + m_A94 += go[95]; + m_A93 += go[96]; + double RHS32 = Idr[95]; + RHS32 += Idr[96]; + RHS32 += Idr[97]; + RHS32 += Idr[98]; + RHS32 -= go[97] * *cnV[97]; + RHS32 -= go[98] * *cnV[98]; + m_A99 += gt[99]; + m_A99 += gt[100]; + m_A99 += gt[101]; + m_A97 += go[99]; + m_A100 += go[100]; + double RHS33 = Idr[99]; + RHS33 += Idr[100]; + RHS33 += Idr[101]; + RHS33 -= go[101] * *cnV[101]; + m_A103 += gt[102]; + m_A103 += gt[103]; + m_A103 += gt[104]; + m_A102 += go[102]; + m_A101 += go[103]; + double RHS34 = Idr[102]; + RHS34 += Idr[103]; + RHS34 += Idr[104]; + RHS34 -= go[104] * *cnV[104]; + m_A107 += gt[105]; + m_A107 += gt[106]; + m_A107 += gt[107]; + m_A105 += go[105]; + m_A106 += go[106]; + double RHS35 = Idr[105]; + RHS35 += Idr[106]; + RHS35 += Idr[107]; + RHS35 -= go[107] * *cnV[107]; + m_A112 += gt[108]; + m_A112 += gt[109]; + m_A112 += gt[110]; + m_A112 += gt[111]; + m_A110 += go[108]; + m_A114 += go[109]; + m_A109 += go[110]; + double RHS36 = Idr[108]; + RHS36 += Idr[109]; + RHS36 += Idr[110]; + RHS36 += Idr[111]; + RHS36 -= go[111] * *cnV[111]; + m_A117 += gt[112]; + m_A117 += gt[113]; + m_A117 += gt[114]; + m_A115 += go[112]; + m_A118 += go[113]; + double RHS37 = Idr[112]; + RHS37 += Idr[113]; + RHS37 += Idr[114]; + RHS37 -= go[114] * *cnV[114]; + m_A127 += gt[115]; + m_A127 += gt[116]; + m_A127 += gt[117]; + m_A127 += gt[118]; + m_A127 += gt[119]; + m_A127 += gt[120]; + m_A124 += go[115]; + m_A121 += go[116]; + m_A120 += go[117]; + m_A122 += go[118]; + m_A119 += go[119]; + double RHS38 = Idr[115]; + RHS38 += Idr[116]; + RHS38 += Idr[117]; + RHS38 += Idr[118]; + RHS38 += Idr[119]; + RHS38 += Idr[120]; + RHS38 -= go[120] * *cnV[120]; + m_A131 += gt[121]; + m_A131 += gt[122]; + m_A131 += gt[123]; + m_A129 += go[121]; + m_A132 += go[122]; + double RHS39 = Idr[121]; + RHS39 += Idr[122]; + RHS39 += Idr[123]; + RHS39 -= go[123] * *cnV[123]; + m_A143 += gt[124]; + m_A143 += gt[125]; + m_A143 += gt[126]; + m_A143 += gt[127]; + m_A143 += gt[128]; + m_A143 += gt[129]; + m_A143 += gt[130]; + m_A143 += gt[131]; + m_A143 += gt[132]; + m_A143 += gt[133]; + m_A143 += gt[134]; + m_A133 += go[124]; + m_A134 += go[125]; + m_A142 += go[126]; + m_A140 += go[127]; + m_A137 += go[128]; + m_A136 += go[129]; + m_A135 += go[130]; + m_A139 += go[131]; + double RHS40 = Idr[124]; + RHS40 += Idr[125]; + RHS40 += Idr[126]; + RHS40 += Idr[127]; + RHS40 += Idr[128]; + RHS40 += Idr[129]; + RHS40 += Idr[130]; + RHS40 += Idr[131]; + RHS40 += Idr[132]; + RHS40 += Idr[133]; + RHS40 += Idr[134]; + RHS40 -= go[132] * *cnV[132]; + RHS40 -= go[133] * *cnV[133]; + RHS40 -= go[134] * *cnV[134]; + const double f0 = 1.0 / m_A0; + const double f0_29 = -f0 * m_A80; + m_A81 += m_A1 * f0_29; + RHS29 += f0_29 * RHS0; + const double f1 = 1.0 / m_A2; + const double f1_36 = -f1 * m_A109; + m_A112 += m_A3 * f1_36; + RHS36 += f1_36 * RHS1; + const double f2 = 1.0 / m_A4; + const double f2_30 = -f2 * m_A83; + m_A85 += m_A5 * f2_30; + RHS30 += f2_30 * RHS2; + const double f3 = 1.0 / m_A6; + const double f3_23 = -f3 * m_A56; + m_A58 += m_A7 * f3_23; + RHS23 += f3_23 * RHS3; + const double f4 = 1.0 / m_A8; + const double f4_26 = -f4 * m_A67; + m_A69 += m_A9 * f4_26; + RHS26 += f4_26 * RHS4; + const double f5 = 1.0 / m_A10; + const double f5_34 = -f5 * m_A101; + m_A103 += m_A11 * f5_34; + RHS34 += f5_34 * RHS5; + const double f6 = 1.0 / m_A12; + const double f6_24 = -f6 * m_A60; + m_A61 += m_A13 * f6_24; + RHS24 += f6_24 * RHS6; + const double f7 = 1.0 / m_A14; + const double f7_23 = -f7 * m_A57; + m_A58 += m_A15 * f7_23; + m_A59 += m_A16 * f7_23; + RHS23 += f7_23 * RHS7; + const double f7_25 = -f7 * m_A63; + m_A64 += m_A15 * f7_25; + m_A65 += m_A16 * f7_25; + RHS25 += f7_25 * RHS7; + const double f8 = 1.0 / m_A17; + const double f8_28 = -f8 * m_A76; + m_A78 += m_A18 * f8_28; + RHS28 += f8_28 * RHS8; + const double f9 = 1.0 / m_A19; + const double f9_26 = -f9 * m_A68; + m_A69 += m_A20 * f9_26; + m_A70 += m_A21 * f9_26; + RHS26 += f9_26 * RHS9; + const double f9_33 = -f9 * m_A97; + m_A98 += m_A20 * f9_33; + m_A99 += m_A21 * f9_33; + RHS33 += f9_33 * RHS9; + const double f10 = 1.0 / m_A22; + const double f10_27 = -f10 * m_A71; + m_A74 += m_A23 * f10_27; + RHS27 += f10_27 * RHS10; + const double f11 = 1.0 / m_A24; + const double f11_27 = -f11 * m_A72; + m_A74 += m_A25 * f11_27; + RHS27 += f11_27 * RHS11; + const double f12 = 1.0 / m_A26; + const double f12_32 = -f12 * m_A93; + m_A95 += m_A27 * f12_32; + RHS32 += f12_32 * RHS12; + const double f13 = 1.0 / m_A28; + const double f13_27 = -f13 * m_A73; + m_A74 += m_A29 * f13_27; + m_A75 += m_A30 * f13_27; + RHS27 += f13_27 * RHS13; + const double f13_38 = -f13 * m_A119; + m_A123 += m_A29 * f13_38; + m_A127 += m_A30 * f13_38; + RHS38 += f13_38 * RHS13; + const double f14 = 1.0 / m_A31; + const double f14_38 = -f14 * m_A120; + m_A127 += m_A32 * f14_38; + RHS38 += f14_38 * RHS14; + const double f15 = 1.0 / m_A33; + const double f15_31 = -f15 * m_A87; + m_A90 += m_A34 * f15_31; + m_A91 += m_A35 * f15_31; + RHS31 += f15_31 * RHS15; + const double f15_36 = -f15 * m_A110; + m_A111 += m_A34 * f15_36; + m_A112 += m_A35 * f15_36; + RHS36 += f15_36 * RHS15; + const double f16 = 1.0 / m_A36; + const double f16_28 = -f16 * m_A77; + m_A78 += m_A37 * f16_28; + m_A79 += m_A38 * f16_28; + RHS28 += f16_28 * RHS16; + const double f16_31 = -f16 * m_A88; + m_A89 += m_A37 * f16_31; + m_A90 += m_A38 * f16_31; + RHS31 += f16_31 * RHS16; + const double f17 = 1.0 / m_A39; + const double f17_38 = -f17 * m_A121; + m_A127 += m_A40 * f17_38; + RHS38 += f17_38 * RHS17; + const double f18 = 1.0 / m_A41; + const double f18_30 = -f18 * m_A84; + m_A85 += m_A42 * f18_30; + m_A86 += m_A43 * f18_30; + RHS30 += f18_30 * RHS18; + const double f18_37 = -f18 * m_A115; + m_A116 += m_A42 * f18_37; + m_A117 += m_A43 * f18_37; + RHS37 += f18_37 * RHS18; + const double f19 = 1.0 / m_A44; + const double f19_32 = -f19 * m_A94; + m_A95 += m_A45 * f19_32; + m_A96 += m_A46 * f19_32; + RHS32 += f19_32 * RHS19; + const double f19_38 = -f19 * m_A122; + m_A125 += m_A45 * f19_38; + m_A127 += m_A46 * f19_38; + RHS38 += f19_38 * RHS19; + const double f20 = 1.0 / m_A47; + const double f20_34 = -f20 * m_A102; + m_A103 += m_A48 * f20_34; + m_A104 += m_A49 * f20_34; + RHS34 += f20_34 * RHS20; + const double f20_39 = -f20 * m_A129; + m_A130 += m_A48 * f20_39; + m_A131 += m_A49 * f20_39; + RHS39 += f20_39 * RHS20; + const double f21 = 1.0 / m_A50; + const double f21_40 = -f21 * m_A133; + m_A135 += m_A51 * f21_40; + m_A143 += m_A52 * f21_40; + RHS40 += f21_40 * RHS21; + const double f22 = 1.0 / m_A53; + const double f22_35 = -f22 * m_A105; + m_A107 += m_A54 * f22_35; + m_A108 += m_A55 * f22_35; + RHS35 += f22_35 * RHS22; + const double f22_40 = -f22 * m_A134; + m_A138 += m_A54 * f22_40; + m_A143 += m_A55 * f22_40; + RHS40 += f22_40 * RHS22; + const double f23 = 1.0 / m_A58; + const double f23_25 = -f23 * m_A64; + m_A65 += m_A59 * f23_25; + RHS25 += f23_25 * RHS23; + const double f24 = 1.0 / m_A61; + const double f24_40 = -f24 * m_A135; + m_A143 += m_A62 * f24_40; + RHS40 += f24_40 * RHS24; + const double f25 = 1.0 / m_A65; + const double f25_40 = -f25 * m_A136; + m_A143 += m_A66 * f25_40; + RHS40 += f25_40 * RHS25; + const double f26 = 1.0 / m_A69; + const double f26_33 = -f26 * m_A98; + m_A99 += m_A70 * f26_33; + RHS33 += f26_33 * RHS26; + const double f27 = 1.0 / m_A74; + const double f27_38 = -f27 * m_A123; + m_A127 += m_A75 * f27_38; + RHS38 += f27_38 * RHS27; + const double f28 = 1.0 / m_A78; + const double f28_31 = -f28 * m_A89; + m_A90 += m_A79 * f28_31; + RHS31 += f28_31 * RHS28; + const double f29 = 1.0 / m_A81; + const double f29_35 = -f29 * m_A106; + m_A107 += m_A82 * f29_35; + RHS35 += f29_35 * RHS29; + const double f30 = 1.0 / m_A85; + const double f30_37 = -f30 * m_A116; + m_A117 += m_A86 * f30_37; + RHS37 += f30_37 * RHS30; + const double f31 = 1.0 / m_A90; + const double f31_36 = -f31 * m_A111; + m_A112 += m_A91 * f31_36; + m_A113 += m_A92 * f31_36; + RHS36 += f31_36 * RHS31; + const double f31_38 = -f31 * m_A124; + m_A126 += m_A91 * f31_38; + m_A127 += m_A92 * f31_38; + RHS38 += f31_38 * RHS31; + const double f32 = 1.0 / m_A95; + const double f32_38 = -f32 * m_A125; + m_A127 += m_A96 * f32_38; + RHS38 += f32_38 * RHS32; + const double f33 = 1.0 / m_A99; + const double f33_40 = -f33 * m_A137; + m_A143 += m_A100 * f33_40; + RHS40 += f33_40 * RHS33; + const double f34 = 1.0 / m_A103; + const double f34_39 = -f34 * m_A130; + m_A131 += m_A104 * f34_39; + RHS39 += f34_39 * RHS34; + const double f35 = 1.0 / m_A107; + const double f35_40 = -f35 * m_A138; + m_A143 += m_A108 * f35_40; + RHS40 += f35_40 * RHS35; + const double f36 = 1.0 / m_A112; + const double f36_38 = -f36 * m_A126; + m_A127 += m_A113 * f36_38; + m_A128 += m_A114 * f36_38; + RHS38 += f36_38 * RHS36; + const double f36_40 = -f36 * m_A139; + m_A141 += m_A113 * f36_40; + m_A143 += m_A114 * f36_40; + RHS40 += f36_40 * RHS36; + const double f37 = 1.0 / m_A117; + const double f37_40 = -f37 * m_A140; + m_A143 += m_A118 * f37_40; + RHS40 += f37_40 * RHS37; + const double f38 = 1.0 / m_A127; + const double f38_40 = -f38 * m_A141; + m_A143 += m_A128 * f38_40; + RHS40 += f38_40 * RHS38; + const double f39 = 1.0 / m_A131; + const double f39_40 = -f39 * m_A142; + m_A143 += m_A132 * f39_40; + RHS40 += f39_40 * RHS39; + V[40] = RHS40 / m_A143; + double tmp39 = 0.0; + tmp39 += m_A132 * V[40]; + V[39] = (RHS39 - tmp39) / m_A131; + double tmp38 = 0.0; + tmp38 += m_A128 * V[40]; + V[38] = (RHS38 - tmp38) / m_A127; + double tmp37 = 0.0; + tmp37 += m_A118 * V[40]; + V[37] = (RHS37 - tmp37) / m_A117; + double tmp36 = 0.0; + tmp36 += m_A113 * V[38]; + tmp36 += m_A114 * V[40]; + V[36] = (RHS36 - tmp36) / m_A112; + double tmp35 = 0.0; + tmp35 += m_A108 * V[40]; + V[35] = (RHS35 - tmp35) / m_A107; + double tmp34 = 0.0; + tmp34 += m_A104 * V[39]; + V[34] = (RHS34 - tmp34) / m_A103; + double tmp33 = 0.0; + tmp33 += m_A100 * V[40]; + V[33] = (RHS33 - tmp33) / m_A99; + double tmp32 = 0.0; + tmp32 += m_A96 * V[38]; + V[32] = (RHS32 - tmp32) / m_A95; + double tmp31 = 0.0; + tmp31 += m_A91 * V[36]; + tmp31 += m_A92 * V[38]; + V[31] = (RHS31 - tmp31) / m_A90; + double tmp30 = 0.0; + tmp30 += m_A86 * V[37]; + V[30] = (RHS30 - tmp30) / m_A85; + double tmp29 = 0.0; + tmp29 += m_A82 * V[35]; + V[29] = (RHS29 - tmp29) / m_A81; + double tmp28 = 0.0; + tmp28 += m_A79 * V[31]; + V[28] = (RHS28 - tmp28) / m_A78; + double tmp27 = 0.0; + tmp27 += m_A75 * V[38]; + V[27] = (RHS27 - tmp27) / m_A74; + double tmp26 = 0.0; + tmp26 += m_A70 * V[33]; + V[26] = (RHS26 - tmp26) / m_A69; + double tmp25 = 0.0; + tmp25 += m_A66 * V[40]; + V[25] = (RHS25 - tmp25) / m_A65; + double tmp24 = 0.0; + tmp24 += m_A62 * V[40]; + V[24] = (RHS24 - tmp24) / m_A61; + double tmp23 = 0.0; + tmp23 += m_A59 * V[25]; + V[23] = (RHS23 - tmp23) / m_A58; + double tmp22 = 0.0; + tmp22 += m_A54 * V[35]; + tmp22 += m_A55 * V[40]; + V[22] = (RHS22 - tmp22) / m_A53; + double tmp21 = 0.0; + tmp21 += m_A51 * V[24]; + tmp21 += m_A52 * V[40]; + V[21] = (RHS21 - tmp21) / m_A50; + double tmp20 = 0.0; + tmp20 += m_A48 * V[34]; + tmp20 += m_A49 * V[39]; + V[20] = (RHS20 - tmp20) / m_A47; + double tmp19 = 0.0; + tmp19 += m_A45 * V[32]; + tmp19 += m_A46 * V[38]; + V[19] = (RHS19 - tmp19) / m_A44; + double tmp18 = 0.0; + tmp18 += m_A42 * V[30]; + tmp18 += m_A43 * V[37]; + V[18] = (RHS18 - tmp18) / m_A41; + double tmp17 = 0.0; + tmp17 += m_A40 * V[38]; + V[17] = (RHS17 - tmp17) / m_A39; + double tmp16 = 0.0; + tmp16 += m_A37 * V[28]; + tmp16 += m_A38 * V[31]; + V[16] = (RHS16 - tmp16) / m_A36; + double tmp15 = 0.0; + tmp15 += m_A34 * V[31]; + tmp15 += m_A35 * V[36]; + V[15] = (RHS15 - tmp15) / m_A33; + double tmp14 = 0.0; + tmp14 += m_A32 * V[38]; + V[14] = (RHS14 - tmp14) / m_A31; + double tmp13 = 0.0; + tmp13 += m_A29 * V[27]; + tmp13 += m_A30 * V[38]; + V[13] = (RHS13 - tmp13) / m_A28; + double tmp12 = 0.0; + tmp12 += m_A27 * V[32]; + V[12] = (RHS12 - tmp12) / m_A26; + double tmp11 = 0.0; + tmp11 += m_A25 * V[27]; + V[11] = (RHS11 - tmp11) / m_A24; + double tmp10 = 0.0; + tmp10 += m_A23 * V[27]; + V[10] = (RHS10 - tmp10) / m_A22; + double tmp9 = 0.0; + tmp9 += m_A20 * V[26]; + tmp9 += m_A21 * V[33]; + V[9] = (RHS9 - tmp9) / m_A19; + double tmp8 = 0.0; + tmp8 += m_A18 * V[28]; + V[8] = (RHS8 - tmp8) / m_A17; + double tmp7 = 0.0; + tmp7 += m_A15 * V[23]; + tmp7 += m_A16 * V[25]; + V[7] = (RHS7 - tmp7) / m_A14; + double tmp6 = 0.0; + tmp6 += m_A13 * V[24]; + V[6] = (RHS6 - tmp6) / m_A12; + double tmp5 = 0.0; + tmp5 += m_A11 * V[34]; + V[5] = (RHS5 - tmp5) / m_A10; + double tmp4 = 0.0; + tmp4 += m_A9 * V[26]; + V[4] = (RHS4 - tmp4) / m_A8; + double tmp3 = 0.0; + tmp3 += m_A7 * V[23]; + V[3] = (RHS3 - tmp3) / m_A6; + double tmp2 = 0.0; + tmp2 += m_A5 * V[30]; + V[2] = (RHS2 - tmp2) / m_A4; + double tmp1 = 0.0; + tmp1 += m_A3 * V[36]; + V[1] = (RHS1 - tmp1) / m_A2; + double tmp0 = 0.0; + tmp0 += m_A1 * V[29]; + V[0] = (RHS0 - tmp0) / m_A0; +} + +#endif + +extern const plib::static_library::symbol nl_static_solver_syms[]; +const plib::static_library::symbol nl_static_solver_syms[] = { +#if !defined(__EMSCRIPTEN__) + +// 1942 + {"nl_gcr_90_double_double_ce766957cb26ff3e", reinterpret_cast<void *>(&nl_gcr_90_double_double_ce766957cb26ff3e)}, // NOLINT +// 280zzzap + {"nl_gcr_149_double_double_fc9971724787b82b", reinterpret_cast<void *>(&nl_gcr_149_double_double_fc9971724787b82b)}, // NOLINT +// 280zzzap + {"nl_gcr_95_double_double_24643c159711f292", reinterpret_cast<void *>(&nl_gcr_95_double_double_24643c159711f292)}, // NOLINT +// armora + {"nl_gcr_22_double_double_a6cfda6668b153c2", reinterpret_cast<void *>(&nl_gcr_22_double_double_a6cfda6668b153c2)}, // NOLINT +// armora,boxingb + {"nl_gcr_45_double_double_d27a39bc93616187", reinterpret_cast<void *>(&nl_gcr_45_double_double_d27a39bc93616187)}, // NOLINT +// armora + {"nl_gcr_56_double_double_afcde432efdafb81", reinterpret_cast<void *>(&nl_gcr_56_double_double_afcde432efdafb81)}, // NOLINT +// armora + {"nl_gcr_58_double_double_64e460d8f716cd89", reinterpret_cast<void *>(&nl_gcr_58_double_double_64e460d8f716cd89)}, // NOLINT +// armora + {"nl_gcr_67_double_double_ee2cacaa15d32491", reinterpret_cast<void *>(&nl_gcr_67_double_double_ee2cacaa15d32491)}, // NOLINT +// astrob + {"nl_gcr_154_double_double_13833bf8c127deaa", reinterpret_cast<void *>(&nl_gcr_154_double_double_13833bf8c127deaa)}, // NOLINT +// astrob + {"nl_gcr_159_double_double_339c6b457f339538", reinterpret_cast<void *>(&nl_gcr_159_double_double_339c6b457f339538)}, // NOLINT +// astrob + {"nl_gcr_15_double_double_6c24726f30e8dc34", reinterpret_cast<void *>(&nl_gcr_15_double_double_6c24726f30e8dc34)}, // NOLINT +// astrob + {"nl_gcr_20_double_double_41c6441d98369158", reinterpret_cast<void *>(&nl_gcr_20_double_double_41c6441d98369158)}, // NOLINT +// astrob + {"nl_gcr_27_double_double_62464664b1c5aa1e", reinterpret_cast<void *>(&nl_gcr_27_double_double_62464664b1c5aa1e)}, // NOLINT +// astrob + {"nl_gcr_285_double_double_ee61dcaa355fc625", reinterpret_cast<void *>(&nl_gcr_285_double_double_ee61dcaa355fc625)}, // NOLINT +// astrob + {"nl_gcr_43_double_double_cf1018e7ed626623", reinterpret_cast<void *>(&nl_gcr_43_double_double_cf1018e7ed626623)}, // NOLINT +// astrob + {"nl_gcr_46_double_double_536c3652eb3bc075", reinterpret_cast<void *>(&nl_gcr_46_double_double_536c3652eb3bc075)}, // NOLINT +// barrier,spacewar + {"nl_gcr_10_double_double_a50a4b733e95414a", reinterpret_cast<void *>(&nl_gcr_10_double_double_a50a4b733e95414a)}, // NOLINT +// barrier,spacewar + {"nl_gcr_10_double_double_ecf17036ce1c07cf", reinterpret_cast<void *>(&nl_gcr_10_double_double_ecf17036ce1c07cf)}, // NOLINT +// barrier + {"nl_gcr_13_double_double_f425d4008ae1d2c6", reinterpret_cast<void *>(&nl_gcr_13_double_double_f425d4008ae1d2c6)}, // NOLINT +// barrier + {"nl_gcr_15_double_double_d06bd7ddbfd17b5e", reinterpret_cast<void *>(&nl_gcr_15_double_double_d06bd7ddbfd17b5e)}, // NOLINT +// barrier + {"nl_gcr_19_double_double_cc913f9c3f9293e7", reinterpret_cast<void *>(&nl_gcr_19_double_double_cc913f9c3f9293e7)}, // NOLINT +// barrier + {"nl_gcr_31_double_double_79e756c5892cf87d", reinterpret_cast<void *>(&nl_gcr_31_double_double_79e756c5892cf87d)}, // NOLINT +// barrier,spacewar + {"nl_gcr_47_double_double_6ef39a62161d596c", reinterpret_cast<void *>(&nl_gcr_47_double_double_6ef39a62161d596c)}, // NOLINT +// boxingb + {"nl_gcr_16_double_double_50f5194a994d56ec", reinterpret_cast<void *>(&nl_gcr_16_double_double_50f5194a994d56ec)}, // NOLINT +// boxingb + {"nl_gcr_22_double_double_2f84bc98d737730b", reinterpret_cast<void *>(&nl_gcr_22_double_double_2f84bc98d737730b)}, // NOLINT +// boxingb + {"nl_gcr_22_double_double_a6b734322b3ea924", reinterpret_cast<void *>(&nl_gcr_22_double_double_a6b734322b3ea924)}, // NOLINT +// boxingb + {"nl_gcr_23_double_double_53e1117fdb16f546", reinterpret_cast<void *>(&nl_gcr_23_double_double_53e1117fdb16f546)}, // NOLINT +// boxingb + {"nl_gcr_23_double_double_f43cf2a28a5a5561", reinterpret_cast<void *>(&nl_gcr_23_double_double_f43cf2a28a5a5561)}, // NOLINT +// boxingb + {"nl_gcr_25_double_double_a0bf548977306172", reinterpret_cast<void *>(&nl_gcr_25_double_double_a0bf548977306172)}, // NOLINT +// boxingb + {"nl_gcr_29_double_double_a6f74be7f61e6db2", reinterpret_cast<void *>(&nl_gcr_29_double_double_a6f74be7f61e6db2)}, // NOLINT +// boxingb + {"nl_gcr_55_double_double_b8d6d148a50bdb8f", reinterpret_cast<void *>(&nl_gcr_55_double_double_b8d6d148a50bdb8f)}, // NOLINT +// boxingb + {"nl_gcr_96_double_double_a1132c8737d5d463", reinterpret_cast<void *>(&nl_gcr_96_double_double_a1132c8737d5d463)}, // NOLINT +// brdrline + {"nl_gcr_134_double_double_c05df522276e65fd", reinterpret_cast<void *>(&nl_gcr_134_double_double_c05df522276e65fd)}, // NOLINT +// brdrline + {"nl_gcr_13_double_double_576f391d0418cb76", reinterpret_cast<void *>(&nl_gcr_13_double_double_576f391d0418cb76)}, // NOLINT +// brdrline + {"nl_gcr_20_double_double_e03f0bc5ac056326", reinterpret_cast<void *>(&nl_gcr_20_double_double_e03f0bc5ac056326)}, // NOLINT +// brdrline + {"nl_gcr_21_double_double_c5b523ed6a9677e6", reinterpret_cast<void *>(&nl_gcr_21_double_double_c5b523ed6a9677e6)}, // NOLINT +// brdrline + {"nl_gcr_23_double_double_2753fc1815ce0cba", reinterpret_cast<void *>(&nl_gcr_23_double_double_2753fc1815ce0cba)}, // NOLINT +// brdrline + {"nl_gcr_30_double_double_d5e1c37cfa2d2853", reinterpret_cast<void *>(&nl_gcr_30_double_double_d5e1c37cfa2d2853)}, // NOLINT +// brdrline + {"nl_gcr_34_double_double_1fec893028a7b809", reinterpret_cast<void *>(&nl_gcr_34_double_double_1fec893028a7b809)}, // NOLINT +// brdrline + {"nl_gcr_47_double_double_aa68b74ffdea9bd8", reinterpret_cast<void *>(&nl_gcr_47_double_double_aa68b74ffdea9bd8)}, // NOLINT +// brdrline + {"nl_gcr_75_double_double_75400df5d559a266", reinterpret_cast<void *>(&nl_gcr_75_double_double_75400df5d559a266)}, // NOLINT +// brdrline + {"nl_gcr_77_double_double_437326911721091", reinterpret_cast<void *>(&nl_gcr_77_double_double_437326911721091)}, // NOLINT +// brdrline + {"nl_gcr_83_double_double_f99b1245e708ec85", reinterpret_cast<void *>(&nl_gcr_83_double_double_f99b1245e708ec85)}, // NOLINT +// brdrline + {"nl_gcr_89_double_double_3c79fd354e01fa8c", reinterpret_cast<void *>(&nl_gcr_89_double_double_3c79fd354e01fa8c)}, // NOLINT +// brdrline + {"nl_gcr_8_double_double_30923b54310ae144", reinterpret_cast<void *>(&nl_gcr_8_double_double_30923b54310ae144)}, // NOLINT +// brdrline + {"nl_gcr_97_double_double_b66df357763b1dce", reinterpret_cast<void *>(&nl_gcr_97_double_double_b66df357763b1dce)}, // NOLINT +// breakout + {"nl_gcr_10_double_double_b66ff415b228d5f8", reinterpret_cast<void *>(&nl_gcr_10_double_double_b66ff415b228d5f8)}, // NOLINT +// breakout + {"nl_gcr_13_double_double_5a3419e2809520de", reinterpret_cast<void *>(&nl_gcr_13_double_double_5a3419e2809520de)}, // NOLINT +// breakout + {"nl_gcr_13_double_double_a971eeb2ef76f75f", reinterpret_cast<void *>(&nl_gcr_13_double_double_a971eeb2ef76f75f)}, // NOLINT +// breakout + {"nl_gcr_31_double_double_8a1565d1413f42f7", reinterpret_cast<void *>(&nl_gcr_31_double_double_8a1565d1413f42f7)}, // NOLINT +// breakout + {"nl_gcr_7_double_double_7a42b97d838ca073", reinterpret_cast<void *>(&nl_gcr_7_double_double_7a42b97d838ca073)}, // NOLINT +// breakout + {"nl_gcr_7_double_double_cb2aae3366e0ac1c", reinterpret_cast<void *>(&nl_gcr_7_double_double_cb2aae3366e0ac1c)}, // NOLINT +// breakout + {"nl_gcr_7_double_double_f7dc4f87b5a8ba93", reinterpret_cast<void *>(&nl_gcr_7_double_double_f7dc4f87b5a8ba93)}, // NOLINT +// bship + {"nl_gcr_137_double_double_401090c1ee6d0345", reinterpret_cast<void *>(&nl_gcr_137_double_double_401090c1ee6d0345)}, // NOLINT +// bship + {"nl_gcr_44_double_double_6a0b8563aaaa6b06", reinterpret_cast<void *>(&nl_gcr_44_double_double_6a0b8563aaaa6b06)}, // NOLINT +// carpolo + {"nl_gcr_34_double_double_a8f1d076330f06b7", reinterpret_cast<void *>(&nl_gcr_34_double_double_a8f1d076330f06b7)}, // NOLINT +// cheekyms + {"nl_gcr_12_double_double_546396f65ce48700", reinterpret_cast<void *>(&nl_gcr_12_double_double_546396f65ce48700)}, // NOLINT +// cheekyms + {"nl_gcr_150_double_double_e75302e17c866419", reinterpret_cast<void *>(&nl_gcr_150_double_double_e75302e17c866419)}, // NOLINT +// cheekyms + {"nl_gcr_7_double_double_733c72a820fdbd1f", reinterpret_cast<void *>(&nl_gcr_7_double_double_733c72a820fdbd1f)}, // NOLINT +// cocoloco + {"nl_gcr_16_double_double_8c0f7f2284333de5", reinterpret_cast<void *>(&nl_gcr_16_double_double_8c0f7f2284333de5)}, // NOLINT +// destroyr + {"nl_gcr_399_double_double_4334c95878d1be92", reinterpret_cast<void *>(&nl_gcr_399_double_double_4334c95878d1be92)}, // NOLINT +// dribling + {"nl_gcr_21_double_double_c9b5f1625a51d98f", reinterpret_cast<void *>(&nl_gcr_21_double_double_c9b5f1625a51d98f)}, // NOLINT +// dribling + {"nl_gcr_28_double_double_99f81817ea8bea2d", reinterpret_cast<void *>(&nl_gcr_28_double_double_99f81817ea8bea2d)}, // NOLINT +// dribling + {"nl_gcr_29_double_double_1e732268bc2d78b2", reinterpret_cast<void *>(&nl_gcr_29_double_double_1e732268bc2d78b2)}, // NOLINT +// dribling + {"nl_gcr_54_double_double_a2823a76b83c45a0", reinterpret_cast<void *>(&nl_gcr_54_double_double_a2823a76b83c45a0)}, // NOLINT +// dribling + {"nl_gcr_7_double_double_a1ecff4d37b54b76", reinterpret_cast<void *>(&nl_gcr_7_double_double_a1ecff4d37b54b76)}, // NOLINT +// dribling + {"nl_gcr_95_double_double_a0159c41cfc0b644", reinterpret_cast<void *>(&nl_gcr_95_double_double_a0159c41cfc0b644)}, // NOLINT +// elim,zektor + {"nl_gcr_10_double_double_11c2ae166b240b6e", reinterpret_cast<void *>(&nl_gcr_10_double_double_11c2ae166b240b6e)}, // NOLINT +// elim,zektor + {"nl_gcr_10_double_double_81f40a54af2ca202", reinterpret_cast<void *>(&nl_gcr_10_double_double_81f40a54af2ca202)}, // NOLINT +// elim,zektor + {"nl_gcr_12_double_double_d224211d1af6811d", reinterpret_cast<void *>(&nl_gcr_12_double_double_d224211d1af6811d)}, // NOLINT +// elim,zektor + {"nl_gcr_13_double_double_d13f9c6838af6aeb", reinterpret_cast<void *>(&nl_gcr_13_double_double_d13f9c6838af6aeb)}, // NOLINT +// elim,zektor + {"nl_gcr_13_double_double_f4f4e2ee05cb584e", reinterpret_cast<void *>(&nl_gcr_13_double_double_f4f4e2ee05cb584e)}, // NOLINT +// elim + {"nl_gcr_150_double_double_be831e5faa508573", reinterpret_cast<void *>(&nl_gcr_150_double_double_be831e5faa508573)}, // NOLINT +// elim,zektor + {"nl_gcr_15_double_double_bb56fa5325163fc3", reinterpret_cast<void *>(&nl_gcr_15_double_double_bb56fa5325163fc3)}, // NOLINT +// elim,zektor,spacfury + {"nl_gcr_18_double_double_e8aeb165b69427ec", reinterpret_cast<void *>(&nl_gcr_18_double_double_e8aeb165b69427ec)}, // NOLINT +// elim,zektor + {"nl_gcr_18_double_double_fcce97532ad2f49d", reinterpret_cast<void *>(&nl_gcr_18_double_double_fcce97532ad2f49d)}, // NOLINT +// elim,zektor + {"nl_gcr_20_double_double_d2ea3f267b959e8b", reinterpret_cast<void *>(&nl_gcr_20_double_double_d2ea3f267b959e8b)}, // NOLINT +// elim,zektor + {"nl_gcr_36_double_double_e76692c10e79997e", reinterpret_cast<void *>(&nl_gcr_36_double_double_e76692c10e79997e)}, // NOLINT +// elim,zektor + {"nl_gcr_45_double_double_28b736fe552777a9", reinterpret_cast<void *>(&nl_gcr_45_double_double_28b736fe552777a9)}, // NOLINT +// fireone + {"nl_gcr_128_double_double_7aee4423e3fdbfda", reinterpret_cast<void *>(&nl_gcr_128_double_double_7aee4423e3fdbfda)}, // NOLINT +// fireone + {"nl_gcr_153_double_double_cca3d1a4219e2ec0", reinterpret_cast<void *>(&nl_gcr_153_double_double_cca3d1a4219e2ec0)}, // NOLINT +// fireone + {"nl_gcr_35_double_double_8c512fd6a6dabc50", reinterpret_cast<void *>(&nl_gcr_35_double_double_8c512fd6a6dabc50)}, // NOLINT +// fireone + {"nl_gcr_36_double_double_dcbecbc127c5868f", reinterpret_cast<void *>(&nl_gcr_36_double_double_dcbecbc127c5868f)}, // NOLINT +// fireone + {"nl_gcr_36_double_double_fd2796828f1ebd00", reinterpret_cast<void *>(&nl_gcr_36_double_double_fd2796828f1ebd00)}, // NOLINT +// fireone + {"nl_gcr_41_double_double_4f2b2f3cdc384f75", reinterpret_cast<void *>(&nl_gcr_41_double_double_4f2b2f3cdc384f75)}, // NOLINT +// fireone + {"nl_gcr_70_double_double_9aa159329f86ca8b", reinterpret_cast<void *>(&nl_gcr_70_double_double_9aa159329f86ca8b)}, // NOLINT +// fireone + {"nl_gcr_73_double_double_643133e86b2b1628", reinterpret_cast<void *>(&nl_gcr_73_double_double_643133e86b2b1628)}, // NOLINT +// fireone + {"nl_gcr_79_double_double_c1d22fe6e895255d", reinterpret_cast<void *>(&nl_gcr_79_double_double_c1d22fe6e895255d)}, // NOLINT +// fireone + {"nl_gcr_7_double_double_e7fb484f621b3ab9", reinterpret_cast<void *>(&nl_gcr_7_double_double_e7fb484f621b3ab9)}, // NOLINT +// fireone + {"nl_gcr_7_double_double_f8f6a951fd1af6bc", reinterpret_cast<void *>(&nl_gcr_7_double_double_f8f6a951fd1af6bc)}, // NOLINT +// flyball + {"nl_gcr_291_double_double_6622b53554e3776", reinterpret_cast<void *>(&nl_gcr_291_double_double_6622b53554e3776)}, // NOLINT +// flyball + {"nl_gcr_7_double_double_c74b1a65978d7121", reinterpret_cast<void *>(&nl_gcr_7_double_double_c74b1a65978d7121)}, // NOLINT +// flyball + {"nl_gcr_7_double_double_e15d9316d59cdad9", reinterpret_cast<void *>(&nl_gcr_7_double_double_e15d9316d59cdad9)}, // NOLINT +// frogs + {"nl_gcr_119_double_double_ab8d1ff6aa7499d8", reinterpret_cast<void *>(&nl_gcr_119_double_double_ab8d1ff6aa7499d8)}, // NOLINT +// frogs + {"nl_gcr_19_double_double_d97fd7ecc1ebba3d", reinterpret_cast<void *>(&nl_gcr_19_double_double_d97fd7ecc1ebba3d)}, // NOLINT +// frogs + {"nl_gcr_30_double_double_f153eda877c6e8ed", reinterpret_cast<void *>(&nl_gcr_30_double_double_f153eda877c6e8ed)}, // NOLINT +// frogs + {"nl_gcr_33_double_double_75852e71cc632a65", reinterpret_cast<void *>(&nl_gcr_33_double_double_75852e71cc632a65)}, // NOLINT +// frogs + {"nl_gcr_38_double_double_263b618097fad01", reinterpret_cast<void *>(&nl_gcr_38_double_double_263b618097fad01)}, // NOLINT +// frogs + {"nl_gcr_53_double_double_f2de20e827252602", reinterpret_cast<void *>(&nl_gcr_53_double_double_f2de20e827252602)}, // NOLINT +// frogs + {"nl_gcr_7_double_double_84425fea9033e75d", reinterpret_cast<void *>(&nl_gcr_7_double_double_84425fea9033e75d)}, // NOLINT +// frogs + {"nl_gcr_88_double_double_494f233b1a947be1", reinterpret_cast<void *>(&nl_gcr_88_double_double_494f233b1a947be1)}, // NOLINT +// frogs + {"nl_gcr_9_double_double_815733e3f2e05029", reinterpret_cast<void *>(&nl_gcr_9_double_double_815733e3f2e05029)}, // NOLINT +// gamemachine + {"nl_gcr_10_double_double_934712b55bb3b2b2", reinterpret_cast<void *>(&nl_gcr_10_double_double_934712b55bb3b2b2)}, // NOLINT +// gamemachine + {"nl_gcr_7_double_double_782d79b5cbe953b1", reinterpret_cast<void *>(&nl_gcr_7_double_double_782d79b5cbe953b1)}, // NOLINT +// gi6809 + {"nl_gcr_13_double_double_9eda6de0d275a3e5", reinterpret_cast<void *>(&nl_gcr_13_double_double_9eda6de0d275a3e5)}, // NOLINT +// gi6809 + {"nl_gcr_7_double_double_8a409a18e77784cb", reinterpret_cast<void *>(&nl_gcr_7_double_double_8a409a18e77784cb)}, // NOLINT +// gtrak10 + {"nl_gcr_22_double_double_1f38df4919cdddae", reinterpret_cast<void *>(&nl_gcr_22_double_double_1f38df4919cdddae)}, // NOLINT +// gtrak10,elim,zektor + {"nl_gcr_7_double_double_d190a0e3b8e1f4a7", reinterpret_cast<void *>(&nl_gcr_7_double_double_d190a0e3b8e1f4a7)}, // NOLINT +// gunfight + {"nl_gcr_112_double_double_743595e64cee0a5e", reinterpret_cast<void *>(&nl_gcr_112_double_double_743595e64cee0a5e)}, // NOLINT +// gunfight + {"nl_gcr_14_double_double_d05b3dbe370c7904", reinterpret_cast<void *>(&nl_gcr_14_double_double_d05b3dbe370c7904)}, // NOLINT +// jpmsru + {"nl_gcr_55_double_double_4963a2f104e4c797", reinterpret_cast<void *>(&nl_gcr_55_double_double_4963a2f104e4c797)}, // NOLINT +// kidniki + {"nl_gcr_198_double_double_43f7ff9bc651cc7a", reinterpret_cast<void *>(&nl_gcr_198_double_double_43f7ff9bc651cc7a)}, // NOLINT +// kidniki + {"nl_gcr_21_double_double_8046625a0fe0959", reinterpret_cast<void *>(&nl_gcr_21_double_double_8046625a0fe0959)}, // NOLINT +// kidniki + {"nl_gcr_24_double_double_9f141889c2091efc", reinterpret_cast<void *>(&nl_gcr_24_double_double_9f141889c2091efc)}, // NOLINT +// kidniki + {"nl_gcr_34_double_double_d8c511d38cef5f6f", reinterpret_cast<void *>(&nl_gcr_34_double_double_d8c511d38cef5f6f)}, // NOLINT +// kidniki + {"nl_gcr_37_double_double_294dde1e0ecca6d0", reinterpret_cast<void *>(&nl_gcr_37_double_double_294dde1e0ecca6d0)}, // NOLINT +// kidniki + {"nl_gcr_37_double_double_9a5874c8e2da79d2", reinterpret_cast<void *>(&nl_gcr_37_double_double_9a5874c8e2da79d2)}, // NOLINT +// kidniki + {"nl_gcr_67_double_double_fc02559fdbfb0e10", reinterpret_cast<void *>(&nl_gcr_67_double_double_fc02559fdbfb0e10)}, // NOLINT +// konami1x + {"nl_gcr_49_double_double_62b99b9904a8c804", reinterpret_cast<void *>(&nl_gcr_49_double_double_62b99b9904a8c804)}, // NOLINT +// konami2x + {"nl_gcr_85_double_double_f6900d3f36a91049", reinterpret_cast<void *>(&nl_gcr_85_double_double_f6900d3f36a91049)}, // NOLINT +// mario + {"nl_gcr_29_double_double_80b4b1e5cc58d303", reinterpret_cast<void *>(&nl_gcr_29_double_double_80b4b1e5cc58d303)}, // NOLINT +// mario + {"nl_gcr_62_double_double_afce66fb47d3c5f3", reinterpret_cast<void *>(&nl_gcr_62_double_double_afce66fb47d3c5f3)}, // NOLINT +// pong + {"nl_gcr_10_double_double_13e7b5ac1a260dbf", reinterpret_cast<void *>(&nl_gcr_10_double_double_13e7b5ac1a260dbf)}, // NOLINT +// pong + {"nl_gcr_35_double_double_dbafc5ddaf7a08f8", reinterpret_cast<void *>(&nl_gcr_35_double_double_dbafc5ddaf7a08f8)}, // NOLINT +// pong + {"nl_gcr_7_double_double_e51b463cd890ef6d", reinterpret_cast<void *>(&nl_gcr_7_double_double_e51b463cd890ef6d)}, // NOLINT +// popeye + {"nl_gcr_50_double_double_c6f25bb06e161d1c", reinterpret_cast<void *>(&nl_gcr_50_double_double_c6f25bb06e161d1c)}, // NOLINT +// rebound,astrob + {"nl_gcr_13_double_double_a41a44bd5c424f88", reinterpret_cast<void *>(&nl_gcr_13_double_double_a41a44bd5c424f88)}, // NOLINT +// rebound + {"nl_gcr_28_double_double_8bec817b324dcc3", reinterpret_cast<void *>(&nl_gcr_28_double_double_8bec817b324dcc3)}, // NOLINT +// rebound + {"nl_gcr_7_double_double_ae15f7f8a55fc96", reinterpret_cast<void *>(&nl_gcr_7_double_double_ae15f7f8a55fc96)}, // NOLINT +// ripoff,sundance + {"nl_gcr_10_double_double_43188bf576854ae0", reinterpret_cast<void *>(&nl_gcr_10_double_double_43188bf576854ae0)}, // NOLINT +// ripoff + {"nl_gcr_11_double_double_aa07266ef5d420d1", reinterpret_cast<void *>(&nl_gcr_11_double_double_aa07266ef5d420d1)}, // NOLINT +// ripoff + {"nl_gcr_16_double_double_698d5dd47fb16d5", reinterpret_cast<void *>(&nl_gcr_16_double_double_698d5dd47fb16d5)}, // NOLINT +// ripoff + {"nl_gcr_20_double_double_e60314070a75e121", reinterpret_cast<void *>(&nl_gcr_20_double_double_e60314070a75e121)}, // NOLINT +// ripoff + {"nl_gcr_29_double_double_4b5ecfbb8f9fa97b", reinterpret_cast<void *>(&nl_gcr_29_double_double_4b5ecfbb8f9fa97b)}, // NOLINT +// ripoff + {"nl_gcr_35_double_double_76c9e236353caed1", reinterpret_cast<void *>(&nl_gcr_35_double_double_76c9e236353caed1)}, // NOLINT +// ripoff + {"nl_gcr_59_double_double_be7c805100c522fd", reinterpret_cast<void *>(&nl_gcr_59_double_double_be7c805100c522fd)}, // NOLINT +// segas16b_audio + {"nl_gcr_111_double_double_9f7104c5e25c87dd", reinterpret_cast<void *>(&nl_gcr_111_double_double_9f7104c5e25c87dd)}, // NOLINT +// segaspeech + {"nl_gcr_21_double_double_b22769fbf3159a8d", reinterpret_cast<void *>(&nl_gcr_21_double_double_b22769fbf3159a8d)}, // NOLINT +// segausb + {"nl_gcr_12_double_double_5b73834d5f313d38", reinterpret_cast<void *>(&nl_gcr_12_double_double_5b73834d5f313d38)}, // NOLINT +// segausb + {"nl_gcr_30_double_double_8cc4eb213eaeef9b", reinterpret_cast<void *>(&nl_gcr_30_double_double_8cc4eb213eaeef9b)}, // NOLINT +// segausb + {"nl_gcr_84_double_double_c61e08cf5e35918", reinterpret_cast<void *>(&nl_gcr_84_double_double_c61e08cf5e35918)}, // NOLINT +// sfxphasor + {"nl_gcr_40_double_double_53bd9f9a45276ed0", reinterpret_cast<void *>(&nl_gcr_40_double_double_53bd9f9a45276ed0)}, // NOLINT +// solarq,boxingb + {"nl_gcr_10_double_double_d7d45dc58b08cab9", reinterpret_cast<void *>(&nl_gcr_10_double_double_d7d45dc58b08cab9)}, // NOLINT +// solarq + {"nl_gcr_15_double_double_7caaa135bff3d9f3", reinterpret_cast<void *>(&nl_gcr_15_double_double_7caaa135bff3d9f3)}, // NOLINT +// solarq + {"nl_gcr_20_double_double_66496d6073aca98e", reinterpret_cast<void *>(&nl_gcr_20_double_double_66496d6073aca98e)}, // NOLINT +// solarq + {"nl_gcr_303_double_double_62612f71055b8fd4", reinterpret_cast<void *>(&nl_gcr_303_double_double_62612f71055b8fd4)}, // NOLINT +// solarq + {"nl_gcr_45_double_double_e081f90c2e0313f6", reinterpret_cast<void *>(&nl_gcr_45_double_double_e081f90c2e0313f6)}, // NOLINT +// solarq + {"nl_gcr_70_double_double_4e4931ccbfb7a3c", reinterpret_cast<void *>(&nl_gcr_70_double_double_4e4931ccbfb7a3c)}, // NOLINT +// solarq + {"nl_gcr_76_double_double_34e910fc1896999f", reinterpret_cast<void *>(&nl_gcr_76_double_double_34e910fc1896999f)}, // NOLINT +// spacewar + {"nl_gcr_20_double_double_e0b492db40bba291", reinterpret_cast<void *>(&nl_gcr_20_double_double_e0b492db40bba291)}, // NOLINT +// spacewar + {"nl_gcr_22_double_double_e9e8211f43d8f4b3", reinterpret_cast<void *>(&nl_gcr_22_double_double_e9e8211f43d8f4b3)}, // NOLINT +// spacewar + {"nl_gcr_24_double_double_b09deef9a25aecaf", reinterpret_cast<void *>(&nl_gcr_24_double_double_b09deef9a25aecaf)}, // NOLINT +// spacewar + {"nl_gcr_28_double_double_15e8f6fb021de0f9", reinterpret_cast<void *>(&nl_gcr_28_double_double_15e8f6fb021de0f9)}, // NOLINT +// spacfury + {"nl_gcr_110_double_double_4dbd0f2aec7ef707", reinterpret_cast<void *>(&nl_gcr_110_double_double_4dbd0f2aec7ef707)}, // NOLINT +// spacfury + {"nl_gcr_15_double_double_8c1dd4afcf0f8ea2", reinterpret_cast<void *>(&nl_gcr_15_double_double_8c1dd4afcf0f8ea2)}, // NOLINT +// spacfury + {"nl_gcr_16_double_double_f4da1503eabe16cf", reinterpret_cast<void *>(&nl_gcr_16_double_double_f4da1503eabe16cf)}, // NOLINT +// spacfury + {"nl_gcr_175_double_double_b1db23287df1da54", reinterpret_cast<void *>(&nl_gcr_175_double_double_b1db23287df1da54)}, // NOLINT +// spacfury + {"nl_gcr_227_double_double_f3c9a6d53371d709", reinterpret_cast<void *>(&nl_gcr_227_double_double_f3c9a6d53371d709)}, // NOLINT +// spacfury + {"nl_gcr_43_double_double_6eae7b15cd376318", reinterpret_cast<void *>(&nl_gcr_43_double_double_6eae7b15cd376318)}, // NOLINT +// spacfury + {"nl_gcr_45_double_double_f365c3863b050e35", reinterpret_cast<void *>(&nl_gcr_45_double_double_f365c3863b050e35)}, // NOLINT +// spacfury + {"nl_gcr_46_double_double_d4c34516ff6aa139", reinterpret_cast<void *>(&nl_gcr_46_double_double_d4c34516ff6aa139)}, // NOLINT +// spacfury + {"nl_gcr_53_double_double_2a153513d3e8e2cc", reinterpret_cast<void *>(&nl_gcr_53_double_double_2a153513d3e8e2cc)}, // NOLINT +// spacfury + {"nl_gcr_91_double_double_b7b209d222c0a9a6", reinterpret_cast<void *>(&nl_gcr_91_double_double_b7b209d222c0a9a6)}, // NOLINT +// speedfrk + {"nl_gcr_37_double_double_e4f2ffbf201a3d0c", reinterpret_cast<void *>(&nl_gcr_37_double_double_e4f2ffbf201a3d0c)}, // NOLINT +// speedfrk,cheekyms,rebound,astrob,fireone + {"nl_gcr_7_double_double_7c86a9bc1c6aef4c", reinterpret_cast<void *>(&nl_gcr_7_double_double_7c86a9bc1c6aef4c)}, // NOLINT +// speedfrk + {"nl_gcr_7_double_double_e07b5b086812756c", reinterpret_cast<void *>(&nl_gcr_7_double_double_e07b5b086812756c)}, // NOLINT +// sspeedr + {"nl_gcr_10_double_double_ac1e401ddf971e15", reinterpret_cast<void *>(&nl_gcr_10_double_double_ac1e401ddf971e15)}, // NOLINT +// sspeedr,280zzzap + {"nl_gcr_113_double_double_ab9144d965a37e4", reinterpret_cast<void *>(&nl_gcr_113_double_double_ab9144d965a37e4)}, // NOLINT +// sspeedr,280zzzap + {"nl_gcr_122_double_double_42c57d523cac30d0", reinterpret_cast<void *>(&nl_gcr_122_double_double_42c57d523cac30d0)}, // NOLINT +// sspeedr,280zzzap + {"nl_gcr_123_double_double_864a61c57bac9c38", reinterpret_cast<void *>(&nl_gcr_123_double_double_864a61c57bac9c38)}, // NOLINT +// sspeedr + {"nl_gcr_13_double_double_3e833834e5ce5aee", reinterpret_cast<void *>(&nl_gcr_13_double_double_3e833834e5ce5aee)}, // NOLINT +// sspeedr + {"nl_gcr_176_double_double_2294220d3c91e762", reinterpret_cast<void *>(&nl_gcr_176_double_double_2294220d3c91e762)}, // NOLINT +// sspeedr,280zzzap + {"nl_gcr_57_double_double_bb501e6a23177009", reinterpret_cast<void *>(&nl_gcr_57_double_double_bb501e6a23177009)}, // NOLINT +// sspeedr + {"nl_gcr_95_double_double_4a8e2b707bbac8a6", reinterpret_cast<void *>(&nl_gcr_95_double_double_4a8e2b707bbac8a6)}, // NOLINT +// starcas,wotw + {"nl_gcr_109_double_double_5d550fc7441617a2", reinterpret_cast<void *>(&nl_gcr_109_double_double_5d550fc7441617a2)}, // NOLINT +// starcas,wotw + {"nl_gcr_12_double_double_88a8ef5f6bd43d48", reinterpret_cast<void *>(&nl_gcr_12_double_double_88a8ef5f6bd43d48)}, // NOLINT +// starcas,wotw,armora,solarq + {"nl_gcr_22_double_double_1250f340dea396ae", reinterpret_cast<void *>(&nl_gcr_22_double_double_1250f340dea396ae)}, // NOLINT +// starcas,wotw,boxingb + {"nl_gcr_23_double_double_ea2b6e3a05e6ef0b", reinterpret_cast<void *>(&nl_gcr_23_double_double_ea2b6e3a05e6ef0b)}, // NOLINT +// starcas,wotw,solarq + {"nl_gcr_25_double_double_4cb524006206eb1a", reinterpret_cast<void *>(&nl_gcr_25_double_double_4cb524006206eb1a)}, // NOLINT +// starcas,wotw + {"nl_gcr_62_double_double_a582a424cb61c678", reinterpret_cast<void *>(&nl_gcr_62_double_double_a582a424cb61c678)}, // NOLINT +// starcas,wotw + {"nl_gcr_64_double_double_ec4f6d2dad5961b9", reinterpret_cast<void *>(&nl_gcr_64_double_double_ec4f6d2dad5961b9)}, // NOLINT +// starcas,wotw + {"nl_gcr_65_double_double_b7344e05aac90017", reinterpret_cast<void *>(&nl_gcr_65_double_double_b7344e05aac90017)}, // NOLINT +// starcrus + {"nl_gcr_129_double_double_8d7bddf33d942482", reinterpret_cast<void *>(&nl_gcr_129_double_double_8d7bddf33d942482)}, // NOLINT +// starcrus + {"nl_gcr_31_double_double_c2e616f3de30f15b", reinterpret_cast<void *>(&nl_gcr_31_double_double_c2e616f3de30f15b)}, // NOLINT +// starcrus + {"nl_gcr_94_double_double_ef2f49641f433a74", reinterpret_cast<void *>(&nl_gcr_94_double_double_ef2f49641f433a74)}, // NOLINT +// starfire + {"nl_gcr_12_double_double_aceb6035dfb557c9", reinterpret_cast<void *>(&nl_gcr_12_double_double_aceb6035dfb557c9)}, // NOLINT +// starfire + {"nl_gcr_23_double_double_b75e0baeb501e907", reinterpret_cast<void *>(&nl_gcr_23_double_double_b75e0baeb501e907)}, // NOLINT +// starfire + {"nl_gcr_27_double_double_649ebca7fa6793ed", reinterpret_cast<void *>(&nl_gcr_27_double_double_649ebca7fa6793ed)}, // NOLINT +// starfire + {"nl_gcr_438_double_double_d32effa2b0ea54a1", reinterpret_cast<void *>(&nl_gcr_438_double_double_d32effa2b0ea54a1)}, // NOLINT +// starfire + {"nl_gcr_7_double_double_feae15b80dd73620", reinterpret_cast<void *>(&nl_gcr_7_double_double_feae15b80dd73620)}, // NOLINT +// starfire + {"nl_gcr_9_double_double_bd1514d7defd4062", reinterpret_cast<void *>(&nl_gcr_9_double_double_bd1514d7defd4062)}, // NOLINT +// starhawk + {"nl_gcr_12_double_double_67838e11f714c455", reinterpret_cast<void *>(&nl_gcr_12_double_double_67838e11f714c455)}, // NOLINT +// starhawk + {"nl_gcr_40_double_double_1f1086787c94f97c", reinterpret_cast<void *>(&nl_gcr_40_double_double_1f1086787c94f97c)}, // NOLINT +// starhawk + {"nl_gcr_40_double_double_8b1ac1e181eec3fc", reinterpret_cast<void *>(&nl_gcr_40_double_double_8b1ac1e181eec3fc)}, // NOLINT +// starhawk + {"nl_gcr_45_double_double_528a27fe9ed07d67", reinterpret_cast<void *>(&nl_gcr_45_double_double_528a27fe9ed07d67)}, // NOLINT +// starhawk + {"nl_gcr_7_double_double_723fa454468a93d", reinterpret_cast<void *>(&nl_gcr_7_double_double_723fa454468a93d)}, // NOLINT +// stuntcyc + {"nl_gcr_10_double_double_85652d3e3ada285a", reinterpret_cast<void *>(&nl_gcr_10_double_double_85652d3e3ada285a)}, // NOLINT +// stuntcyc + {"nl_gcr_20_double_double_c924fe5960b1479e", reinterpret_cast<void *>(&nl_gcr_20_double_double_c924fe5960b1479e)}, // NOLINT +// stuntcyc,brdrline + {"nl_gcr_7_double_double_59cb6bf7cb9d17dc", reinterpret_cast<void *>(&nl_gcr_7_double_double_59cb6bf7cb9d17dc)}, // NOLINT +// sundance + {"nl_gcr_100_double_double_e02a162cb515a958", reinterpret_cast<void *>(&nl_gcr_100_double_double_e02a162cb515a958)}, // NOLINT +// sundance + {"nl_gcr_70_double_double_8446e63d7842f6a6", reinterpret_cast<void *>(&nl_gcr_70_double_double_8446e63d7842f6a6)}, // NOLINT +// sundance + {"nl_gcr_8_double_double_e5b7711fac1ea80c", reinterpret_cast<void *>(&nl_gcr_8_double_double_e5b7711fac1ea80c)}, // NOLINT +// tailg + {"nl_gcr_119_double_double_144ed14e6bafdb", reinterpret_cast<void *>(&nl_gcr_119_double_double_144ed14e6bafdb)}, // NOLINT +// tailg + {"nl_gcr_12_double_double_7388106355fb27c3", reinterpret_cast<void *>(&nl_gcr_12_double_double_7388106355fb27c3)}, // NOLINT +// tailg + {"nl_gcr_15_double_double_a46301cd3479b8db", reinterpret_cast<void *>(&nl_gcr_15_double_double_a46301cd3479b8db)}, // NOLINT +// tailg + {"nl_gcr_23_double_double_c4cec7aed23b7b94", reinterpret_cast<void *>(&nl_gcr_23_double_double_c4cec7aed23b7b94)}, // NOLINT +// tailg + {"nl_gcr_31_double_double_5ccf7da1202da2e5", reinterpret_cast<void *>(&nl_gcr_31_double_double_5ccf7da1202da2e5)}, // NOLINT +// tank,gamemachine + {"nl_gcr_19_double_double_491f95430bfdfd05", reinterpret_cast<void *>(&nl_gcr_19_double_double_491f95430bfdfd05)}, // NOLINT +// tank + {"nl_gcr_328_double_double_930b64361c2cdba8", reinterpret_cast<void *>(&nl_gcr_328_double_double_930b64361c2cdba8)}, // NOLINT +// tank + {"nl_gcr_36_double_double_a63d1344e34bef4b", reinterpret_cast<void *>(&nl_gcr_36_double_double_a63d1344e34bef4b)}, // NOLINT +// tankbatt + {"nl_gcr_137_double_double_328d886b444b586b", reinterpret_cast<void *>(&nl_gcr_137_double_double_328d886b444b586b)}, // NOLINT +// tankbatt + {"nl_gcr_16_double_double_124f7aa10f044582", reinterpret_cast<void *>(&nl_gcr_16_double_double_124f7aa10f044582)}, // NOLINT +// tp1985 + {"nl_gcr_10_double_double_73f2ba8ad4a45b26", reinterpret_cast<void *>(&nl_gcr_10_double_double_73f2ba8ad4a45b26)}, // NOLINT +// tp1985 + {"nl_gcr_26_double_double_a4540ffea06b4346", reinterpret_cast<void *>(&nl_gcr_26_double_double_a4540ffea06b4346)}, // NOLINT +// tp1985 + {"nl_gcr_7_double_double_74349e9889a2630b", reinterpret_cast<void *>(&nl_gcr_7_double_double_74349e9889a2630b)}, // NOLINT +// warrior + {"nl_gcr_10_double_double_8003d4625273fa4d", reinterpret_cast<void *>(&nl_gcr_10_double_double_8003d4625273fa4d)}, // NOLINT +// warrior,ripoff,sundance + {"nl_gcr_12_double_double_295cf2e2f3d489bf", reinterpret_cast<void *>(&nl_gcr_12_double_double_295cf2e2f3d489bf)}, // NOLINT +// warrior + {"nl_gcr_12_double_double_42a31ce5c187b308", reinterpret_cast<void *>(&nl_gcr_12_double_double_42a31ce5c187b308)}, // NOLINT +// warrior,sundance + {"nl_gcr_12_double_double_ad6dba01ff2425c3", reinterpret_cast<void *>(&nl_gcr_12_double_double_ad6dba01ff2425c3)}, // NOLINT +// warrior + {"nl_gcr_27_double_double_da598f43329e823", reinterpret_cast<void *>(&nl_gcr_27_double_double_da598f43329e823)}, // NOLINT +// warrior + {"nl_gcr_7_double_double_9c975530a1a529d6", reinterpret_cast<void *>(&nl_gcr_7_double_double_9c975530a1a529d6)}, // NOLINT +// warrior + {"nl_gcr_89_double_double_bff07f8d339f7cc4", reinterpret_cast<void *>(&nl_gcr_89_double_double_bff07f8d339f7cc4)}, // NOLINT +// zac1b11142 + {"nl_gcr_12_double_double_861d39f81d29d51", reinterpret_cast<void *>(&nl_gcr_12_double_double_861d39f81d29d51)}, // NOLINT +// zac1b11142 + {"nl_gcr_178_double_double_6041272373b8603c", reinterpret_cast<void *>(&nl_gcr_178_double_double_6041272373b8603c)}, // NOLINT +// zac1b11142 + {"nl_gcr_30_double_double_1fad5cda2646cf42", reinterpret_cast<void *>(&nl_gcr_30_double_double_1fad5cda2646cf42)}, // NOLINT +// zac1b11142 + {"nl_gcr_30_double_double_7425594cec8024ad", reinterpret_cast<void *>(&nl_gcr_30_double_double_7425594cec8024ad)}, // NOLINT +// zac1b11142 + {"nl_gcr_71_double_double_cfd3bbf5fbba4765", reinterpret_cast<void *>(&nl_gcr_71_double_double_cfd3bbf5fbba4765)}, // NOLINT +// zac1b11142 + {"nl_gcr_7_double_double_87cb2c78a2628efd", reinterpret_cast<void *>(&nl_gcr_7_double_double_87cb2c78a2628efd)}, // NOLINT +// zac1b11142 + {"nl_gcr_96_double_double_287a160e7c36b5b0", reinterpret_cast<void *>(&nl_gcr_96_double_double_287a160e7c36b5b0)}, // NOLINT +// zektor + {"nl_gcr_144_double_double_fbff020f5f5d5a5", reinterpret_cast<void *>(&nl_gcr_144_double_double_fbff020f5f5d5a5)}, // NOLINT +#endif + +{"", nullptr} +}; diff --git a/src/lib/netlist/macro/modules/nlmod_icl8038_dip.cpp b/src/lib/netlist/macro/modules/nlmod_icl8038_dip.cpp new file mode 100644 index 00000000000..dac830bcb88 --- /dev/null +++ b/src/lib/netlist/macro/modules/nlmod_icl8038_dip.cpp @@ -0,0 +1,62 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz + +#include "devices/net_lib.h" + +// +// ICL8038 is broadly similar to a 566 VCO, and can be simulated partially as such. +// + +NETLIST_START(ICL8038_DIP) +{ + VCVS(VI, 1) + CCCS(CI1, -1) + CCCS(CI2, 2) + SYS_COMPD(COMP) + SYS_DSW2(SW) + VCVS(VO, 1) + RES(R_SHUNT, RES_R(50)) + + PARAM(VO.RO, 50) + PARAM(COMP.MODEL, "FAMILY(TYPE=CUSTOM IVL=0.16 IVH=0.4 OVL=0.01 OVH=0.01 ORL=50 ORH=50)") + PARAM(SW.GOFF, 0) // This has to be zero to block current sources + + NET_C(VI.OP, CI1.IN, CI2.IN) + NET_C(CI1.OP, VO.IP) + NET_C(COMP.Q, SW.I) + NET_C(CI2.OP, SW.2) + NET_C(COMP.VCC, R_SHUNT.1) + NET_C(SW.1, R_SHUNT.2) + NET_C(SW.3, VO.IP) + NET_C(VO.OP, COMP.IN) + + // Avoid singular Matrix due to G=0 switch + RES(RX1, 1e10) + RES(RX2, 1e10) + NET_C(RX1.1, SW.1) + NET_C(RX2.1, SW.3) + + NET_C(COMP.GND, RX1.2, RX2.2) + + RES(R1, 5000) + RES(R2, 5000) + RES(R3, 5000) + + // Square output wave + VCVS(V_SQR, 1) + NET_C(COMP.Q, V_SQR.IP) + + NET_C(COMP.GND, SW.GND, VI.ON, VI.IN, CI1.ON, CI2.ON, VO.IN, VO.ON, R2.2, V_SQR.IN, V_SQR.ON) + NET_C(COMP.VCC, SW.VCC, R1.2) + NET_C(COMP.IP, R1.1, R2.1, R3.1) + NET_C(COMP.Q, R3.2) + + ALIAS(11, VI.ON) // GND + ALIAS(9, V_SQR.OP) // Square out + ALIAS(3, VO.OP) // Triangle out + ALIAS(8, VI.IP) // VC + ALIAS(4, CI1.IP) // R1 + ALIAS(5, CI2.IP) // R2 + ALIAS(10, VO.IP) // C1 + ALIAS(6, COMP.VCC) // V+ +} diff --git a/src/lib/netlist/macro/modules/nlmod_ne556_dip.cpp b/src/lib/netlist/macro/modules/nlmod_ne556_dip.cpp new file mode 100644 index 00000000000..fa6924cda92 --- /dev/null +++ b/src/lib/netlist/macro/modules/nlmod_ne556_dip.cpp @@ -0,0 +1,25 @@ +// license:BSD-3-Clause +// copyright-holders:Ryan Holtz +// + +#include "devices/net_lib.h" + +NETLIST_START(NE556_DIP) +{ + NE555(A) + NE555(B) + + NET_C(A.GND, B.GND) + NET_C(A.VCC, B.VCC) + + DIPPINS( /* +--------------+ */ + A.DISCH, /* 1DISCH |1 ++ 14| VCC */ A.VCC, + A.THRESH, /* 1THRES |2 13| 2DISCH */ B.DISCH, + A.CONT, /* 1CONT |3 12| 2THRES */ B.THRESH, + A.RESET, /* 1RESET |4 NE556 11| 2CONT */ B.CONT, + A.OUT, /* 1OUT |5 10| 2RESET */ B.RESET, + A.TRIG, /* 1TRIG |6 9| 2OUT */ B.OUT, + A.GND, /* GND |7 8| 2TRIG */ B.TRIG + /* +--------------+ */ + ) +} diff --git a/src/lib/netlist/macro/modules/nlmod_rtest.cpp b/src/lib/netlist/macro/modules/nlmod_rtest.cpp new file mode 100644 index 00000000000..39c8cd5e63e --- /dev/null +++ b/src/lib/netlist/macro/modules/nlmod_rtest.cpp @@ -0,0 +1,13 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +#include "devices/net_lib.h" + +NETLIST_START(RTEST) +{ + + RES(R1, RES_K(10)) + ALIAS(1, R1.1) + ALIAS(2, R1.2) + +} diff --git a/src/lib/netlist/macro/nlm_base.h b/src/lib/netlist/macro/nlm_base.h deleted file mode 100644 index 6a88ad5a1be..00000000000 --- a/src/lib/netlist/macro/nlm_base.h +++ /dev/null @@ -1,31 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#ifndef NLM_BASE_H_ -#define NLM_BASE_H_ - -/* - * Provide base environment for netlist - * - */ - -#ifndef __PLIB_PREPROCESSOR__ - -#include "netlist/nl_setup.h" - -/* ---------------------------------------------------------------------------- - * Netlist Macros - * ---------------------------------------------------------------------------*/ - -/* ---------------------------------------------------------------------------- - * DIP only macros - * ---------------------------------------------------------------------------*/ - -/* ---------------------------------------------------------------------------- - * External declarations - * ---------------------------------------------------------------------------*/ - -NETLIST_EXTERNAL(base) - -#endif - -#endif diff --git a/src/lib/netlist/macro/nlm_base.cpp b/src/lib/netlist/macro/nlm_base_lib.cpp index 3a8e2b5eb0d..276e9335422 100644 --- a/src/lib/netlist/macro/nlm_base.cpp +++ b/src/lib/netlist/macro/nlm_base_lib.cpp @@ -1,21 +1,27 @@ -// license:GPL-2.0+ +// license:CC0-1.0 // copyright-holders:Couriersud -#include "netlist/nl_setup.h" -#include "netlist/devices/net_lib.h" -#include "nlm_base.h" + +// Specific technical terms +// spell-checker: words Iave, Vishay, Zdiodes, Icrating, Vceo + +#include "devices/net_lib.h" /* ---------------------------------------------------------------------------- * Diode Models * ---------------------------------------------------------------------------*/ static NETLIST_START(diode_models) - NET_MODEL("D _(IS=1e-15 N=1)") +{ + NET_MODEL("D _(IS=1e-15 N=1 NBV=3 IBV=0.001 BV=1E9)") NET_MODEL("1N914 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)") // FIXME: 1N916 currently only a copy of 1N914! NET_MODEL("1N916 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)") NET_MODEL("1N4001 D(Is=14.11n N=1.984 Rs=33.89m Ikf=94.81 Xti=3 Eg=1.11 Cjo=25.89p M=.44 Vj=.3245 Fc=.5 Bv=75 Ibv=10u Tt=5.7u Iave=1 Vpk=50 mfg=GI type=silicon)") + NET_MODEL("1N4002 D(IS=65.4p RS=42.2m BV=100 IBV=5.00u CJO=14.8p M=0.333 N=1.36 TT=2.88u)") NET_MODEL("1N4148 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75 mfg=OnSemi type=silicon)") + NET_MODEL("1N4154 D(Is=0.1n Rs=4 N=1.67 Cjo=2p M=.333 tt=3n Iave=150m Vpk=35 Bv=60 Ibv=0.1p mfg=Vishay type=silicon)") + NET_MODEL("1N4454 D(Is=168.1e-21 Rs=.1 N=1 Cjo=2p M=.333 tt=5.771n Iave=400m Vpk=35 Bv=75 Ibv=100u mfg=OnSemi type=silicon)") NET_MODEL("1S1588 D(Is=2.52n Rs=.568 N=1.752 Cjo=4p M=.4 tt=20n Iave=200m Vpk=75)") NET_MODEL("1N34A D( Bv=75 Cjo=0.5e-12 Eg=0.67 Ibv=18e-3 Is=2e-7 Rs=7 N=1.3 Vj=0.1 M=0.27 type=germanium)") @@ -25,26 +31,37 @@ static NETLIST_START(diode_models) NET_MODEL("LedBlue D(IS=93.2p RS=42M N=7.47 BV=5 IBV=10U CJO=2.97P VJ=.75 M=.333 TT=4.32U Iave=40m Vpk=5 type=LED)") NET_MODEL("LedWhite D(Is=0.27n Rs=5.65 N=6.79 Cjo=42p Iave=30m Vpk=5 type=LED)") -NETLIST_END() + // Zdiodes ... + + // not really found anywhere, just took the 5239 and changed the + // breakdown voltage to 5.1 according to the datasheet + NET_MODEL("1N5231 D(BV=5.1 IBV=0.020 NBV=1)") + NET_MODEL("1N5236B D(BV=7.5 IS=27.5p RS=33.8 N=1.10 CJO=58.2p VJ=0.750 M=0.330 TT=50.1n)") + NET_MODEL("1N5240 D(BV=10 IS=14.4p RS=32.0 N=1.10 CJO=24.1p VJ=0.750 M=0.330 TT=50.1n)") + NET_MODEL("1N5240B D(BV=10 IS=14.4p RS=32.0 N=1.10 CJO=24.1p VJ=0.750 M=0.330 TT=50.1n)") + +} /* ---------------------------------------------------------------------------- * Mosfet Models * ---------------------------------------------------------------------------*/ static NETLIST_START(mosfet_models) +{ //NET_MODEL("NMOS _(VTO=0.0 N=1.0 IS=1E-14 KP=2E-5 UO=600 PHI=0.6 LD=0.0 L=1.0 TOX=1E-7 W=1.0 NSUB=0.0 GAMMA=0.0 RD=0.0 RS=0.0 LAMBDA=0.0)") //NET_MODEL("PMOS _(VTO=0.0 N=1.0 IS=1E-14 KP=2E-5 UO=600 PHI=0.6 LD=0.0 L=1.0 TOX=1E-7 W=1.0 NSUB=0.0 GAMMA=0.0 RD=0.0 RS=0.0 LAMBDA=0.0)") // NMOS_DEFAULT and PMOS_DEFAULT are created in nl_setup.cpp NET_MODEL("NMOS NMOS_DEFAULT(VTO=0.0 N=1.0 IS=1E-14 KP=0.0 UO=600 PHI=0.0 LD=0.0 L=100e-6 TOX=1E-7 W=100e-6 NSUB=0.0 GAMMA=0.0 RD=0.0 RS=0.0 LAMBDA=0.0 CGSO=0 CGDO=0 CGBO=0)") NET_MODEL("PMOS PMOS_DEFAULT(VTO=0.0 N=1.0 IS=1E-14 KP=0.0 UO=600 PHI=0.0 LD=0.0 L=100e-6 TOX=1E-7 W=100e-6 NSUB=0.0 GAMMA=0.0 RD=0.0 RS=0.0 LAMBDA=0.0 CGSO=0 CGDO=0 CGBO=0)") -NETLIST_END() +} /* ---------------------------------------------------------------------------- * BJT Models * ---------------------------------------------------------------------------*/ static NETLIST_START(bjt_models) +{ NET_MODEL("NPN _(IS=1e-15 BF=100 NF=1 BR=1 NR=1 CJE=0 CJC=0)") NET_MODEL("PNP _(IS=1e-15 BF=100 NF=1 BR=1 NR=1 CJE=0 CJC=0)") @@ -56,10 +73,26 @@ static NETLIST_START(bjt_models) NET_MODEL("2N3645 PNP(IS=650.6E-18 ISE=54.81E-15 ISC=0 XTI=3 BF=231.7 BR=3.563 IKF=1.079 IKR=0 XTB=1.5 VAF=115.7 VAR=35 VJE=0.65 VJC=0.65 RE=0.15 RC=0.715 RB=10 CJE=19.82E-12 CJC=14.76E-12 XCJC=0.75 FC=0.5 NF=1 NR=1 NE=1.829 NC=2 MJE=0.3357 MJC=0.5383 TF=603.7E-12 TR=111.3E-9 ITF=0.65 VTF=5 XTF=1.7 EG=1.11 KF=0 AF=1 VCEO=60 ICRATING=500m MFG=NSC)") // 3644 = 3645 Difference between 3644 and 3645 is voltage rating. 3644: VCBO=45, 3645: VCBO=60 NET_MODEL("2N3644 PNP(IS=650.6E-18 ISE=54.81E-15 ISC=0 XTI=3 BF=231.7 BR=3.563 IKF=1.079 IKR=0 XTB=1.5 VAF=115.7 VAR=35 VJE=0.65 VJC=0.65 RE=0.15 RC=0.715 RB=10 CJE=19.82E-12 CJC=14.76E-12 XCJC=0.75 FC=0.5 NF=1 NR=1 NE=1.829 NC=2 MJE=0.3357 MJC=0.5383 TF=603.7E-12 TR=111.3E-9 ITF=0.65 VTF=5 XTF=1.7 EG=1.11 KF=0 AF=1 VCEO=60 ICRATING=500m MFG=NSC)") + NET_MODEL("2N3702 PNP(Is=650.6E-18 Xti=3 Eg=1.11 Vaf=115.7 Bf=133.8 Ne=1.832 Ise=97.16f Ikf=1.081 Xtb=1.5 Br=3.73 Nc=2 Isc=0 Ikr=0 Rc=.715 Cjc=14.76p Mjc=.5383 Vjc=.75 Fc=.5 Cje=19.82p Mje=.3357 Vje=.75 Tr=114.1n Tf=761.3p Itf=.65 Vtf=5 Xtf=1.7 Rb=10 mfg=National)") + NET_MODEL("2N3704 NPN(IS=26.03f VAF=90.7 Bf=736.1K IKF=.1983 XTB=1.5 BR=1.024 CJC=11.01p CJE=24.07p RB=10 RC=.5 RE=.5 TR=233.8n TF=1.03n ITF=0 VTF=0 XTF=0 mfg=Motorola)") + // SPICE model parameters taken from Fairchild Semiconductor datasheet + NET_MODEL("2N3904 NPN(IS=1E-14 VAF=100 Bf=300 IKF=0.4 XTB=1.5 BR=4 CJC=4E-12 CJE=8E-12 RB=20 RC=0.1 RE=0.1 TR=250E-9 TF=350E-12 ITF=1 VTF=2 XTF=3 Vceo=40 Icrating=200m mfg=Philips)") + // SPICE model parameters taken from Fairchild Semiconductor datasheet + NET_MODEL("2N3906 PNP(Is=1.41f Xti=3 Eg=1.11 Vaf=18.7 Bf=180.7 Ne=1.5 Ise=0 Ikf=80m Xtb=1.5 Br=4.977 Nc=2 Isc=0 Ikr=0 Rc=2.5 Cjc=9.728p Mjc=.5776 Vjc=.75 Fc=.5 Cje=8.063p Mje=.3677 Vje=.75 Tr=33.42n Tf=179.3p Itf=.4 Vtf=4 Xtf=6 Rb=10)") // 2N5190 = BC817-25 NET_MODEL("2N5190 NPN(IS=9.198E-14 NF=1.003 ISE=4.468E-16 NE=1.65 BF=338.8 IKF=0.4913 VAF=107.9 NR=1.002 ISC=5.109E-15 NC=1.071 BR=29.48 IKR=0.193 VAR=25 RB=1 IRB=1000 RBM=1 RE=0.2126 RC=0.143 XTB=0 EG=1.11 XTI=3 CJE=3.825E-11 VJE=0.7004 MJE=0.364 TF=5.229E-10 XTF=219.7 VTF=3.502 ITF=7.257 PTF=0 CJC=1.27E-11 VJC=0.4431 MJC=0.3983 XCJC=0.4555 TR=7E-11 CJS=0 VJS=0.75 MJS=0.333 FC=0.905 Vceo=45 Icrating=500m mfg=Philips)") NET_MODEL("2N4401 NPN(IS=26.03f XTI=3 EG=1.11 VAF=90.7 BF=4.292K NE=1.244 ISE=26.03f IKF=0.2061 XTB=1.5 BR=1.01 NC=2 ISC=0 IKR=0 RC=0.5 CJC=11.01p MJC=0.3763 VJC=0.75 FC=0.5 CJE=24.07p MJE=0.3641 VJE=0.75 TR=233.7n TF=466.5p ITF=0 VTF=0 XTF=0 RB=10 VCEO=40)") + NET_MODEL("2N4403 PNP(Is=650.6E-18 Xti=3 Eg=1.11 Vaf=115.7 Bf=216.2 Ne=1.829 Ise=58.72f Ikf=1.079 Xtb=1.5 Br=3.578 Nc=2 Isc=0 Ikr=0 Rc=.715 Cjc=14.76p Mjc=.5383 Vjc=.75 Fc=.5 Cje=19.82p Mje=.3357 Vje=.75 Tr=111.6n Tf=603.7p Itf=.65 Vtf=5 Xtf=1.7 Rb=10)") + NET_MODEL("2N4124 NPN(IS=6.734f XTI=3 EG=1.11 VAF=74.03 BF=495 NE=1.28 ISE=6.734f IKF=69.35m XTB=1.5 BR=0.7214 NC=2 ISC=0 IKR=0 RC=1 CJC=3.638p MJC=0.3085 VJC=0.75 FC=0.5 CJE=4.493p MJE=0.2593 VJE=0.75 TR=238.3n TF=301.3p ITF=.4 VTF=4 XTF=2 RB=10 VCEO=25)") + NET_MODEL("2N4126 PNP(IS=1.41f XTI=3 EG=1.11 VAF=18.7 BF=203.7 NE=1.5 ISE=0 IKF=80m XTB=1.5 BR=4.924 NC=2 ISC=0 IKR=0 RC=2.5 CJC=9.728p MJC=0.5776 VJC=0.75 FC=0.5 CJE=8.063p MJE=0.3677 VJE=0.75 TR=33.23n TF=179.3p ITF=.4 VTF=4 XTF=6 RB=10 VCEO=25)") + // SPICE model parameters taken from http://ltwiki.org/files/LTspiceIV/Vendor%20List/Fairchild/2N/index.html + NET_MODEL("2N5210 NPN(Is=5.911f Xti=3 Eg=1.11 Vaf=62.37 Bf=809.9 Ne=1.358 Ise=5.911f Ikf=14.26m Xtb=1.5 Br=1.287 Nc=2 Isc=0 Ikr=0 Rc=1.61 Cjc=4.017p Mjc=.3174 Vjc=.75 Fc=.5 Cje=4.973p Mje=.4146 Vje=.75 Tr=4.68n Tf=820.9p Itf=.35 Vtf=4 Xtf=7 Rb=10)") + // SPICE model parameters taken from https://www.onsemi.com/support/design-resources/models?rpn=2N6107 + NET_MODEL("2N6107 PNP(IS=7.62308e-14 BF=6692.56 NF=0.85 VAF=10 IKF=0.032192 ISE=2.07832e-13 NE=2.41828 BR=15.6629 NR=1.5 VAR=1.44572 IKR=0.32192 ISC=4.75e-16 NC=3.9375 RB=7.19824 IRB=0.1 RBM=0.1 RE=0.0001 RC=0.355458 XTB=0.1 XTI=2.97595 EG=1.206 CJE=1.84157e-10 VJE=0.99 MJE=0.347177 TF=6.63757e-09 XTF=1.50003 VTF=1.0001 ITF=1 CJC=1.06717e-10 VJC=0.942679 MJC=0.245405 XCJC=0.8 FC=0.533334 CJS=0 VJS=0.75 MJS=0.5 TR=1.32755e-07 PTF=0 KF=0 AF=1)") + // SPICE model parameters taken from https://www.onsemi.com/support/design-resources/models?rpn=2N6292 + NET_MODEL("2N6292 NPN(IS=9.3092e-13 BF=2021.8 NF=0.85 VAF=63.2399 IKF=1 ISE=1.92869e-13 NE=1.97024 BR=40.0703 NR=1.5 VAR=0.89955 IKR=10 ISC=4.92338e-16 NC=3.9992 RB=6.98677 IRB=0.1 RBM=0.1 RE=0.0001 RC=0.326141 XTB=0.1 XTI=2.86739 EG=1.206 CJE=1.84157e-10 VJE=0.99 MJE=0.347174 TF=6.73756e-09 XTF=1.49917 VTF=0.997395 ITF=0.998426 CJC=1.06717e-10 VJC=0.942694 MJC=0.245406 XCJC=0.8 FC=0.533405 CJS=0 VJS=0.75 MJS=0.5 TR=6.0671e-08 PTF=0 KF=0 AF=1)") + NET_MODEL("2SC945 NPN(IS=3.577E-14 BF=2.382E+02 NF=1.01 VAF=1.206E+02 IKF=3.332E-01 ISE=3.038E-16 NE=1.205 BR=1.289E+01 NR=1.015 VAR=1.533E+01 IKR=2.037E-01 ISC=3.972E-14 NC=1.115 RB=3.680E+01 IRB=1.004E-04 RBM=1 RE=8.338E-01 RC=1.557E+00 CJE=1.877E-11 VJE=7.211E-01 MJE=3.486E-01 TF=4.149E-10 XTF=1.000E+02 VTF=9.956 ITF=5.118E-01 PTF=0 CJC=6.876p VJC=3.645E-01 MJC=3.074E-01 TR=5.145E-08 XTB=1.5 EG=1.11 XTI=3 FC=0.5 Vceo=50 Icrating=100m MFG=NEC)") NET_MODEL("BC237B NPN(IS=1.8E-14 ISE=5.0E-14 ISC=1.72E-13 XTI=3 BF=400 BR=35.5 IKF=0.14 IKR=0.03 XTB=1.5 VAF=80 VAR=12.5 VJE=0.58 VJC=0.54 RE=0.6 RC=0.25 RB=0.56 CJE=13E-12 CJC=4E-12 XCJC=0.75 FC=0.5 NF=0.9955 NR=1.005 NE=1.46 NC=1.27 MJE=0.33 MJC=0.33 TF=0.64E-9 TR=50.72E-9 EG=1.11 KF=0 AF=1 VCEO=45 ICRATING=100M MFG=ZETEX)") @@ -68,30 +101,39 @@ static NETLIST_START(bjt_models) NET_MODEL("BC817-25 NPN(IS=9.198E-14 NF=1.003 ISE=4.468E-16 NE=1.65 BF=338.8 IKF=0.4913 VAF=107.9 NR=1.002 ISC=5.109E-15 NC=1.071 BR=29.48 IKR=0.193 VAR=25 RB=1 IRB=1000 RBM=1 RE=0.2126 RC=0.143 XTB=0 EG=1.11 XTI=3 CJE=3.825E-11 VJE=0.7004 MJE=0.364 TF=5.229E-10 XTF=219.7 VTF=3.502 ITF=7.257 PTF=0 CJC=1.27E-11 VJC=0.4431 MJC=0.3983 XCJC=0.4555 TR=7E-11 CJS=0 VJS=0.75 MJS=0.333 FC=0.905 Vceo=45 Icrating=500m mfg=Philips)") NET_MODEL("9013 NPN(IS=3.40675E-14 BF=166 VAF=67 IKF=1.164 ISE=12.37e-15 NE=2 BR=15.17 VAR=40.84 IKR=0.261352 ISC=1.905E-15 NC=1.066 RB=63.2 IRB=5.62E-6 RBM=22.1 RE=0.02 RC=0.7426 CJE=3.53E-11 VJE=0.808 MJE=0.372 CJC=1.74E-11 VJC=0.614 MJC=0.388 XCJC=0.349 XTB=1.4025 EG=1.0999 XTI=3 VC=0.5 VCEO=20)") -NETLIST_END() +} /* ---------------------------------------------------------------------------- * Family models * ---------------------------------------------------------------------------*/ static NETLIST_START(family_models) - NET_MODEL("FAMILY _(TYPE=CUSTOM FV=5 IVL=0.16 IVH=0.4 OVL=0.1 OVH=1.0 ORL=1.0 ORH=130.0)") +{ + + // FAMILIES always need a type. UNKNOWN below will break + NET_MODEL("FAMILY _(TYPE=UNKNOWN IVL=0.16 IVH=0.4 OVL=0.1 OVH=1.0 ORL=1.0 ORH=130.0)") NET_MODEL("OPAMP _()") NET_MODEL("SCHMITT_TRIGGER _()") - NET_MODEL("74XXOC FAMILY(FV=5 IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e8)") - NET_MODEL("74XX FAMILY(TYPE=TTL)") - NET_MODEL("CD4XXX FAMILY(TYPE=CD4XXX)") -NETLIST_END() + NET_MODEL("74XX FAMILY(TYPE=TTL IVL=0.16 IVH=0.4 OVL=0.1 OVH=1.0 ORL=1.0 ORH=130)") + + // CMOS + // low input 1.5 , high input trigger 3.5 at 5V supply + // output offsets, low for CMOS, thus 0.05 + // output currents: see https://www.classe.cornell.edu/~ib38/teaching/p360/lectures/wk09/l26/EE2301Exp3F10.pdf + // typical CMOS may sink 0.4mA while output stays <= 0.4V + NET_MODEL("CD4XXX FAMILY(TYPE=CMOS IVL=0.3 IVH=0.7 OVL=0.05 OVH=0.05 ORL=500 ORH=500)") + + NET_MODEL("74XXOC FAMILY(TYPE=TTL IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e8)") +} /* ---------------------------------------------------------------------------- * Always included * ---------------------------------------------------------------------------*/ -NETLIST_START(base) - TTL_INPUT(ttlhigh, 1) - TTL_INPUT(ttllow, 0) - NET_REGISTER_DEV(GND, GND) +NETLIST_START(base_lib) +{ + NET_REGISTER_DEV(GNDA, GND) NET_REGISTER_DEV(PARAMETER, NETLIST) LOCAL_SOURCE(diode_models) @@ -99,19 +141,26 @@ NETLIST_START(base) LOCAL_SOURCE(mosfet_models) LOCAL_SOURCE(family_models) - LOCAL_SOURCE(TTL74XX_lib) - LOCAL_SOURCE(CD4XXX_lib) - LOCAL_SOURCE(OPAMP_lib) - LOCAL_SOURCE(otheric_lib) + EXTERNAL_SOURCE(ttl74xx_lib) + EXTERNAL_SOURCE(cd4xxx_lib) + EXTERNAL_SOURCE(opamp_lib) + EXTERNAL_SOURCE(otheric_lib) + EXTERNAL_SOURCE(roms_lib) + + EXTERNAL_SOURCE(modules_lib) INCLUDE(diode_models) INCLUDE(bjt_models) INCLUDE(mosfet_models) INCLUDE(family_models) - INCLUDE(TTL74XX_lib) - INCLUDE(CD4XXX_lib) - INCLUDE(OPAMP_lib) + + INCLUDE(ttl74xx_lib) + INCLUDE(cd4xxx_lib) + INCLUDE(opamp_lib) INCLUDE(otheric_lib) + INCLUDE(roms_lib) + + INCLUDE(modules_lib) -NETLIST_END() +} diff --git a/src/lib/netlist/macro/nlm_cd4xxx.cpp b/src/lib/netlist/macro/nlm_cd4xxx.cpp deleted file mode 100644 index 8844b3f8154..00000000000 --- a/src/lib/netlist/macro/nlm_cd4xxx.cpp +++ /dev/null @@ -1,202 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#include "nlm_cd4xxx.h" - -#include "netlist/devices/nld_4020.h" -#include "netlist/devices/nld_4066.h" -#include "netlist/devices/nld_4316.h" -#include "netlist/devices/nld_system.h" - -/* - * CD4001BC: Quad 2-Input NOR Buffered B Series Gate - * - * +--------------+ - * A1 |1 ++ 14| VCC - * B1 |2 13| A6 - * A2 |3 12| Y6 - * Y2 |4 4001 11| A5 - * A3 |5 10| Y5 - * Y3 |6 9| A4 - * GND |7 8| Y4 - * +--------------+ - * - */ - -static NETLIST_START(CD4001_DIP) - CD4001_NOR(s1) - CD4001_NOR(s2) - CD4001_NOR(s3) - CD4001_NOR(s4) - - NET_C(s1.VCC, s2.VCC, s3.VCC, s4.VCC) - NET_C(s1.VDD, s2.VDD, s3.VDD, s4.VDD) - DIPPINS( /* +--------------+ */ - s1.A, /* A1 |1 ++ 14| VCC */ s1.VCC, - s1.B, /* B1 |2 13| A6 */ s4.B, - s1.Q, /* A2 |3 12| Y6 */ s4.A, - s2.Q, /* Y2 |4 4001 11| A5 */ s4.Q, - s2.A, /* A3 |5 10| Y5 */ s3.Q, - s2.B, /* Y3 |6 9| A4 */ s3.B, - s1.VDD, /* GND |7 8| Y4 */ s3.A - /* +--------------+ */ - ) - -NETLIST_END() - -/* CD4020: 14-Stage Ripple Carry Binary Counters - * - * +--------------+ - * Q12 |1 ++ 16| VDD - * Q13 |2 15| Q11 - * Q14 |3 14| Q10 - * Q6 |4 4020 13| Q8 - * Q5 |5 12| Q9 - * Q7 |6 11| RESET - * Q4 |7 10| IP (Input pulses) - * VSS |8 9| Q1 - * +--------------+ - * - * Naming conventions follow Texas Instruments datasheet - * - * FIXME: Timing depends on VDD-VSS - * This needs a cmos d-a/a-d proxy implementation. - */ - -static NETLIST_START(CD4020_DIP) - - CD4020(s1) - DIPPINS( /* +--------------+ */ - s1.Q12, /* Q12 |1 ++ 16| VDD */ s1.VDD, - s1.Q13, /* Q13 |2 15| Q11 */ s1.Q11, - s1.Q14, /* Q14 |3 14| Q10 */ s1.Q10, - s1.Q6, /* Q6 |4 4020 13| Q8 */ s1.Q8, - s1.Q5, /* Q5 |5 12| Q9 */ s1.Q9, - s1.Q7, /* Q7 |6 11| RESET */ s1.RESET, - s1.Q4, /* Q4 |7 10| IP */ s1.IP, - s1.VSS, /* VSS |8 9| Q1 */ s1.Q1 - /* +--------------+ */ - ) - /* - * IP = (Input pulses) - */ - -NETLIST_END() - -/* CD4066: Quad Bilateral Switch - * - * +--------------+ - * INOUTA |1 ++ 14| VDD - * OUTINA |2 13| CONTROLA - * OUTINB |3 12| CONTROLD - * INOUTB |4 4066 11| INOUTD - * CONTROLB |5 10| OUTIND - * CONTROLC |6 9| OUTINC - * VSS |7 8| INOUTC - * +--------------+ - * - * FIXME: These devices are slow (~125 ns). THis is currently not reflected - * - * Naming conventions follow National semiconductor datasheet - * - */ - -static NETLIST_START(CD4066_DIP) - CD4066_GATE(A) - CD4066_GATE(B) - CD4066_GATE(C) - CD4066_GATE(D) - - NET_C(A.VDD, B.VDD, C.VDD, D.VDD) - NET_C(A.VSS, B.VSS, C.VSS, D.VSS) - - PARAM(A.BASER, 270.0) - PARAM(B.BASER, 270.0) - PARAM(C.BASER, 270.0) - PARAM(D.BASER, 270.0) - - DIPPINS( /* +--------------+ */ - A.R.1, /* INOUTA |1 ++ 14| VDD */ A.VDD, - A.R.2, /* OUTINA |2 13| CONTROLA */ A.CTL, - B.R.1, /* OUTINB |3 12| CONTROLD */ D.CTL, - B.R.2, /* INOUTB |4 4066 11| INOUTD */ D.R.1, - B.CTL, /* CONTROLB |5 10| OUTIND */ D.R.2, - C.CTL, /* CONTROLC |6 9| OUTINC */ C.R.1, - A.VSS, /* VSS |7 8| INOUTC */ C.R.2 - /* +--------------+ */ - ) -NETLIST_END() - -static NETLIST_START(CD4016_DIP) - CD4066_GATE(A) - CD4066_GATE(B) - CD4066_GATE(C) - CD4066_GATE(D) - - NET_C(A.VDD, B.VDD, C.VDD, D.VDD) - NET_C(A.VSS, B.VSS, C.VSS, D.VSS) - - PARAM(A.BASER, 1000.0) - PARAM(B.BASER, 1000.0) - PARAM(C.BASER, 1000.0) - PARAM(D.BASER, 1000.0) - - DIPPINS( /* +--------------+ */ - A.R.1, /* INOUTA |1 ++ 14| VDD */ A.VDD, - A.R.2, /* OUTINA |2 13| CONTROLA */ A.CTL, - B.R.1, /* OUTINB |3 12| CONTROLD */ D.CTL, - B.R.2, /* INOUTB |4 4016 11| INOUTD */ D.R.1, - B.CTL, /* CONTROLB |5 10| OUTIND */ D.R.2, - C.CTL, /* CONTROLC |6 9| OUTINC */ C.R.1, - A.VSS, /* VSS |7 8| INOUTC */ C.R.2 - /* +--------------+ */ - ) -NETLIST_END() - -static NETLIST_START(CD4316_DIP) - CD4316_GATE(A) - CD4316_GATE(B) - CD4316_GATE(C) - CD4316_GATE(D) - - NET_C(A.E, B.E, C.E, D.E) - NET_C(A.VDD, B.VDD, C.VDD, D.VDD) - NET_C(A.VSS, B.VSS, C.VSS, D.VSS) - - PARAM(A.BASER, 45.0) - PARAM(B.BASER, 45.0) - PARAM(C.BASER, 45.0) - PARAM(D.BASER, 45.0) - - DIPPINS( /* +--------------+ */ - A.R.2, /* 1Z |1 ++ 16| VCC */ A.VDD, - A.R.1, /* 1Y |2 15| 1S */ A.S, - B.R.1, /* 2Y |3 14| 4S */ D.S, - B.R.2, /* 2Z |4 4316 13| 4Z */ D.R.2, - B.S, /* 2S |5 12| 4Y */ D.R.1, - C.S, /* 3S |6 11| 3Y */ C.R.1, - A.E, /* /E |7 10| 3Z */ C.R.2, - A.VSS, /* GND |8 9| VEE */ VEE - /* +--------------+ */ - ) - -NETLIST_END() - -NETLIST_START(CD4XXX_lib) - - TRUTHTABLE_START(CD4001_NOR, 2, 1, "") - TT_HEAD("A , B | Q ") - TT_LINE("0,0|1|85") - TT_LINE("X,1|0|120") - TT_LINE("1,X|0|120") - TT_FAMILY("CD4XXX") - TRUTHTABLE_END() - - LOCAL_LIB_ENTRY(CD4001_DIP) - - /* DIP ONLY */ - LOCAL_LIB_ENTRY(CD4020_DIP) - LOCAL_LIB_ENTRY(CD4016_DIP) - LOCAL_LIB_ENTRY(CD4066_DIP) - LOCAL_LIB_ENTRY(CD4316_DIP) - -NETLIST_END() diff --git a/src/lib/netlist/macro/nlm_cd4xxx.h b/src/lib/netlist/macro/nlm_cd4xxx.h deleted file mode 100644 index d4d9c97fdc2..00000000000 --- a/src/lib/netlist/macro/nlm_cd4xxx.h +++ /dev/null @@ -1,58 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#ifndef NLD_CD4XXX_H_ -#define NLD_CD4XXX_H_ - -#include "netlist/nl_setup.h" - -/* - * Devices: - * - * CD4001_NOR : single gate - * CD4001_DIP : dip package - * CD4020_DIP : dip package (device model in core) - * CD4016_DIP : dip package (device model in core) - * CD4066_DIP : dip package (device model in core) - * - */ - -#ifndef __PLIB_PREPROCESSOR__ - -/* ---------------------------------------------------------------------------- - * Netlist Macros - * ---------------------------------------------------------------------------*/ - -#ifndef NL_AUTO_DEVICES - -#define CD4001_NOR(name) \ - NET_REGISTER_DEV(CD4001_NOR, name) - -#define CD4001_DIP(name) \ - NET_REGISTER_DEV(CD4001_DIP, name) - -/* ---------------------------------------------------------------------------- - * DIP only macros - * ---------------------------------------------------------------------------*/ - -#define CD4020_DIP(name) \ - NET_REGISTER_DEV(CD4020_DIP, name) - -#define CD4066_DIP(name) \ - NET_REGISTER_DEV(CD4066_DIP, name) - -#define CD4016_DIP(name) \ - NET_REGISTER_DEV(CD4016_DIP, name) - -#define CD4316_DIP(name) \ - NET_REGISTER_DEV(CD4016_DIP, name) - -#endif -/* ---------------------------------------------------------------------------- - * External declarations - * ---------------------------------------------------------------------------*/ - -NETLIST_EXTERNAL(CD4XXX_lib) - -#endif - -#endif diff --git a/src/lib/netlist/macro/nlm_cd4xxx_lib.cpp b/src/lib/netlist/macro/nlm_cd4xxx_lib.cpp new file mode 100644 index 00000000000..0a0f75c8732 --- /dev/null +++ b/src/lib/netlist/macro/nlm_cd4xxx_lib.cpp @@ -0,0 +1,978 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +#include "devices/net_lib.h" + +//- Identifier: CD4001_DIP +//- Title: CD4001BM/CD4001BC Quad 2-Input NOR Buffered B Series Gate +//- Pinalias: A1,B1,Y1,Y2,A2,B2,VSS,A3,B3,Y3,Y4,A4,B4,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/166/108518_DS.pdf +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 1 | +//- | X | 1 || 0 | +//- | 1 | X || 0 | +//- +---+---++---+ +//- +static NETLIST_START(CD4001_DIP) +{ + CD4001_GATE(A) + CD4001_GATE(B) + CD4001_GATE(C) + CD4001_GATE(D) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + DIPPINS( + /*# +--------------+ */ + A.A, /*# A1 |1 ++ 14| VDD */ A.VDD, // + A.B, /*# B1 |2 13| B4 */ D.B, // + A.Q, /*# Y1 |3 12| A4 */ D.A, // + B.Q, /*# Y2 |4 4001 11| Y4 */ D.Q, // + B.A, /*# A2 |5 10| Y3 */ C.Q, // + B.B, /*# B2 |6 9| B3 */ C.B, // + A.VSS, /*# VSS |7 8| A3 */ C.A // + /*# +--------------+ */ + ) +} + +//- Identifier: CD4006_DIP +//- Title: CD4006BM/CD4006BC 18-Stage Static Shift Register +//- Pinalias: D1,NC,CLOCK,D2,D3,D4,VSS,D4P4,D4P5,D3P4,D2P4,D2P5,D1P4,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS005942.PDF +//- +static NETLIST_START(CD4006_DIP) +{ + CD4006(A) + NC_PIN(NC) + + DIPPINS( /* +--------------+ */ + A.D1, /* D1 |1 ++ 14| VDD */ A.VDD, + NC.I, /* NC |2 13| D1+4 */ A.D1P4, + A.CLOCK, /* CLOCK |3 12| D2+5 */ A.D2P5, + A.D2, /* D2 |4 4006 11| D2+4 */ A.D2P4, + A.D3, /* D3 |5 10| D3+4 */ A.D3P4, + A.D4, /* D4 |6 9| D4+5 */ A.D4P5, + A.VSS, /* VSS |7 8| D4+4 */ A.D4P4 + /* +--------------+ */ + ) +} + +//- Identifier: CD4011_DIP +//- Title: CD4011BM/CD4011BC Quad 2-Input NAND Buffered B Series Gate +//- Pinalias: A1,B1,Y1,Y2,A2,B2,VSS,A3,B3,Y3,Y4,A4,B4,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/166/108518_DS.pdf +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | X | 0 || 1 | +//- | 0 | X || 1 | +//- | 1 | 1 || 0 | +//- +---+---++---+ +//- +static NETLIST_START(CD4011_DIP) +{ + CD4011_GATE(A) + CD4011_GATE(B) + CD4011_GATE(C) + CD4011_GATE(D) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + DIPPINS( /* +--------------+ */ + A.A, /* A |1 ++ 14| VDD */ A.VDD, + A.B, /* B |2 13| H */ D.B, + A.Q, /* J |3 12| G */ D.A, + B.Q, /* K |4 4011 11| M */ D.Q, + B.A, /* C |5 10| L */ C.Q, + B.B, /* D |6 9| F */ C.B, + A.VSS, /* VSS |7 8| E */ C.A + /* +--------------+ */ + ) +} + +//- Identifier: CD4013_DIP +//- Title: CD4013BM/CD4013BC Dual D Flip-Flop +//- Pinalias: Q1,QQ1,CLOCK1,RESET1,DATA1,SET1,VSS,SET2,DATA2,RESET2,CLOCK2,QQ2,Q2,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/150/108670_DS.pdf +//- +//- +-----+---+---+---++---+----+ +//- | CLK | D | R | S || Q | QQ | +//- +=====+===+===+===++===+====+ +//- | 0-1 | 0 | 0 | 0 || 0 | 1 | +//- | 0-1 | 1 | 0 | 0 || 1 | 0 | +//- | 1-0 | X | 0 | 0 || Q | QQ | +//- | X | X | 1 | 0 || 0 | 1 | +//- | X | X | 0 | 1 || 1 | 0 | +//- | X | X | 1 | 1 || 1 | 1 | +//- +-----+---+---+---++---+----+ +//- +static NETLIST_START(CD4013_DIP) +{ + CD4013(A) + CD4013(B) + + NET_C(A.VDD, B.VDD) + NET_C(A.VSS, B.VSS) + + DIPPINS( /* +--------------+ */ + A.Q, /* Q1 |1 ++ 14| VDD */ A.VDD, + A.QQ, /* Q1Q |2 13| Q2 */ B.Q, + A.CLOCK, /* CLOCK1 |3 12| Q2Q */ B.QQ, + A.RESET, /* RESET1 |4 4013 11| CLOCK2 */ B.CLOCK, + A.DATA, /* DATA1 |5 10| RESET2 */ B.RESET, + A.SET, /* SET1 |6 9| DATA2 */ B.DATA, + A.VSS, /* VSS |7 8| SET2 */ B.SET + /* +--------------+ */ + ) +} + +//- Identifier: CD4016_DIP +//- Title: CD4016BM/CD4016BC Quad Bilateral Switch +//- Pinalias: INOUTA,OUTINA,OUTINB,INOUTB,CONTROLB,CONTROLC,VSS,INOUTC,OUTINC,OUTIND,INOUTD,CONTROLD,CONTROLA,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/185/108711_DS.pdf +//- +static NETLIST_START(CD4016_DIP) +{ + CD4066_GATE(A) + CD4066_GATE(B) + CD4066_GATE(C) + CD4066_GATE(D) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + PARAM(A.BASER, 1000.0) + PARAM(B.BASER, 1000.0) + PARAM(C.BASER, 1000.0) + PARAM(D.BASER, 1000.0) + + DIPPINS( /* +--------------+ */ + A.R.1, /* INOUTA |1 ++ 14| VDD */ A.VDD, + A.R.2, /* OUTINA |2 13| CONTROLA */ A.CTL, + B.R.1, /* OUTINB |3 12| CONTROLD */ D.CTL, + B.R.2, /* INOUTB |4 4016 11| INOUTD */ D.R.1, + B.CTL, /* CONTROLB |5 10| OUTIND */ D.R.2, + C.CTL, /* CONTROLC |6 9| OUTINC */ C.R.1, + A.VSS, /* VSS |7 8| INOUTC */ C.R.2 + /* +--------------+ */ + ) +} + +//- Identifier: CD4017_DIP +//- Title: CD4017BM/CD4017BC Decade Counter/Divider with 10 Decoded Outputs +//- Pinalias: Q5,Q1,Q0,Q2,Q6,Q7,Q3,VSS,Q8,Q4,Q9,CARRY_OUT,CLOCK_ENABLE,CLOCK,RESET,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/166/108736_DS.pdf +//- +static NETLIST_START(CD4017_DIP) +{ + CD4017(A) + + DIPPINS( /* +--------------+ */ + A.Q5, /* Q5 |1 ++ 16| VDD */ A.VDD, + A.Q1, /* Q1 |2 15| RESET */ A.RESET, + A.Q0, /* Q0 |3 14| CLOCK */ A.CLK, + A.Q2, /* Q2 |4 4017 13| CLOCK ENABLE */ A.CLKEN, + A.Q6, /* Q6 |5 12| CARRY OUT */ A.CO, + A.Q7, /* Q7 |6 11| Q9 */ A.Q9, + A.Q3, /* Q3 |7 10| Q4 */ A.Q4, + A.VSS, /* VSS |8 9| Q8 */ A.Q8 + /* +--------------+ */ + ) +} + +//- Identifier: CD4020_DIP +//- Title: CD4020BC 14-Stage Ripple Carry Binary Counters +//- Pinalias: Q12,Q13,Q14,Q6,Q5,Q7,Q4,VSS,Q1,PHI1,RESET,Q9,Q8,Q10,Q11,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow Fairchild Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/90/109006_DS.pdf +//- +static NETLIST_START(CD4020_DIP) +{ + CD4020(A) + + DIPPINS( /* +--------------+ */ + A.Q12, /* Q12 |1 ++ 16| VDD */ A.VDD, + A.Q13, /* Q13 |2 15| Q11 */ A.Q11, + A.Q14, /* Q14 |3 14| Q10 */ A.Q10, + A.Q6, /* Q6 |4 4020 13| Q8 */ A.Q8, + A.Q5, /* Q5 |5 12| Q9 */ A.Q9, + A.Q7, /* Q7 |6 11| RESET */ A.RESET, + A.Q4, /* Q4 |7 10| PHI1 */ A.IP, + A.VSS, /* VSS |8 9| Q1 */ A.Q1 + /* +--------------+ */) +} + +//- Identifier: CD4022_DIP +//- Title: CD4022BM/CD4022BC Divide-by-8 Counter/Divider with 8 Decoded Outputs +//- Pinalias: Q1,Q0,Q2,Q5,Q6,NC,Q3,VSS,NC,Q7,Q4,CARRY_OUT,CLOCK_ENABLE,CLOCK,RESET,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/166/108736_DS.pdf +//- +static NETLIST_START(CD4022_DIP) +{ + CD4022(A) + NC_PIN(NC) + + DIPPINS( /* +--------------+ */ + A.Q1, /* Q1 |1 ++ 16| VDD */ A.VDD, + A.Q0, /* Q0 |2 15| RESET */ A.RESET, + A.Q2, /* Q2 |3 14| CLOCK */ A.CLK, + A.Q5, /* Q5 |4 4022 13| CLOCK ENABLE */ A.CLKEN, + A.Q6, /* Q6 |5 12| CARRY OUT */ A.CO, + NC.I, /* NC |6 11| Q4 */ A.Q4, + A.Q3, /* Q3 |7 10| Q7 */ A.Q7, + A.VSS, /* VSS |8 9| NC */ NC.I + /* +--------------+ */ + ) +} + +//- Identifier: CD4024_DIP +//- Title: CD4024BM/CD4024BC 7-Stage Ripple Carry Binary Counter +//- Pinalias: IP,RESET,Q7,Q6,Q5,Q4,VSS,NC,Q3,NC,Q2,Q1,NC,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/120/108894_DS.pdf +//- +static NETLIST_START(CD4024_DIP) +{ + CD4024(A) + NC_PIN(NC) + + DIPPINS( /* +--------------+ */ + A.IP, /* IP |1 ++ 14| VDD */ A.VDD, + A.RESET, /* RESET |2 13| NC */ NC.I, + A.Q7, /* Q7 |3 12| Q1 */ A.Q1, + A.Q6, /* Q6 |4 4024 11| Q2 */ A.Q2, + A.Q5, /* Q5 |5 10| NC */ NC.I, + A.Q4, /* Q4 |6 9| Q3 */ A.Q3, + A.VSS, /* VSS |7 8| NC */ NC.I + /* +--------------+ */) +} + +//- Identifier: CD4029_DIP +//- Title: CD4029BM/CD4029BC Presettable Binary/Decade Up/Down Counter +//- Pinalias: PE,Q4,J4,J1,CI,Q1,CO,VSS,BD,UD,Q2,J2,J3,Q3,CLK,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: +//- Voltage-dependent timing is not implemented. +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/166/108968_DS.pdf +//- See nld_4029.cpp for tables explaining the counting order for all states +//- +//- Counter Sequences: +//- +//- B/D high (Binary), U/D high (Up) +//- +-------++----+----+----+----+----++-------+ +//- | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | +//- +=======++====+====+====+====+====++=======+ +//- | 0 || 0 | 0 | 0 | 0 | 1 || 1 | +//- | 1 || 0 | 0 | 0 | 1 | 1 || 2 | +//- | 2 || 0 | 0 | 1 | 0 | 1 || 3 | +//- | 3 || 0 | 0 | 1 | 1 | 1 || 4 | +//- | 4 || 0 | 1 | 0 | 0 | 1 || 5 | +//- | 5 || 0 | 1 | 0 | 1 | 1 || 6 | +//- | 6 || 0 | 1 | 1 | 0 | 1 || 7 | +//- | 7 || 0 | 1 | 1 | 1 | 1 || 8 | +//- | 8 || 1 | 0 | 0 | 0 | 1 || 9 | +//- | 9 || 1 | 0 | 0 | 1 | 1 || A | +//- | A || 1 | 0 | 1 | 0 | 1 || B | +//- | B || 1 | 0 | 1 | 1 | 1 || C | +//- | C || 1 | 1 | 0 | 0 | 1 || D | +//- | D || 1 | 1 | 0 | 1 | 1 || E | +//- | E || 1 | 1 | 1 | 0 | 1 || F | +//- | F || 1 | 1 | 1 | 1 |0|CI|| 0 | +//- | 0 || 0 | 0 | 0 | 0 | 1 || 1 | +//- +-------++----+----+----+----+----++-------+ +//- +//- B/D high (Binary), U/D low (Down) +//- +-------++----+----+----+----+----++-------+ +//- | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | +//- +=======++====+====+====+====+====++=======+ +//- | F || 1 | 1 | 1 | 1 | 1 || E | +//- | E || 1 | 1 | 1 | 0 | 1 || D | +//- | D || 1 | 1 | 0 | 1 | 1 || C | +//- | C || 1 | 1 | 0 | 0 | 1 || B | +//- | B || 1 | 0 | 1 | 1 | 1 || A | +//- | A || 1 | 0 | 1 | 0 | 1 || 9 | +//- | 9 || 1 | 0 | 0 | 1 | 1 || 8 | +//- | 8 || 1 | 0 | 0 | 0 | 1 || 7 | +//- | 7 || 0 | 1 | 1 | 1 | 1 || 6 | +//- | 6 || 0 | 1 | 1 | 0 | 1 || 5 | +//- | 5 || 0 | 1 | 0 | 1 | 1 || 4 | +//- | 4 || 0 | 1 | 0 | 0 | 1 || 3 | +//- | 3 || 0 | 0 | 1 | 1 | 1 || 2 | +//- | 2 || 0 | 0 | 1 | 0 | 1 || 1 | +//- | 1 || 0 | 0 | 0 | 1 | 1 || 0 | +//- | 0 || 0 | 0 | 0 | 0 |0|CI|| F | +//- | F || 1 | 1 | 1 | 1 | 1 || E | +//- +-------++----+----+----+----+----++-------+ +//- +//- B/D low (Decimal), U/D high (Up) +//- +-------++----+----+----+----+----++-------+ +//- | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | +//- +=======++====+====+====+====+====++=======+ +//- | 0 || 0 | 0 | 0 | 0 | 1 || 1 | +//- | 1 || 0 | 0 | 0 | 1 | 1 || 2 | +//- | 2 || 0 | 0 | 1 | 0 | 1 || 3 | +//- | 3 || 0 | 0 | 1 | 1 | 1 || 4 | +//- | 4 || 0 | 1 | 0 | 0 | 1 || 5 | +//- | 5 || 0 | 1 | 0 | 1 | 1 || 6 | +//- | 6 || 0 | 1 | 1 | 0 | 1 || 7 | +//- | 7 || 0 | 1 | 1 | 1 | 1 || 8 | +//- | 8 || 1 | 0 | 0 | 0 | 1 || 9 | +//- | 9 || 1 | 0 | 0 | 1 |0|CI|| 0 | +//- | A || 1 | 0 | 1 | 0 | 1 || B | +//- | B || 1 | 0 | 1 | 1 |0|CI|| 6 | +//- | C || 1 | 1 | 0 | 0 | 1 || D | +//- | D || 1 | 1 | 0 | 1 |0|CI|| 4 | +//- | E || 1 | 1 | 1 | 0 | 1 || F | +//- | F || 1 | 1 | 1 | 1 |0|CI|| 2 | +//- | 0 || 0 | 0 | 0 | 0 | 1 || 1 | +//- +-------++----+----+----+----+----++-------+ +//- +//- B/D low (Decimal), U/D low (Down) +//- +-------++----+----+----+----+----++-------+ +//- | COUNT || Q4 | Q3 | Q2 | Q1 | CO || NEXT | +//- +=======++====+====+====+====+====++=======+ +//- | F || 1 | 1 | 1 | 1 | 1 || E | +//- | E || 1 | 1 | 1 | 0 | 1 || D | +//- | D || 1 | 1 | 0 | 1 | 1 || C | +//- | C || 1 | 1 | 0 | 0 | 1 || B | +//- | B || 1 | 0 | 1 | 1 | 1 || A | +//- | A || 1 | 0 | 1 | 0 | 1 || 9 | +//- | 9 || 1 | 0 | 0 | 1 | 1 || 8 | +//- | 8 || 1 | 0 | 0 | 0 | 1 || 7 | +//- | 7 || 0 | 1 | 1 | 1 | 1 || 6 | +//- | 6 || 0 | 1 | 1 | 0 | 1 || 5 | +//- | 5 || 0 | 1 | 0 | 1 | 1 || 4 | +//- | 4 || 0 | 1 | 0 | 0 | 1 || 3 | +//- | 3 || 0 | 0 | 1 | 1 | 1 || 2 | +//- | 2 || 0 | 0 | 1 | 0 | 1 || 1 | +//- | 1 || 0 | 0 | 0 | 1 | 1 || 0 | +//- | 0 || 0 | 0 | 0 | 0 |0|CI|| 9 | +//- | 9 || 1 | 0 | 0 | 1 | 1 || 8 | +//- +-------++----+----+----+----+----++-------+ +//- +//- Note that in all cases where Carry-out is generating a non-1 signal (0 | Carry-in), +//- this signal is asynchronous, so if carry-in changes the carry-out value will +//- change immediately. +//- +//- Preset/Carry in function table +//- +-----+-----+-----++----+----+----+----+ +//- | PE | CLK | CI || Q1 | Q2 | Q3 | Q4 | +//- +=====+=====+=====++====+====+====+====+ +//- | 1 | X | X || J1 | J2 | J3 | J4 | +//- | 0 | X | 1 || Q1 | Q2 | Q3 | Q4 | +//- | 0 | ./` | 0 || COUNT | +//- +-----+-----+-----++----+----+----+----+ +//- +static NETLIST_START(CD4029_DIP) +{ + CD4029(A) + + DIPPINS( /* +--------------+ */ + A.PE, /* PE |1 ++ 16| VDD */ A.VDD, + A.Q4, /* Q4 |2 15| CLK */ A.CLK, + A.J4, /* J4 |3 14| Q3 */ A.Q3, + A.J1, /* J1 |4 4029 13| J3 */ A.J3, + A.CI, /* CI |5 12| J2 */ A.J2, + A.Q1, /* Q1 |6 11| Q2 */ A.Q2, + A.CO, /* CO |7 10| U/D */ A.UD, + A.VSS, /* VSS |8 9| B/D */ A.BD + /* +--------------+ */) +} + +//- Identifier: CD4030_DIP +//- Title: CD4030M/CD4030C Quad EXCLUSIVE-OR Gate +//- Pinalias: A1,B1,Y1,Y2,A2,B2,VSS,A3,B3,Y3,Y4,A4,B4,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: +//- Voltage-dependent timing is not implemented. +//- FunctionTable: +//- https://www.uni-kl.de/elektronik-lager/418055 +//- +static NETLIST_START(CD4030_DIP) +{ + CD4030_GATE(A) + CD4030_GATE(B) + CD4030_GATE(C) + CD4030_GATE(D) + + DIPPINS( /* +--------------+ */ + A.A, /* A1 |1 ++ 14| VDD */ A.VDD, + A.B, /* B1 |2 13| B4 */ D.B, + A.Q, /* Y1 |3 12| A4 */ D.A, + B.Q, /* Y2 |4 4030 11| Y4 */ D.Q, + B.A, /* A2 |5 10| Y3 */ C.Q, + B.B, /* B2 |6 9| B3 */ C.B, + A.VSS, /* VSS |7 8| A3 */ C.A + /* +--------------+ */ + ) +} + +//- Identifier: CD4042_DIP +//- Title: CD4042BM/CD4042BC Quad Clocked D Latch +//- Pinalias: Q4,Q1,QQ1,D1,CLK,POL,D2,VSS,QQ2,Q2,Q3,QQ3,D3,D4,QQ4,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: +//- Voltage-dependent timing is partially implemented. +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS005966.PDF +//- +//- +-----+-----+----++----+-----+ +//- | POL | CLK | Dx || Qx | QQx | +//- +=====+=====+====++====+=====+ +//- | 0 | 0 | X || Qx | /Qx | +//- | 0 | 1 | D || D | /D | +//- | 1 | 1 | X || Qx | /Qx | +//- | 1 | 0 | D || D | /D | +//- +-----+-----+----++----+-----+ +//- Note that since this is a level triggered transparent latch, +//- as long as POL ^ CLK == true, the latch is transparent, and +//- if D changes Q and QQ(/Q) will instantly change. +//- +static NETLIST_START(CD4042_DIP) +{ + CD4042(A) + + DIPPINS( /* +--------------+ */ + A.Q4, /* Q4 |1 ++ 16| VDD */ A.VDD, + A.Q1, /* Q1 |2 15| Q4Q */ A.Q4Q, + A.Q1Q, /* Q1Q |3 14| D4 */ A.D4, + A.D1, /* D1 |4 4042 13| D3 */ A.D3, + A.CLK, /* CLK |5 12| Q3Q */ A.Q3Q, + A.POL, /* POL |6 11| Q3 */ A.Q3, + A.D2, /* D2 |7 10| Q2 */ A.Q2, + A.VSS, /* VSS |8 9| Q2Q */ A.Q2Q + /* +--------------+ */ + ) +} + +//- Identifier: CD4049_DIP +//- Title: CD4049UBM/CD4049UBC Hex Inverting Buffer +//- Pinalias: VDD,G,A,H,B,I,C,VSS,D,J,E,K,NC,F,L,NC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: +//- Voltage-dependent timing is not implemented. +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/134/109125_DS.pdf +//- +static NETLIST_START(CD4049_DIP) +{ + CD4049_GATE(A) + CD4049_GATE(B) + CD4049_GATE(C) + CD4049_GATE(D) + CD4049_GATE(E) + CD4049_GATE(F) + NC_PIN(NC) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD, E.VDD, F.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS, E.VSS, F.VSS) + + //DIPPINS( /* +--------------+ */ + // A.VDD, /* VCC |1 ++ 16| NC */ NC.I, + // A.G, /*G=/A |2 15| L=/F*/ F.L, + // A.A, /* A |3 14| F */ F.F, + // B.H, /*H=/B |4 13| NC */ NC.I, + // B.B, /* B |5 4049 12| K=/E*/ E.K, + // C.I, /*I=/C |6 11| E */ E.E, + // C.C, /* C |7 10| J=/D*/ D.J, + // A.VSS, /* VSS |8 9| D */ D.D + // /* +--------------+ */ + //) + DIPPINS( /* +--------------+ */ + A.VDD, /* VCC |1 ++ 16| NC */ NC.I, + A.Q, /*G=/A |2 15| L=/F*/ F.Q, + A.A, /* A |3 14| F */ F.A, + B.Q, /*H=/B |4 13| NC */ NC.I, + B.A, /* B |5 4049 12| K=/E*/ E.Q, + C.Q, /*I=/C |6 11| E */ E.A, + C.A, /* C |7 10| J=/D*/ D.Q, + A.VSS, /* VSS |8 9| D */ D.A + /* +--------------+ */ + ) +} + +//- Identifier: CD4053_DIP +//- Title: CD4053BM/CD4053BC Triple 2-Channel AnalogMultiplexer/Demultiplexer +//- Pinalias: INOUTBY,INOUTBX,INOUTCY,OUTINC,INOUTCX,INH,VEE,VSS,C,B,A,INOUTAX,INOUTAY,OUTINA,OUTINB,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS005662.PDF +//- +static NETLIST_START(CD4053_DIP) +{ + CD4053_GATE(A) + CD4053_GATE(B) + CD4053_GATE(C) + + NET_C(A.VEE, B.VEE, C.VEE) + NET_C(A.VDD, B.VDD, C.VDD) + NET_C(A.VSS, B.VSS, C.VSS) + NET_C(A.INH, B.INH, C.INH) + + PARAM(A.BASER, 270.0) + PARAM(B.BASER, 270.0) + PARAM(C.BASER, 270.0) + + DIPPINS( /* +--------------+ */ + B.Y, /* INOUTBY |1 ++ 16| VDD */ A.VDD, + B.X, /* INOUTBX |2 15| OUTINB */ B.XY, + C.Y, /* INOUTCY |3 14| OUTINA */ A.XY, + C.XY, /* OUTINC |4 4053 13| INOUTAY */ A.Y, + C.X, /* INOUTCX |5 12| INOUTAX */ A.X, + A.INH, /* INH |6 11| A */ A.S, + A.VEE, /* VEE |7 10| B */ B.S, + A.VSS, /* VSS |8 9| C */ C.S + /* +--------------+ */ + ) +} + +//- Identifier: CD4066_DIP +//- Title: CD4066BM/CD4066BC Quad Bilateral Switch +//- Pinalias: INOUTA,OUTINA,OUTINB,INOUTB,CONTROLB,CONTROLC,VSS,INOUTC,OUTINC,OUTIND,INOUTD,CONTROLD,CONTROLA,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS005665.PDF +//- +static NETLIST_START(CD4066_DIP) +{ + CD4066_GATE(A) + CD4066_GATE(B) + CD4066_GATE(C) + CD4066_GATE(D) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + PARAM(A.BASER, 270.0) + PARAM(B.BASER, 270.0) + PARAM(C.BASER, 270.0) + PARAM(D.BASER, 270.0) + + DIPPINS( /* +--------------+ */ + A.R.1, /* INOUTA |1 ++ 14| VDD */ A.VDD, + A.R.2, /* OUTINA |2 13| CONTROLA */ A.CTL, + B.R.1, /* OUTINB |3 12| CONTROLD */ D.CTL, + B.R.2, /* INOUTB |4 4066 11| INOUTD */ D.R.1, + B.CTL, /* CONTROLB |5 10| OUTIND */ D.R.2, + C.CTL, /* CONTROLC |6 9| OUTINC */ C.R.1, + A.VSS, /* VSS |7 8| INOUTC */ C.R.2 + /* +--------------+ */ + ) +} + +//- Identifier: CD4069_DIP +//- Title: CD4069UBM/CD4069UBC Inverter Circuits +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,VSS,Y4,A4,Y5,A5,Y6,A6,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/150/206783_DS.pdf +//- +static NETLIST_START(CD4069_DIP) +{ + CD4069_GATE(A) + CD4069_GATE(B) + CD4069_GATE(C) + CD4069_GATE(D) + CD4069_GATE(E) + CD4069_GATE(F) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD, E.VDD, F.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS, E.VSS, F.VSS) + + DIPPINS( /* +--------------+ */ + A.A, /* A1 |1 ++ 14| VDD */ A.VDD, + A.Q, /* Y1 |2 13| A6 */ F.A, + B.A, /* A2 |3 12| Y6 */ F.Q, + B.Q, /* Y2 |4 4069 11| A5 */ E.A, + C.A, /* A3 |5 10| Y5 */ E.Q, + C.Q, /* Y3 |6 9| A4 */ D.A, + A.VSS, /* VSS |7 8| Y4 */ D.Q + /* +--------------+ */ + ) +} + +//- Identifier: CD4070_DIP +//- Title: CD4070BM/CD4070BC Quad 2-Input EXCLUSIVE-OR Gate +//- Pinalias: A,B,J,K,C,D,VSS,E,F,L,M,G,H,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/150/206783_DS.pdf +//- +static NETLIST_START(CD4070_DIP) +{ + CD4070_GATE(A) + CD4070_GATE(B) + CD4070_GATE(C) + CD4070_GATE(D) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + DIPPINS( /* +--------------+ */ + A.A, /* A |1 ++ 14| VDD */ A.VDD, + A.B, /* B |2 13| H */ D.B, + A.Q, /* J |3 12| G */ D.A, + B.Q, /* K |4 4070 11| M */ D.Q, + B.A, /* C |5 10| L */ C.Q, + B.B, /* D |6 9| F */ C.B, + A.VSS, /* VSS |7 8| E */ C.A + /* +--------------+ */ + ) +} + +//- Identifier: CD4071_DIP +//- Title: CD4071BC Quad 2-Input OR Buffered B Series Gate +//- Pinalias: A,B,J,K,C,D,VSS,E,F,L,M,G,H,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/185/109289_DS.pdf +//- +static NETLIST_START(CD4071_DIP) +{ + CD4071_GATE(A) + CD4071_GATE(B) + CD4071_GATE(C) + CD4071_GATE(D) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + DIPPINS( /* +--------------+ */ + A.A, /* A |1 ++ 14| VDD */ A.VDD, + A.B, /* B |2 13| H */ D.B, + A.Q, /* J |3 12| G */ D.A, + B.Q, /* K |4 4071 11| M */ D.Q, + B.A, /* C |5 10| L */ C.Q, + B.B, /* D |6 9| F */ C.B, + A.VSS, /* VSS |7 8| E */ C.A + /* +--------------+ */ + ) +} + +//- Identifier: CD4076_DIP +//- Title: CD4076BM/CD4076BC TRI-STATE(R) Quad D Flip-Flop +//- Pinalias: OD1,OD2,OA,OB,OC,OD,CLK,VSS,ID1,ID2,ID,IC,IB,IA,CLR,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: +//- Voltage-dependent timing is not implemented. +//- FunctionTable: +//- http://www.bitsavers.org/components/national/_dataBooks/1981_Natonal_CMOS_Databook.pdf 5-186 (pdf page 567) +//- +//- Function table for ID1/2 pins +//- +-----+-----+-----+----+-----++-----+ +//- | ID1 | ID2 | CLR | Ix | CLK || iOx | +//- +=====+=====+=====+====+=====++=====+ +//- | X | X | 0 | X | 0 || iOx | +//- | X | X | 0 | X | 1 || iOx | +//- | 1 | X | 0 | X | 0>1 || iOx | +//- | X | 1 | 0 | X | 0>1 || iOx | +//- | 0 | 0 | 0 | 0 | 0>1 || 0 | +//- | 0 | 0 | 0 | 1 | 0>1 || 1 | +//- | X | X | 1 | X | X || 0 | +//- +-----+-----+-----+----+-----++-----+ +//- Note: iOX is an internal signal, the output of each D-latch +//- +//- Function table for OD1/2 pins vs output of the internal D-latches +//- +-----+-----+-----++-----+ +//- | OD1 | OD2 | iOx || Ox | +//- +=====+=====+=====++=====+ +//- | 1 | X | X || Z | +//- | X | 1 | X || Z | +//- | 0 | 0 | 0 || 0 | +//- | 0 | 0 | 1 || 1 | +//- +-----+-----+-----++-----+ +//- +static NETLIST_START(CD4076_DIP) +{ + CD4076(A) + + DIPPINS( /* +--------------+ */ + A.OD1, /* OD1 |1 ++ 16| VDD */ A.VDD, + A.OD2, /* OD2 |2 15| CLR */ A.CLR, + A.OA, /* OA |3 14| IA */ A.IA, + A.OB, /* OB |4 4076 13| IB */ A.IB, + A.OC, /* OC |5 12| IC */ A.IC, + A.OD, /* OD |6 11| ID */ A.ID, + A.CLK, /* CLK |7 10| ID2 */ A.ID2, + A.VSS, /* VSS |8 9| ID1 */ A.ID1 + /* +--------------+ */ + ) +} + +//- Identifier: CD4081_DIP +//- Title: CD4081BC Quad 2-Input AND Buffered B Series Gate +//- Pinalias: A,B,J,K,C,D,VSS,E,F,L,M,G,H,VDD +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/185/109289_DS.pdf +//- +static NETLIST_START(CD4081_DIP) +{ + CD4081_GATE(A) + CD4081_GATE(B) + CD4081_GATE(C) + CD4081_GATE(D) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + DIPPINS( /* +--------------+ */ + A.A, /* A |1 ++ 14| VDD */ A.VDD, + A.B, /* B |2 13| H */ D.B, + A.Q, /* J |3 12| G */ D.A, + B.Q, /* K |4 4081 11| M */ D.Q, + B.A, /* C |5 10| L */ C.Q, + B.B, /* D |6 9| F */ C.B, + A.VSS, /* VSS |7 8| E */ C.A + /* +--------------+ */ + ) +} + +//- Identifier: CD4316_DIP +//- Title: 74HC/HCT4316 Quad bilateral switches +//- Pinalias: 1Z,1Y,2Y,2Z,2S,3S,EQ,GND,VEE,3Z,3Y,4Y,4Z,4S,1S,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Philips datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/philips/74HCT4316.pdf +//- +static NETLIST_START(CD4316_DIP) +{ + CD4316_GATE(A) + CD4316_GATE(B) + CD4316_GATE(C) + CD4316_GATE(D) + + NET_C(A.E, B.E, C.E, D.E) + NET_C(A.VDD, B.VDD, C.VDD, D.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS) + + PARAM(A.BASER, 45.0) + PARAM(B.BASER, 45.0) + PARAM(C.BASER, 45.0) + PARAM(D.BASER, 45.0) + + DIPPINS( /* +--------------+ */ + A.R.2, /* 1Z |1 ++ 16| VCC */ A.VDD, + A.R.1, /* 1Y |2 15| 1S */ A.S, + B.R.1, /* 2Y |3 14| 4S */ D.S, + B.R.2, /* 2Z |4 4316 13| 4Z */ D.R.2, + B.S, /* 2S |5 12| 4Y */ D.R.1, + C.S, /* 3S |6 11| 3Y */ C.R.1, + A.E, /* EQ |7 10| 3Z */ C.R.2, + A.VSS, /* GND |8 9| VEE */ VEE + /* +--------------+ */ + ) +} + +//- Identifier: CD4538_DIP +//- Title: CD4538BC Dual Precision Monostable +//- Pinalias: C1,RC1,CLRQ1,B1,A1,Q1,QQ1,GND,QQ2,Q2,A2,B2,CLRQ2,RC2,C2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Fairchild Semiconductor datasheet +//- Limitations: +//- Timing inaccuracies may occur for capacitances < 1nF. Please consult datasheet +//- +//- Example: 74123.cpp,74123_example +//- +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/50871/FAIRCHILD/CD4538.html +//- +static NETLIST_START(CD4538_DIP) +{ + CD4538(A) + CD4538(B) + + NET_C(A.VDD, B.VDD) + NET_C(A.VSS, B.VSS) + + DIPPINS( /* +--------------+ */ + A.C, /* 1Z |1 ++ 16| VCC */ A.VDD, + A.RC, /* 1Y |2 15| 1S */ B.C, + A.CLRQ, /* 2Y |3 14| 4S */ B.RC, + A.A, /* 2Z |4 4316 13| 4Z */ B.CLRQ, + A.B, /* 2S |5 12| 4Y */ B.A, + A.Q, /* 3S |6 11| 3Y */ B.B, + A.QQ, /* EQ |7 10| 3Z */ B.Q, + A.VSS, /* GND |8 9| VEE */ B.QQ + /* +--------------+ */ + ) +} + +//FIXME: Documentation +static NETLIST_START(MM5837_DIP) +{ + MM5837(A) + NC_PIN(NC) + + // Create a parameter freq for the dip model + // The default will be A's FREQ parameter. + DEFPARAM(FREQ, "$(@.A.FREQ") + PARAM(A.FREQ, "$(@.FREQ)") + + DIPPINS( /* +--------+ */ + A.VDD, /* VDD |1 ++ 8| NC */ NC.I, + A.VGG, /* VGG |2 7| NC */ NC.I, + A.OUT, /* OUT |3 6| NC */ NC.I, + A.VSS, /* VSS |4 5| NC */ NC.I + /* +--------+ */ + ) +} + +static TRUTH_TABLE(CD4001_GATE, 2, 1, "") +{ + TT_HEAD("A , B | Q ") + TT_LINE("0,0|1|110") + TT_LINE("X,1|0|120") + TT_LINE("1,X|0|120") + TT_FAMILY("CD4XXX") +} + +static TRUTH_TABLE(CD4011_GATE, 2, 1, "") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,X|1|100") + TT_LINE("X,0|1|100") + TT_LINE("1,1|0|100") + TT_FAMILY("CD4XXX") +} + +static TRUTH_TABLE(CD4030_GATE, 2, 1, "") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,0|0|100") + TT_LINE("0,1|1|100") + TT_LINE("1,0|1|100") + TT_LINE("1,1|0|100") + TT_FAMILY("CD4XXX") +} + +static TRUTH_TABLE(CD4049_GATE, 1, 1, "") +{ + TT_HEAD("A|Q ") + TT_LINE("0|1|45") + TT_LINE("1|0|45") + TT_FAMILY("CD4XXX") +} + +static TRUTH_TABLE(CD4069_GATE, 1, 1, "") +{ + TT_HEAD("A|Q ") + TT_LINE("0|1|55") + TT_LINE("1|0|55") + TT_FAMILY("CD4XXX") +} + +static TRUTH_TABLE(CD4070_GATE, 2, 1, "") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,0|0|15") + TT_LINE("0,1|1|22") + TT_LINE("1,0|1|22") + TT_LINE("1,1|0|15") + TT_FAMILY("CD4XXX") +} + +static TRUTH_TABLE(CD4071_GATE, 2, 1, "") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,0|0|200") + TT_LINE("0,1|1|200") + TT_LINE("1,0|1|200") + TT_LINE("1,1|1|200") + TT_FAMILY("CD4XXX") +} + +static TRUTH_TABLE(CD4081_GATE, 2, 1, "") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,0|0|200") + TT_LINE("0,1|0|200") + TT_LINE("1,0|0|200") + TT_LINE("1,1|1|200") + TT_FAMILY("CD4XXX") +} + +NETLIST_START(cd4xxx_lib) +{ + + TRUTHTABLE_ENTRY(CD4001_GATE) + TRUTHTABLE_ENTRY(CD4011_GATE) + TRUTHTABLE_ENTRY(CD4030_GATE) + TRUTHTABLE_ENTRY(CD4049_GATE) + TRUTHTABLE_ENTRY(CD4069_GATE) + TRUTHTABLE_ENTRY(CD4070_GATE) + TRUTHTABLE_ENTRY(CD4071_GATE) + TRUTHTABLE_ENTRY(CD4081_GATE) + + LOCAL_LIB_ENTRY(CD4001_DIP) + LOCAL_LIB_ENTRY(CD4011_DIP) + LOCAL_LIB_ENTRY(CD4030_DIP) + LOCAL_LIB_ENTRY(CD4049_DIP) + LOCAL_LIB_ENTRY(CD4069_DIP) + LOCAL_LIB_ENTRY(CD4070_DIP) + LOCAL_LIB_ENTRY(CD4071_DIP) + LOCAL_LIB_ENTRY(CD4081_DIP) + + /* DIP ONLY */ + LOCAL_LIB_ENTRY(CD4006_DIP) + LOCAL_LIB_ENTRY(CD4013_DIP) + LOCAL_LIB_ENTRY(CD4017_DIP) + LOCAL_LIB_ENTRY(CD4022_DIP) + LOCAL_LIB_ENTRY(CD4020_DIP) + LOCAL_LIB_ENTRY(CD4024_DIP) + LOCAL_LIB_ENTRY(CD4029_DIP) + LOCAL_LIB_ENTRY(CD4042_DIP) + LOCAL_LIB_ENTRY(CD4053_DIP) + LOCAL_LIB_ENTRY(CD4066_DIP) + LOCAL_LIB_ENTRY(CD4016_DIP) + LOCAL_LIB_ENTRY(CD4076_DIP) + LOCAL_LIB_ENTRY(CD4316_DIP) + LOCAL_LIB_ENTRY(CD4538_DIP) + + LOCAL_LIB_ENTRY(MM5837_DIP) + +} diff --git a/src/lib/netlist/macro/nlm_opamp.cpp b/src/lib/netlist/macro/nlm_opamp.cpp deleted file mode 100644 index 34c0791e312..00000000000 --- a/src/lib/netlist/macro/nlm_opamp.cpp +++ /dev/null @@ -1,374 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#include "nlm_opamp.h" -#include "netlist/devices/net_lib.h" - -/* - * 0 = Basic hack (Norton with just amplification, no voltage cutting) - * 1 = Model from LTSPICE mailing list - slow! - * 2 = Simplified model using diode inputs and netlist TYPE=3 - * 3 = Model according to datasheet - * - * For Money Money 1 and 3 delivery comparable results. - * 3 is simpler (less BJTs) and converges a lot faster. - */ -#define USE_LM3900_MODEL (3) - -/* - * Generic layout with 4 opamps, VCC on pin 4 and GND on pin 11 - */ - -static NETLIST_START(opamp_layout_4_4_11) - DIPPINS( /* +--------------+ */ - A.OUT, /* |1 ++ 14| */ D.OUT, - A.MINUS, /* |2 13| */ D.MINUS, - A.PLUS, /* |3 12| */ D.PLUS, - A.VCC, /* |4 11| */ A.GND, - B.PLUS, /* |5 10| */ C.PLUS, - B.MINUS, /* |6 9| */ C.MINUS, - B.OUT, /* |7 8| */ C.OUT - /* +--------------+ */ - ) - NET_C(A.GND, B.GND, C.GND, D.GND) - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) -NETLIST_END() - -/* - * Generic layout with 2 opamps, VCC on pin 8 and GND on pin 4 - */ - -static NETLIST_START(opamp_layout_2_8_4) - DIPPINS( /* +--------------+ */ - A.OUT, /* |1 ++ 8| */ A.VCC, - A.MINUS, /* |2 7| */ B.OUT, - A.PLUS, /* |3 6| */ B.MINUS, - A.GND, /* |4 5| */ B.PLUS - /* +--------------+ */ - ) - NET_C(A.GND, B.GND) - NET_C(A.VCC, B.VCC) -NETLIST_END() - -/* - * Generic layout with 2 opamps, VCC+ on pins 9/13, VCC- on pin 4 and compensation - */ - -static NETLIST_START(opamp_layout_2_13_9_4) - DIPPINS( /* +--------------+ */ - A.MINUS, /* |1 ++ 14| */ A.N2, - A.PLUS, /* |2 13| */ A.VCC, - A.N1, /* |3 12| */ A.OUT, - A.GND, /* |4 11| */ NC, - B.N1, /* |5 10| */ B.OUT, - B.PLUS, /* |6 9| */ B.VCC, - B.MINUS, /* |7 8| */ B.N2 - /* +--------------+ */ - ) - NET_C(A.GND, B.GND) -NETLIST_END() - -/* - * Generic layout with 1 opamp, VCC+ on pin 7, VCC- on pin 4 and compensation - */ - -static NETLIST_START(opamp_layout_1_7_4) - DIPPINS( /* +--------------+ */ - OFFSET.N1, /* |1 ++ 8| */ NC, - MINUS, /* |2 7| */ VCC.PLUS, - PLUS, /* |3 6| */ OUT, - VCC.MINUS, /* |4 5| */ OFFSET.N2 - /* +--------------+ */ - ) - NET_C(A.GND, VCC.MINUS) - NET_C(A.VCC, VCC.PLUS) - NET_C(A.MINUS, MINUS) - NET_C(A.PLUS, PLUS) - NET_C(A.OUT, OUT) -NETLIST_END() - -/* - * Generic layout with 1 opamp, VCC+ on pin 8, VCC- on pin 5 and compensation - */ - -static NETLIST_START(opamp_layout_1_8_5) - DIPPINS( /* +--------------+ */ - NC.1, /* |1 10| */ NC.3, - OFFSET.N1, /* |2 9| */ NC.2, - MINUS, /* |3 8| */ VCC.PLUS, - PLUS, /* |4 7| */ OUT, - VCC.MINUS, /* |5 6| */ OFFSET.N2 - /* +--------------+ */ - ) - NET_C(A.GND, VCC.MINUS) - NET_C(A.VCC, VCC.PLUS) - NET_C(A.MINUS, MINUS) - NET_C(A.PLUS, PLUS) - NET_C(A.OUT, OUT) -NETLIST_END() - -/* - * Generic layout with 1 opamp, VCC+ on pin 11, VCC- on pin 6 and compensation - */ - -static NETLIST_START(opamp_layout_1_11_6) - DIPPINS( /* +--------------+ */ - NC.1, /* |1 ++ 14| */ NC.7, - NC.2, /* |2 13| */ NC.6, - OFFSET.N1, /* |3 12| */ NC.5, - MINUS, /* |4 11| */ VCC.PLUS, - PLUS, /* |5 10| */ OUT, - VCC.MINUS, /* |6 9| */ OFFSET.N2, - NC.3, /* |7 8| */ NC.4 - /* +--------------+ */ - ) - NET_C(A.GND, VCC.MINUS) - NET_C(A.VCC, VCC.PLUS) - NET_C(A.MINUS, MINUS) - NET_C(A.PLUS, PLUS) - NET_C(A.OUT, OUT) -NETLIST_END() - -static NETLIST_START(MB3614_DIP) - OPAMP(A, "MB3614") - OPAMP(B, "MB3614") - OPAMP(C, "MB3614") - OPAMP(D, "MB3614") - - INCLUDE(opamp_layout_4_4_11) - -NETLIST_END() - -static NETLIST_START(LM324_DIP) - OPAMP(A, "LM324") - OPAMP(B, "LM324") - OPAMP(C, "LM324") - OPAMP(D, "LM324") - - INCLUDE(opamp_layout_4_4_11) - -NETLIST_END() - -static NETLIST_START(LM2902_DIP) - // Same datasheet and mostly same characteristics as LM324 - OPAMP(A, "LM324") - OPAMP(B, "LM324") - OPAMP(C, "LM324") - OPAMP(D, "LM324") - - INCLUDE(opamp_layout_4_4_11) - -NETLIST_END() - -static NETLIST_START(LM358_DIP) - OPAMP(A, "LM358") - OPAMP(B, "LM358") - - INCLUDE(opamp_layout_2_8_4) - -NETLIST_END() - -static NETLIST_START(UA741_DIP8) - OPAMP(A, "UA741") - - INCLUDE(opamp_layout_1_7_4) - -NETLIST_END() - -static NETLIST_START(UA741_DIP10) - OPAMP(A, "UA741") - - INCLUDE(opamp_layout_1_8_5) - -NETLIST_END() - -static NETLIST_START(UA741_DIP14) - OPAMP(A, "UA741") - - INCLUDE(opamp_layout_1_11_6) - -NETLIST_END() - -static NETLIST_START(LM747_DIP) - OPAMP(A, "LM747") - OPAMP(B, "LM747") - - INCLUDE(opamp_layout_2_13_9_4) - NET_C(A.VCC, B.VCC) - -NETLIST_END() - -static NETLIST_START(LM747A_DIP) - OPAMP(A, "LM747A") - OPAMP(B, "LM747A") - - INCLUDE(opamp_layout_2_13_9_4) - NET_C(A.VCC, B.VCC) - -NETLIST_END() - -#if USE_LM3900_MODEL == 0 -static NETLIST_START(LM3900) - - /* - * Fast norton opamp model without bandwidth - */ - - /* Terminal definitions for calling netlists */ - - ALIAS(PLUS, R1.1) // Positive input - ALIAS(MINUS, R2.1) // Negative input - ALIAS(OUT, G1.OP) // Opamp output ... - ALIAS(GND, G1.ON) // V- terminal - ALIAS(VCC, DUMMY.I) // V+ terminal - - DUMMY_INPUT(DUMMY) - - /* The opamp model */ - - RES(R1, 1) - RES(R2, 1) - NET_C(R1.1, G1.IP) - NET_C(R2.1, G1.IN) - NET_C(R1.2, R2.2, G1.ON) - VCVS(G1) - PARAM(G1.G, 10000000) - //PARAM(G1.RI, 1) - PARAM(G1.RO, RES_K(8)) - -NETLIST_END() -#endif - -#if USE_LM3900_MODEL == 1 -// LTSPICE MODEL OF LM3900 FROM NATIONAL SEMICONDUCTOR -// MADE BY HELMUT SENNEWALD, 8/6/2004 -// THE LM3900 IS A SO CALLED NORTON AMPLIFIER. -// -// PIN ORDER: IN+ IN- VCC VSS OUT -static NETLIST_START(LM3900) - PARAM(E1.G, 0.5) - //ALIAS(IN+, Q2.B) - //ALIAS(IN-, Q2.C) - //ALIAS(VCC, Q10.C) - //ALIAS(VSS, Q2.E) - - ALIAS(PLUS, Q2.B) - ALIAS(MINUS, Q2.C) - ALIAS(VCC, Q10.C) - ALIAS(GND, Q2.E) - ALIAS(OUT, Q6.C) - - //CS(B1/*I=LIMIT(0, V(VCC,VSS)/10K, 0.2m)*/) - CS(B1, 2e-4) - CAP(C1, CAP_P(6.000000)) - VCVS(E1) - QBJT_EB(Q1, "LM3900_NPN1") - QBJT_EB(Q10, "LM3900_NPN1") - QBJT_EB(Q11, "LM3900_NPN1") - QBJT_EB(Q12, "LM3900_NPN1") - QBJT_EB(Q2, "LM3900_NPN1") - QBJT_EB(Q3, "LM3900_NPN1") - QBJT_EB(Q4, "LM3900_PNP1") - QBJT_EB(Q5, "LM3900_PNP1") - QBJT_EB(Q6, "LM3900_PNP1") - QBJT_EB(Q7, "LM3900_PNP1") - QBJT_EB(Q8, "LM3900_NPN1") - QBJT_EB(Q9, "LM3900_NPN1") - RES(R1, RES_K(2.000000)) - RES(R6, RES_K(1.600000)) - NET_C(Q11.B, Q12.B, R6.2) - NET_C(Q5.C, Q5.B, B1.P, Q4.B) - NET_C(Q8.C, Q8.B, B1.N, R1.1, E1.IP) - NET_C(Q9.B, R1.2) - NET_C(R6.1, E1.OP) - NET_C(Q10.C, Q5.E, Q4.E, Q11.C, Q12.C) - NET_C(Q2.C, Q3.B, Q12.E) - NET_C(Q2.E, Q3.E, Q9.E, C1.2, Q1.E, Q8.E, E1.ON, E1.IN, Q7.C) - NET_C(Q3.C, Q6.B, C1.1, Q7.B) - NET_C(Q6.E, Q10.B, Q4.C) - NET_C(Q6.C, Q10.E, Q9.C, Q7.E) - NET_C(Q2.B, Q1.C, Q1.B, Q11.E) -NETLIST_END() -#endif - -#if USE_LM3900_MODEL == 2 -static NETLIST_START(LM3900) - OPAMP(A, "LM3900") - - DIODE(D1, "D(IS=1e-15 N=1)") - CCCS(CS1) // Current Mirror - - ALIAS(VCC, A.VCC) - ALIAS(GND, A.GND) - ALIAS(PLUS, A.PLUS) - ALIAS(MINUS, A.MINUS) - ALIAS(OUT, A.OUT) - - NET_C(A.PLUS, CS1.IP) - NET_C(D1.A, CS1.IN) - NET_C(CS1.OP, A.MINUS) - NET_C(CS1.ON, A.GND, D1.K) - -NETLIST_END() -#endif - -#if USE_LM3900_MODEL == 3 -static NETLIST_START(LM3900) - - ALIAS(VCC, Q5.C) - ALIAS(GND, Q1.E) - ALIAS(PLUS, Q1.B) - ALIAS(MINUS, Q1.C) - ALIAS(OUT, Q5.E) - - CAP(C1, CAP_P(6.000000)) - CS(I1, 1.300000e-3) - CS(I2, 200e-6) - QBJT_EB(Q1, "NPN") - QBJT_EB(Q2, "NPN") - QBJT_EB(Q3, "PNP") - QBJT_EB(Q4, "PNP") - QBJT_EB(Q5, "NPN") - QBJT_EB(Q6, "NPN") - NET_C(Q3.E, Q5.B, I2.2) - NET_C(Q3.C, Q4.E, Q5.E, I1.1) - NET_C(Q5.C, I2.1) - NET_C(Q1.B, Q6.C, Q6.B) - NET_C(Q1.E, Q2.E, Q4.C, C1.2, I1.2, Q6.E) - NET_C(Q1.C, Q2.B) - NET_C(Q2.C, Q3.B, Q4.B, C1.1) -NETLIST_END() -#endif - -NETLIST_START(OPAMP_lib) - LOCAL_LIB_ENTRY(opamp_layout_4_4_11) - LOCAL_LIB_ENTRY(opamp_layout_2_8_4) - LOCAL_LIB_ENTRY(opamp_layout_2_13_9_4) - LOCAL_LIB_ENTRY(opamp_layout_1_7_4) - LOCAL_LIB_ENTRY(opamp_layout_1_8_5) - LOCAL_LIB_ENTRY(opamp_layout_1_11_6) - - NET_MODEL("LM324 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.3M RI=1000k RO=50 DAB=0.00075)") - NET_MODEL("LM358 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.3M RI=1000k RO=50 DAB=0.001)") - NET_MODEL("MB3614 OPAMP(TYPE=3 VLH=1.4 VLL=0.02 FPF=10 UGF=1000k SLEW=0.6M RI=1000k RO=50 DAB=0.002)") - NET_MODEL("UA741 OPAMP(TYPE=3 VLH=1.0 VLL=1.0 FPF=5 UGF=1000k SLEW=0.5M RI=2000k RO=75 DAB=0.0017)") - NET_MODEL("LM747 OPAMP(TYPE=3 VLH=1.0 VLL=1.0 FPF=5 UGF=1000k SLEW=0.5M RI=2000k RO=50 DAB=0.0017)") - NET_MODEL("LM747A OPAMP(TYPE=3 VLH=2.0 VLL=2.0 FPF=5 UGF=1000k SLEW=0.7M RI=6000k RO=50 DAB=0.0015)") - // TI and Motorola Datasheets differ - below are Motorola values values SLEW is average of LH and HL - NET_MODEL("LM3900 OPAMP(TYPE=3 VLH=1.0 VLL=0.03 FPF=2k UGF=4M SLEW=10M RI=10M RO=2k DAB=0.0015)") - -#if USE_LM3900_MODEL == 1 - NET_MODEL("LM3900_NPN1 NPN(IS=1E-14 BF=150 TF=1E-9 CJC=1E-12 CJE=1E-12 VAF=150 RB=100 RE=5 IKF=0.002)") - NET_MODEL("LM3900_PNP1 PNP(IS=1E-14 BF=40 TF=1E-7 CJC=1E-12 CJE=1E-12 VAF=150 RB=100 RE=5)") -#endif - LOCAL_LIB_ENTRY(MB3614_DIP) - LOCAL_LIB_ENTRY(LM324_DIP) - LOCAL_LIB_ENTRY(LM358_DIP) - LOCAL_LIB_ENTRY(LM2902_DIP) - LOCAL_LIB_ENTRY(UA741_DIP8) - LOCAL_LIB_ENTRY(UA741_DIP10) - LOCAL_LIB_ENTRY(UA741_DIP14) - LOCAL_LIB_ENTRY(LM747_DIP) - LOCAL_LIB_ENTRY(LM747A_DIP) - LOCAL_LIB_ENTRY(LM3900) - -NETLIST_END() diff --git a/src/lib/netlist/macro/nlm_opamp.h b/src/lib/netlist/macro/nlm_opamp.h deleted file mode 100644 index 13d2254d952..00000000000 --- a/src/lib/netlist/macro/nlm_opamp.h +++ /dev/null @@ -1,41 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#ifndef NLM_OPAMP_H_ -#define NLM_OPAMP_H_ - -#include "netlist/nl_setup.h" - -#ifndef __PLIB_PREPROCESSOR__ - -/* ---------------------------------------------------------------------------- - * Netlist Macros - * ---------------------------------------------------------------------------*/ - -#ifndef NL_AUTO_DEVICES - -#define MB3614_DIP(name) \ - NET_REGISTER_DEV(MB3614_DIP, name) - -#define LM324_DIP(name) \ - NET_REGISTER_DEV(LM324_DIP, name) - -#define LM2902_DIP(name) \ - NET_REGISTER_DEV(LM2902_DIP, name) - -#define LM358_DIP(name) \ - NET_REGISTER_DEV(LM358_DIP, name) - -#define LM3900(name) \ - NET_REGISTER_DEV(LM3900, name) - -#endif - -/* ---------------------------------------------------------------------------- - * External declarations - * ---------------------------------------------------------------------------*/ - -NETLIST_EXTERNAL(OPAMP_lib) - -#endif - -#endif diff --git a/src/lib/netlist/macro/nlm_opamp_lib.cpp b/src/lib/netlist/macro/nlm_opamp_lib.cpp new file mode 100644 index 00000000000..26e9adba7c8 --- /dev/null +++ b/src/lib/netlist/macro/nlm_opamp_lib.cpp @@ -0,0 +1,685 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +#include "devices/net_lib.h" + +/* + * 0 = Basic hack (Norton with just amplification, no voltage cutting) + * 1 = Model from LTSPICE mailing list - slow! + * 2 = Simplified model using diode inputs and netlist + * 3 = Model according to datasheet + * 4 = Faster model by Colin Howell + * + * For Money Money 1 and 3 delivery comparable results. + * 3 is simpler (less BJTs) and converges a lot faster. + * + * Model 4 uses a lot less resources and pn-junctions. The preferred new normal. + */ +#define USE_LM3900_MODEL (4) + +/* + * Generic layout with 4 opamps, VCC on pin 4 and GND on pin 11 + */ + +static NETLIST_START(opamp_layout_4_4_11) +{ + DIPPINS( /* +--------------+ */ + A.OUT, /* |1 ++ 14| */ D.OUT, + A.MINUS, /* |2 13| */ D.MINUS, + A.PLUS, /* |3 12| */ D.PLUS, + A.VCC, /* |4 11| */ A.GND, + B.PLUS, /* |5 10| */ C.PLUS, + B.MINUS, /* |6 9| */ C.MINUS, + B.OUT, /* |7 8| */ C.OUT + /* +--------------+ */ + ) + NET_C(A.GND, B.GND, C.GND, D.GND) + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) +} + +/* + * Generic layout with 2 opamps, VCC on pin 8 and GND on pin 4 + */ + +static NETLIST_START(opamp_layout_2_8_4) +{ + DIPPINS( /* +--------------+ */ + A.OUT, /* |1 ++ 8| */ A.VCC, + A.MINUS, /* |2 7| */ B.OUT, + A.PLUS, /* |3 6| */ B.MINUS, + A.GND, /* |4 5| */ B.PLUS + /* +--------------+ */ + ) + NET_C(A.GND, B.GND) + NET_C(A.VCC, B.VCC) +} + +/* + * Generic layout with 2 opamps, VCC+ on pins 9/13, VCC- on pin 4 and compensation + */ + +static NETLIST_START(opamp_layout_2_13_9_4) +{ + DIPPINS( /* +--------------+ */ + A.MINUS, /* |1 ++ 14| */ A.N2, + A.PLUS, /* |2 13| */ A.VCC, + A.N1, /* |3 12| */ A.OUT, + A.GND, /* |4 11| */ NC, + B.N1, /* |5 10| */ B.OUT, + B.PLUS, /* |6 9| */ B.VCC, + B.MINUS, /* |7 8| */ B.N2 + /* +--------------+ */ + ) + NET_C(A.GND, B.GND) +} + +/* + * Generic layout with 1 opamp, VCC+ on pin 7, VCC- on pin 4 and compensation + * // FIXME: Offset inputs are not supported! + */ + +static NETLIST_START(opamp_layout_1_7_4) +{ + DIPPINS( /* +--------------+ */ + NC /* OFFSET */, /* |1 ++ 8| */ NC, + A.MINUS, /* |2 7| */ A.VCC, + A.PLUS, /* |3 6| */ A.OUT, + A.GND, /* |4 5| */ NC /* OFFSET */ + /* +--------------+ */ + ) +} + +/* + * Generic layout with 1 opamp, VCC+ on pin 8, VCC- on pin 5 and compensation + */ + +static NETLIST_START(opamp_layout_1_8_5) +{ + DIPPINS( /* +--------------+ */ + NC.1, /* |1 10| */ NC.3, + OFFSET.N1, /* |2 9| */ NC.2, + MINUS, /* |3 8| */ VCC.PLUS, + PLUS, /* |4 7| */ OUT, + VCC.MINUS, /* |5 6| */ OFFSET.N2 + /* +--------------+ */ + ) + NET_C(A.GND, VCC.MINUS) + NET_C(A.VCC, VCC.PLUS) + NET_C(A.MINUS, MINUS) + NET_C(A.PLUS, PLUS) + NET_C(A.OUT, OUT) +} + +/* + * Generic layout with 1 opamp, VCC+ on pin 11, VCC- on pin 6 and compensation + */ + +static NETLIST_START(opamp_layout_1_11_6) +{ + DIPPINS( /* +--------------+ */ + NC.1, /* |1 ++ 14| */ NC.7, + NC.2, /* |2 13| */ NC.6, + OFFSET.N1, /* |3 12| */ NC.5, + MINUS, /* |4 11| */ VCC.PLUS, + PLUS, /* |5 10| */ OUT, + VCC.MINUS, /* |6 9| */ OFFSET.N2, + NC.3, /* |7 8| */ NC.4 + /* +--------------+ */ + ) + NET_C(A.GND, VCC.MINUS) + NET_C(A.VCC, VCC.PLUS) + NET_C(A.MINUS, MINUS) + NET_C(A.PLUS, PLUS) + NET_C(A.OUT, OUT) +} + +static NETLIST_START(MB3614_DIP) +{ + OPAMP(A, "MB3614") + OPAMP(B, "MB3614") + OPAMP(C, "MB3614") + OPAMP(D, "MB3614") + + INCLUDE(opamp_layout_4_4_11) + +} + +static NETLIST_START(MC3340_DIP) +{ + // A netlist description of the Motorola MC3340 Electronic Attenuator + // IC, a voltage-controlled amplifier/attenuator. It amplifies or + // attenuates an input signal according to the voltage of a second, + // control signal, with a maximum gain of about 12-13 dB (about a + // factor of 4 in voltage), and higher control voltages giving greater + // attenuation, which scales logarithmically. + + // The netlist here is based on the circuit schematic given in + // Motorola's own data books, especially the most recent ones + // published in the 1990s (e.g. _Motorola Analog/Interface ICs Device + // Data, Vol. II_ (1996), p. 9-67), which are the only schematics that + // include resistor values. However, the 1990s schematics are missing + // one crossover connection which is present in older schematics + // published in the 1970s (e.g. _Motorola Linear Integrated Circuits_ + // (1979), p. 5-130). This missing connection is clearly an error + // which has been fixed in this netlist; without it, the circuit won't + // amplify properly, generating only a very weak output signal. + + // The 1990s schematics also omit a couple of diodes which are present + // in the 1970s schematics. Both of these diodes have been included + // here. One raises the minimum control voltage at which signal + // attenuation starts, so it makes the netlist's profile of + // attenuation vs. control voltage better match Motorola's charts for + // the device. The other affects the level of the input "midpoint", + // and including it makes the engine sound closer to that on real + // 280-ZZZAP machines. + + // The Motorola schematics do not label components, so I've created my + // own labeling scheme based on numbering components on the schematics + // from top to bottom, left to right, with resistors also getting + // their value (expressed European-style to avoid decimal points) as + // part of the name. The netlist is also listed following the + // schematics in roughly top-to-bottom, left-to-right order. + + // A very simple model is used for the transistors here, based on the + // generic NPN default but with a larger scale current. Again, this + // was chosen to better match the netlist's attenuation vs. control + // voltage profile to that given in Motorola's charts for the device. + + // The MC3340 has the same circuit internally as an older Motorola + // device, the MFC6040, which was replaced by the MC3340 in the + // mid-1970s. The two chips differ only in packaging. Older arcade + // games which use the MFC6040 may also benefit from this netlist + // implementation. + + RES(R1_5K1, RES_K(5.1)) + + DIODE(D1, "D(IS=1e-15 N=1)") + + RES(R2_4K7, RES_K(4.7)) + + QBJT_EB(Q1, "NPN(IS=1E-13 BF=100)") + + RES(R3_750, RES_R(750)) + RES(R4_10K, RES_K(10)) + + QBJT_EB(Q2, "NPN(IS=1E-13 BF=100)") + + RES(R5_750, RES_R(750)) + RES(R6_3K9, RES_K(3.9)) + + RES(R7_5K1, RES_K(5.1)) + RES(R8_20K, RES_K(20)) + + DIODE(D2, "D(IS=1e-15 N=1)") + + RES(R9_510, RES_R(510)) + + QBJT_EB(Q3, "NPN(IS=1E-13 BF=100)") + + QBJT_EB(Q4, "NPN(IS=1E-13 BF=100)") + + QBJT_EB(Q5, "NPN(IS=1E-13 BF=100)") + + RES(R10_1K3, RES_K(1.3)) + + QBJT_EB(Q6, "NPN(IS=1E-13 BF=100)") + + RES(R11_5K1, RES_K(5.1)) + + QBJT_EB(Q7, "NPN(IS=1E-13 BF=100)") + + QBJT_EB(Q8, "NPN(IS=1E-13 BF=100)") + + RES(R12_1K5, RES_K(1.5)) + + RES(R13_6K2, RES_K(6.2)) + + QBJT_EB(Q9, "NPN(IS=1E-13 BF=100)") + + RES(R14_5K1, RES_K(5.1)) + + QBJT_EB(Q10, "NPN(IS=1E-13 BF=100)") + + RES(R15_5K1, RES_K(5.1)) + + RES(R16_200, RES_R(200)) + + RES(R17_5K1, RES_K(5.1)) + + DIODE(D3, "D(IS=1e-15 N=1)") + + RES(R18_510, RES_R(510)) + + ALIAS(VCC, R1_5K1.1) + NET_C(R1_5K1.1, Q1.C, Q2.C, R7_5K1.1, Q3.C, Q4.C, Q7.C, + R13_6K2.1, Q10.C, R17_5K1.1) + // Location of first diode present on 1970s schematics but omitted on + // 1990s ones. Including it raises the control voltage threshold for + // attenuation significantly. + NET_C(R1_5K1.2, D1.A, Q1.B) + NET_C(D1.K, R2_4K7.1) + NET_C(R2_4K7.2, GND) + + NET_C(Q1.E, R3_750.1, R5_750.1) + NET_C(R3_750.2, R4_10K.1, Q2.B) + NET_C(R4_10K.2, GND) + + NET_C(R5_750.2, R6_3K9.1, Q3.B) + ALIAS(CONTROL, R6_3K9.2) + + ALIAS(INPUT, Q5.B) + + NET_C(INPUT, R8_20K.1) + // Location of second diode present on 1970s schematics but omitted on + // 1990s ones. Including it is critical to making the tone of the + // output engine sound match that of real 280-ZZZAP machines. + NET_C(R7_5K1.2, R8_20K.2, D2.A) + NET_C(D2.K, R9_510.1) + NET_C(R9_510.2, GND) + + NET_C(Q4.E, Q6.E, Q5.C) + NET_C(Q5.E, R10_1K3.1) + NET_C(R10_1K3.2, GND) + + NET_C(Q6.B, Q7.B, Q2.E, R11_5K1.1) + NET_C(R11_5K1.2, GND) + + NET_C(Q7.E, Q9.E, Q8.C) + NET_C(Q8.E, R12_1K5.1) + NET_C(R12_1K5.2, GND) + + NET_C(Q4.B, Q9.B, Q3.E, R14_5K1.1) + NET_C(R14_5K1.2, GND) + + // This is where the cross-connection is erroneously omitted from + // 1990s schematics. + NET_C(Q6.C, R13_6K2.2, Q9.C, Q10.B) + + // Connection for external frequency compensation capacitor; unused + // here. + ALIAS(ROLLOFF, Q10.B) + + NET_C(Q10.E, R16_200.1, R15_5K1.1) + NET_C(R15_5K1.2, GND) + ALIAS(OUTPUT, R16_200.2) + + NET_C(R17_5K1.2, D3.A, Q8.B) + NET_C(D3.K, R18_510.1) + ALIAS(GND, R18_510.2) + + ALIAS(1, INPUT) + ALIAS(2, CONTROL) + ALIAS(3, GND) + ALIAS(6, ROLLOFF) + ALIAS(7, OUTPUT) + ALIAS(8, VCC) +} + +static NETLIST_START(TL081_DIP) +{ + OPAMP(A, "TL084") + + INCLUDE(opamp_layout_1_7_4) + +} + +static NETLIST_START(TL082_DIP) +{ + OPAMP(A, "TL084") + OPAMP(B, "TL084") + + INCLUDE(opamp_layout_2_8_4) + +} + +static NETLIST_START(TL084_DIP) +{ + OPAMP(A, "TL084") + OPAMP(B, "TL084") + OPAMP(C, "TL084") + OPAMP(D, "TL084") + + INCLUDE(opamp_layout_4_4_11) + +} + +static NETLIST_START(LM324_DIP) +{ + OPAMP(A, "LM324") + OPAMP(B, "LM324") + OPAMP(C, "LM324") + OPAMP(D, "LM324") + + INCLUDE(opamp_layout_4_4_11) + +} + +static NETLIST_START(LM2902_DIP) +{ + // Same datasheet and mostly same characteristics as LM324 + OPAMP(A, "LM324") + OPAMP(B, "LM324") + OPAMP(C, "LM324") + OPAMP(D, "LM324") + + INCLUDE(opamp_layout_4_4_11) + +} + +static NETLIST_START(LM348_DIP) +{ + OPAMP(A, "UA741") + OPAMP(B, "UA741") + OPAMP(C, "UA741") + OPAMP(D, "UA741") + + INCLUDE(opamp_layout_4_4_11) + +} + +static NETLIST_START(LM358_DIP) +{ + OPAMP(A, "LM358") + OPAMP(B, "LM358") + + INCLUDE(opamp_layout_2_8_4) + +} + +static NETLIST_START(UA741_DIP8) +{ + OPAMP(A, "UA741") + + INCLUDE(opamp_layout_1_7_4) + +} + +static NETLIST_START(UA741_DIP10) +{ + OPAMP(A, "UA741") + + INCLUDE(opamp_layout_1_8_5) + +} + +static NETLIST_START(UA741_DIP14) +{ + OPAMP(A, "UA741") + + INCLUDE(opamp_layout_1_11_6) + +} + +static NETLIST_START(MC1558_DIP) +{ + OPAMP(A, "UA741") + OPAMP(B, "UA741") + + INCLUDE(opamp_layout_2_8_4) + +} + +static NETLIST_START(LM747_DIP) +{ + OPAMP(A, "LM747") + OPAMP(B, "LM747") + + INCLUDE(opamp_layout_2_13_9_4) + NET_C(A.VCC, B.VCC) + +} + +static NETLIST_START(LM747A_DIP) +{ + OPAMP(A, "LM747A") + OPAMP(B, "LM747A") + + INCLUDE(opamp_layout_2_13_9_4) + NET_C(A.VCC, B.VCC) + +} + +//- Identifier: AN6551_SIL +//- Title: AN6551 Dual Operational Amplifier +//- Pinalias: VCC,A.OUT,A-,A+,GND,B+,B-,B.OUT,VCC +//- Package: SIL +//- NamingConvention: Naming conventions follow Panasonic datasheet +//- FunctionTable: +//- https://datasheetspdf.com/pdf-file/182163/PanasonicSemiconductor/AN6551/1 +//- +static NETLIST_START(AN6551_SIL) +{ + OPAMP(A, "AN6551") + OPAMP(B, "AN6551") + + NET_C(A.GND, B.GND) + + ALIAS(1, A.VCC) + ALIAS(2, A.OUT) + ALIAS(3, A.MINUS) + ALIAS(4, A.PLUS) + ALIAS(5, A.GND) + ALIAS(6, B.PLUS) + ALIAS(7, B.MINUS) + ALIAS(8, B.OUT) + ALIAS(9, B.VCC) +} + +#if USE_LM3900_MODEL == 0 +static NETLIST_START(LM3900) +{ + + /* + * Fast norton opamp model without bandwidth + */ + + /* Terminal definitions for calling netlists */ + + ALIAS(PLUS, R1.1) // Positive input + ALIAS(MINUS, R2.1) // Negative input + ALIAS(OUT, G1.OP) // Opamp output ... + ALIAS(GND, G1.ON) // V- terminal + ALIAS(VCC, DUMMY.1) // V+ terminal + + RES(DUMMY, RES_K(1)) + NET_C(DUMMY.2, GND) + + /* The opamp model */ + + RES(R1, 1) + RES(R2, 1) + NET_C(R1.1, G1.IP) + NET_C(R2.1, G1.IN) + NET_C(R1.2, R2.2, G1.ON) + VCVS(G1, 10000000) + //PARAM(G1.RI, 1) + PARAM(G1.RO, RES_K(8)) + +} +#endif + +#if USE_LM3900_MODEL == 1 +// LTSPICE MODEL OF LM3900 FROM NATIONAL SEMICONDUCTOR +// MADE BY HELMUT SENNEWALD, 8/6/2004 +// THE LM3900 IS A SO CALLED NORTON AMPLIFIER. +// +// PIN ORDER: IN+ IN- VCC VSS OUT +static NETLIST_START(LM3900) +{ + PARAM(E1.G, 0.5) + //ALIAS(IN+, Q2.B) + //ALIAS(IN-, Q2.C) + //ALIAS(VCC, Q10.C) + //ALIAS(VSS, Q2.E) + + ALIAS(PLUS, Q2.B) + ALIAS(MINUS, Q2.C) + ALIAS(VCC, Q10.C) + ALIAS(GND, Q2.E) + ALIAS(OUT, Q6.C) + + //CS(B1/*I=LIMIT(0, V(VCC,VSS)/10K, 0.2m)*/) + CS(B1, 2e-4) + CAP(C1, CAP_P(6.000000)) + VCVS(E1, 1) + QBJT_EB(Q1, "LM3900_NPN1") + QBJT_EB(Q10, "LM3900_NPN1") + QBJT_EB(Q11, "LM3900_NPN1") + QBJT_EB(Q12, "LM3900_NPN1") + QBJT_EB(Q2, "LM3900_NPN1") + QBJT_EB(Q3, "LM3900_NPN1") + QBJT_EB(Q4, "LM3900_PNP1") + QBJT_EB(Q5, "LM3900_PNP1") + QBJT_EB(Q6, "LM3900_PNP1") + QBJT_EB(Q7, "LM3900_PNP1") + QBJT_EB(Q8, "LM3900_NPN1") + QBJT_EB(Q9, "LM3900_NPN1") + RES(R1, RES_K(2.000000)) + RES(R6, RES_K(1.600000)) + NET_C(Q11.B, Q12.B, R6.2) + NET_C(Q5.C, Q5.B, B1.P, Q4.B) + NET_C(Q8.C, Q8.B, B1.N, R1.1, E1.IP) + NET_C(Q9.B, R1.2) + NET_C(R6.1, E1.OP) + NET_C(Q10.C, Q5.E, Q4.E, Q11.C, Q12.C) + NET_C(Q2.C, Q3.B, Q12.E) + NET_C(Q2.E, Q3.E, Q9.E, C1.2, Q1.E, Q8.E, E1.ON, E1.IN, Q7.C) + NET_C(Q3.C, Q6.B, C1.1, Q7.B) + NET_C(Q6.E, Q10.B, Q4.C) + NET_C(Q6.C, Q10.E, Q9.C, Q7.E) + NET_C(Q2.B, Q1.C, Q1.B, Q11.E) +} +#endif + +#if USE_LM3900_MODEL == 2 +static NETLIST_START(LM3900) +{ + OPAMP(A, "LM3900") + + DIODE(D1, "D(IS=1e-15 N=1)") + CCCS(CS1, 1) // Current Mirror + + ALIAS(VCC, A.VCC) + ALIAS(GND, A.GND) + ALIAS(PLUS, A.PLUS) + ALIAS(MINUS, A.MINUS) + ALIAS(OUT, A.OUT) + + NET_C(A.PLUS, CS1.IP) + NET_C(D1.A, CS1.IN) + NET_C(CS1.ON, A.MINUS) + NET_C(CS1.OP, A.GND, D1.K) + +} +#endif + +#if USE_LM3900_MODEL == 3 +static NETLIST_START(LM3900) +{ + + ALIAS(VCC, Q5.C) + ALIAS(GND, Q1.E) + ALIAS(PLUS, Q1.B) + ALIAS(MINUS, Q1.C) + ALIAS(OUT, Q5.E) + + CAP(C1, CAP_P(6.000000)) + CS(I1, 1.300000e-3) + CS(I2, 200e-6) + QBJT_EB(Q1, "NPN") + QBJT_EB(Q2, "NPN") + QBJT_EB(Q3, "PNP") + QBJT_EB(Q4, "PNP") + QBJT_EB(Q5, "NPN") + QBJT_EB(Q6, "NPN") + NET_C(Q3.E, Q5.B, I2.2) + NET_C(Q3.C, Q4.E, Q5.E, I1.1) + NET_C(Q5.C, I2.1) + NET_C(Q1.B, Q6.C, Q6.B) + NET_C(Q1.E, Q2.E, Q4.C, C1.2, I1.2, Q6.E) + NET_C(Q1.C, Q2.B) + NET_C(Q2.C, Q3.B, Q4.B, C1.1) +} +#endif + +#if USE_LM3900_MODEL == 4 +static NETLIST_START(LM3900) +{ + OPAMP(A, "OPAMP(TYPE=3 VLH=0.5 VLL=0.03 FPF=2k UGF=2.5M SLEW=1M RI=10M RO=100 DAB=0.0015)") + + DIODE(D1, "D(IS=6e-15 N=1)") + DIODE(D2, "D(IS=6e-15 N=1)") + CCCS(CS1, 1) // Current Mirror + + ALIAS(VCC, A.VCC) + ALIAS(GND, A.GND) + ALIAS(OUT, A.OUT) + + ALIAS(PLUS, CS1.IP) + NET_C(D1.A, CS1.IN) + NET_C(A.GND, D1.K) + + CS(CS_BIAS, 10e-6) + NET_C(A.VCC, CS_BIAS.P) + + ALIAS(MINUS, CS1.OP) + NET_C(CS1.ON, A.GND) + + CCVS(VS1, 200000) // current-to-voltage gain + NET_C(CS1.OP, VS1.IP) + NET_C(VS1.IN, CS_BIAS.N, D2.A) + NET_C(D2.K, A.GND) + NET_C(VS1.OP, A.MINUS) + NET_C(VS1.ON, A.PLUS, A.GND) +} +#endif + +NETLIST_START(opamp_lib) +{ + LOCAL_LIB_ENTRY(opamp_layout_4_4_11) + LOCAL_LIB_ENTRY(opamp_layout_2_8_4) + LOCAL_LIB_ENTRY(opamp_layout_2_13_9_4) + LOCAL_LIB_ENTRY(opamp_layout_1_7_4) + LOCAL_LIB_ENTRY(opamp_layout_1_8_5) + LOCAL_LIB_ENTRY(opamp_layout_1_11_6) + + // FIXME: JFET Opamp may need better model + // VLL and VHH for +-6V RI=10^12 (for numerical stability 10^9 is used below + // RO from data sheet + NET_MODEL("TL084 OPAMP(TYPE=3 VLH=0.75 VLL=0.75 FPF=10 UGF=3000k SLEW=13M RI=1000M RO=192 DAB=0.0014)") + + NET_MODEL("LM324 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.3M RI=1000k RO=50 DAB=0.00075)") + NET_MODEL("LM358 OPAMP(TYPE=3 VLH=2.0 VLL=0.2 FPF=5 UGF=500k SLEW=0.3M RI=1000k RO=50 DAB=0.001)") + NET_MODEL("MB3614 OPAMP(TYPE=3 VLH=1.4 VLL=0.02 FPF=3 UGF=1000k SLEW=0.6M RI=1000k RO=100 DAB=0.002)") + NET_MODEL("UA741 OPAMP(TYPE=3 VLH=1.0 VLL=1.0 FPF=5 UGF=1000k SLEW=0.5M RI=2000k RO=75 DAB=0.0017)") + NET_MODEL("LM747 OPAMP(TYPE=3 VLH=1.0 VLL=1.0 FPF=5 UGF=1000k SLEW=0.5M RI=2000k RO=50 DAB=0.0017)") + NET_MODEL("LM747A OPAMP(TYPE=3 VLH=2.0 VLL=2.0 FPF=5 UGF=1000k SLEW=0.7M RI=6000k RO=50 DAB=0.0015)") + NET_MODEL("LM748 OPAMP(TYPE=3 VLH=2.0 VLL=2.0 FPF=5 UGF=800k SLEW=0.7M RI=800k RO=60 DAB=0.001)") + // TI and Motorola datasheets differ - below are Motorola values, SLEW is average of LH and HL + NET_MODEL("LM3900 OPAMP(TYPE=3 VLH=1.0 VLL=0.03 FPF=2k UGF=4M SLEW=10M RI=10M RO=2k DAB=0.0015)") + + NET_MODEL("AN6551 OPAMP(TYPE=3 VLH=1.0 VLL=0.03 FPF=20 UGF=2M SLEW=1M RI=10M RO=200 DAB=0.0015)") + + #if USE_LM3900_MODEL == 1 + NET_MODEL("LM3900_NPN1 NPN(IS=1E-14 BF=150 TF=1E-9 CJC=1E-12 CJE=1E-12 VAF=150 RB=100 RE=5 IKF=0.002)") + NET_MODEL("LM3900_PNP1 PNP(IS=1E-14 BF=40 TF=1E-7 CJC=1E-12 CJE=1E-12 VAF=150 RB=100 RE=5)") +#endif + LOCAL_LIB_ENTRY(MB3614_DIP) + LOCAL_LIB_ENTRY(MC3340_DIP) + LOCAL_LIB_ENTRY(TL081_DIP) + LOCAL_LIB_ENTRY(TL082_DIP) + LOCAL_LIB_ENTRY(TL084_DIP) + LOCAL_LIB_ENTRY(LM324_DIP) + LOCAL_LIB_ENTRY(LM348_DIP) + LOCAL_LIB_ENTRY(LM358_DIP) + LOCAL_LIB_ENTRY(LM2902_DIP) + LOCAL_LIB_ENTRY(UA741_DIP8) + LOCAL_LIB_ENTRY(UA741_DIP10) + LOCAL_LIB_ENTRY(UA741_DIP14) + LOCAL_LIB_ENTRY(MC1558_DIP) + LOCAL_LIB_ENTRY(LM747_DIP) + LOCAL_LIB_ENTRY(LM747A_DIP) + LOCAL_LIB_ENTRY(LM3900) + LOCAL_LIB_ENTRY(AN6551_SIL) + +} diff --git a/src/lib/netlist/macro/nlm_other.cpp b/src/lib/netlist/macro/nlm_other.cpp deleted file mode 100644 index befbc99a364..00000000000 --- a/src/lib/netlist/macro/nlm_other.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#include "nlm_other.h" - -#include "netlist/devices/nld_system.h" - -/* - * MC14584B: Hex Schmitt Trigger - * ON Semiconductor - * - * +--------------+ - * A1 |1 ++ 14| VCC - * Y1 |2 13| A6 - * A2 |3 12| Y6 - * Y2 |4 MC14584B 11| A5 - * A3 |5 10| Y5 - * Y3 |6 9| A4 - * GND |7 8| Y4 - * +--------------+ - * - */ - -static NETLIST_START(MC14584B_DIP) - MC14584B_GATE(A) - MC14584B_GATE(B) - MC14584B_GATE(C) - MC14584B_GATE(D) - MC14584B_GATE(E) - MC14584B_GATE(F) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.Q, /* Y1 |2 13| A6 */ F.A, - B.A, /* A2 |3 12| Y6 */ F.Q, - B.Q, /* Y2 |4 MC14584B 11| A5 */ E.A, - C.A, /* A3 |5 10| Y5 */ E.Q, - C.Q, /* Y3 |6 9| A4 */ D.A, - A.GND,/* GND |7 8| Y4 */ D.Q - /* +--------------+ */ - ) -NETLIST_END() - -NETLIST_START(otheric_lib) - TRUTHTABLE_START(MC14584B_GATE, 1, 1, "") - TT_HEAD(" A | Q ") - TT_LINE(" 0 | 1 |100") - TT_LINE(" 1 | 0 |100") - // 2.1V negative going and 2.7V positive going at 5V - TT_FAMILY("FAMILY(FV=0 IVL=0.42 IVH=0.54 OVL=0.05 OVH=0.05 ORL=10.0 ORH=10.0)") - TRUTHTABLE_END() - - LOCAL_LIB_ENTRY(MC14584B_DIP) -NETLIST_END() diff --git a/src/lib/netlist/macro/nlm_other.h b/src/lib/netlist/macro/nlm_other.h deleted file mode 100644 index ee231fbd6db..00000000000 --- a/src/lib/netlist/macro/nlm_other.h +++ /dev/null @@ -1,32 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#ifndef NLM_OTHER_H_ -#define NLM_OTHER_H_ - -#include "netlist/nl_setup.h" - -#ifndef __PLIB_PREPROCESSOR__ - -/* ---------------------------------------------------------------------------- - * Netlist Macros - * ---------------------------------------------------------------------------*/ - -#ifndef NL_AUTO_DEVICES - -#define MC14584B_GATE(name) \ - NET_REGISTER_DEV(MC14584B_GATE, name) - -#define MC14584B_DIP(name) \ - NET_REGISTER_DEV(MC14584B_DIP, name) - -#endif - -/* ---------------------------------------------------------------------------- - * External declarations - * ---------------------------------------------------------------------------*/ - -NETLIST_EXTERNAL(otheric_lib) - -#endif - -#endif diff --git a/src/lib/netlist/macro/nlm_otheric_lib.cpp b/src/lib/netlist/macro/nlm_otheric_lib.cpp new file mode 100644 index 00000000000..086801b0f3a --- /dev/null +++ b/src/lib/netlist/macro/nlm_otheric_lib.cpp @@ -0,0 +1,209 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +#include "devices/net_lib.h" + +/* + * MC14584B: Hex Schmitt Trigger + * ON Semiconductor + * + * +--------------+ + * A1 |1 ++ 14| VCC + * Y1 |2 13| A6 + * A2 |3 12| Y6 + * Y2 |4 MC14584B 11| A5 + * A3 |5 10| Y5 + * Y3 |6 9| A4 + * GND |7 8| Y4 + * +--------------+ + * + */ + +static NETLIST_START(MC14584B_DIP) +{ + MC14584B_GATE(A) + MC14584B_GATE(B) + MC14584B_GATE(C) + MC14584B_GATE(D) + MC14584B_GATE(E) + MC14584B_GATE(F) + + NET_C(A.VDD, B.VDD, C.VDD, D.VDD, E.VDD, F.VDD) + NET_C(A.VSS, B.VSS, C.VSS, D.VSS, E.VSS, F.VSS) + DIPPINS( /* +--------------+ */ + A.A, /* A1 |1 ++ 14| VDD */ A.VDD, + A.Q, /* Y1 |2 13| A6 */ F.A, + B.A, /* A2 |3 12| Y6 */ F.Q, + B.Q, /* Y2 |4 MC14584B 11| A5 */ E.A, + C.A, /* A3 |5 10| Y5 */ E.Q, + C.Q, /* Y3 |6 9| A4 */ D.A, + A.VSS,/* VSS |7 8| Y4 */ D.Q + /* +--------------+ */ + ) +} + +//- Identifier: NE566_DIP +//- Title: NE566 Voltage Controlled Oscillator +//- Pinalias: GND,NC,SQUARE,TRIANGLE,MODULATION,R1,C1,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: +//- This implementation is focused on performance. There may be edge cases +//- which lead to issues and ringing. +//. +//- Example: ne566.cpp,ne566_example +//- FunctionTable: +//- https://www.egr.msu.edu/eceshop/Parts_Inventory/datasheets/lm566.pdf +//- +//. + +static NETLIST_START(NE566_DIP) +{ + + VCVS(VI, 1) + CCCS(CI1, -1) + CCCS(CI2, 1) + SYS_COMPD(COMP) + SYS_DSW2(SW) + VCVS(VO, 1) + DIODE(DC, "D") + DIODE(DM, "D") + RES(ROD, 5200) + RES(ROU, 200) + + PARAM(VO.RO, 50) + PARAM(COMP.MODEL, "FAMILY(TYPE=CUSTOM IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.1 ORL=50 ORH=50)") + PARAM(SW.GOFF, 0) // This has to be zero to block current sources + + NET_C(CI2.IN, VI.OP) + NET_C(CI2.IP, CI1.IN) + NET_C(COMP.Q, SW.I) + NET_C(SW.1, CI1.OP) + NET_C(SW.3, CI2.OP) + NET_C(SW.2, VO.IP) + NET_C(VO.OP, COMP.IN) + + // Avoid singular Matrix due to G=0 switch + RES(RX1, 1e10) + RES(RX2, 1e10) + NET_C(RX1.1, SW.1) + NET_C(RX2.1, SW.3) + + NET_C(COMP.GND, RX1.2, RX2.2) + + // Block if VC < V+ - ~4 + VS(VM, 3) + PARAM(VM.RI, 10) + NET_C(VM.1, COMP.VCC) + NET_C(VM.2, DM.A) + NET_C(DM.K, VI.OP) + + // Block if VC > V+ + NET_C(COMP.GND, DC.A) + NET_C(SW.2, DC.K) + + RES(R1, 5000) + RES(R2, 1800) + RES(R3, 6000) + + // Square output wave + AFUNC(FO, 2, "min(A1-1,A0 + 5)") + NET_C(COMP.QQ, FO.A0) + NET_C(FO.Q, ROU.1) + NET_C(ROU.2, ROD.1) + + NET_C(COMP.GND, SW.GND, VI.ON, VI.IN, CI1.ON, CI2.ON, VO.IN, VO.ON, R2.2, ROD.2) + NET_C(COMP.VCC, SW.VCC, R1.2) + NET_C(COMP.IP, R1.1, R2.1, R3.1) + NET_C(COMP.Q, R3.2) + + ALIAS(1, VI.ON) // GND + ALIAS(3, ROD.1) // Square out + ALIAS(4, VO.OP) // Diag out + ALIAS(5, VI.IP) // VC + ALIAS(6, CI1.IP) // R1 + ALIAS(7, SW.2) // C1 + ALIAS(8, COMP.VCC) // V+ + + NET_C(COMP.VCC, FO.A1) + + +} + +//- Identifier: NE555_DIP +//- Title: NE555 PRECISION TIMERS +//- Pinalias: GND,TRIG,OUT,RESET,CONT,THRES,DISCH,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas instrument datasheet +//- Limitations: Internal resistor network currently fixed to 5k +//- If TRIG and TRESH are connected overshoot compensation will be enabled. +//- The approach is raw but delivers results (at 5 to 10 steps per discharge/charge) +//- within a couple of percent. Please take into account that any datasheet +//- formulas are idealistic. Neither capacitor, resistor, internal resistor +//- tolerances are taken into account. Nor are ambient temperature and chip +//- temperature. Thus the result is considered acceptable. +//- The datasheet states a maximum discharge of 200mA, this is not modelled +//- Instead an impedance of 1 Ohm is used. +//- +//- Example: ne555_astable.c,ne555_example +//- FunctionTable: +//- +//- |RESET|TRIGGER VOLTAGE|THRESHOLD VOLTAGE|OUTPUT|DISCHARGE SWITCH| +//- |:---:|:-------------:|:---------------:|:----:|:--------------:| +//- |Low | Irrelevant | Irrelevant | Low | On | +//- |High | <1/3 VDD | Irrelevant | High | Off | +//- |High | >1/3 VDD | >2/3 VDD | Low | On | +//- |High | >1/3 VDD | <2/3 VDD | As previously established|| +//- +static NETLIST_START(NE555_DIP) +{ + + NE555(A) + + ALIAS(1, A.GND) // Pin 1 + ALIAS(2, A.TRIG) // Pin 2 + ALIAS(3, A.OUT) // Pin 3 + ALIAS(4, A.RESET) // Pin 4 + ALIAS(5, A.CONT) // Pin 5 + ALIAS(6, A.THRESH) // Pin 6 + ALIAS(7, A.DISCH) // Pin 7 + ALIAS(8, A.VCC) // Pin 8 + +} + +static NETLIST_START(MC1455P_DIP) +{ + + MC1455P(A) + + ALIAS(1, A.GND) // Pin 1 + ALIAS(2, A.TRIG) // Pin 2 + ALIAS(3, A.OUT) // Pin 3 + ALIAS(4, A.RESET) // Pin 4 + ALIAS(5, A.CONT) // Pin 5 + ALIAS(6, A.THRESH) // Pin 6 + ALIAS(7, A.DISCH) // Pin 7 + ALIAS(8, A.VCC) // Pin 8 + +} + +static TRUTH_TABLE(MC14584B_GATE, 1, 1, "") +{ + TT_HEAD(" A | Q ") + TT_LINE(" 0 | 1 |100") + TT_LINE(" 1 | 0 |100") + // 2.1V negative going and 2.7V positive going at 5V + TT_FAMILY("FAMILY(TYPE=CMOS IVL=0.42 IVH=0.54 OVL=0.05 OVH=0.05 ORL=10.0 ORH=10.0)") +} + +NETLIST_START(otheric_lib) +{ + + TRUTHTABLE_ENTRY(MC14584B_GATE) + + LOCAL_LIB_ENTRY(MC14584B_DIP) + LOCAL_LIB_ENTRY(NE566_DIP) + LOCAL_LIB_ENTRY(NE555_DIP) + LOCAL_LIB_ENTRY(MC1455P_DIP) +} + diff --git a/src/lib/netlist/macro/nlm_roms_lib.cpp b/src/lib/netlist/macro/nlm_roms_lib.cpp new file mode 100644 index 00000000000..ede3feae85d --- /dev/null +++ b/src/lib/netlist/macro/nlm_roms_lib.cpp @@ -0,0 +1,453 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +#include "devices/net_lib.h" + + +//- Identifier: PROM_82S126_DIP +//- Title: 82S126 1K-bit TTL bipolar PROM +//- Pinalias: A6,A5,A4,A3,A0,A1,A2,GND,O4,O3,O2,O1,CE1Q,CE2Q,A7,VCC +//- Package: DIP +//- Param: ROM +//- The name of the source to load the rom content from +//- Param: FORCE_TRISTATE_LOGIC +//- Set this parameter to 1 force tristate outputs into logic mode. +//- This should be done only if the device enable inputs are connected +//- in a way which always enables the device. +//- Param: MODEL +//- Overwrite the default model of the device. Use with care. +//- NamingConvention: Naming conventions follow Philips Components-Signetics datasheet +//- Limitations: +//- Currently OC is not supported. +//- +//- Example: 82S126.cpp,82S126_example +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/philips/82S129.pdf +//- + +static NETLIST_START(PROM_82S126_DIP) +{ + + PROM_82S126(A) + + DEFPARAM(ROM, "unknown") + DEFPARAM(FORCE_TRISTATE_LOGIC, 0) + DEFPARAM(MODEL, "$(@.A.MODEL)") + PARAM(A.ROM, "$(@.ROM)") + PARAM(A.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(A.MODEL, "$(@.MODEL)") + ALIAS(1, A.A6) + ALIAS(2, A.A5) + ALIAS(3, A.A4) + ALIAS(4, A.A3) + ALIAS(5, A.A0) + ALIAS(6, A.A1) + ALIAS(7, A.A2) + ALIAS(8, A.GND) + ALIAS(9, A.O4) + ALIAS(10, A.O3) + ALIAS(11, A.O2) + ALIAS(12, A.O1) + ALIAS(13, A.CE1Q) + ALIAS(14, A.CE2Q) + ALIAS(15, A.A7) + ALIAS(16, A.VCC) +} + +//- Identifier: PROM_74S287_DIP +//- Title: 74S287 (256 x 4) 1024-Bit TTL PROM +//- Pinalias: A6,A5,A4,A3,A0,A1,A2,GND,O3,O2,O1,O0,CE1Q,CE2Q,A7,VCC +//- Package: DIP +//- Param: ROM +//- The name of the source to load the rom content from +//- Param: FORCE_TRISTATE_LOGIC +//- Set this parameter to 1 force tristate outputs into logic mode. +//- This should be done only if the device enable inputs are connected +//- in a way which always enables the device. +//- Param: MODEL +//- Overwrite the default model of the device. Use with care. +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: +//- None. +//- +//- Example: 74S287.cpp,74S287_example +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet_pdf/national-semiconductor/DM54S287AJ_to_DM74S287V.pdf +//- + +static NETLIST_START(PROM_74S287_DIP) +{ + + PROM_74S287(A) + + DEFPARAM(ROM, "unknown") + DEFPARAM(FORCE_TRISTATE_LOGIC, 0) + DEFPARAM(MODEL, "$(@.A.MODEL)") + PARAM(A.ROM, "$(@.ROM)") + PARAM(A.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(A.MODEL, "$(@.MODEL)") + ALIAS(1, A.A6) + ALIAS(2, A.A5) + ALIAS(3, A.A4) + ALIAS(4, A.A3) + ALIAS(5, A.A0) + ALIAS(6, A.A1) + ALIAS(7, A.A2) + ALIAS(8, A.GND) + ALIAS(9, A.O3) + ALIAS(10, A.O2) + ALIAS(11, A.O1) + ALIAS(12, A.O0) + ALIAS(13, A.CE1Q) + ALIAS(14, A.CE2Q) + ALIAS(15, A.A7) + ALIAS(16, A.VCC) +} + +//- Identifier: PROM_82S123_DIP +//- Title: 82S123 256 bit TTL bipolar PROM +//- Pinalias: O1,O2,O3,O4,O5,O6,O7,GND,O8,A0,A1,A2,A3,A4,CEQ,VCC +//- Package: DIP +//- Param: ROM +//- The name of the source to load the rom content from +//- Param: FORCE_TRISTATE_LOGIC +//- Set this parameter to 1 force tristate outputs into logic mode. +//- This should be done only if the device enable inputs are connected +//- in a way which always enables the device. +//- Param: MODEL +//- Overwrite the default model of the device. Use with care. +//- NamingConvention: Naming conventions follow Philips Components-Signetics datasheet +//- Limitations: +//- Currently OC is not supported. +//- +//- Example: 82S123.cpp,82S123_example +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/philips/82S123.pdf +//- + +static NETLIST_START(PROM_82S123_DIP) +{ + + PROM_82S123(A) + + DEFPARAM(ROM, "unknown") + DEFPARAM(FORCE_TRISTATE_LOGIC, 0) + DEFPARAM(MODEL, "$(@.A.MODEL)") + PARAM(A.ROM, "$(@.ROM)") + PARAM(A.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(A.MODEL, "$(@.MODEL)") + ALIAS(1, A.O0) + ALIAS(2, A.O1) + ALIAS(3, A.O2) + ALIAS(4, A.O3) + ALIAS(5, A.O4) + ALIAS(6, A.O5) + ALIAS(7, A.O6) + ALIAS(8, A.GND) + + ALIAS(9, A.O7) + ALIAS(10, A.A0) + ALIAS(11, A.A1) + ALIAS(12, A.A2) + ALIAS(13, A.A3) + ALIAS(14, A.A4) + ALIAS(15, A.CEQ) + ALIAS(16, A.VCC) +} + +/* + * nld_82S16.h + * + * DM82S16: 256 Bit bipolar ram + * + * +--------------+ + * A1 |1 ++ 16| VCC + * A0 |2 15| A2 + * CE1Q |3 14| A3 + * CE2Q |4 82S16 13| DIN + * CE3Q |5 12| WEQ + * DOUTQ |6 11| A7 + * A4 |7 10| A6 + * GND |8 9| A5 + * +--------------+ + * + * + * Naming conventions follow Signetics datasheet + */ + + +//- Identifier: EPROM_2716_DIP +//- Title: 2716 16K (2K x 8) UV ERASABLE PROM +//- Pinalias: A7,A6,A6,A4,A4,A2,A1,A0,O0,O1,O2,GND,O3,O4,O5,O6,O7,CE1Q/CE,A10,CE2Q/OE,VPP,A9,A8,VCC +//- Package: DIP +//- Param: ROM +//- The name of the source to load the rom content from +//- Param: FORCE_TRISTATE_LOGIC +//- Set this parameter to 1 force tristate outputs into logic mode. +//- This should be done only if the device enable inputs are connected +//- in a way which always enables the device. +//- Param: MODEL +//- Overwrite the default model of the device. Use with care. +//- NamingConvention: Naming conventions follow Intel datasheet +//- Limitations: +//- Currently OC is not supported. +//- +//- Example: 2716.cpp,2716_example +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/400/500340_DS.pdf +//- +static NETLIST_START(EPROM_2716_DIP) +{ + + EPROM_2716(A) + + DEFPARAM(ROM, "unknown") + DEFPARAM(FORCE_TRISTATE_LOGIC, 0) + DEFPARAM(MODEL, "$(@.A.MODEL)") + PARAM(A.ROM, "$(@.ROM)") + PARAM(A.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(A.MODEL, "$(@.MODEL)") + ALIAS(1, A.A7) + ALIAS(2, A.A6) + ALIAS(3, A.A5) + ALIAS(4, A.A4) + ALIAS(5, A.A3) + ALIAS(6, A.A2) + ALIAS(7, A.A1) + ALIAS(8, A.A0) + ALIAS(9, A.O0) + ALIAS(10, A.O1) + ALIAS(11, A.O2) + ALIAS(12, A.GND) + + ALIAS(13, A.O3) + ALIAS(14, A.O4) + ALIAS(15, A.O5) + ALIAS(16, A.O6) + ALIAS(17, A.O7) + ALIAS(18, A.CE1Q) // CEQ + ALIAS(19, A.A10) + ALIAS(20, A.CE2Q) // OEQ + ALIAS(22, A.A9) + ALIAS(23, A.A8) + ALIAS(24, A.VCC) +} + +/* DM82S16: 256 Bit bipolar ram + * + * +--------------+ + * A1 |1 ++ 16| VCC + * A0 |2 15| A2 + * CE1Q |3 14| A3 + * CE2Q |4 82S16 13| DIN + * CE3Q |5 12| WEQ + * DOUTQ |6 11| A7 + * A4 |7 10| A6 + * GND |8 9| A5 + * +--------------+ + * + * Naming conventions follow Signetics datasheet + */ + +static NETLIST_START(TTL_82S16_DIP) +{ + TTL_82S16(A) + + DIPPINS( /* +--------------+ */ + A.A1, /* A1 |1 ++ 16| VCC */ A.VCC, + A.A0, /* A0 |2 15| A2 */ A.A2, + A.CE1Q, /* CE1Q |3 14| A3 */ A.A3, + A.CE2Q, /* CE2Q |4 82S16 13| DIN */ A.DIN, + A.CE3Q, /* CE3Q |5 12| WEQ */ A.WEQ, + A.DOUTQ, /* DOUTQ |6 11| A7 */ A.A7, + A.A4, /* A4 |7 10| A6 */ A.A6, + A.GND, /* GND |8 9| A5 */ A.A5 + /* +--------------+ */ + ) +} + +/* 82S115: 4K-bit TTL bipolar PROM (512 x 8) + * + * +--------------+ + * A3 |1 ++ 24| VCC + * A4 |2 23| A2 + * A5 |3 22| A1 + * A6 |4 82S115 21| A0 + * A7 |5 20| CE1Q + * A8 |6 19| CE2 + * O1 |7 18| STROBE + * O2 |8 17| O8 + * O3 |9 16| O7 + * O4 |10 15| O6 + * FE2 |11 14| O5 + * GND |12 13| FE1 + * +--------------+ + */ + +static NETLIST_START(PROM_82S115_DIP) +{ + PROM_82S115(A) + NC_PIN(NC) + + DIPPINS( /* +--------------+ */ + A.A3, /* A3 |1 ++ 24| VCC */ A.VCC, + A.A4, /* A4 |2 23| A2 */ A.A2, + A.A5, /* A5 |3 22| A1 */ A.A1, + A.A6, /* A6 |4 82S115 21| A0 */ A.A0, + A.A7, /* A7 |5 20| CE1Q */ A.CE1Q, + A.A8, /* A8 |6 19| CE2 */ A.CE2, + A.O1, /* O1 |7 18| STROBE */ A.STROBE, + A.O2, /* O2 |8 17| O8 */ A.O8, + A.O3, /* O3 |9 16| O7 */ A.O7, + A.O4, /* O4 |10 15| O6 */ A.O6, + NC.I, /* FE2 |11 14| O5 */ A.O5, + A.GND, /* GND |12 13| FE1 */ NC.I + /* +--------------+ */ + ) +} + +//- Identifier: PROM_MK28000_DIP +//- Title: MK28000 (2048 x 8 or 4096 x 4) 16384-Bit TTL PROM +//- Pinalias: VCC,A1,A2,A3,A4,A5,A6,A10,GND,A9,A8,A7,ARQ,OE2,A11,O8,O7,O6,O5,O4,O3,O2,O1,OE1 +//- Package: DIP +//- Param: ROM +//- The name of the source to load the rom content from +//- NamingConvention: Naming conventions follow Mostek datasheet +//- Limitations: +//- None. + +static NETLIST_START(PROM_MK28000_DIP) +{ + + PROM_MK28000(A) + + DEFPARAM(ROM, "unknown") + PARAM(A.ROM, "$(@.ROM)") + ALIAS(1, A.VCC) + ALIAS(2, A.A1) + ALIAS(3, A.A2) + ALIAS(4, A.A3) + ALIAS(5, A.A4) + ALIAS(6, A.A5) + ALIAS(7, A.A6) + ALIAS(8, A.A10) + ALIAS(9, A.GND) + ALIAS(10, A.A9) + ALIAS(11, A.A8) + ALIAS(12, A.A7) + ALIAS(13, A.ARQ) + ALIAS(14, A.OE2) + ALIAS(15, A.A11) + ALIAS(16, A.O8) + ALIAS(17, A.O7) + ALIAS(18, A.O6) + ALIAS(19, A.O5) + ALIAS(20, A.O4) + ALIAS(21, A.O3) + ALIAS(22, A.O2) + ALIAS(23, A.O1) + ALIAS(24, A.OE1) +} + +//- Identifier: ROM_MCM14524_DIP +//- Title: MCM14524 1024-BIT READ ONLY MEMORY +//- Pinalias: CLK,EN,B0,B1,B2,B3,A2,GND,A3,A4,A5,A6,A7,A1,A0,VCC +//- Package: DIP +//- Param: ROM +//- The name of the source to load the rom content from +//- NamingConvention: Naming conventions follow Motorola datasheet +//- Limitations: +//- Voltage-dependent timing is partially implemented. +//- FunctionTable: +//- http://www.bitsavers.org/components/motorola/_dataBooks/1978_Motorola_CMOS_Data_Book.pdf 7-439 (pdf page 488) + +static NETLIST_START(ROM_MCM14524_DIP) +{ + + ROM_MCM14524(A) + + DEFPARAM(ROM, "unknown") + PARAM(A.ROM, "$(@.ROM)") + + /* Motorola MCM14524: */ + DIPPINS( /* +-----..-----+ */ + A.CLK, /* /CLK |1 16| VDD */ A.VCC, + A.EN, /* CE |2 15| A0 */ A.A0, + A.B0, /* B0 |3 MCM 14| A1 */ A.A1, + A.B1, /* B1 |4 14524 13| A7 */ A.A7, + A.B2, /* B2 |5 12| A6 */ A.A6, + A.B3, /* B3 |6 11| A5 */ A.A5, + A.A2, /* A2 |7 10| A4 */ A.A4, + A.GND, /* VSS |8 9| A3 */ A.A3 + /* +------------+ */ + ) +} + +/* 2102: 1024 x 1-bit Static RAM + * + * +--------------+ + * A6 |1 ++ 16| A7 + * A5 |2 15| A8 + * RWQ |3 14| A9 + * A1 |4 82S16 13| CEQ + * A2 |5 12| DO + * A3 |6 11| DI + * A4 |7 10| VCC + * A0 |8 9| GND + * +--------------+ + */ +static NETLIST_START(RAM_2102A_DIP) +{ + RAM_2102A(A) + + DIPPINS( /* +--------------+ */ + A.A6, /* A6 |1 ++ 16| A7 */ A.A7, + A.A5, /* A5 |2 15| A8 */ A.A8, + A.RWQ, /* RWQ |3 14| A9 */ A.A9, + A.A1, /* A1 |4 82S16 13| CEQ */ A.CEQ, + A.A2, /* A2 |5 12| DO */ A.DO, + A.A3, /* A3 |6 11| DI */ A.DI, + A.A4, /* A4 |7 10| VCC */ A.VCC, + A.A0, /* A0 |8 9| GND */ A.GND + /* +--------------+ */ + ) +} + +//FIXME: Documentation +static NETLIST_START(ROM_TMS4800_DIP) +{ + ROM_TMS4800(A) + + DIPPINS( /* +----------------+ */ + A.VSS, /* VSS |1 ++ 24| OE1 */ A.OE1, + A.A1, /* A1 |2 23| O1 */ A.O1, + A.A2, /* A2 |3 22| O2 */ A.O2, + A.A3, /* A3 |4 TMS-4800 21| O3 */ A.O3, + A.A4, /* A4 |5 20| O4 */ A.O4, + A.A5, /* A5 |6 19| O5 */ A.O5, + A.A6, /* A6 |7 18| O6 */ A.O6, + A.A10, /* A10 |8 17| O7 */ A.O7, + A.VGG, /* VGG |9 16| O8 */ A.O8, + A.A9, /* A9 |10 15| A11 */ A.A11, + A.A8, /* A8 |11 14| OE2 */ A.OE2, + A.A7, /* A7 |12 13| AR */ A.AR + /* +----------------+ */ + ) +} + + +NETLIST_START(roms_lib) +{ + + LOCAL_LIB_ENTRY(PROM_82S123_DIP) + LOCAL_LIB_ENTRY(PROM_82S126_DIP) + LOCAL_LIB_ENTRY(PROM_74S287_DIP) + LOCAL_LIB_ENTRY(EPROM_2716_DIP) + LOCAL_LIB_ENTRY(TTL_82S16_DIP) + LOCAL_LIB_ENTRY(PROM_82S115_DIP) + LOCAL_LIB_ENTRY(PROM_MK28000_DIP) + LOCAL_LIB_ENTRY(ROM_MCM14524_DIP) + LOCAL_LIB_ENTRY(RAM_2102A_DIP) + LOCAL_LIB_ENTRY(ROM_TMS4800_DIP) + } + diff --git a/src/lib/netlist/macro/nlm_ttl74xx.cpp b/src/lib/netlist/macro/nlm_ttl74xx.cpp deleted file mode 100644 index fb175ae0c18..00000000000 --- a/src/lib/netlist/macro/nlm_ttl74xx.cpp +++ /dev/null @@ -1,1394 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#include "nlm_ttl74xx.h" - -#include "netlist/devices/nld_schmitt.h" -#include "netlist/devices/nld_system.h" - - -/* - * DM7400: Quad 2-Input NAND Gates - * - * _ - * Y = AB - * +---+---++---+ - * | A | B || Y | - * +===+===++===+ - * | 0 | 0 || 1 | - * | 0 | 1 || 1 | - * | 1 | 0 || 1 | - * | 1 | 1 || 0 | - * +---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7400_DIP) - TTL_7400_GATE(A) - TTL_7400_GATE(B) - TTL_7400_GATE(C) - TTL_7400_GATE(D) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| B4 */ D.B, - A.Q, /* Y1 |3 12| A4 */ D.A, - B.A, /* A2 |4 7400 11| Y4 */ D.Q, - B.B, /* B2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7402: Quad 2-Input NOR Gates - * - * Y = A+B - * +---+---++---+ - * | A | B || Y | - * +===+===++===+ - * | 0 | 0 || 1 | - * | 0 | 1 || 0 | - * | 1 | 0 || 0 | - * | 1 | 1 || 0 | - * +---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7402_DIP) - TTL_7402_GATE(A) - TTL_7402_GATE(B) - TTL_7402_GATE(C) - TTL_7402_GATE(D) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND) - - DIPPINS( /* +--------------+ */ - A.Q, /* Y1 |1 ++ 14| VCC */ A.VCC, - A.A, /* A1 |2 13| Y4 */ D.Q, - A.B, /* B1 |3 12| B4 */ D.B, - B.Q, /* Y2 |4 7402 11| A4 */ D.A, - B.A, /* A2 |5 10| Y3 */ C.Q, - B.B, /* B2 |6 9| B3 */ C.B, - A.GND,/* GND |7 8| A3 */ C.A - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7404: Hex Inverting Gates - * - * Y = A - * +---++---+ - * | A || Y | - * +===++===+ - * | 0 || 1 | - * | 1 || 0 | - * +---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7404_DIP) - TTL_7404_GATE(A) - TTL_7404_GATE(B) - TTL_7404_GATE(C) - TTL_7404_GATE(D) - TTL_7404_GATE(E) - TTL_7404_GATE(F) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.Q, /* Y1 |2 13| A6 */ F.A, - B.A, /* A2 |3 12| Y6 */ F.Q, - B.Q, /* Y2 |4 7404 11| A5 */ E.A, - C.A, /* A3 |5 10| Y5 */ E.Q, - C.Q, /* Y3 |6 9| A4 */ D.A, - A.GND,/* GND |7 8| Y4 */ D.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7408: Quad 2-Input AND Gates - * - * - * Y = AB - * +---+---++---+ - * | A | B || Y | - * +===+===++===+ - * | 0 | 0 || 0 | - * | 0 | 1 || 0 | - * | 1 | 0 || 0 | - * | 1 | 1 || 1 | - * +---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7408_DIP) - TTL_7408_GATE(A) - TTL_7408_GATE(B) - TTL_7408_GATE(C) - TTL_7408_GATE(D) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| B4 */ D.B, - A.Q, /* Y1 |3 12| A4 */ D.A, - B.A, /* A2 |4 7400 11| Y4 */ D.Q, - B.B, /* B2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7410: Triple 3-Input NAND Gates - * __ - * Y = ABC - * +---+---+---++---+ - * | A | B | C || Y | - * +===+===+===++===+ - * | X | X | 0 || 1 | - * | X | 0 | X || 1 | - * | 0 | X | X || 1 | - * | 1 | 1 | 1 || 0 | - * +---+---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7410_DIP) - TTL_7410_GATE(A) - TTL_7410_GATE(B) - TTL_7410_GATE(C) - - NET_C(A.VCC, B.VCC, C.VCC) - NET_C(A.GND, B.GND, C.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| C1 */ A.C, - B.A, /* A2 |3 12| Y1 */ A.Q, - B.B, /* B2 |4 7410 11| C3 */ C.C, - B.C, /* C2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7411: Triple 3-Input AND Gates - * - * Y = ABC - * +---+---+---++---+ - * | A | B | C || Y | - * +===+===+===++===+ - * | X | X | 0 || 0 | - * | X | 0 | X || 0 | - * | 0 | X | X || 0 | - * | 1 | 1 | 1 || 1 | - * +---+---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7411_DIP) - TTL_7411_GATE(A) - TTL_7411_GATE(B) - TTL_7411_GATE(C) - - NET_C(A.VCC, B.VCC, C.VCC) - NET_C(A.GND, B.GND, C.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| C1 */ A.C, - B.A, /* A2 |3 12| Y1 */ A.Q, - B.B, /* B2 |4 7411 11| C3 */ C.C, - B.C, /* C2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7414/DM74LS14: Hex Inverter with - * Schmitt Trigger Inputs - * - */ - -static NETLIST_START(TTL_7414_GATE) - SCHMITT_TRIGGER(X, "DM7414") - ALIAS(A, X.A) - ALIAS(Q, X.Q) - ALIAS(GND, X.GND) -NETLIST_END() - -static NETLIST_START(TTL_74LS14_GATE) - SCHMITT_TRIGGER(X, "DM74LS14") - ALIAS(A, X.A) - ALIAS(Q, X.Q) - ALIAS(GND, X.GND) -NETLIST_END() - -static NETLIST_START(TTL_7414_DIP) - SCHMITT_TRIGGER(A, "DM7414") - SCHMITT_TRIGGER(B, "DM7414") - SCHMITT_TRIGGER(C, "DM7414") - SCHMITT_TRIGGER(D, "DM7414") - SCHMITT_TRIGGER(E, "DM7414") - SCHMITT_TRIGGER(F, "DM7414") - - NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) - DUMMY_INPUT(VCC) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ VCC.I, - A.Q, /* Y1 |2 13| A6 */ F.A, - B.A, /* A2 |3 12| Y6 */ F.Q, - B.Q, /* Y2 |4 7414 11| A5 */ E.A, - C.A, /* A3 |5 10| Y5 */ E.Q, - C.Q, /* Y3 |6 9| A4 */ D.A, - A.GND, /* GND |7 8| Y4 */ D.Q - /* +--------------+ */ - ) -NETLIST_END() - -static NETLIST_START(TTL_74LS14_DIP) - SCHMITT_TRIGGER(A, "DM74LS14") - SCHMITT_TRIGGER(B, "DM74LS14") - SCHMITT_TRIGGER(C, "DM74LS14") - SCHMITT_TRIGGER(D, "DM74LS14") - SCHMITT_TRIGGER(E, "DM74LS14") - SCHMITT_TRIGGER(F, "DM74LS14") - - NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) - DUMMY_INPUT(VCC) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ VCC.I, - A.Q, /* Y1 |2 13| A6 */ F.A, - B.A, /* A2 |3 12| Y6 */ F.Q, - B.Q, /* Y2 |4 74LS14 11| A5 */ E.A, - C.A, /* A3 |5 10| Y5 */ E.Q, - C.Q, /* Y3 |6 9| A4 */ D.A, - A.GND, /* GND |7 8| Y4 */ D.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7416: Hex Inverting Buffers with - * High Voltage Open-Collector Outputs - * - */ - -static NETLIST_START(TTL_7416_DIP) - TTL_7416_GATE(A) - TTL_7416_GATE(B) - TTL_7416_GATE(C) - TTL_7416_GATE(D) - TTL_7416_GATE(E) - TTL_7416_GATE(F) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.Q, /* Y1 |2 13| A6 */ F.A, - B.A, /* A2 |3 12| Y6 */ F.Q, - B.Q, /* Y2 |4 7416 11| A5 */ E.A, - C.A, /* A3 |5 10| Y5 */ E.Q, - C.Q, /* Y3 |6 9| A4 */ D.A, - A.GND,/* GND |7 8| Y4 */ D.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7420: Dual 4-Input NAND Gates - * - * ___ - * Y = ABCD - * +---+---+---+---++---+ - * | A | B | C | D || Y | - * +===+===+===+===++===+ - * | X | X | X | 0 || 1 | - * | X | X | 0 | X || 1 | - * | X | 0 | X | X || 1 | - * | 0 | X | X | X || 1 | - * | 1 | 1 | 1 | 1 || 0 | - * +---+---+---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet * - */ - -static NETLIST_START(TTL_7420_DIP) - TTL_7420_GATE(A) - TTL_7420_GATE(B) - - NET_C(A.VCC, B.VCC) - NET_C(A.GND, B.GND) - DUMMY_INPUT(NC) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| D2 */ B.D, - NC.I, /* NC |3 12| C2 */ B.C, - A.C, /* C1 |4 7420 11| NC */ NC.I, - A.D, /* D1 |5 10| B2 */ B.B, - A.Q, /* Y1 |6 9| A2 */ B.A, - A.GND,/* GND |7 8| Y2 */ B.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7425: Dual 4-Input NOR Gates - * - * ______ - * Y = A+B+C+D - * +---+---+---+---+---++---+ - * | A | B | C | D | X || Y | - * +===+===+===+===+===++===+ - * | X | X | X | X | 0 || Z | - * | 0 | 0 | 0 | 0 | 1 || 1 | - * | X | X | X | 1 | 1 || 0 | - * | X | X | 1 | X | 1 || 0 | - * | X | 1 | X | X | 1 || 0 | - * | 1 | X | X | X | 1 || 0 | - * +---+---+---+---+---++---+ - * - * FIXME: The "X" input and high impedance output are currently not simulated. - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7425_DIP) - TTL_7425_GATE(A) - TTL_7425_GATE(B) - - NET_C(A.VCC, B.VCC) - NET_C(A.GND, B.GND) - DUMMY_INPUT(X) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| D2 */ B.D, - X.I, /* X1 |3 12| C2 */ B.C, - A.C, /* C1 |4 7425 11| X2 */ X.I, - A.D, /* D1 |5 10| B2 */ B.B, - A.Q, /* Y1 |6 9| A2 */ B.A, - A.GND,/* GND |7 8| Y2 */ B.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7427: Triple 3-Input NOR Gates - * - * ____ - * Y = A+B+C - * +---+---+---++---+ - * | A | B | C || Y | - * +===+===+===++===+ - * | X | X | 1 || 0 | - * | X | 1 | X || 0 | - * | 1 | X | X || 0 | - * | 0 | 0 | 0 || 1 | - * +---+---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7427_DIP) - TTL_7427_GATE(A) - TTL_7427_GATE(B) - TTL_7427_GATE(C) - - NET_C(A.VCC, B.VCC, C.VCC) - NET_C(A.GND, B.GND, C.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| C1 */ A.C, - B.A, /* A2 |3 12| Y1 */ A.Q, - B.B, /* B2 |4 7427 11| C3 */ C.C, - B.C, /* C2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7430: 8-Input NAND Gate - * - * _______ - * Y = ABCDEFGH - * +---+---+---+---+---+---+---+---++---+ - * | A | B | C | D | E | F | G | H || Y | - * +===+===+===+===+===+===+===+===++===+ - * | X | X | X | X | X | X | X | 0 || 1 | - * | X | X | X | X | X | X | 0 | X || 1 | - * | X | X | X | X | X | 0 | X | X || 1 | - * | X | X | X | X | 0 | X | X | X || 1 | - * | X | X | X | 0 | X | X | X | X || 1 | - * | X | X | 0 | X | X | X | X | X || 1 | - * | X | 0 | X | X | X | X | X | X || 1 | - * | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 || 0 | - * +---+---+---+---+---+---+---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - */ - -static NETLIST_START(TTL_7430_DIP) - TTL_7430_GATE(A) - - DUMMY_INPUT(NC) - - DIPPINS( /* +--------------+ */ - A.A, /* A |1 ++ 14| VCC */ A.VCC, - A.B, /* B |2 13| NC */ NC.I, - A.C, /* C |3 12| H */ A.H, - A.D, /* D |4 7430 11| G */ A.G, - A.E, /* E |5 10| NC */ NC.I, - A.F, /* F |6 9| NC */ NC.I, - A.GND,/* GND |7 8| Y */ A.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7432: Quad 2-Input OR Gates - * - * __ - * Y = A+B - * +---+---++---+ - * | A | B || Y | - * +===+===++===+ - * | 0 | 0 || 0 | - * | 0 | 1 || 1 | - * | 1 | 0 || 1 | - * | 1 | 1 || 1 | - * +---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7432_DIP) - TTL_7432_GATE(A) - TTL_7432_GATE(B) - TTL_7432_GATE(C) - TTL_7432_GATE(D) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| B4 */ D.B, - A.Q, /* Y1 |3 12| A4 */ D.A, - B.A, /* A2 |4 7400 11| Y4 */ D.Q, - B.B, /* B2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - - -/* - * DM7437: Quad 2-Input NAND Gates - * - * _ - * Y = AB - * +---+---++---+ - * | A | B || Y | - * +===+===++===+ - * | 0 | 0 || 1 | - * | 0 | 1 || 1 | - * | 1 | 0 || 1 | - * | 1 | 1 || 0 | - * +---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - * NOTE: Same as 7400, but drains higher output currents. - * Netlist currently does not model over currents (should it ever?) - */ - -static NETLIST_START(TTL_7437_DIP) - TTL_7437_GATE(A) - TTL_7437_GATE(B) - TTL_7437_GATE(C) - TTL_7437_GATE(D) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| B4 */ D.B, - A.Q, /* Y1 |3 12| A4 */ D.A, - B.A, /* A2 |4 7400 11| Y4 */ D.Q, - B.B, /* B2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM7486: Quad 2-Input Exclusive-OR Gates - * - * Y = A+B - * +---+---++---+ - * | A | B || Y | - * +===+===++===+ - * | 0 | 0 || 0 | - * | 0 | 1 || 1 | - * | 1 | 0 || 1 | - * | 1 | 1 || 0 | - * +---+---++---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_7486_DIP) - TTL_7486_GATE(A) - TTL_7486_GATE(B) - TTL_7486_GATE(C) - TTL_7486_GATE(D) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND) - - DIPPINS( /* +--------------+ */ - A.A, /* A1 |1 ++ 14| VCC */ A.VCC, - A.B, /* B1 |2 13| B4 */ D.B, - A.Q, /* Y1 |3 12| A4 */ D.A, - B.A, /* A2 |4 7486 11| Y4 */ D.Q, - B.B, /* B2 |5 10| B3 */ C.B, - B.Q, /* Y2 |6 9| A3 */ C.A, - A.GND,/* GND |7 8| Y3 */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -#if (USE_TRUTHTABLE_74107) -#ifndef __PLIB_PREPROCESSOR__ -#define TTL_74107_TT(name) \ - NET_REGISTER_DEV(TTL_74107, name) -#endif - -static NETLIST_START(TTL_74107_DIP) - TTL_74107_TT(A) - TTL_74107_TT(B) - - NET_C(A.VCC, B.VCC) - NET_C(A.GND, B.GND) - - DIPPINS( /* +--------------+ */ - A.J, /* 1J |1 ++ 14| VCC */ A.VCC, - A.QQ, /* 1QQ |2 13| 1CLRQ */ A.CLRQ, - A.Q, /* 1Q |3 12| 1CLK */ A.CLK, - A.K, /* 1K |4 74107 11| 2K */ B.K, - B.Q, /* 2Q |5 10| 2CLRQ */ B.CLRQ, - B.QQ, /* 2QQ |6 9| 2CLK */ B.CLK, - B.GND, /* GND |7 8| 2J */ B.J - /* +--------------+ */ - ) - -NETLIST_END() -#endif - - -/* - * DM74155/DM74156: Dual 2-Line to 4-Line Decoders/Demultiplexers - * - * +-----+-------++-----------------+ - * | B A | G1 C1 || 1Y0 1Y1 1Y2 1Y3 | - * +=====+=======++=================+ - * | X X | 1 X || 1 1 1 1 | - * | 0 0 | 0 1 || 0 1 1 1 | - * | 0 1 | 0 1 || 1 0 1 1 | - * | 1 0 | 0 1 || 1 1 0 1 | - * | 1 1 | 0 1 || 1 1 1 0 | - * | X X | X 0 || 1 1 1 1 | - * +-----+-------++-----------------+ - * - * +-----+-------++-----------------+ - * | B A | G2 C2 || 2Y0 2Y1 2Y2 2Y3 | - * +=====+=======++=================+ - * | X X | 1 X || 1 1 1 1 | - * | 0 0 | 0 0 || 0 1 1 1 | - * | 0 1 | 0 0 || 1 0 1 1 | - * | 1 0 | 0 0 || 1 1 0 1 | - * | 1 1 | 0 0 || 1 1 1 0 | - * | X X | X 1 || 1 1 1 1 | - * +-----+-------++-----------------+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -static NETLIST_START(TTL_74155_DIP) - NET_REGISTER_DEV(TTL_74155A_GATE, A) - NET_REGISTER_DEV(TTL_74155B_GATE, B) - - NET_C(A.A, B.A) - NET_C(A.B, B.B) - - NET_C(A.VCC, B.VCC) - NET_C(A.GND, B.GND) - - DIPPINS( /* +--------------+ */ - A.C, /* C1 |1 ++ 16| VCC */ A.VCC, - A.G, /* G1 |2 15| B4 */ B.C, - A.B, /* B |3 14| B4 */ B.G, - A.3, /* 1Y3 |4 74155 13| A4 */ B.A, - B.2, /* 1Y2 |5 12| Y4 */ B.3, - B.1, /* 1Y1 |6 11| B3 */ B.2, - B.0, /* 1Y0 |7 10| A3 */ B.1, - A.GND,/* GND |8 9| Y3 */ B.0 - /* +--------------+ */ - ) -NETLIST_END() - -static NETLIST_START(TTL_74156_DIP) - NET_REGISTER_DEV(TTL_74156A_GATE, A) - NET_REGISTER_DEV(TTL_74156B_GATE, B) - - NET_C(A.A, B.A) - NET_C(A.B, B.B) - - NET_C(A.VCC, B.VCC) - NET_C(A.GND, B.GND) - - DIPPINS( /* +--------------+ */ - A.C, /* C1 |1 ++ 16| VCC */ A.VCC, - A.G, /* G1 |2 15| B4 */ B.C, - A.B, /* B |3 14| B4 */ B.G, - A.3, /* 1Y3 |4 74156 13| A4 */ B.A, - B.2, /* 1Y2 |5 12| Y4 */ B.3, - B.1, /* 1Y1 |6 11| B3 */ B.2, - B.0, /* 1Y0 |7 10| A3 */ B.1, - A.GND,/* GND |8 9| Y3 */ B.0 - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM74260: Dual 5-Input NOR Gates - * _________ - * Y = A+B+C+D+E - * +---+---+---+---+---++---+ - * | A | B | B | B | B || Y | - * +===+===+===+===+===++===+ - * | 0 | 0 | 0 | 0 | 0 || 1 | - * | 0 | 0 | 0 | 0 | 1 || 0 | - * | 0 | 0 | 0 | 1 | 0 || 0 | - * | 0 | 0 | 1 | 0 | 0 || 0 | - * | 0 | 1 | 0 | 0 | 0 || 0 | - * | 1 | 0 | 0 | 0 | 0 || 0 | - * +---+---+---+---+---++---+ - * - * Naming conventions follow Texas Instruments datasheet - * - */ - -static NETLIST_START(TTL_74260_DIP) - TTL_74260_GATE(A) - TTL_74260_GATE(B) - - NET_C(A.VCC, B.VCC) - NET_C(A.GND, B.GND) - - DIPPINS( /* +--------------+ */ - A.C, /* C1 |1 ++ 14| VCC */ A.VCC, - A.D, /* D1 |2 13| B1 */ A.B, - A.E, /* E1 |3 12| A1 */ A.A, - B.E, /* E2 |4 74260 11| D2 */ B.D, - A.Q, /* Y1 |5 10| C2 */ B.C, - B.Q, /* Y2 |6 9| B2 */ B.B, - A.GND,/* GND |7 8| A2 */ B.A - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM74279: Quad S-R Latch - * - * +---+---+---++---+ - * |S1 |S2 | R || Q | - * +===+===+===++===+ - * | 0 | 0 | 0 || 1 | - * | 0 | 1 | 1 || 1 | - * | 1 | 0 | 1 || 1 | - * | 1 | 1 | 0 || 0 | - * | 1 | 1 | 1 ||QP | - * +---+---+---++---+ - * - * QP: Previous Q - * - * Naming conventions follow Fairchild Semiconductor datasheet - * - */ - -#ifndef __PLIB_PREPROCESSOR__ -#define TTL_74279A(name) \ - NET_REGISTER_DEV(TTL_74279A, name) -#define TTL_74279B(name) \ - NET_REGISTER_DEV(TTL_74279B, name) -#endif - -static NETLIST_START(TTL_74279_DIP) - TTL_74279B(A) - TTL_74279A(B) - TTL_74279B(C) - TTL_74279A(D) - - NET_C(A.VCC, B.VCC, C.VCC, D.VCC) - NET_C(A.GND, B.GND, C.GND, D.GND) - - DIPPINS( /* +--------------+ */ - A.R, /* 1R |1 ++ 16| VCC */ A.VCC, - A.S1, /* 1S1 |2 15| 4S */ D.S, - A.S2, /* 1S2 |3 14| 4R */ D.R, - A.Q, /* 1Q |4 74279 13| 4Q */ D.Q, - B.R, /* 2R |5 12| 3S2 */ C.S2, - B.S, /* 2S |6 11| 3S1 */ C.S1, - B.Q, /* 2Q |7 10| 3R */ C.R, - A.GND, /* GND |8 9| 3Q */ C.Q - /* +--------------+ */ - ) -NETLIST_END() - -/* - * DM9312: One of Eight Line Data Selectors/Multiplexers - * - * +--------------+ - * D0 |1 ++ 16| VCC - * D1 |2 15| Y - * D2 |3 14| YQ - * D3 |4 9312 13| C - * D4 |5 12| B - * D5 |6 11| A - * D6 |7 10| G Strobe - * GND |8 9| D7 - * +--------------+ - * __ - * +---+---+---+---++---+---+ - * | C | B | A | G || Y | YQ| - * +===+===+===+===++===+===+ - * | X | X | X | 1 || 0| 1 | - * | 0 | 0 | 0 | 0 || D0|D0Q| - * | 0 | 0 | 1 | 0 || D1|D1Q| - * | 0 | 1 | 0 | 0 || D2|D2Q| - * | 0 | 1 | 1 | 0 || D3|D3Q| - * | 1 | 0 | 0 | 0 || D4|D4Q| - * | 1 | 0 | 1 | 0 || D5|D5Q| - * | 1 | 1 | 0 | 0 || D6|D6Q| - * | 1 | 1 | 1 | 0 || D7|D7Q| - * +---+---+---+---++---+---+ - * - * Naming conventions follow National Semiconductor datasheet - * - */ - -#ifndef __PLIB_PREPROCESSOR__ -#define DM9312_TT(name) \ - NET_REGISTER_DEV(DM9312_TT, name) -#endif - -static NETLIST_START(DM9312_DIP) - DM9312_TT(s) - - DIPPINS( /* +--------------+ */ - s.D0, /* D0 |1 ++ 16| VCC */ s.VCC, - s.D1, /* D1 |2 15| Y */ s.Y, - s.D2, /* D2 |3 14| YQ */ s.YQ, - s.D3, /* D3 |4 9312 13| C */ s.C, - s.D4, /* D4 |5 12| B */ s.B, - s.D5, /* D5 |6 11| A */ s.A, - s.D6, /* D6 |7 10| G */ s.G, //Strobe - s.GND, /* GND |8 9| D7 */ s.D7 - /* +--------------+ */ - ) -NETLIST_END() - -#if (USE_TRUTHTABLE_7448) - -/* - * DM7448: BCD to 7-Segment decoders/drivers - * - * +--------------+ - * B |1 ++ 16| VCC - * C |2 15| f - * LAMP TEST |3 14| g - * BI/RBQ |4 7448 13| a - * RBI |5 12| b - * D |6 11| c - * A |7 10| d - * GND |8 9| e - * +--------------+ - * - * - * Naming conventions follow National Semiconductor datasheet - * - */ -#ifndef __PLIB_PREPROCESSOR__ -#define TTL_7448_TT(name) \ - NET_REGISTER_DEV(TTL_7448_TT, name) -#endif - -static NETLIST_START(TTL_7448_DIP) - TTL_7448_TT(s) - - DIPPINS( /* +--------------+ */ - s.B, /* B |1 ++ 16| VCC */ s.VCC, - s.C, /* C |2 15| f */ s.f, - s.LTQ, /* LTQ |3 14| g */ s.g, - s.BIQ, /* BIQ |4 7448 13| a */ s.a, - s.RBIQ, /* RBIQ |5 12| b */ s.b, - s.D, /* D |6 11| c */ s.c, - s.A, /* A |7 10| d */ s.d, - s.GND, /* GND |8 9| e */ s.e - /* +--------------+ */ - ) -NETLIST_END() -#endif - -NETLIST_START(TTL74XX_lib) - NET_MODEL("DM7414 SCHMITT_TRIGGER(VTP=1.7 VTM=0.9 VI=4.35 RI=6.15k VOH=3.5 ROH=120 VOL=0.1 ROL=37.5 TPLH=15 TPHL=15)") - NET_MODEL("TTL_7414_GATE SCHMITT_TRIGGER(VTP=1.7 VTM=0.9 VI=4.35 RI=6.15k VOH=3.5 ROH=120 VOL=0.1 ROL=37.5 TPLH=15 TPHL=15)") - NET_MODEL("DM74LS14 SCHMITT_TRIGGER(VTP=1.6 VTM=0.8 VI=4.4 RI=19.3k VOH=3.45 ROH=130 VOL=0.1 ROL=31.2 TPLH=15 TPHL=15)") - //NET_MODEL("DM7414 FAMILY(FV=5 IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 ORH=1.0e8)") - - - TRUTHTABLE_START(TTL_7400_GATE, 2, 1, "") - TT_HEAD("A,B|Q ") - TT_LINE("0,X|1|22") - TT_LINE("X,0|1|22") - TT_LINE("1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7400_NAND, 2, 1, "+A,+B,@VCC,@GND") - TT_HEAD("A,B|Q ") - TT_LINE("0,X|1|22") - TT_LINE("X,0|1|22") - TT_LINE("1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7402_GATE, 2, 1, "") - TT_HEAD("A,B|Q ") - TT_LINE("0,0|1|22") - TT_LINE("X,1|0|15") - TT_LINE("1,X|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7402_NOR, 2, 1, "+A,+B,@VCC,@GND") - TT_HEAD("A,B|Q ") - TT_LINE("0,0|1|22") - TT_LINE("X,1|0|15") - TT_LINE("1,X|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7404_GATE, 1, 1, "") - TT_HEAD(" A | Q ") - TT_LINE(" 0 | 1 |22") - TT_LINE(" 1 | 0 |15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7404_INVERT, 1, 1, "+A,@VCC,@GND") - TT_HEAD(" A | Q ") - TT_LINE(" 0 | 1 |22") - TT_LINE(" 1 | 0 |15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7408_GATE, 2, 1, "") - TT_HEAD("A,B|Q ") - TT_LINE("0,X|0|15") - TT_LINE("X,0|0|15") - TT_LINE("1,1|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7408_AND, 2, 1, "+A,+B,@VCC,@GND") - TT_HEAD("A,B|Q ") - TT_LINE("0,X|0|15") - TT_LINE("X,0|0|15") - TT_LINE("1,1|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7410_NAND, 3, 1, "+A,+B,+C,@VCC,@GND") - TT_HEAD("A,B,C|Q ") - TT_LINE("0,X,X|1|22") - TT_LINE("X,0,X|1|22") - TT_LINE("X,X,0|1|22") - TT_LINE("1,1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7410_GATE, 3, 1, "") - TT_HEAD("A,B,C|Q ") - TT_LINE("0,X,X|1|22") - TT_LINE("X,0,X|1|22") - TT_LINE("X,X,0|1|22") - TT_LINE("1,1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7411_AND, 3, 1, "+A,+B,+C,@VCC,@GND") - TT_HEAD("A,B,C|Q ") - TT_LINE("0,X,X|0|15") - TT_LINE("X,0,X|0|15") - TT_LINE("X,X,0|0|15") - TT_LINE("1,1,1|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7411_GATE, 3, 1, "") - TT_HEAD("A,B,C|Q ") - TT_LINE("0,X,X|0|15") - TT_LINE("X,0,X|0|15") - TT_LINE("X,X,0|0|15") - TT_LINE("1,1,1|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7416_GATE, 1, 1, "") - TT_HEAD(" A | Q ") - TT_LINE(" 0 | 1 |15") - TT_LINE(" 1 | 0 |23") - /* Open Collector */ - TT_FAMILY("74XXOC") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7420_GATE, 4, 1, "") - TT_HEAD("A,B,C,D|Q ") - TT_LINE("0,X,X,X|1|22") - TT_LINE("X,0,X,X|1|22") - TT_LINE("X,X,0,X|1|22") - TT_LINE("X,X,X,0|1|22") - TT_LINE("1,1,1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7420_NAND, 4, 1, "+A,+B,+C,+D,@VCC,@GND") - TT_HEAD("A,B,C,D|Q ") - TT_LINE("0,X,X,X|1|22") - TT_LINE("X,0,X,X|1|22") - TT_LINE("X,X,0,X|1|22") - TT_LINE("X,X,X,0|1|22") - TT_LINE("1,1,1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7425_GATE, 4, 1, "") - TT_HEAD("A,B,C,D|Q ") - TT_LINE("1,X,X,X|0|15") - TT_LINE("X,1,X,X|0|15") - TT_LINE("X,X,1,X|0|15") - TT_LINE("X,X,X,1|0|15") - TT_LINE("0,0,0,0|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7425_NOR, 4, 1, "+A,+B,+C,+D,@VCC,@GND") - TT_HEAD("A,B,C,D|Q ") - TT_LINE("1,X,X,X|0|15") - TT_LINE("X,1,X,X|0|15") - TT_LINE("X,X,1,X|0|15") - TT_LINE("X,X,X,1|0|15") - TT_LINE("0,0,0,0|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7427_GATE, 3, 1, "") - TT_HEAD("A,B,C|Q ") - TT_LINE("1,X,X|0|15") - TT_LINE("X,1,X|0|15") - TT_LINE("X,X,1|0|15") - TT_LINE("0,0,0|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7427_NOR, 3, 1, "+A,+B,+C,@VCC,@GND") - TT_HEAD("A,B,C|Q ") - TT_LINE("1,X,X|0|15") - TT_LINE("X,1,X|0|15") - TT_LINE("X,X,1|0|15") - TT_LINE("0,0,0|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7430_GATE, 8, 1, "") - TT_HEAD("A,B,C,D,E,F,G,H|Q ") - TT_LINE("0,X,X,X,X,X,X,X|1|22") - TT_LINE("X,0,X,X,X,X,X,X|1|22") - TT_LINE("X,X,0,X,X,X,X,X|1|22") - TT_LINE("X,X,X,0,X,X,X,X|1|22") - TT_LINE("X,X,X,X,0,X,X,X|1|22") - TT_LINE("X,X,X,X,X,0,X,X|1|22") - TT_LINE("X,X,X,X,X,X,0,X|1|22") - TT_LINE("X,X,X,X,X,X,X,0|1|22") - TT_LINE("1,1,1,1,1,1,1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7430_NAND, 8, 1, "+A,+B,+C,+D,+E,+F,+G,+H,@VCC,@GND") - TT_HEAD("A,B,C,D,E,F,G,H|Q ") - TT_LINE("0,X,X,X,X,X,X,X|1|22") - TT_LINE("X,0,X,X,X,X,X,X|1|22") - TT_LINE("X,X,0,X,X,X,X,X|1|22") - TT_LINE("X,X,X,0,X,X,X,X|1|22") - TT_LINE("X,X,X,X,0,X,X,X|1|22") - TT_LINE("X,X,X,X,X,0,X,X|1|22") - TT_LINE("X,X,X,X,X,X,0,X|1|22") - TT_LINE("X,X,X,X,X,X,X,0|1|22") - TT_LINE("1,1,1,1,1,1,1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7432_GATE, 2, 1, "") - TT_HEAD("A,B|Q ") - TT_LINE("1,X|1|22") - TT_LINE("X,1|1|22") - TT_LINE("0,0|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7432_OR, 2, 1, "+A,+B,@VCC,@GND") - TT_HEAD("A,B|Q ") - TT_LINE("1,X|1|22") - TT_LINE("X,1|1|22") - TT_LINE("0,0|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - /* FIXME: Same as 7400, but drains higher output currents. - * Netlist currently does not model over currents (should it ever?) - */ - - TRUTHTABLE_START(TTL_7437_GATE, 2, 1, "") - TT_HEAD("A,B|Q ") - TT_LINE("0,X|1|22") - TT_LINE("X,0|1|22") - TT_LINE("1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - -#if (USE_TRUTHTABLE_7448) - TRUTHTABLE_START(TTL_7448, 7, 7, "+A,+B,+C,+D,+LTQ,+BIQ,+RBIQ,@VCC,@GND") - TT_HEAD(" LTQ,BIQ,RBIQ, A , B , C , D | a, b, c, d, e, f, g") - - TT_LINE(" 1, 1, 1, 0, 0, 0, 0 | 1, 1, 1, 1, 1, 1, 0|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 0, 0 | 0, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 0, 0 | 1, 1, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 0, 0 | 1, 1, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 0, 1, 0 | 0, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 1, 0 | 1, 0, 1, 1, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 1, 0 | 0, 0, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 1, 0 | 1, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 0, 0, 1 | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 0, 1 | 1, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 0, 1 | 0, 0, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 0, 1 | 0, 0, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 0, 1, 1 | 0, 1, 0, 0, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 1, 1 | 1, 0, 0, 1, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 1, 1 | 0, 0, 0, 1, 1, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 1, 1 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") - - // BI/RBO is input output. In the next case it is used as an input will go low. - TT_LINE(" 1, 1, 0, 0, 0, 0, 0 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // RBI - - TT_LINE(" 0, 1, X, X, X, X, X | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") // LT - - // This condition has precedence - TT_LINE(" X, 0, X, X, X, X, X | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // BI - TT_FAMILY("74XX") - - TRUTHTABLE_END() - - // FIXME: We need a more elegant solution than defining twice - TRUTHTABLE_START(TTL_7448_TT, 7, 7, "") - TT_HEAD(" LTQ,BIQ,RBIQ, A , B , C , D | a, b, c, d, e, f, g") - - TT_LINE(" 1, 1, 1, 0, 0, 0, 0 | 1, 1, 1, 1, 1, 1, 0|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 0, 0 | 0, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 0, 0 | 1, 1, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 0, 0 | 1, 1, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 0, 1, 0 | 0, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 1, 0 | 1, 0, 1, 1, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 1, 0 | 0, 0, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 1, 0 | 1, 1, 1, 0, 0, 0, 0|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 0, 0, 1 | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 0, 1 | 1, 1, 1, 0, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 0, 1 | 0, 0, 0, 1, 1, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 0, 1 | 0, 0, 1, 1, 0, 0, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 0, 1, 1 | 0, 1, 0, 0, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 0, 1, 1 | 1, 0, 0, 1, 0, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 0, 1, 1, 1 | 0, 0, 0, 1, 1, 1, 1|100,100,100,100,100,100,100") - TT_LINE(" 1, 1, X, 1, 1, 1, 1 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") - - // BI/RBO is input output. In the next case it is used as an input will go low. - TT_LINE(" 1, 1, 0, 0, 0, 0, 0 | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // RBI - - TT_LINE(" 0, 1, X, X, X, X, X | 1, 1, 1, 1, 1, 1, 1|100,100,100,100,100,100,100") // LT - - // This condition has precedence - TT_LINE(" X, 0, X, X, X, X, X | 0, 0, 0, 0, 0, 0, 0|100,100,100,100,100,100,100") // BI - TT_FAMILY("74XX") - - TRUTHTABLE_END() - -#endif - - TRUTHTABLE_START(TTL_7437_NAND, 2, 1, "+A,+B") - TT_HEAD("A,B|Q ") - TT_LINE("0,X|1|22") - TT_LINE("X,0|1|22") - TT_LINE("1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7486_GATE, 2, 1, "") - TT_HEAD("A,B|Q ") - TT_LINE("0,0|0|15") - TT_LINE("0,1|1|22") - TT_LINE("1,0|1|22") - TT_LINE("1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_7486_XOR, 2, 1, "+A,+B,@VCC,@GND") - TT_HEAD("A,B|Q ") - TT_LINE("0,0|0|15") - TT_LINE("0,1|1|22") - TT_LINE("1,0|1|22") - TT_LINE("1,1|0|15") - TT_FAMILY("74XX") - TRUTHTABLE_END() - -#if (USE_TRUTHTABLE_74107) - /* - * +-----+-----+-----+---++---+-----+ - * | CLRQ| CLK | J | K || Q | QQ | - * +=====+=====+=====+===++===+=====+ - * | 0 | X | X | X || 0 | 1 | - * | 1 | * | 0 | 0 || Q0| Q0Q | - * | 1 | * | 1 | 0 || 1 | 0 | - * | 1 | * | 0 | 1 || 0 | 1 | - * | 1 | * | 1 | 1 || TOGGLE | - * +-----+-----+-----+---++---+-----+ - */ - TRUTHTABLE_START(TTL_74107, 6, 4, "+CLK,+J,+K,+CLRQ,@VCC,@GND") - TT_HEAD("CLRQ, CLK, _CO, J, K,_QX | Q, QQ, CO, QX") - TT_LINE(" 0, 0, X, X, X, X | 0, 1, 0, 0 | 16, 25, 1, 1") - TT_LINE(" 0, 1, X, X, X, X | 0, 1, 1, 0 | 16, 25, 1, 1") - - TT_LINE(" 1, 0, X, 0, 0, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 1, X, 0, 0, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 0, X, 0, 0, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") - TT_LINE(" 1, 1, X, 0, 0, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") - - TT_LINE(" 1, 0, 1, 1, 0, X | 1, 0, 0, 1 | 25, 16, 1, 1") - TT_LINE(" 1, 0, 0, 1, 0, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 0, 0, 1, 0, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") - TT_LINE(" 1, 1, X, 1, 0, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 1, X, 1, 0, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") - - TT_LINE(" 1, 0, 1, 0, 1, X | 0, 1, 0, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 0, 0, 0, 1, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 0, 0, 0, 1, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") - TT_LINE(" 1, 1, X, 0, 1, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 1, X, 0, 1, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") - - // Toggle - TT_LINE(" 1, 0, 0, 1, 1, 0 | 0, 1, 0, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 0, 0, 1, 1, 1 | 1, 0, 0, 1 | 25, 16, 1, 1") - TT_LINE(" 1, 1, 0, 1, 1, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 1, 0, 1, 1, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") - TT_LINE(" 1, 1, 1, 1, 1, 0 | 0, 1, 1, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 1, 1, 1, 1, 1 | 1, 0, 1, 1 | 25, 16, 1, 1") - - TT_LINE(" 1, 0, 1, 1, 1, 1 | 0, 1, 0, 0 | 16, 25, 1, 1") - TT_LINE(" 1, 0, 1, 1, 1, 0 | 1, 0, 0, 1 | 25, 16, 1, 1") - TRUTHTABLE_END() -#endif - - TRUTHTABLE_START(TTL_74155A_GATE, 4, 4, "") - TT_HEAD("B,A,G,C|0,1,2,3") - TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") - TT_LINE("X,X,0,0|1,1,1,1|13,13,13,13") - TT_LINE("0,0,0,1|0,1,1,1|13,13,13,13") - TT_LINE("0,1,0,1|1,0,1,1|13,13,13,13") - TT_LINE("1,0,0,1|1,1,0,1|13,13,13,13") - TT_LINE("1,1,0,1|1,1,1,0|13,13,13,13") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_74155B_GATE, 4, 4, "") - TT_HEAD("B,A,G,C|0,1,2,3") - TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") - TT_LINE("X,X,0,1|1,1,1,1|13,13,13,13") - TT_LINE("0,0,0,0|0,1,1,1|13,13,13,13") - TT_LINE("0,1,0,0|1,0,1,1|13,13,13,13") - TT_LINE("1,0,0,0|1,1,0,1|13,13,13,13") - TT_LINE("1,1,0,0|1,1,1,0|13,13,13,13") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_74156A_GATE, 4, 4, "") - TT_HEAD("B,A,G,C|0,1,2,3") - TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") - TT_LINE("X,X,0,0|1,1,1,1|13,13,13,13") - TT_LINE("0,0,0,1|0,1,1,1|13,13,13,13") - TT_LINE("0,1,0,1|1,0,1,1|13,13,13,13") - TT_LINE("1,0,0,1|1,1,0,1|13,13,13,13") - TT_LINE("1,1,0,1|1,1,1,0|13,13,13,13") - TT_FAMILY("74XXOC") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_74156B_GATE, 4, 4, "") - TT_HEAD("B,A,G,C|0,1,2,3") - TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") - TT_LINE("X,X,0,1|1,1,1,1|13,13,13,13") - TT_LINE("0,0,0,0|0,1,1,1|13,13,13,13") - TT_LINE("0,1,0,0|1,0,1,1|13,13,13,13") - TT_LINE("1,0,0,0|1,1,0,1|13,13,13,13") - TT_LINE("1,1,0,0|1,1,1,0|13,13,13,13") - TT_FAMILY("74XXOC") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_74260_GATE, 5, 1, "") - TT_HEAD("A,B,C,D,E|Q ") - TT_LINE("0,0,0,0,0|1|10") - TT_LINE("X,X,X,X,1|0|12") - TT_LINE("X,X,X,1,X|0|12") - TT_LINE("X,X,1,X,X|0|12") - TT_LINE("X,1,X,X,X|0|12") - TT_LINE("1,X,X,X,X|0|12") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_74260_NOR, 5, 1, "+A,+B,+C,+D,+E,@VCC,@GND") - TT_HEAD("A,B,C,D,E|Q") - TT_LINE("0,0,0,0,0|1|10") - TT_LINE("X,X,X,X,1|0|12") - TT_LINE("X,X,X,1,X|0|12") - TT_LINE("X,X,1,X,X|0|12") - TT_LINE("X,1,X,X,X|0|12") - TT_LINE("1,X,X,X,X|0|12") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - // FIXME: We need "private" devices - TRUTHTABLE_START(TTL_74279A, 3, 1, "") - TT_HEAD("S,R,_Q|Q") - TT_LINE("0,X,X|1|22") - TT_LINE("1,0,X|0|27") - TT_LINE("1,1,0|0|27") - TT_LINE("1,1,1|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(TTL_74279B, 4, 1, "") - TT_HEAD("S1,S2,R,_Q|Q") - TT_LINE("0,X,X,X|1|22") - TT_LINE("X,0,X,X|1|22") - TT_LINE("1,1,0,X|0|27") - TT_LINE("1,1,1,0|0|27") - TT_LINE("1,1,1,1|1|22") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - TRUTHTABLE_START(DM9312_TT, 12, 2, "+A,+B,+C,+G,+D0,+D1,+D2,+D3,+D4,+D5,+D6,+D7,@VCC,@GND") - TT_HEAD(" C, B, A, G,D0,D1,D2,D3,D4,D5,D6,D7| Y,YQ") - TT_LINE(" X, X, X, 1, X, X, X, X, X, X, X, X| 0, 1|33,19") - TT_LINE(" 0, 0, 0, 0, 0, X, X, X, X, X, X, X| 0, 1|33,28") - TT_LINE(" 0, 0, 0, 0, 1, X, X, X, X, X, X, X| 1, 0|33,28") - TT_LINE(" 0, 0, 1, 0, X, 0, X, X, X, X, X, X| 0, 1|33,28") - TT_LINE(" 0, 0, 1, 0, X, 1, X, X, X, X, X, X| 1, 0|33,28") - TT_LINE(" 0, 1, 0, 0, X, X, 0, X, X, X, X, X| 0, 1|33,28") - TT_LINE(" 0, 1, 0, 0, X, X, 1, X, X, X, X, X| 1, 0|33,28") - TT_LINE(" 0, 1, 1, 0, X, X, X, 0, X, X, X, X| 0, 1|33,28") - TT_LINE(" 0, 1, 1, 0, X, X, X, 1, X, X, X, X| 1, 0|33,28") - TT_LINE(" 1, 0, 0, 0, X, X, X, X, 0, X, X, X| 0, 1|33,28") - TT_LINE(" 1, 0, 0, 0, X, X, X, X, 1, X, X, X| 1, 0|33,28") - TT_LINE(" 1, 0, 1, 0, X, X, X, X, X, 0, X, X| 0, 1|33,28") - TT_LINE(" 1, 0, 1, 0, X, X, X, X, X, 1, X, X| 1, 0|33,28") - TT_LINE(" 1, 1, 0, 0, X, X, X, X, X, X, 0, X| 0, 1|33,28") - TT_LINE(" 1, 1, 0, 0, X, X, X, X, X, X, 1, X| 1, 0|33,28") - TT_LINE(" 1, 1, 1, 0, X, X, X, X, X, X, X, 0| 0, 1|33,28") - TT_LINE(" 1, 1, 1, 0, X, X, X, X, X, X, X, 1| 1, 0|33,28") - TT_FAMILY("74XX") - TRUTHTABLE_END() - - LOCAL_LIB_ENTRY(TTL_7400_DIP) - LOCAL_LIB_ENTRY(TTL_7402_DIP) - LOCAL_LIB_ENTRY(TTL_7404_DIP) - LOCAL_LIB_ENTRY(TTL_7408_DIP) - LOCAL_LIB_ENTRY(TTL_7410_DIP) - LOCAL_LIB_ENTRY(TTL_7411_DIP) - LOCAL_LIB_ENTRY(TTL_7414_GATE) - LOCAL_LIB_ENTRY(TTL_74LS14_GATE) - LOCAL_LIB_ENTRY(TTL_7414_DIP) - LOCAL_LIB_ENTRY(TTL_74LS14_DIP) - LOCAL_LIB_ENTRY(TTL_7416_DIP) - LOCAL_LIB_ENTRY(TTL_7420_DIP) - LOCAL_LIB_ENTRY(TTL_7425_DIP) - LOCAL_LIB_ENTRY(TTL_7427_DIP) - LOCAL_LIB_ENTRY(TTL_7430_DIP) - LOCAL_LIB_ENTRY(TTL_7432_DIP) - LOCAL_LIB_ENTRY(TTL_7437_DIP) -#if (USE_TRUTHTABLE_7448) - LOCAL_LIB_ENTRY(TTL_7448_DIP) -#endif - LOCAL_LIB_ENTRY(TTL_7486_DIP) -#if (USE_TRUTHTABLE_74107) - LOCAL_LIB_ENTRY(TTL_74107_DIP) -#endif - LOCAL_LIB_ENTRY(TTL_74155_DIP) - LOCAL_LIB_ENTRY(TTL_74156_DIP) - LOCAL_LIB_ENTRY(TTL_74260_DIP) - LOCAL_LIB_ENTRY(TTL_74279_DIP) - LOCAL_LIB_ENTRY(DM9312_DIP) -NETLIST_END() diff --git a/src/lib/netlist/macro/nlm_ttl74xx.h b/src/lib/netlist/macro/nlm_ttl74xx.h deleted file mode 100644 index 8afc465490d..00000000000 --- a/src/lib/netlist/macro/nlm_ttl74xx.h +++ /dev/null @@ -1,313 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -#ifndef NLD_TTL74XX_H_ -#define NLD_TTL74XX_H_ - -#include "netlist/nl_setup.h" - -#ifndef __PLIB_PREPROCESSOR__ - -/* ---------------------------------------------------------------------------- - * Netlist Macros - * ---------------------------------------------------------------------------*/ - -#ifndef NL_AUTO_DEVICES - -#define TTL_7400_GATE(name) \ - NET_REGISTER_DEV(TTL_7400_GATE, name) - -#define TTL_7400_NAND(name, cA, cB) \ - NET_REGISTER_DEV(TTL_7400_NAND, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) - -#define TTL_7400_DIP(name) \ - NET_REGISTER_DEV(TTL_7400_DIP, name) - - -#define TTL_7402_GATE(name) \ - NET_REGISTER_DEV(TTL_7402_GATE, name) - -#define TTL_7402_NOR(name, cI1, cI2) \ - NET_REGISTER_DEV(TTL_7402_NOR, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) - -#define TTL_7402_DIP(name) \ - NET_REGISTER_DEV(TTL_7402_DIP, name) - -#define TTL_7404_GATE(name) \ - NET_REGISTER_DEV(TTL_7404_GATE, name) - -#define TTL_7404_INVERT(name, cA) \ - NET_REGISTER_DEV(TTL_7404_INVERT, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA) - -#define TTL_7404_DIP(name) \ - NET_REGISTER_DEV(TTL_7404_DIP, name) - -#define TTL_7408_GATE(name) \ - NET_REGISTER_DEV(TTL_7408_GATE, name) - -#define TTL_7408_AND(name, cA, cB) \ - NET_REGISTER_DEV(TTL_7408_AND, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) - -#define TTL_7408_DIP(name) \ - NET_REGISTER_DEV(TTL_7408_DIP, name) - -#define TTL_7410_GATE(name) \ - NET_REGISTER_DEV(TTL_7410_GATE, name) - -#define TTL_7410_NAND(name, cI1, cI2, cI3) \ - NET_REGISTER_DEV(TTL_7410_NAND, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) \ - NET_CONNECT(name, C, cI3) - -#define TTL_7410_DIP(name) \ - NET_REGISTER_DEV(TTL_7410_DIP, name) - - -#define TTL_7411_GATE(name) \ - NET_REGISTER_DEV(TTL_7411_GATE, name) - -#define TTL_7411_AND(name, cI1, cI2, cI3) \ - NET_REGISTER_DEV(TTL_7411_AND, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) \ - NET_CONNECT(name, C, cI3) - -#define TTL_7411_DIP(name) \ - NET_REGISTER_DEV(TTL_7411_DIP, name) - -#define TTL_7414_GATE(name) \ - NET_REGISTER_DEV(TTL_7414_GATE, name) - -#define TTL_7414_DIP(name) \ - NET_REGISTER_DEV(TTL_7414_DIP, name) - - -#define TTL_74LS14_GATE(name) \ - NET_REGISTER_DEV(TTL_74LS14_GATE, name) - -#define TTL_74LS14_DIP(name) \ - NET_REGISTER_DEV(TTL_74LS14_DIP, name) - - -#define TTL_7416_GATE(name) \ - NET_REGISTER_DEV(TTL_7416_GATE, name) - -#define TTL_7416_DIP(name) \ - NET_REGISTER_DEV(TTL_7416_DIP, name) - - -#define TTL_7420_GATE(name) \ - NET_REGISTER_DEV(TTL_7420_GATE, name) - -#define TTL_7420_NAND(name, cI1, cI2, cI3, cI4) \ - NET_REGISTER_DEV(TTL_7420_NAND, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) \ - NET_CONNECT(name, C, cI3) \ - NET_CONNECT(name, D, cI4) - -#define TTL_7420_DIP(name) \ - NET_REGISTER_DEV(TTL_7420_DIP, name) - - -#define TTL_7425_GATE(name) \ - NET_REGISTER_DEV(TTL_7425_GATE, name) - -#define TTL_7425_NOR(name, cI1, cI2, cI3, cI4) \ - NET_REGISTER_DEV(TTL_7425_NOR, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) \ - NET_CONNECT(name, C, cI3) \ - NET_CONNECT(name, D, cI4) - -#define TTL_7425_DIP(name) \ - NET_REGISTER_DEV(TTL_7425_DIP, name) - - -#define TTL_7427_GATE(name) \ - NET_REGISTER_DEV(TTL_7427_GATE, name) - -#define TTL_7427_NOR(name, cI1, cI2, cI3) \ - NET_REGISTER_DEV(TTL_7427_NOR, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) \ - NET_CONNECT(name, C, cI3) - -#define TTL_7427_DIP(name) \ - NET_REGISTER_DEV(TTL_7427_DIP, name) - - -#define TTL_7430_GATE(name) \ - NET_REGISTER_DEV(TTL_7430_GATE, name) - -#define TTL_7430_NAND(name, cI1, cI2, cI3, cI4, cI5, cI6, cI7, cI8)\ - NET_REGISTER_DEV(TTL_7430_NAND, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) \ - NET_CONNECT(name, C, cI3) \ - NET_CONNECT(name, D, cI4) \ - NET_CONNECT(name, E, cI5) \ - NET_CONNECT(name, F, cI6) \ - NET_CONNECT(name, G, cI7) \ - NET_CONNECT(name, H, cI8) - -#define TTL_7430_DIP(name) \ - NET_REGISTER_DEV(TTL_7430_DIP, name) - - -#define TTL_7432_GATE(name) \ - NET_REGISTER_DEV(TTL_7432_OR, name) - -#define TTL_7432_OR(name, cI1, cI2) \ - NET_REGISTER_DEV(TTL_7432_OR, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cI1) \ - NET_CONNECT(name, B, cI2) - -#define TTL_7432_DIP(name) \ - NET_REGISTER_DEV(TTL_7432_DIP, name) - -#define TTL_7437_GATE(name) \ - NET_REGISTER_DEV(TTL_7437_GATE, name) - -#define TTL_7437_NAND(name, cA, cB) \ - NET_REGISTER_DEV(TTL_7437_NAND, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) - -#define TTL_7437_DIP(name) \ - NET_REGISTER_DEV(TTL_7437_DIP, name) - - -#if (USE_TRUTHTABLE_7448) -#define TTL_7448(name, cA0, cA1, cA2, cA3, cLTQ, cBIQ, cRBIQ) \ - NET_REGISTER_DEV(TTL_7448, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA0) \ - NET_CONNECT(name, B, cA1) \ - NET_CONNECT(name, C, cA2) \ - NET_CONNECT(name, D, cA3) \ - NET_CONNECT(name, LTQ, cLTQ) \ - NET_CONNECT(name, BIQ, cBIQ) \ - NET_CONNECT(name, RBIQ, cRBIQ) - -#define TTL_7448_DIP(name) \ - NET_REGISTER_DEV(TTL_7448_DIP, name) - -#endif - -#define TTL_7486_GATE(name) \ - NET_REGISTER_DEV(TTL_7486_GATE, name) - -#define TTL_7486_XOR(name, cA, cB) \ - NET_REGISTER_DEV(TTL_7486_XOR, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) - -#define TTL_7486_DIP(name) \ - NET_REGISTER_DEV(TTL_7486_DIP, name) - -#if (USE_TRUTHTABLE_74107) -#define TTL_74107(name, cCLK, cJ, cK, cCLRQ) \ - NET_REGISTER_DEV(TTL_74107, name) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, CLK, cCLK) \ - NET_CONNECT(name, J, cJ) \ - NET_CONNECT(name, K, cK) \ - NET_CONNECT(name, CLRQ, cCLRQ) - -#define TTL_74107_DIP(name) \ - NET_REGISTER_DEV(TTL_74107_DIP, name) - -#endif - -#define TTL_74155_DIP(name) \ - NET_REGISTER_DEV(TTL_74155_DIP, name) - -#define TTL_74156_DIP(name) \ - NET_REGISTER_DEV(TTL_74156_DIP, name) - -#define TTL_74260_GATE(name) \ - NET_REGISTER_DEV(TTL_74260_GATE, name) - -#define TTL_74260_NOR(name, cA, cB, cC, cD, cE) \ - NET_REGISTER_DEV(TTL_74260_NOR, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, D, cD) \ - NET_CONNECT(name, E, cE) - -#define TTL_74260_DIP(name) \ - NET_REGISTER_DEV(TTL_74260_DIP, name) - -#define TTL_74279_DIP(name) \ - NET_REGISTER_DEV(TTL_74279_DIP, name) - -#define DM9312(name, cA, cB, cC, cSTROBE, cD0, cD1, cD2, cD3, cD4, cD5, cD6, cD7) \ - NET_REGISTER_DEV(DM9312_TT, name) \ - NET_CONNECT(name, VCC, VCC) \ - NET_CONNECT(name, GND, GND) \ - NET_CONNECT(name, A, cA) \ - NET_CONNECT(name, B, cB) \ - NET_CONNECT(name, C, cC) \ - NET_CONNECT(name, G, cSTROBE) \ - NET_CONNECT(name, D0, cD0) \ - NET_CONNECT(name, D1, cD1) \ - NET_CONNECT(name, D2, cD2) \ - NET_CONNECT(name, D3, cD3) \ - NET_CONNECT(name, D4, cD4) \ - NET_CONNECT(name, D5, cD5) \ - NET_CONNECT(name, D6, cD6) \ - NET_CONNECT(name, D7, cD7) - -#define DM9312_DIP(name) \ - NET_REGISTER_DEV(DM9312_DIP, name) - -#endif - -/* ---------------------------------------------------------------------------- - * External declarations - * ---------------------------------------------------------------------------*/ - -NETLIST_EXTERNAL(TTL74XX_lib) - -#endif - -#endif diff --git a/src/lib/netlist/macro/nlm_ttl74xx_lib.cpp b/src/lib/netlist/macro/nlm_ttl74xx_lib.cpp new file mode 100644 index 00000000000..2a1d844d512 --- /dev/null +++ b/src/lib/netlist/macro/nlm_ttl74xx_lib.cpp @@ -0,0 +1,3653 @@ +// license:CC0-1.0 +// copyright-holders:Couriersud + +//#rewritten with sed -e "s_^\(.*\)/\*\(.*\)\*/\(.*\)\$_\1\3 // \2_g" ../macro/nlm_ttl74xx_lib.cpp + +#include "devices/net_lib.h" + +//- Identifier: TTL_7400_DIP +//- Title: 5400/DM5400/DM7400 Quad 2-Input NAND Gates +//- Pinalias: A1,B1,Y1,A2,B2,Y2,GND,Y3,A3,B3,Y4,A4,B4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006613.PDF +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 1 | +//- | 0 | 1 || 1 | +//- | 1 | 0 || 1 | +//- | 1 | 1 || 0 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7400_DIP) +{ + TTL_7400_NAND(A) + TTL_7400_NAND(B) + TTL_7400_NAND(C) + TTL_7400_NAND(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, D.B, // B1 |2 13| B4 + A.Q, D.A, // Y1 |3 12| A4 + B.A, D.Q, // A2 |4 7400 11| Y4 + B.B, C.B, // B2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q) // GND |7 8| Y3 + // +--------------+ +} + +//- Identifier: TTL_7402_DIP +//- Title: 5402/DM5402/DM7402 Quad 2-Input NOR Gates +//- Pinalias: Y1,A1,B1,Y2,A2,B2,GND,A3,B3,Y3,A4,B4,Y4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006492.PDF +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 1 | +//- | 0 | 1 || 0 | +//- | 1 | 0 || 0 | +//- | 1 | 1 || 0 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7402_DIP) +{ + TTL_7402_NOR(A) + TTL_7402_NOR(B) + TTL_7402_NOR(C) + TTL_7402_NOR(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.Q, A.VCC, // Y1 |1 ++ 14| VCC + A.A, D.Q, // A1 |2 13| Y4 + A.B, D.B, // B1 |3 12| B4 + B.Q, D.A, // Y2 |4 7402 11| A4 + B.A, C.Q, // A2 |5 10| Y3 + B.B, C.B, // B2 |6 9| B3 + A.GND, C.A // GND |7 8| A3 + // +--------------+ + ) +} + +//- Identifier: TTL_7404_DIP +//- Title: 5404/DM5404/DM7404 Hex Inverting Gates +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,GND,Y4,A4,Y5,A5,Y6,A6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006494.PDF +//- +//- +---++---+ +//- | A || Y | +//- +===++===+ +//- | 0 || 1 | +//- | 1 || 0 | +//- +---++---+ +//- +static NETLIST_START(TTL_7404_DIP) +{ + TTL_7404_INVERT(A) + TTL_7404_INVERT(B) + TTL_7404_INVERT(C) + TTL_7404_INVERT(D) + TTL_7404_INVERT(E) + TTL_7404_INVERT(F) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.Q, F.A, // Y1 |2 13| A6 + B.A, F.Q, // A2 |3 12| Y6 + B.Q, E.A, // Y2 |4 7404 11| A5 + C.A, E.Q, // A3 |5 10| Y5 + C.Q, D.A, // Y3 |6 9| A4 + A.GND, D.Q // GND |7 8| Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_7406_DIP +//- Title: DM5406/DM7406 Hex Inverting Buffers with High Voltage Open-Collector Outputs +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,GND,Y4,A4,Y5,A5,Y6,A6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: Open collector behavior currently not simulated. +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006496.PDF +//- +//- +---++---+ +//- | A || Y | +//- +===++===+ +//- | 0 || 1 | +//- | 1 || 0 | +//- +---++---+ +//- +static NETLIST_START(TTL_7406_DIP) +{ + TTL_7406_GATE(A) + TTL_7406_GATE(B) + TTL_7406_GATE(C) + TTL_7406_GATE(D) + TTL_7406_GATE(E) + TTL_7406_GATE(F) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.Y, F.A, // Y1 |2 13| A6 + B.A, F.Y, // A2 |3 12| Y6 + B.Y, E.A, // Y2 |4 7406 11| A5 + C.A, E.Y, // A3 |5 10| Y5 + C.Y, D.A, // Y3 |6 9| A4 + A.GND, D.Y // GND |7 8| Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_7407_DIP +//- Title: DM5407/DM7407 Hex Buffers with High Voltage Open-Collector Outputs +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,GND,Y4,A4,Y5,A5,Y6,A6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: Open collector behavior currently not simulated. +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006497.PDF +//- +//- +---++---+ +//- | A || Y | +//- +===++===+ +//- | 0 || 0 | +//- | 1 || 1 | +//- +---++---+ +//- +static NETLIST_START(TTL_7407_DIP) +{ + TTL_7407_GATE(A) + TTL_7407_GATE(B) + TTL_7407_GATE(C) + TTL_7407_GATE(D) + TTL_7407_GATE(E) + TTL_7407_GATE(F) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.Y, F.A, // Y1 |2 13| A6 + B.A, F.Y, // A2 |3 12| Y6 + B.Y, E.A, // Y2 |4 7407 11| A5 + C.A, E.Y, // A3 |5 10| Y5 + C.Y, D.A, // Y3 |6 9| A4 + A.GND, D.Y // GND |7 8| Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_7408_DIP +//- Title: 5408/DM5408/DM7408 Quad 2-Input AND Gates +//- Pinalias: A1,B1,Y1,A2,B2,Y2,GND,Y3,A3,B3,Y4,A4,B4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006498.PDF +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 0 | +//- | 0 | 1 || 0 | +//- | 1 | 0 || 0 | +//- | 1 | 1 || 1 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7408_DIP) +{ + TTL_7408_AND(A) + TTL_7408_AND(B) + TTL_7408_AND(C) + TTL_7408_AND(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, D.B, // B1 |2 13| B4 + A.Q, D.A, // Y1 |3 12| A4 + B.A, D.Q, // A2 |4 7408 11| Y4 + B.B, C.B, // B2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7410_DIP +//- Title: 5410/DM5410/DM7410 Triple 3-Input NAND Gates +//- Pinalias: A1,B1,A2,B2,C2,Y2,GND,Y3,A3,B3,C3,Y1,C1,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006500.PDF +//- +//- +---+---+---++---+ +//- | A | B | C || Y | +//- +===+===+===++===+ +//- | X | X | 0 || 1 | +//- | X | 0 | X || 1 | +//- | 0 | X | X || 1 | +//- | 1 | 1 | 1 || 0 | +//- +---+---+---++---+ +//- +static NETLIST_START(TTL_7410_DIP) +{ + TTL_7410_NAND(A) + TTL_7410_NAND(B) + TTL_7410_NAND(C) + + NET_C(A.VCC, B.VCC, C.VCC) + NET_C(A.GND, B.GND, C.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, A.C, // B1 |2 13| C1 + B.A, A.Q, // A2 |3 12| Y1 + B.B, C.C, // B2 |4 7410 11| C3 + B.C, C.B, // C2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7411_DIP +//- Title: DM7411 Triple 3-Input AND Gate +//- Pinalias: A1,B1,A2,B2,C2,Y2,GND,Y3,A3,B3,C3,Y1,C1,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009774.PDF +//- +//- +---+---+---++---+ +//- | A | B | C || Y | +//- +===+===+===++===+ +//- | X | X | 0 || 0 | +//- | X | 0 | X || 0 | +//- | 0 | X | X || 0 | +//- | 1 | 1 | 1 || 1 | +//- +---+---+---++---+ +//- +static NETLIST_START(TTL_7411_DIP) +{ + TTL_7411_AND(A) + TTL_7411_AND(B) + TTL_7411_AND(C) + + NET_C(A.VCC, B.VCC, C.VCC) + NET_C(A.GND, B.GND, C.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, A.C, // B1 |2 13| C1 + B.A, A.Q, // A2 |3 12| Y1 + B.B, C.C, // B2 |4 7411 11| C3 + B.C, C.B, // C2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7414_DIP +//- Title: DM5414/DM7414 Hex Inverter withSchmitt Trigger Inputs +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,GND,Y4,A4,Y5,A5,Y6,A6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006503.PDF +//- +//- +---++---+ +//- | A || Y | +//- +===++===+ +//- | 0 || 1 | +//- | 1 || 0 | +//- +---++---+ +//- +static NETLIST_START(TTL_7414_GATE) +{ + SCHMITT_TRIGGER(X, "DM7414") + ALIAS(A, X.A) + ALIAS(Q, X.Q) + ALIAS(GND, X.GND) + ALIAS(VCC, X.VCC) +} + +static NETLIST_START(TTL_74LS14_GATE) +{ + SCHMITT_TRIGGER(X, "DM74LS14") + ALIAS(A, X.A) + ALIAS(Q, X.Q) + ALIAS(GND, X.GND) + ALIAS(VCC, X.VCC) +} + +static NETLIST_START(TTL_7414_DIP) +{ + SCHMITT_TRIGGER(A, "DM7414") + SCHMITT_TRIGGER(B, "DM7414") + SCHMITT_TRIGGER(C, "DM7414") + SCHMITT_TRIGGER(D, "DM7414") + SCHMITT_TRIGGER(E, "DM7414") + SCHMITT_TRIGGER(F, "DM7414") + + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.Q, F.A, // Y1 |2 13| A6 + B.A, F.Q, // A2 |3 12| Y6 + B.Q, E.A, // Y2 |4 7414 11| A5 + C.A, E.Q, // A3 |5 10| Y5 + C.Q, D.A, // Y3 |6 9| A4 + A.GND, D.Q // GND |7 8| Y4 + // +--------------+ + ) +} + +static NETLIST_START(TTL_74LS14_DIP) +{ + SCHMITT_TRIGGER(A, "DM74LS14") + SCHMITT_TRIGGER(B, "DM74LS14") + SCHMITT_TRIGGER(C, "DM74LS14") + SCHMITT_TRIGGER(D, "DM74LS14") + SCHMITT_TRIGGER(E, "DM74LS14") + SCHMITT_TRIGGER(F, "DM74LS14") + + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.Q, F.A, // Y1 |2 13| A6 + B.A, F.Q, // A2 |3 12| Y6 + B.Q, E.A, // Y2 |4 74LS14 11| A5 + C.A, E.Q, // A3 |5 10| Y5 + C.Q, D.A, // Y3 |6 9| A4 + A.GND, D.Q // GND |7 8| Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_7416_DIP +//- Title: DM5416/DM7416 Hex Inverting Buffers with High Voltage Open-Collector Outputs +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,GND,Y4,A4,Y5,A5,Y6,A6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006504.PDF +//- +//- +---++---+ +//- | A || Y | +//- +===++===+ +//- | 0 || 1 | +//- | 1 || 0 | +//- +---++---+ +//- +static NETLIST_START(TTL_7416_DIP) +{ + TTL_7416_GATE(A) + TTL_7416_GATE(B) + TTL_7416_GATE(C) + TTL_7416_GATE(D) + TTL_7416_GATE(E) + TTL_7416_GATE(F) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.Q, F.A, // Y1 |2 13| A6 + B.A, F.Q, // A2 |3 12| Y6 + B.Q, E.A, // Y2 |4 7416 11| A5 + C.A, E.Q, // A3 |5 10| Y5 + C.Q, D.A, // Y3 |6 9| A4 + A.GND, D.Q // GND |7 8| Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_7417_DIP +//- Title: DM5417/DM7417 Hex Buffers withHigh Voltage Open-Collector Output +//- Pinalias: A1,Y1,A2,Y2,A3,Y3,GND,Y4,A4,Y5,A5,Y6,A6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006505.PDF +//- +//- +---++---+ +//- | A || Y | +//- +===++===+ +//- | 0 || 0 | +//- | 1 || 1 | +//- +---++---+ +//- +static NETLIST_START(TTL_7417_DIP) +{ + TTL_7417_GATE(A) + TTL_7417_GATE(B) + TTL_7417_GATE(C) + TTL_7417_GATE(D) + TTL_7417_GATE(E) + TTL_7417_GATE(F) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.Q, F.A, // Y1 |2 13| A6 + B.A, F.Q, // A2 |3 12| Y6 + B.Q, E.A, // Y2 |4 7417 11| A5 + C.A, E.Q, // A3 |5 10| Y5 + C.Q, D.A, // Y3 |6 9| A4 + A.GND, D.Q // GND |7 8| Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_7420_DIP +//- Title: 5420/DM5420/DM7420 Dual 4-Input NAND Gates +//- Pinalias: A1,B1,NC,C1,D1,Y1,GND,Y2,A2,B2,NC,C2,D2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006506.PDF +//- +//- +---+---+---+---++---+ +//- | A | B | C | D || Y | +//- +===+===+===+===++===+ +//- | X | X | X | 0 || 1 | +//- | X | X | 0 | X || 1 | +//- | X | 0 | X | X || 1 | +//- | 0 | X | X | X || 1 | +//- | 1 | 1 | 1 | 1 || 0 | +//- +---+---+---+---++---+ +//- +static NETLIST_START(TTL_7420_DIP) +{ + TTL_7420_NAND(A) + TTL_7420_NAND(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, B.D, // B1 |2 13| D2 + NC.I, B.C, // NC |3 12| C2 + A.C, NC.I, // C1 |4 7420 11| NC + A.D, B.B, // D1 |5 10| B2 + A.Q, B.A, // Y1 |6 9| A2 + A.GND, B.Q // GND |7 8| Y2 + // +--------------+ + ) +} + +//- Identifier: TTL_7421_DIP +//- Title: 54LS21/DM54LS21/DM74LS21 Dual 4-Input AND Gates +//- Pinalias: A1,B1,NC,C1,D1,Y1,GND,Y2,A2,B2,NC,C2,D2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006356.PDF +//- +//- +---+---+---+---++---+ +//- | A | B | C | D || Y | +//- +===+===+===+===++===+ +//- | X | X | X | 0 || 1 | +//- | X | X | 0 | X || 1 | +//- | X | 0 | X | X || 1 | +//- | 0 | X | X | X || 1 | +//- | 1 | 1 | 1 | 1 || 0 | +//- +---+---+---+---++---+ +//- +static NETLIST_START(TTL_7421_DIP) +{ + TTL_7421_AND(A) + TTL_7421_AND(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, B.D, // B1 |2 13| D2 + NC.I, B.C, // NC |3 12| C2 + A.C, NC.I, // C1 |4 7421 11| NC + A.D, B.B, // D1 |5 10| B2 + A.Q, B.A, // Y1 |6 9| A2 + A.GND, B.Q // GND |7 8| Y2 + // +--------------+ + ) +} + +//- Identifier: TTL_7425_DIP +//- Title: 5425/DM7425 Dual 4-Input NOR Gate (with Strobe) +//- Pinalias: A1,B1,X1,C1,D1,Y1,GND,Y2,A2,B2,X2,C2,D2 +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: The "X" input and high impedance output are currently not simulated. +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet_pdf/national-semiconductor/5425DMQB_to_DM7425N.pdf +//- +//- +---+---+---+---+---++---+ +//- | A | B | C | D | X || Y | +//- +===+===+===+===+===++===+ +//- | X | X | X | X | 0 || Z | +//- | 0 | 0 | 0 | 0 | 1 || 1 | +//- | X | X | X | 1 | 1 || 0 | +//- | X | X | 1 | X | 1 || 0 | +//- | X | 1 | X | X | 1 || 0 | +//- | 1 | X | X | X | 1 || 0 | +//- +---+---+---+---+---++---+ +//- +static NETLIST_START(TTL_7425_DIP) +{ + TTL_7425_NOR(A) + TTL_7425_NOR(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + NC_PIN(XA) // FIXME: Functionality needs to be implemented + NC_PIN(XB) // FIXME: Functionality needs to be implemented + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, B.D, // B1 |2 13| D2 + XA.I, B.C, // X1 |3 12| C2 + A.C, XB.I, // C1 |4 7425 11| X2 + A.D, B.B, // D1 |5 10| B2 + A.Q, B.A, // Y1 |6 9| A2 + A.GND, B.Q // GND |7 8| Y2 + // +--------------+ + ) +} + +//- Identifier: TTL_7427_DIP +//- Title: DM7427 Triple 3-Input NOR Gates +//- Pinalias: A1,B1,A2,B2,C2,Y2,GND,Y3,A3,B3,C3,Y1,C1,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006509.PDF +//- +//- +---+---+---++---+ +//- | A | B | C || Y | +//- +===+===+===++===+ +//- | X | X | 1 || 0 | +//- | X | 1 | X || 0 | +//- | 1 | X | X || 0 | +//- | 0 | 0 | 0 || 1 | +//- +---+---+---++---+ +//- +static NETLIST_START(TTL_7427_DIP) +{ + TTL_7427_NOR(A) + TTL_7427_NOR(B) + TTL_7427_NOR(C) + + NET_C(A.VCC, B.VCC, C.VCC) + NET_C(A.GND, B.GND, C.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, A.C, // B1 |2 13| C1 + B.A, A.Q, // A2 |3 12| Y1 + B.B, C.C, // B2 |4 7427 11| C3 + B.C, C.B, // C2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7430_DIP +//- Title: 5430/DM5430/DM7430 8-Input NAND Gate +//- Pinalias: A,B,C,D,E,F,GND,Y,NC,NC,G,H,NC,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006510.PDF +//- +//- +---+---+---+---+---+---+---+---++---+ +//- | A | B | C | D | E | F | G | H || Y | +//- +===+===+===+===+===+===+===+===++===+ +//- | X | X | X | X | X | X | X | 0 || 1 | +//- | X | X | X | X | X | X | 0 | X || 1 | +//- | X | X | X | X | X | 0 | X | X || 1 | +//- | X | X | X | X | 0 | X | X | X || 1 | +//- | X | X | X | 0 | X | X | X | X || 1 | +//- | X | X | 0 | X | X | X | X | X || 1 | +//- | X | 0 | X | X | X | X | X | X || 1 | +//- | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 || 0 | +//- +---+---+---+---+---+---+---+---++---+ +//- +static NETLIST_START(TTL_7430_DIP) +{ + TTL_7430_NAND(A) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A |1 ++ 14| VCC + A.B, NC.I, // B |2 13| NC + A.C, A.H, // C |3 12| H + A.D, A.G, // D |4 7430 11| G + A.E, NC.I, // E |5 10| NC + A.F, NC.I, // F |6 9| NC + A.GND, A.Q // GND |7 8| Y + // +--------------+ + ) +} + +//- Identifier: TTL_7432_DIP +//- Title: 5432/DM5432/DM7432 Quad 2-Input OR Gates +//- Pinalias: A1,B1,Y1,A2,B2,Y2,GND,Y3,A3,B3,Y4,A4,B4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006511.PDF +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 0 | +//- | 0 | 1 || 1 | +//- | 1 | 0 || 1 | +//- | 1 | 1 || 1 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7432_DIP) +{ + TTL_7432_OR(A) + TTL_7432_OR(B) + TTL_7432_OR(C) + TTL_7432_OR(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, D.B, // B1 |2 13| B4 + A.Q, D.A, // Y1 |3 12| A4 + B.A, D.Q, // A2 |4 7432 11| Y4 + B.B, C.B, // B2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7437_DIP +//- Title: 5437/DM5437/DM7437 Quad 2-Input NAND Buffers +//- Pinalias: A1,B1,Y1,A2,B2,Y2,GND,Y3,A3,B3,Y4,A4,B4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: Same as 7400, but drains higher output currents. Netlist currently does not model over currents (should it ever?) +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/105/236976_DS.pdf +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 1 | +//- | 0 | 1 || 1 | +//- | 1 | 0 || 1 | +//- | 1 | 1 || 0 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7437_DIP) +{ + TTL_7437_NAND(A) + TTL_7437_NAND(B) + TTL_7437_NAND(C) + TTL_7437_NAND(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, D.B, // B1 |2 13| B4 + A.Q, D.A, // Y1 |3 12| A4 + B.A, D.Q, // A2 |4 7437 11| Y4 + B.B, C.B, // B2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7438_DIP +//- Title: DM74LS38 Quad 2-Input NAND Buffer with Open-Collector Outputs +//- Pinalias: A1,B1,Y1,A2,B2,Y2,GND,Y3,A3,B3,Y4,A4,B4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/70/375632_DS.pdf +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 1 | +//- | 0 | 1 || 1 | +//- | 1 | 0 || 1 | +//- | 1 | 1 || 0 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7438_DIP) +{ + TTL_7438_NAND(A) + TTL_7438_NAND(B) + TTL_7438_NAND(C) + TTL_7438_NAND(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, D.B, // B1 |2 13| B4 + A.Q, D.A, // Y1 |3 12| A4 + B.A, D.Q, // A2 |4 7438 11| Y4 + B.B, C.B, // B2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7442_DIP +//- Title: 5442A/DM5442A/DM7442A BCD to Decimal Decoders +//- Pinalias: 0,1,2,3,4,5,6,GND,7,8,9,D,C,B,A,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006516.PDF +//- +//- +---+---+---+---++---+---+---+---+---+---+---+---+---+---+ +//- | D | C | B | A || 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | +//- +===+===+===+===++===+===+===+===+===+===+===+===+===+===+ +//- | 0 | 0 | 0 | 0 || 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 0 | 0 | 1 || 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 0 | 1 | 0 || 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 0 | 1 | 1 || 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 1 | 0 | 0 || 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 1 | 0 | 1 || 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | +//- | 0 | 1 | 1 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | +//- | 0 | 1 | 1 | 1 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | +//- | 1 | 0 | 0 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | +//- | 1 | 0 | 0 | 1 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | +//- | 1 | 0 | 1 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 1 | 0 | 1 | 1 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 1 | 1 | 0 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 1 | 1 | 0 | 1 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 1 | 1 | 1 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 1 | 1 | 1 | 1 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- +---+---+---+---++---+---+---+---+---+---+---+---+---+---+ +//- +static NETLIST_START(TTL_7442_DIP) +{ + NET_REGISTER_DEV(TTL_7442, A) + + DIPPINS( // +--------------+ + A.Q0, A.VCC, // 0 |1 ++ 16| VCC + A.Q1, A.A, // 1 |2 15| A + A.Q2, A.B, // 2 |3 14| B + A.Q3, A.C, // 3 |4 13| C + A.Q4, A.D, // 4 |5 7442 12| D + A.Q5, A.Q9, // 5 |6 11| 9 + A.Q6, A.Q8, // 6 |7 10| 8 + A.GND, A.Q7 // GND |8 9| 7 + // +--------------+ + ) +} + +//- Identifier: TTL_7448_DIP +//- Title: DM5448/DM48LS48/DM7448/DM74LS48 BCD to 7-Segment Decoder +//- Pinalias: A1,A2,LTQ,BIQ,RBIQ,A3,A0,GND,e,d,c,b,a,g,f,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS010172.PDF +//- +//- +-----+------+----+----+----+----++-----+---+---+---+---+---+---+---+ +//- | LTQ | RBIQ | A3 | A2 | A1 | A0 || BIQ | a | b | c | d | e | f | g | +//- +=====+======+====+====+====+====++=====+===+===+===+===+===+===+===+ +//- | 1 | 1 | 0 | 0 | 0 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | +//- | 1 | X | 0 | 0 | 0 | 1 || 1 | 0 | 1 | 1 | 0 | 0 | 0 | 0 | +//- | 1 | X | 0 | 0 | 1 | 0 || 1 | 1 | 1 | 0 | 1 | 1 | 0 | 1 | +//- | 1 | X | 0 | 0 | 1 | 1 || 1 | 1 | 1 | 1 | 1 | 0 | 0 | 1 | +//- | 1 | X | 0 | 1 | 0 | 0 || 1 | 0 | 1 | 1 | 0 | 0 | 1 | 1 | +//- | 1 | X | 0 | 1 | 0 | 1 || 1 | 1 | 0 | 1 | 1 | 0 | 1 | 1 | +//- | 1 | X | 0 | 1 | 1 | 0 || 1 | 0 | 0 | 1 | 1 | 1 | 1 | 1 | +//- | 1 | X | 0 | 1 | 1 | 1 || 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | +//- | 1 | X | 1 | 0 | 0 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 1 | X | 1 | 0 | 0 | 1 || 1 | 1 | 1 | 1 | 0 | 0 | 1 | 1 | +//- | 1 | X | 1 | 0 | 1 | 0 || 1 | 0 | 0 | 0 | 1 | 1 | 0 | 1 | +//- | 1 | X | 1 | 0 | 1 | 1 || 1 | 0 | 0 | 1 | 1 | 0 | 0 | 1 | +//- | 1 | X | 1 | 1 | 0 | 0 || 1 | 0 | 1 | 0 | 0 | 0 | 1 | 1 | +//- | 1 | X | 1 | 1 | 0 | 1 || 1 | 1 | 0 | 0 | 1 | 0 | 1 | 1 | +//- | 1 | X | 1 | 1 | 1 | 0 || 1 | 0 | 0 | 0 | 1 | 1 | 1 | 1 | +//- | 1 | X | 1 | 1 | 1 | 1 || 1 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +//- | X | X | X | X | X | X || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +//- | 1 | 0 | 0 | 0 | 0 | 0 || 0 | 0 | 0 | 0 | 0 | 0 | 0 | 0 | +//- | 0 | X | X | X | X | X || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- +-----+------+----+----+----+----++-----+---+---+---+---+---+---+---+ +//- +static NETLIST_START(TTL_7448_DIP) +{ + + TTL_7448(A) + + DIPPINS( // +--------------+ + A.B, A.VCC, // B |1 ++ 16| VCC + A.C, A.f, // C |2 15| f + A.LTQ, A.g, // LTQ |3 14| g + A.BIQ, A.a, // BIQ |4 7448 13| a + A.RBIQ, A.b, // RBIQ |5 12| b + A.D, A.c, // D |6 11| c + A.A, A.d, // A |7 10| d + A.GND, A.e // GND |8 9| e + // +--------------+ + ) +} + +//- Identifier: TTL_7450_DIP +//- Title: DM7450 Expandable Dual 2-Wide 2-Input AND-OR-INVERT Gate +//- Pinalias: A1,B1,Y1,A2,B2,Y2,GND,Y3,A3,B3,Y4,A4,B4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: Expander signal is not implemented +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/105/236976_DS.pdf +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 1 | +//- | 0 | 1 || 1 | +//- | 1 | 0 || 1 | +//- | 1 | 1 || 0 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7450_DIP) +{ + TTL_7450_ANDORINVERT(A) + TTL_7450_ANDORINVERT(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.A, A.VCC, // 1A |1 ++ 14| VCC + B.A, A.B, // 2A |2 13| 1B + B.B, NC.I, // 2B |3 12| 1XQ + B.C, NC.I, // 2C |4 7450 11| 1X + B.D, A.D, // 2D |5 10| 1D + B.Q, A.C, // 2Y |6 9| 1C + A.GND, A.Q // GND |7 8| 1Y + // +--------------+ + ) +} + +//- Identifier: TTL_7473_DIP +//- Title: 5473/DM5473/DM7473 Dual Master-Slave J-K Flip-Flops with Clear and Complementary Outputs +//- Pinalias: CLK1,CLR1,K1,VCC,CLK2,CLR2,J2,QQ2,Q2,K2,GND,Q1,QQ1,J1 +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet_pdf/national-semiconductor/5473DMQB_to_DM7473N.pdf +//- +//- +-----+-------+---+---++---+----+ +//- | CLR | CLK | J | K || Q | QQ | +//- +=====+=======+===+===++===+====+ +//- | 0 | X | X | X || 0 | 1 | +//- | 1 | 0-1-0 | 0 | 0 || Q | QQ | +//- | 1 | 0-1-0 | 1 | 0 || 1 | 0 | +//- | 1 | 0-1-0 | 0 | 1 || 0 | 1 | +//- | 1 | 0-1-0 | 1 | 1 || Toggle | +//- +-----+-------+---+---++---+----+ +//- +static NETLIST_START(TTL_7473_DIP) +{ + TTL_7473(A) + TTL_7473(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.CLK, A.J, // CLK1 |1 ++ 14| J1 + A.CLRQ, A.QQ, // CLR1 |2 13| QQ1 + A.K, A.Q, // K1 |3 12| Q1 + A.VCC, A.GND, // VCC |4 7473 11| GND + B.CLK, B.K, // CLK2 |5 10| K2 + B.CLRQ, B.Q, // CLR2 |6 9| Q2 + B.J, B.QQ // J2 |7 8| QQ2 + // +--------------+ + ) +} + +//- Identifier: TTL_7473A_DIP +//- Title: DM54LS73A/DM74LS73A Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flops with Clear and Complementary Outputs +//- Pinalias: CLK1,CLR1,K1,VCC,CLK2,CLR2,J2,QQ2,Q2,K2,GND,Q1,QQ1,J1 +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006372.PDF +//- +//- +-----+-----+---+---++---+----+ +//- | CLR | CLK | J | K || Q | QQ | +//- +=====+=====+===+===++===+====+ +//- | 0 | X | X | X || 0 | 1 | +//- | 1 | 1-0 | 0 | 0 || Q | QQ | +//- | 1 | 1-0 | 1 | 0 || 1 | 0 | +//- | 1 | 1-0 | 0 | 1 || 0 | 1 | +//- | 1 | 1-0 | 1 | 1 || Toggle | +//- | 1 | 1 | X | X || Q | QQ | +//- +-----+-----+---+---++---+----+ +//- +static NETLIST_START(TTL_7473A_DIP) +{ + TTL_7473A(A) + TTL_7473A(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.CLK, A.J, // CLK1 |1 ++ 14| J1 + A.CLRQ, A.QQ, // CLR1 |2 13| QQ1 + A.K, A.Q, // K1 |3 12| Q1 + A.VCC, A.GND, // VCC |4 7473A 11| GND + B.CLK, B.K, // CLK2 |5 10| K2 + B.CLRQ, B.Q, // CLR2 |6 9| Q2 + B.J, B.QQ // J2 |7 8| QQ2 + // +--------------+ + ) +} + +//- Identifier: TTL_7474_DIP +//- Title: 5474/DM5474/DM7474 Dual Positive-Edge-Triggered D Flip-Flops with Preset, Clear and Complementary Outputs +//- Pinalias: CLR1,D1,CLK1,PR1,Q1,QQ1,GND,QQ2,Q2,PR2,CLK2,D2,CLR2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006526.PDF +//- +//- +----+-----+-----+---++---+----+ +//- | PR | CLR | CLK | D || Q | QQ | +//- +====+=====+=====+===++===+====+ +//- | 0 | 1 | X | X || 1 | 0 | +//- | 1 | 0 | X | X || 0 | 1 | +//- | 0 | 0 | X | X || 1 | 1 | (unstable) +//- | 1 | 1 | 0-1 | 1 || 1 | 0 | +//- | 1 | 1 | 0-1 | 0 || 0 | 1 | +//- | 1 | 1 | 0 | X || Q | QQ | +//- +----+-----+-----+---++---+----+ +//- +static NETLIST_START(TTL_7474_DIP) +{ + TTL_7474(A) + TTL_7474(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.CLRQ, A.VCC, // CLR1 |1 ++ 14| VCC + A.D, B.CLRQ, // D1 |2 13| CLR2 + A.CLK, B.D, // CLK1 |3 12| D2 + A.PREQ, B.CLK, // PR1 |4 7474 11| CLK2 + A.Q, B.PREQ, // Q1 |5 10| PR2 + A.QQ, B.Q, // QQ1 |6 9| Q2 + A.GND, B.QQ // GND |7 8| QQ2 + // +-------------+ + ) +} + +//- Identifier: TTL_7475_DIP +//- Title: DM5475/DM7475/DM7475A/DM74LS75 4-bit D Latch +//- Pinalias: QQ1,D1,D2,E34,VCC,D3,D4,QQ4,Q4,Q3,QQ3,GND,E12,QQ2,Q2,Q1 +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- https://archive.org/download/bitsavers_nationaldaTTLDatabook_40452765/1976_National_TTL_Databook.pdf +//- +//- +---+---++---+----+ +//- | D | G || Q | QQ | +//- +===+===++===+====+ +//- | 0 | 1 || 0 | 1 | +//- | 1 | 1 || 1 | 0 | +//- | X | 0 || Q | QQ | +//- +---+---++---+----+ +//- +static NETLIST_START(TTL_7475_DIP) +{ + TTL_7475_GATE(A) + TTL_7475_GATE(B) + TTL_7475_GATE(C) + TTL_7475_GATE(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + NET_C(A.CLK, B.CLK) + NET_C(C.CLK, D.CLK) + + DIPPINS( // +--------------+ + A.QQ, A.Q, // QQ1 |1 ++ 16| Q1 + A.D, B.Q, // D1 |2 15| Q2 + B.D, B.QQ, // D2 |3 14| QQ2 + C.CLK, A.CLK, // E34 |4 7475 13| E12 + A.VCC, A.GND, // VCC |5 12| GND + C.D, C.QQ, // D3 |6 11| QQ3 + D.D, C.Q, // D4 |7 10| Q3 + D.QQ, D.Q // QQ4 |8 9| Q4 + // +--------------+ + ) +} + +//- Identifier: TTL_7477_DIP +//- Title: DM74LS77 4-bit D Latch +//- Pinalias: D1,D2,E34,VCC,D3,D4,NC,Q4,Q3,NC,GND,E12,Q2,Q1 +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- https://archive.org/download/bitsavers_nationaldaTTLDatabook_40452765/1976_National_TTL_Databook.pdf +//- +//- +---+---++---+----+ +//- | D | G || Q | QQ | +//- +===+===++===+====+ +//- | 0 | 1 || 0 | 1 | +//- | 1 | 1 || 1 | 0 | +//- | X | 0 || Q | QQ | +//- +---+---++---+----+ +//- +static NETLIST_START(TTL_7477_DIP) +{ + TTL_7477_GATE(A) + TTL_7477_GATE(B) + TTL_7477_GATE(C) + TTL_7477_GATE(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + NET_C(A.CLK, B.CLK) + NET_C(C.CLK, D.CLK) + + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.D, A.Q, // D1 |1 ++ 14| Q1 + B.D, B.Q, // D2 |2 13| Q2 + C.CLK, A.CLK, // E34 |3 12| E12 + A.VCC, A.GND, // VCC |4 7477 11| GND + C.D, NC.I, // D3 |5 10| NC + D.D, C.Q, // D4 |6 9| Q3 + NC.I, D.Q // NC |7 8| Q4 + // +--------------+ + ) +} + +//- Identifier: TTL_7483_DIP +//- Title: DM5483/DM7483/DM74LS83A 4-bit Binary Adders With Fast Carry +//- Pinalias: A4,S3,A3,B3,VCC,S2,B2,A2,S1,A1,B1,GND,C0,C4,S4,B4 +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006378.PDF +//- +static NETLIST_START(TTL_7483_DIP) +{ + TTL_7483(A) + + DIPPINS( // +--------------+ + A.A4, A.B4, // A4 |1 ++ 16| B4 + A.S3, A.S4, // S3 |2 15| S4 + A.A3, A.C4, // A3 |3 14| C4 + A.B3, A.C0, // B3 |4 7483 13| C0 + A.VCC, A.GND, // VCC |5 12| GND + A.S2, A.B1, // S2 |6 11| B1 + A.B2, A.A1, // B2 |7 10| A1 + A.A2, A.S1 // A2 |8 9| S1 + // +--------------+ + ) +} + +//- Identifier: TTL_7485_DIP +//- Title: DM5485/DM7485/DM74L85/DM74LS85 4-Bit Magnitude Comparators +//- Pinalias: B3,LTIN,EQIN,GTIN,GTOUT,EQOUT,LTOUT,GND,B0,A0,B1,A1,A2,B2,A3,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006379.PDF +//- +static NETLIST_START(TTL_7485_DIP) +{ + TTL_7485(A) + + DIPPINS( // +--------------+ + A.B3, A.VCC, // B3 |1 ++ 16| VCC + A.LTIN, A.A3, // LTIN |2 15| A3 + A.EQIN, A.B2, // EQIN |3 14| B2 + A.GTIN, A.A2, // GTIN |4 7485 13| A2 + A.GTOUT, A.A1, // GTOUT |5 12| A1 + A.EQOUT, A.B1, // EQOUT |6 11| B1 + A.LTOUT, A.A0, // LTOUT |7 10| A0 + A.GND, A.B0 // GND |8 9| B0 + // +--------------+ + ) +} + +//- Identifier: TTL_7486_DIP +//- Title: 5486/DM5486/DM7486 Quad 2-Input Exclusive-OR Gates +//- Pinalias: A1,B1,Y1,A2,B2,Y2,GND,Y3,A3,B3,Y4,A4,B4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006531.PDF +//- +//- +---+---++---+ +//- | A | B || Y | +//- +===+===++===+ +//- | 0 | 0 || 0 | +//- | 0 | 1 || 1 | +//- | 1 | 0 || 1 | +//- | 1 | 1 || 0 | +//- +---+---++---+ +//- +static NETLIST_START(TTL_7486_DIP) +{ + TTL_7486_XOR(A) + TTL_7486_XOR(B) + TTL_7486_XOR(C) + TTL_7486_XOR(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 14| VCC + A.B, D.B, // B1 |2 13| B4 + A.Q, D.A, // Y1 |3 12| A4 + B.A, D.Q, // A2 |4 7486 11| Y4 + B.B, C.B, // B2 |5 10| B3 + B.Q, C.A, // Y2 |6 9| A3 + A.GND, C.Q // GND |7 8| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_7490_DIP +//- Title: DM5490/DM7490A Decade Counter +//- Pinalias: B,R01,R02,NC,VCC,R91,R92,QC,QB,GND,QD,QA,NC,A +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006533.PDF +//- +//- BCD Count Sequence BCD Bi-Quinary +//- +-------++----+----+----+----+ +-------++----+----+----+----+ +//- | Count || QD | QC | QB | QA | | Count || QD | QC | QB | QA | +//- +=======++====+====+====+====+ +=======++====+====+====+====+ +//- | 0 || 0 | 0 | 0 | 0 | | 0 || 0 | 0 | 0 | 0 | +//- | 1 || 0 | 0 | 0 | 1 | | 1 || 0 | 0 | 0 | 1 | +//- | 2 || 0 | 0 | 1 | 0 | | 2 || 0 | 0 | 1 | 0 | +//- | 3 || 0 | 0 | 1 | 1 | | 3 || 0 | 0 | 1 | 1 | +//- | 4 || 0 | 1 | 0 | 0 | | 4 || 0 | 1 | 0 | 0 | +//- | 5 || 0 | 1 | 0 | 1 | | 5 || 1 | 0 | 0 | 0 | +//- | 6 || 0 | 1 | 1 | 0 | | 6 || 1 | 0 | 0 | 1 | +//- | 7 || 0 | 1 | 1 | 1 | | 7 || 1 | 0 | 1 | 0 | +//- | 8 || 1 | 0 | 0 | 0 | | 8 || 1 | 0 | 1 | 1 | +//- | 9 || 1 | 0 | 0 | 1 | | 9 || 1 | 1 | 0 | 0 | +//- +-------++----+----+----+----+ +-------++----+----+----+----+ +//- +//- Reset/Count Function Table +//- +-----+-----+-----+-----++----+----+----+----+ +//- | R01 | R02 | R91 | R92 || QD | QC | QB | QA | +//- +=====+=====+=====+=====++====+====+====+====+ +//- | 1 | 1 | 0 | X || 0 | 0 | 0 | 0 | +//- | 1 | 1 | X | 0 || 0 | 0 | 0 | 0 | +//- | X | X | 1 | 1 || 1 | 0 | 0 | 1 | +//- | X | 0 | X | 0 || COUNT | +//- | 0 | X | 0 | X || COUNT | +//- | 0 | X | X | 0 || COUNT | +//- | X | 0 | 0 | X || COUNT | +//- +-----+-----+-----+-----++----+----+----+----+ +//- +static NETLIST_START(TTL_7490_DIP) +{ + TTL_7490(A) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.B, A.A, // B |1 ++ 14| A + A.R1, NC.I, // R01 |2 13| NC + A.R2, A.QA, // R02 |3 12| QA + NC.I, A.QD, // NC |4 7490 11| QD + A.VCC, A.GND, // VCC |5 10| GND + A.R91, A.QB, // R91 |6 9| QB + A.R92, A.QC // R92 |7 8| QC + // +--------------+ + ) +} + +//- Identifier: TTL_7492_DIP +//- Title: SN5492A, SN54LS92, SN7492A, SN74LS92 Divide-By-Twelve Counter +//- Pinalias: CKB,NC,NC,NC,VCC,R01,R02,QD,QC,GND,QB,QA,NC,CLKA +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/27430/TI/SN7492A.html +//- +//- Count Sequence +//- +-------++----+----+----+----+ +//- | Count || QD | QC | QB | QA | +//- +=======++====+====+====+====+ +//- | 0 || 0 | 0 | 0 | 0 | +//- | 1 || 0 | 0 | 0 | 1 | +//- | 2 || 0 | 0 | 1 | 0 | +//- | 3 || 0 | 0 | 1 | 1 | +//- | 4 || 0 | 1 | 0 | 0 | +//- | 5 || 0 | 1 | 0 | 1 | +//- | 6 || 1 | 0 | 0 | 0 | +//- | 7 || 1 | 0 | 0 | 1 | +//- | 8 || 1 | 0 | 1 | 0 | +//- | 9 || 1 | 0 | 1 | 1 | +//- | 10 || 1 | 1 | 0 | 0 | +//- | 11 || 1 | 1 | 0 | 1 | +//- +-------++----+----+----+----+ +//- +//- Reset/Count Function Table +//- +-----+-----++----+----+----+----+ +//- | R01 | R02 || QD | QC | QB | QA | +//- +=====+=====++====+====+====+====+ +//- | 1 | 1 || 0 | 0 | 0 | 0 | +//- | 0 | X || COUNT | +//- | X | 0 || COUNT | +//- +-----+-----++----+----+----+----+ +//- +static NETLIST_START(TTL_7492_DIP) +{ + TTL_7492(A) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.B, A.A, // CLKB |1 ++ 14| CLKA + NC.I, NC.I, // NC |2 13| NC + NC.I, A.QA, // NC |3 12| QA + NC.I, A.QD, // NC |4 7492 11| QD + A.VCC, A.GND, // VCC |5 10| GND + A.R1, A.QB, // R01 |6 9| QB + A.R2, A.QC // R02 |7 8| QC + // +--------------+ + ) +} + +//- Identifier: TTL_7493_DIP +//- Title: 7493 Binary Counters +//- Pinalias: B,R01,R02,NC,VCC,NC,NC,QC,QB,GND,QD,QA,NC,A +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- Limitations: Internal resistor network currently fixed to 5k +//- more limitations +//- Example: ne555_astable.c,ne555_example +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006533.PDF +//- +//- Counter Sequence +//- +//- | COUNT || QD | QC | QB | QA | +//- |------:||:--:|:--:|:--:|:--:| +//- | 0 || 0 | 0 | 0 | 0 | +//- | 1 || 0 | 0 | 0 | 1 | +//- | 2 || 0 | 0 | 1 | 0 | +//- | 3 || 0 | 0 | 1 | 1 | +//- | 4 || 0 | 1 | 0 | 0 | +//- | 5 || 0 | 1 | 0 | 1 | +//- | 6 || 0 | 1 | 1 | 0 | +//- | 7 || 0 | 1 | 1 | 1 | +//- | 8 || 1 | 0 | 0 | 0 | +//- | 9 || 1 | 0 | 0 | 1 | +//- | 10 || 1 | 0 | 1 | 0 | +//- | 11 || 1 | 0 | 1 | 1 | +//- | 12 || 1 | 1 | 0 | 0 | +//- | 13 || 1 | 1 | 0 | 1 | +//- | 14 || 1 | 1 | 1 | 0 | +//- | 15 || 1 | 1 | 1 | 1 | +//- +//- Note C Output QA is connected to input B +//- +//- Reset Count Function table +//- +//- | R01 | R02 | QD | QC | QB | QA | +//- |:---:|:---:|:--:|:--:|:--:|:--:| +//- | 1 | 1 | 0 | 0 | 0 | 0 | +//- | 0 | X | COUNT |||| +//- | X | 0 | COUNT |||| +//- +//- + +static NETLIST_START(TTL_7493_DIP) +{ + TTL_7493(A) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.CLKB, A.CLKA, // CLKB |1 ++ 14| CLKA + A.R1, NC.I, // R01 |2 13| NC + A.R2, A.QA, // R02 |3 12| QA + NC.I, A.QD, // NC |4 7493 11| QD + A.VCC, A.GND, // VCC |5 10| GND + NC.I, A.QB, // NC |6 9| QB + NC.I, A.QC // NC |7 8| QC + // +--------------+ + ) +} + +//- Identifier: TTL_7497_DIP +//- Title: 5497/DM7497 Synchronous Modulo-64 Bit Rate Multiplier +//- Pinalias: S1,S4,S5,S0,ZQ,Y,TCQ,GND,CP,EZQ,CEQ,EY,MR,S2,S3,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009780.PDF +//- +static NETLIST_START(TTL_7497_DIP) +{ + TTL_7497(A) + + DIPPINS( // +--------------+ + A.B1, A.VCC, // S1 |1 ++ 16| VCC + A.B4, A.B3, // S4 |2 15| S3 + A.B5, A.B2, // S5 |3 14| S2 + A.B0, A.CLR, // S0 |4 7497 13| MR + A.ZQ, A.UNITYQ, // ZQ |5 12| EY + A.Y, A.ENQ, // Y |6 11| CEQ + A.ENOUTQ, A.STRBQ, // TCQ |7 10| EZQ + A.GND, A.CLK // GND |8 9| CP + // +--------------+ + ) +} + +//- Identifier: TTL_74107_DIP +//- Title: SN54107, SN74107 Dual J-K Flip-Flops With Clear +//- Pinalias: 1J,1QQ,1Q,1K,2Q,2QQ,GND,2J,2CLK,2CLRQ,2K,1CLK,1CLRQ,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/840452/TI1/SN74107.html +//- +//- +------+-------+---+---++---+----+ +//- | CLRQ | CLK | J | K || Q | QQ | +//- +======+=======+===+===++===+====+ +//- | 0 | X | X | X || 0 | 1 | +//- | 1 | 0-1-0 | 0 | 0 || Q | QQ | +//- | 1 | 0-1-0 | 1 | 0 || 1 | 0 | +//- | 1 | 0-1-0 | 0 | 1 || 0 | 1 | +//- | 1 | 0-1-0 | 1 | 1 || TOGGLE | +//- +------+-------+---+---++---+----+ +//- +static NETLIST_START(TTL_74107_DIP) +{ + TTL_74107(A) + TTL_74107(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.J, A.VCC, // 1J |1 ++ 14| VCC + A.QQ, A.CLRQ, // 1QQ |2 13| 1CLRQ + A.Q, A.CLK, // 1Q |3 12| 1CLK + A.K, B.K, // 1K |4 74107 11| 2K + B.Q, B.CLRQ, // 2Q |5 10| 2CLRQ + B.QQ, B.CLK, // 2QQ |6 9| 2CLK + B.GND, B.J // GND |7 8| 2J + // +--------------+ + ) +} + +//- Identifier: TTL_74107A_DIP +//- Title: DM54LS107A/DM74LS107A Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flops withClear and Complementary Outputs +//- Pinalias: J1,QQ1,Q1,K1,Q2,QQ2,GND,J2,CLK2,CLRQ2,K2,CLK1,CLRQ1,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006367.PDF +//- +//- +------+-----+---+---++---+----+ +//- | CLRQ | CLK | J | K || Q | QQ | +//- +======+=====+===+===++===+====+ +//- | 0 | X | X | X || 0 | 1 | +//- | 1 | 1-0 | 0 | 0 || Q | QQ | +//- | 1 | 1-0 | 1 | 0 || 1 | 0 | +//- | 1 | 1-0 | 0 | 1 || 0 | 1 | +//- | 1 | 1-0 | 1 | 1 || TOGGLE | +//- | 1 | 1 | X | X || Q | QQ | +//- +------+-----+---+---++---+----+ +//- +static NETLIST_START(TTL_74107A_DIP) +{ + TTL_74107A(A) + TTL_74107A(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.J, A.VCC, // J1 |1 ++ 14| VCC + A.QQ, A.CLRQ, // QQ1 |2 13| CLRQ1 + A.Q, A.CLK, // Q1 |3 12| CLK1 + A.K, B.K, // K1 |4 74107A 11| K2 + B.Q, B.CLRQ, // Q2 |5 10| CLRQ2 + B.QQ, B.CLK, // QQ2 |6 9| CLK2 + B.GND, B.J // GND |7 8| J2 + // +--------------+ + ) +} + +//- Identifier: TTL_74113_DIP +//- Title: DM54S113/DM74S113 Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flops with Preset and Complementary Outputs +//- Pinalias: CLK1,K1,J1,PRQ1,Q1,QQ1,GND,QQ2,Q2,PRQ2,J2,K2,CLK2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006460.PDF +//- +//- +-----+-----+---+---++---+----+ +//- | PRQ | CLK | J | K || Q | QQ | +//- +=====+=====+===+===++===+====+ +//- | 0 | X | X | X || 1 | 0 | +//- | 1 | 1-0 | 0 | 0 || Q | QQ | +//- | 1 | 1-0 | 1 | 0 || 1 | 0 | +//- | 1 | 1-0 | 0 | 1 || 0 | 1 | +//- | 1 | 1-0 | 1 | 1 || TOGGLE | +//- | 1 | 1 | X | X || Q | QQ | +//- +-----+-----+---+---++---+----+ +//- +static NETLIST_START(TTL_74113_DIP) +{ + TTL_74113(A) + TTL_74113(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.CLK, A.VCC, // CLK1 |1 ++ 14| VCC + A.K, B.CLK, // K1 |2 13| CLK2 + A.J, B.K, // J1 |3 12| K2 + A.SETQ, B.J, // PRQ1 |4 74113 11| J2 + A.Q, B.SETQ, // Q1 |5 10| PRQ2 + A.QQ, B.Q, // QQ1 |6 9| Q2 + A.GND, B.QQ // GND |7 8| QQ2 + // +--------------+ + ) +} + +//- Identifier: TTL_74113A_DIP +//- Title: DM54S113/DM74S113 Dual Negative-Edge-Triggered Master-Slave J-K Flip-Flops with Preset and Complementary Outputs +//- Pinalias: CLK1,K1,J1,PRQ1,Q1,QQ1,GND,QQ2,Q2,PRQ2,J2,K2,CLK2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/131122/TI/SN74LS113A.html +//- +//- +------+-----+---+---++---+----+ +//- | PREQ | CLK | J | K || Q | QQ | +//- +======+=====+===+===++===+====+ +//- | 0 | X | X | X || 1 | 0 | +//- | 1 | 1-0 | 0 | 0 || Q | QQ | +//- | 1 | 1-0 | 1 | 0 || 1 | 0 | +//- | 1 | 1-0 | 0 | 1 || 0 | 1 | +//- | 1 | 1-0 | 1 | 1 || TOGGLE | +//- | 1 | 1 | X | X || Q | QQ | +//- +------+-----+---+---++---+----+ +//- +static NETLIST_START(TTL_74113A_DIP) +{ + TTL_74113A(A) + TTL_74113A(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.CLK, A.VCC, // CLK1 |1 ++ 14| VCC + A.K, B.CLK, // K1 |2 13| CLK2 + A.J, B.K, // J1 |3 12| K2 + A.SETQ, B.J, // PRQ1 |4 74113A 11| J2 + A.Q, B.SETQ, // Q1 |5 10| PRQ2 + A.QQ, B.Q, // QQ1 |6 9| Q2 + A.GND, B.QQ // GND |7 8| QQ2 + // +--------------+ + ) +} + +//- Identifier: TTL_74121_DIP +//- Title: DM74121 One-Shot with Clear and Complementary Outputs +//- Pinalias: QQ,NC,A1,A2,B,Q,GND,NC,RINT,C,RC,NC,NC,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Fairchild Semiconductor datasheet +//- Limitations: +//- Timing inaccuracies may occur for capacitances < 1nF. Please consult datasheet +//- +//- Example: 74123.cpp,74123_example +//- +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/50894/FAIRCHILD/74121.html +//- +static NETLIST_START(TTL_74121_DIP) +{ + TTL_74121(A) + NC_PIN(NC) + RES(RINT, RES_K(2)) + RES(RD, RES_M(1000)) + + NET_C(RINT.2, A.RC) + // Avoid error messages if RINT is not used. + NET_C(RINT.1, RD.2) + NET_C(RD.1, A.GND) + + DIPPINS( // +--------------+ + A.QQ, A.VCC, // QQ |1 ++ 14| VCC + NC.I, NC.I, // NC |2 13| NC + A.A1, NC.I, // A1 |3 12| NC + A.A2, A.RC, // A2 |4 74121 11| REXT/CEXT + A.B, A.C, // B |5 10| CEXT + A.Q, RINT.1, // Q |6 9| RINT + A.GND, NC.I // GND |7 8| NC + // +--------------+ + ) +} + +//- Identifier: TTL_74123_DIP +//- Title: DM74123 Dual Retriggerable One-Shot with Clear and Complementary Outputs +//- Pinalias: A1,B1,CLRQ1,QQ1,Q2,C2,RC2,GND,A2,B2,CLRQ2,QQ2,Q1,C1,RC1,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Fairchild Semiconductor datasheet +//- Limitations: +//- Timing inaccuracies may occur for capacitances < 1nF. Please consult datasheet +//- +//- Example: 74123.cpp,74123_example +//- +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/50893/FAIRCHILD/DM74123.html +//- +static NETLIST_START(TTL_74123_DIP) +{ + TTL_74123(A) + TTL_74123(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A1 |1 ++ 16| VCC + A.B, A.RC, // B1 |2 15| RC1 + A.CLRQ, A.C, // CLRQ1 |3 14| C1 + A.QQ, A.Q, // QQ1 |4 74123 13| Q1 + B.Q, B.QQ, // Q2 |5 12| QQ2 + B.C, B.CLRQ, // C2 |6 11| CLRQ + B.RC, B.B, // RC2 |7 10| B2 + A.GND, B.A // GND |8 9| A2 + // +--------------+ + ) +} + +//- Identifier: TTL_74125_DIP +//- Title: SN74125 QUADRUPLE BUS BUFFERS WITH 3-STATE OUTPUTS +//- Pinalias: 1GQ,1A,1Y,2GQ,2A,2Y,GND,3Y,3A,3GQ,4Y,4A,4GQ,VCC +//- Package: DIP +//- Param: FORCE_TRISTATE_LOGIC +//- Set this parameter to 1 force tristate outputs into logic mode. +//- This should be done only if the device enable inputs are connected +//- in a way which always enables the device. +//- NamingConvention: Naming conventions follow Texas instruments datasheet +//- Limitations: +//- No limitations +//- +//- Example: 74125.cpp,74125_example +//- +//- FunctionTable: +//- +//- | GQ | A | Y | +//- |:---:|:--:|:--:| +//- | L | L | L | +//- | L | H | H | +//- | H | X | Z | +//- +static NETLIST_START(TTL_74125_DIP) +{ + TTL_74125_GATE(A) + TTL_74125_GATE(B) + TTL_74125_GATE(C) + TTL_74125_GATE(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DEFPARAM(FORCE_TRISTATE_LOGIC, "$(@.A.FORCE_TRISTATE_LOGIC") + PARAM(A.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(B.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(C.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(D.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + + DIPPINS( // +--------------+ + A.GQ, A.VCC, // 1GQ |1 ++ 14| VCC + A.A, D.GQ, // 1A |2 13| 4GQ + A.Y, D.A, // 1Y |3 12| 4A + B.GQ, D.Y, // 2GQ |4 74125 11| 4Y + B.A, C.GQ, // 2A |5 10| 3GQ + B.Y, C.A, // 2Y |6 9| 3A + A.GND, C.Y // GND |7 8| 3Y + // +--------------+ + ) +} + +//- Identifier: TTL_74126_DIP +//- Title: DM74LS126A Quad 3-STATE Buffer +//- Pinalias: C1,A1,Y1,C2,A2,Y2,GND,Y3,A3,C3,Y4,A4,C4,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/50/232293_DS.pdf +//- +//- +---+---++------+ +//- | A | C || Y | +//- +===+===++======+ +//- | 0 | 1 || 0 | +//- | 1 | 1 || 1 | +//- | X | 0 || Hi-Z | +//- +---+---++------+ +//- +static NETLIST_START(TTL_74126_DIP) +{ + TTL_74126_GATE(A) + TTL_74126_GATE(B) + TTL_74126_GATE(C) + TTL_74126_GATE(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DEFPARAM(FORCE_TRISTATE_LOGIC, 0) + PARAM(A.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(B.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(C.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + PARAM(D.FORCE_TRISTATE_LOGIC, "$(@.FORCE_TRISTATE_LOGIC)") + + DIPPINS( // +--------------+ + A.G, A.VCC, // C1 |1 ++ 14| VCC + A.A, D.G, // A1 |2 13| C4 + A.Y, D.A, // Y1 |3 12| A4 + B.G, D.Y, // C2 |4 74126 11| Y4 + B.A, C.G, // A2 |5 10| C3 + B.Y, C.A, // Y2 |6 9| A3 + A.GND, C.Y // GND |7 8| Y3 + // +--------------+ + ) +} + +// FIXME: Pinalias completely wrong. + +//- Identifier: TTL_74139_DIP +//- Title: 54LS139/DM54LS139/DM74LS139 Decoders/Demultiplexers +//- Pinalias: G1,A1,B1,1Y0,1Y1,1Y2,1Y3,GND,2Y3,2Y2,2Y1,2Y0,B2,A2,G2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/166/375388_DS.pdf +//- +//- +---+-------+-------------+ +//- | E | A0 A1 | O0 O1 O2 O3 | +//- +===+=======+=============+ +//- | 1 | X X | 1 1 1 1 | +//- | 0 | 0 0 | 0 1 1 1 | +//- | 0 | 1 0 | 1 0 1 1 | +//- | 0 | 0 1 | 1 1 0 1 | +//- | 0 | 1 1 | 1 1 1 0 | +//- +---+-------+-------------+ +//- +static NETLIST_START(TTL_74139_DIP) +{ + NET_REGISTER_DEV(TTL_74139_GATE, A) + NET_REGISTER_DEV(TTL_74139_GATE, B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.E, A.VCC, // /Ea |1 ++ 16| VCC + A.A, B.E, // A0a |2 15| /Eb + A.B, B.A, // A1a |3 14| A0b + A.O0, B.B, // /O0a |4 74139 13| A1b + A.O1, B.O0, // /O1a |5 12| /O0b + A.O2, B.O1, // /O2a |6 11| /O1b + A.O3, B.O2, // /O3a |7 10| /O2b + A.GND, B.O3 // GND |8 9| /O3b + // +--------------+ + ) +} + +//- Identifier: TTL_74147_DIP +//- Title: SN74147 10-Line to 4-Line priority encoder +//- Pinalias: 4,5,6,7,8,C,B,GND,A,9,1,2,3,D,NC,Vcc +//- Package: DIP-16 +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://www.ti.com/lit/ds/symlink/sn74ls148.pdf +//- +//- 10-line to 4 line encoder +//- +-----+-----+-----+-----+-----+-----+-----+-----+-----+---+---+---+---+ +//- | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | D | C | B | A | +//- +=====+=====+=====+=====+=====+=====+=====+=====+=====+===+===+===+===+ +//- | H | H | H | H | H | H | H | H | H | H | H | H | H | +//- | X | X | X | X | X | X | X | X | L | L | H | H | L | +//- | X | X | X | X | X | X | X | L | H | L | H | H | H | +//- | X | X | X | X | X | X | L | H | H | H | L | L | L | +//- | X | X | X | X | X | L | H | H | H | H | L | L | H | +//- | X | X | X | X | L | H | H | H | H | H | L | H | L | +//- | X | X | X | L | H | H | H | H | H | H | L | H | H | +//- | X | X | L | H | H | H | H | H | H | H | H | L | L | +//- | X | L | H | H | H | H | H | H | H | H | H | L | H | +//- | L | H | H | H | H | H | H | H | H | H | H | H | L | +//- +-----+-----+-----+-----+-----+-----+-----+-----+-----+---+---+---+---+ +static NETLIST_START(TTL_74147_DIP) +{ + NET_REGISTER_DEV(TTL_74147_GATE, A) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.I4, A.VCC, // 4 |1 ++ 16| VCC + A.I5, NC.I, // 5 |2 15| NC + A.I6, A.D, // 6 |3 14| D + A.I7, A.I3, // 7 |4 74147 13| 3 + A.I8, A.I2, // 8 |5 12| 2 + A.C, A.I1, // C |6 11| 1 + A.B, A.I9, // B |7 10| 9 + A.GND, A.A // GND |8 9| A + // +--------------+ + ) +} + +//- Identifier: TTL_74148_DIP +//- Title: SN74148 8-line to 3-line priority encoders +//- Pinalias: 4,5,6,7,EI,A2,A1,GND,A0,0,1,2,3,GS,E0,Vcc +//- Package: DIP-16 +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://www.ti.com/lit/ds/symlink/sn74ls148.pdf +//- +//- 10-line to 4 line encoder +//- +-----+-----+-----+-----+-----+-----+-----+-----+-----+----+----+----+----+----+ +//- | EI | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | A2 | A1 | A0 | GS | E0 | +//- +=====+=====+=====+=====+=====+=====+=====+=====+=====+====+====+====+====+====+ +//- | H | X | X | X | X | X | X | X | X | H | H | H | H | H | +//- | L | H | X | H | H | H | H | H | H | H | H | H | H | L | +//- | L | X | X | X | X | X | X | X | L | L | L | L | L | H | +//- | L | X | X | X | X | X | X | L | H | L | L | H | L | H | +//- | L | X | X | X | X | X | L | H | H | L | H | L | L | H | +//- | L | X | X | X | X | L | H | H | H | L | H | H | L | H | +//- | L | X | X | X | L | H | H | H | H | H | L | L | L | H | +//- | L | X | X | L | H | H | H | H | H | H | L | H | L | H | +//- | L | X | L | H | H | H | H | H | H | H | H | L | L | H | +//- | L | L | H | H | H | H | H | H | H | H | H | H | L | H | +//- +-----+-----+-----+-----+-----+-----+-----+-----+-----+----+----+----+----+----+ +static NETLIST_START(TTL_74148_DIP) +{ + NET_REGISTER_DEV(TTL_74148_GATE, A) + + DIPPINS( // +--------------+ + A.I4, A.VCC, // 4 |1 ++ 16| VCC + A.I5, A.E0, // 5 |2 15| E0 + A.I6, A.GS, // 6 |3 14| GS + A.I7, A.I3, // 7 |4 74148 13| 3 + A.EI, A.I2, // EI |5 12| 2 + A.A2, A.I1, // A2 |6 11| 1 + A.A1, A.I0, // A1 |7 10| 0 + A.GND, A.A0 // GND |8 9| A0 + // +--------------+ + ) +} + +//- Identifier: TTL_74151_DIP +//- Title: SN74151 Data selector/multiplexer +//- Pinalias: D3,D2,D1,D0,Y,W,G,Gnd,C,B,A,D7,D6,D5,D4,Vcc +//- Package: DIP-16 +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://www.ti.com/lit/ds/symlink/sn74ls151.pdf +//- +//- +---+---+----+--++----+-----+ +//- | C | B | A | G || Y | W | +//- +===+===+===+===++====+=====+ +//- | X | X | X | H || L | H | +//- | L | L | L | L || D0 | ~D0 | +//- | L | L | H | L || D1 | ~D1 | +//- | L | H | L | L || D2 | ~D2 | +//- | L | H | H | L || D3 | ~D3 | +//- | H | L | L | L || D4 | ~D4 | +//- | H | L | H | L || D5 | ~D5 | +//- | H | H | L | L || D6 | ~D6 | +//- | H | H | H | L || D7 | ~D7 | +//- +---+---+---+---++----+-----+ +//- +static NETLIST_START(TTL_74151_DIP) +{ + NET_REGISTER_DEV(TTL_74151_GATE, A) + + DIPPINS( // +--------------+ + A.D3, A.VCC, // D3 |1 ++ 16| VCC + A.D2, A.D4, // D2 |2 15| D4 + A.D1, A.D5, // D1 |3 14| D5 + A.D0, A.D6, // D0 |4 74151 13| D6 + A.Y, A.D7, // Y |5 12| D7 + A.W, A.A, // W |6 11| A + A.G, A.B, // G |7 10| B + A.GND, A.C // GND |8 9| C + // +--------------+ + ) +} + +//- Identifier: TTL_74153_DIP +//- Title: 54153/DM54153/DM74153 Dual 4-Line to 1-LineData Selectors/Multiplexers +//- Pinalias: G1,B,1C3,1C2,1C1,1C0,Y1,GND,Y2,2C0,2C1,2C2,2C3,A,G2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006547.PDF +//- +//- +---+---+----+----+----+----+---++---+ +//- | B | A | C0 | C1 | C2 | C3 | G || Y | +//- +===+===+====+====+====+====+===++===+ +//- | X | X | X | X | X | X | 1 || 0 | +//- | 0 | 0 | 0 | X | X | X | 0 || 0 | +//- | 0 | 0 | 1 | X | X | X | 0 || 1 | +//- | 0 | 1 | X | 0 | X | X | 0 || 0 | +//- | 0 | 1 | X | 1 | X | X | 0 || 1 | +//- | 1 | 0 | X | X | 0 | X | 0 || 0 | +//- | 1 | 0 | X | X | 1 | X | 0 || 1 | +//- | 1 | 1 | X | X | X | 0 | 0 || 0 | +//- | 1 | 1 | X | X | X | 1 | 0 || 1 | +//- +---+---+----+----+----+----+---++---+ +//- +static NETLIST_START(TTL_74153_DIP) +{ + NET_REGISTER_DEV(TTL_74153, A) + NET_REGISTER_DEV(TTL_74153, B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + NET_C(A.A, B.A) + NET_C(A.B, B.B) + + DIPPINS( // +--------------+ + A.G, A.VCC, // G1 |1 ++ 16| VCC + A.B, B.G, // B |2 15| G2 + A.C3, A.A, // 1C3 |3 14| A + A.C2, B.C3, // 1C2 |4 74153 13| 2C3 + A.C1, B.C2, // 1C1 |5 12| 2C2 + A.C0, B.C1, // 1C0 |6 11| 2C1 + A.AY, B.C0, // Y1 |7 10| 2C0 + A.GND, B.AY // GND |8 9| Y2 + // +--------------+ + ) +} + +//- Identifier: TTL_74155_DIP +//- Title: 54LS155/DM54LS155/DM74LS155 Dual 2-Line to 4-Line Decoders/Demultiplexers +//- Pinalias: C1,G1,B,1Y3,1Y2,1Y1,1Y0,GND,2Y0,2Y1,2Y2,2Y3,A,G2,C2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006395.PDF +//- +//- 2-line-to-4-line decoder 2-line-to-4-line decoder +//- +---+---+----+----++-----+-----+-----+-----+ +---+---+----+----++-----+-----+-----+-----+ +//- | B | A | G1 | C1 || 1Y0 | 1Y1 | 1Y2 | 1Y3 | | B | A | G2 | C2 || 2Y0 | 2Y1 | 2Y2 | 2Y3 | +//- +===+===+====+====++=====+=====+=====+=====+ +===+===+====+====++=====+=====+=====+=====+ +//- | X | X | 1 | X || 1 | 1 | 1 | 1 | | X | X | 1 | X || 1 | 1 | 1 | 1 | +//- | 0 | 0 | 0 | 1 || 0 | 1 | 1 | 1 | | 0 | 0 | 0 | 0 || 0 | 1 | 1 | 1 | +//- | 0 | 1 | 0 | 1 || 1 | 0 | 1 | 1 | | 0 | 1 | 0 | 0 || 1 | 0 | 1 | 1 | +//- | 1 | 0 | 0 | 1 || 1 | 1 | 0 | 1 | | 1 | 0 | 0 | 0 || 1 | 1 | 0 | 1 | +//- | 1 | 1 | 0 | 1 || 1 | 1 | 1 | 0 | | 1 | 1 | 0 | 0 || 1 | 1 | 1 | 0 | +//- | X | X | X | 0 || 1 | 1 | 1 | 1 | | X | X | X | 1 || 1 | 1 | 1 | 1 | +//- +---+---+----+----++-----+-----+-----+-----+ +---+---+----+----++-----+-----+-----+-----+ +//- +//- 3-line-to-8-line decoder +//- +---+---+---+---++-----+-----+-----+-----+-----+-----+-----+-----+ +//- | C | B | A | G || 2Y0 | 2Y1 | 2Y2 | 2Y3 | 1Y0 | 1Y1 | 1Y2 | 1Y3 | +//- +===+===+===+===++=====+=====+=====+=====+=====+=====+=====+=====+ +//- | X | X | X | 1 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 0 | 0 | 0 || 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 0 | 1 | 0 || 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 1 | 0 | 0 || 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 1 | 1 | 0 || 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | +//- | 1 | 0 | 0 | 0 || 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | +//- | 1 | 0 | 1 | 0 || 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | +//- | 1 | 1 | 0 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | +//- | 1 | 1 | 1 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | +//- +---+---+---+---++-----+-----+-----+-----+-----+-----+-----+-----+ +//- +static NETLIST_START(TTL_74155_DIP) +{ + NET_REGISTER_DEV(TTL_74155A_GATE, A) + NET_REGISTER_DEV(TTL_74155B_GATE, B) + + NET_C(A.A, B.A) + NET_C(A.B, B.B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.C, A.VCC, // C1 |1 ++ 16| VCC + A.G, B.C, // G1 |2 15| C2 + A.B, B.G, // B |3 14| G2 + A.Y3, B.A, // 1Y3 |4 74155 13| A + B.Y2, B.Y3, // 1Y2 |5 12| 2Y3 + B.Y1, B.Y2, // 1Y1 |6 11| 2Y2 + B.Y0, B.Y1, // 1Y0 |7 10| 2Y1 + A.GND, B.Y0 // GND |8 9| 2Y0 + // +--------------+ + ) +} + +//- Identifier: TTL_74156_DIP +//- Title: 54LS156/DM54LS156/DM74LS156 Dual 2-Line to 4-Line Decoders/Demultiplexers with Open-Collector Outputs +//- Pinalias: C1,G1,B,1Y3,1Y2,1Y1,1Y0,GND,2Y0,2Y1,2Y2,2Y3,A,G2,C2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006395.PDF +//- +//- 2-line-to-4-line decoder 2-line-to-4-line decoder +//- +---+---+----+----++-----+-----+-----+-----+ +---+---+----+----++-----+-----+-----+-----+ +//- | B | A | G1 | C1 || 1Y0 | 1Y1 | 1Y2 | 1Y3 | | B | A | G2 | C2 || 2Y0 | 2Y1 | 2Y2 | 2Y3 | +//- +===+===+====+====++=====+=====+=====+=====+ +===+===+====+====++=====+=====+=====+=====+ +//- | X | X | 1 | X || 1 | 1 | 1 | 1 | | X | X | 1 | X || 1 | 1 | 1 | 1 | +//- | 0 | 0 | 0 | 1 || 0 | 1 | 1 | 1 | | 0 | 0 | 0 | 0 || 0 | 1 | 1 | 1 | +//- | 0 | 1 | 0 | 1 || 1 | 0 | 1 | 1 | | 0 | 1 | 0 | 0 || 1 | 0 | 1 | 1 | +//- | 1 | 0 | 0 | 1 || 1 | 1 | 0 | 1 | | 1 | 0 | 0 | 0 || 1 | 1 | 0 | 1 | +//- | 1 | 1 | 0 | 1 || 1 | 1 | 1 | 0 | | 1 | 1 | 0 | 0 || 1 | 1 | 1 | 0 | +//- | X | X | X | 0 || 1 | 1 | 1 | 1 | | X | X | X | 1 || 1 | 1 | 1 | 1 | +//- +---+---+----+----++-----+-----+-----+-----+ +---+---+----+----++-----+-----+-----+-----+ +//- +//- 3-line-to-8-line decoder +//- +---+---+---+---++-----+-----+-----+-----+-----+-----+-----+-----+ +//- | C | B | A | G || 2Y0 | 2Y1 | 2Y2 | 2Y3 | 1Y0 | 1Y1 | 1Y2 | 1Y3 | +//- +===+===+===+===++=====+=====+=====+=====+=====+=====+=====+=====+ +//- | X | X | X | 1 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 0 | 0 | 0 || 0 | 1 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 0 | 1 | 0 || 1 | 0 | 1 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 1 | 0 | 0 || 1 | 1 | 0 | 1 | 1 | 1 | 1 | 1 | +//- | 0 | 1 | 1 | 0 || 1 | 1 | 1 | 0 | 1 | 1 | 1 | 1 | +//- | 1 | 0 | 0 | 0 || 1 | 1 | 1 | 1 | 0 | 1 | 1 | 1 | +//- | 1 | 0 | 1 | 0 || 1 | 1 | 1 | 1 | 1 | 0 | 1 | 1 | +//- | 1 | 1 | 0 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 0 | 1 | +//- | 1 | 1 | 1 | 0 || 1 | 1 | 1 | 1 | 1 | 1 | 1 | 0 | +//- +---+---+---+---++-----+-----+-----+-----+-----+-----+-----+-----+ +//- +static NETLIST_START(TTL_74156_DIP) +{ + NET_REGISTER_DEV(TTL_74156A_GATE, A) + NET_REGISTER_DEV(TTL_74156B_GATE, B) + + NET_C(A.A, B.A) + NET_C(A.B, B.B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.C, A.VCC, // C1 |1 ++ 16| VCC + A.G, B.C, // G1 |2 15| C2 + A.B, B.G, // B |3 14| G2 + A.Y3, B.A, // 1Y3 |4 74156 13| A + B.Y2, B.Y3, // 1Y2 |5 12| 2Y3 + B.Y1, B.Y2, // 1Y1 |6 11| 2Y2 + B.Y0, B.Y1, // 1Y0 |7 10| 2Y1 + A.GND, B.Y0 // GND |8 9| 2Y0 + // +--------------+ + ) +} + +//- Identifier: TTL_74157_DIP +//- Title: 54157/DM54157/DM74157 Quad 2-Line to 1-Line Data Selectors/Multiplexers +//- Pinalias: S,A1,B1,Y1,A2,B2,Y2,GND,Y3,B3,A3,Y4,B4,A4,G,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/120/236599_DS.pdf +//- +//- +---+---+---+---++---+ +//- | G | S | A | B || Y | +//- +===+===+===+===++===+ +//- | 1 | X | X | X || 0 | +//- | 0 | 0 | 0 | X || 0 | +//- | 0 | 0 | 1 | X || 1 | +//- | 0 | 1 | X | 0 || 0 | +//- | 0 | 1 | X | 1 || 1 | +//- +---+---+---+---++---+ +//- +static NETLIST_START(TTL_74157_DIP) +{ + NET_REGISTER_DEV(TTL_74157_GATE, A) + NET_REGISTER_DEV(TTL_74157_GATE, B) + NET_REGISTER_DEV(TTL_74157_GATE, C) + NET_REGISTER_DEV(TTL_74157_GATE, D) + + NET_C(A.E, B.E, C.E, D.E) + NET_C(A.S, B.S, C.S, D.S) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.S, A.VCC, // S |1 ++ 16| VCC + A.I, A.E, // A1 |2 15| G + A.J, D.I, // B1 |3 14| A4 + A.O, D.J, // Y1 |4 74157 13| B4 + B.I, D.O, // A2 |5 12| Y4 + B.J, C.I, // B2 |6 11| A3 + B.O, C.J, // Y2 |7 10| B3 + A.GND, C.O // GND |8 9| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_74161_DIP +//- Title: DM54161/DM74161 Synchronous 4-Bit Counter +//- Pinalias: CLRQ,CLK,A,B,C,D,ENP,GND,LOADQ,ENT,QD,QC,QB,QA,RC,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006551.PDF +//- +static NETLIST_START(TTL_74161_DIP) +{ + TTL_74161(A) + + DIPPINS( // +--------------+ + A.CLRQ, A.VCC, // /CLEAR |1 ++ 16| VCC + A.CLK, A.RC, // CLOCK |2 15| RC + A.A, A.QA, // A |3 14| QA + A.B, A.QB, // B |4 74161 13| QB + A.C, A.QC, // C |5 12| QC + A.D, A.QD, // D |6 11| QD + A.ENP, A.ENT, // Enable P |7 10| Enable T + A.GND, A.LOADQ // GND |8 9| /LOAD + // +--------------+ + ) +} + +//- Identifier: TTL_74163_DIP +//- Title: DM74163 Synchronous 4-Bit Counter +//- Pinalias: CLRQ,CLK,A,B,C,D,ENP,GND,LOADQ,ENT,QD,QC,QB,QA,RC,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006551.PDF +//- +static NETLIST_START(TTL_74163_DIP) +{ + TTL_74163(A) + + DIPPINS( // +--------------+ + A.CLRQ, A.VCC, // /CLEAR |1 ++ 16| VCC + A.CLK, A.RC, // CLOCK |2 15| RC + A.A, A.QA, // A |3 14| QA + A.B, A.QB, // B |4 74163 13| QB + A.C, A.QC, // C |5 12| QC + A.D, A.QD, // D |6 11| QD + A.ENP, A.ENT, // Enable P |7 10| Enable T + A.GND, A.LOADQ // GND |8 9| /LOAD + // +--------------+ + ) +} + +//- Identifier: TTL_74164_DIP +//- Title: DM74164 8-Bit Serial In/Parallel Out Shift Registers +//- Pinalias: A,B,QA,QB,QC,QD,GND,CLOCK,CLEAR,QE,QF,QG,QH,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Fairchild Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/fairchild/DM74164.pdf +//- +//- +-------+-------+---+---++----+----+-----+----+ +//- | CLEAR | CLOCK | A | B || QA | QB | ... | QH | +//- +=======+=======+===+===++====+====+=====+====+ +//- | 0 | X | X | X || 0 | 0 | ... | 0 | +//- | 1 | 0 | X | X || QA | QB | ... | QH | +//- | 1 | 0-1 | 1 | 1 || 1 | QA | ... | QG | +//- | 1 | 0-1 | 0 | X || 0 | QA | ... | QG | +//- | 1 | 0-1 | X | 0 || 0 | QA | ... | QG | +//- +-------+-------+---+---++----+----+-----+----+ +//- +static NETLIST_START(TTL_74164_DIP) +{ + TTL_74164(A) + + DIPPINS( // +--------------+ + A.A, A.VCC, // A |1 ++ 14| VCC + A.B, A.QH, // B |2 13| QH + A.QA, A.QG, // QA |3 12| QG + A.QB, A.QF, // QB |4 74164 11| QF + A.QC, A.QE, // QC |5 10| QE + A.QD, A.CLRQ, // QD |6 9| CLRQ + A.GND, A.CLK // GND |7 8| CLK + // +--------------+ + ) +} + +//- Identifier: TTL_74165_DIP +//- Title: 54165/DM74165 8-Bit Parallel-to-Serial Converter +//- Pinalias: PLQ,CP1,P4,P5,P6,P7,QQ7,GND,Q7,DS,P0,P1,P2,P3,CP2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009782.PDF +//- +//- +-----+-----+-----++----+----+----+----+----+----+----+----+ +//- | PLQ | CP1 | CP2 || Q0 | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | Q7 | +//- +=====+=====+=====++====+====+====+====+====+====+====+====+ +//- | 0 | X | X || P0 | P1 | P2 | P3 | P4 | P5 | P6 | P7 | +//- | 1 | 0 | 0-1 || DS | Q0 | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | +//- | 1 | 1 | 0-1 || Q0 | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | Q7 | +//- | 1 | 0-1 | 0 || DS | Q0 | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | +//- | 1 | 0-1 | 1 || Q0 | Q1 | Q2 | Q3 | Q4 | Q5 | Q6 | Q7 | +//- +-----+-----+-----++----+----+----+----+----+----+----+----+ +//- +static NETLIST_START(TTL_74165_DIP) +{ + TTL_74165(A) + + DIPPINS( // +--------------+ + A.SH_LDQ, A.VCC, // PLQ |1 ++ 16| VCC + A.CLK, A.CLKINH, // CP1 |2 15| CP2 + A.E, A.D, // P4 |3 14| P3 + A.F, A.C, // P5 |4 74165 13| P2 + A.G, A.B, // P6 |5 12| P1 + A.H, A.A, // P7 |6 11| P0 + A.QHQ, A.SER, // QQ7 |7 10| DS + A.GND, A.QH // GND |8 9| Q7 + // +--------------+ + ) +} + +//- Identifier: TTL_74166_DIP +//- Title: DM74LS166 8-Bit Parallel-In/Serial-Out Shift Registers +//- Pinalias: SER,A,B,C,D,CLKINH,CLK,GND,CLRQ,E,F,G,QH,H,SH/LDQ,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006400.PDF +//- +//- +------+--------+--------+-----+-----+------++----+----+-----+----+ +//- | CLRQ | SH/LDQ | CLKINH | CLK | SER | A..H || QA | QB | ... | QH | +//- +======+========+========+=====+=====+======++====+====+=====+====+ +//- | 0 | X | X | X | X | X || 0 | 0 | ... | 0 | +//- | 1 | X | 0 | 0 | X | X || QA | QB | ... | QH | +//- | 1 | 0 | 0 | 0-1 | X | a..h || a | b | ... | h | +//- | 1 | 1 | 0 | 0-1 | 1 | X || 1 | QA | ... | QG | +//- | 1 | 1 | 0 | 0-1 | 0 | X || 0 | QA | ... | QG | +//- | 1 | X | 1 | 0-1 | X | X || QA | QB | ... | QH | +//- +------+--------+--------+-----+-----+------++----+----+-----+----+ +//- +static NETLIST_START(TTL_74166_DIP) +{ + TTL_74166(A) + + DIPPINS( // +--------------+ + A.SER, A.VCC, // SER |1 ++ 16| VCC + A.A, A.SH_LDQ, // A |2 15| SH/LDQ + A.B, A.H, // B |3 14| H + A.C, A.QH, // C |4 74166 13| QH + A.D, A.G, // D |5 12| G + A.CLKINH, A.F, // CLKINH |6 11| F + A.CLK, A.E, // CLK |7 10| E + A.GND, A.CLRQ // GND |8 9| CLRQ + // +--------------+ + ) +} + +//- Identifier: TTL_74174_DIP +//- Title: DM74174 Hex/Quad D-Type Flip-Flop with Clear +//- Pinalias: CLRQ,Q1,D1,D2,Q2,D3,Q3,GND,CLK,Q4,D4,Q5,D5,Q6,D6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Fairchild Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/fairchild/DM74174.pdf +//- +//- +------+-----+---++---+ +//- | CLRQ | CLK | D || Q | +//- +======+=====+===++===+ +//- | 0 | X | X || 0 | +//- | 1 | 0-1 | 1 || 1 | +//- | 1 | 0-1 | 0 || 0 | +//- | 1 | 0 | X || Q | +//- +------+-----+---++---+ +//- +static NETLIST_START(TTL_74174_DIP) +{ + TTL_74174(A) + + DIPPINS( // +------------+ + A.CLRQ, A.VCC, // CLRQ |1 ++ 16| VCC + A.Q1, A.Q6, // Q1 |2 15| Q6 + A.D1, A.D6, // D1 |3 14| D6 + A.D2, A.D5, // D2 |4 74174 13| D5 + A.Q2, A.Q5, // Q2 |5 12| Q5 + A.D3, A.D4, // D3 |6 11| D4 + A.Q3, A.Q4, // Q3 |7 10| Q4 + A.GND, A.CLK // GND |8 9| CLK + // +------------+ + ) +} + +// FIXME: add documentation +static NETLIST_START(TTL_74175_DIP) +{ + TTL_74175(A) + + DIPPINS( // +--------------+ + A.CLRQ, A.VCC, // CLRQ |1 ++ 16| VCC + A.Q1, A.Q4, // Q1 |2 15| Q4 + A.Q1Q, A.Q4Q, // Q1Q |3 14| Q4Q + A.D1, A.D4, // D1 |4 74175 13| D4 + A.D2, A.D3, // D2 |5 12| D3 + A.Q2Q, A.Q3Q, // Q2Q |6 11| Q3Q + A.Q2, A.Q3, // Q2 |7 10| Q3 + A.GND, A.CLK // GND |8 9| CLK + // +--------------+ + ) +} + +// FIXME: add documentation +static NETLIST_START(TTL_74192_DIP) +{ + TTL_74192(A) + + DIPPINS( // +--------------+ + A.B, A.VCC, // B |1 ++ 16| VCC + A.QB, A.A, // QB |2 15| A + A.QA, A.CLEAR, // QA |3 14| CLEAR + A.CD, A.BORROWQ, // CD |4 74192 13| BORROWQ + A.CU, A.CARRYQ, // CU |5 12| CARRYQ + A.QC, A.LOADQ, // QC |6 11| LOADQ + A.QD, A.C, // QD |7 10| C + A.GND, A.D // GND |8 9| D + // +--------------+ + ) +} + +// FIXME: add documentation +static NETLIST_START(TTL_74193_DIP) +{ + TTL_74193(A) + + DIPPINS( // +--------------+ + A.B, A.VCC, // B |1 ++ 16| VCC + A.QB, A.A, // QB |2 15| A + A.QA, A.CLEAR, // QA |3 14| CLEAR + A.CD, A.BORROWQ, // CD |4 74192 13| BORROWQ + A.CU, A.CARRYQ, // CU |5 12| CARRYQ + A.QC, A.LOADQ, // QC |6 11| LOADQ + A.QD, A.C, // QD |7 10| C + A.GND, A.D // GND |8 9| D + // +--------------+ + ) +} + +// FIXME: add documentation +static NETLIST_START(TTL_74194_DIP) +{ + TTL_74194(A) + + DIPPINS( // +--------------+ + A.CLRQ, A.VCC, // CLRQ |1 ++ 16| VCC + A.SRIN, A.QA, // SRIN |2 15| QA + A.A, A.QB, // A |3 14| QB + A.B, A.QC, // B |4 74194 13| QC + A.C, A.QD, // C |5 12| QD + A.D, A.CLK, // D |6 11| CLK + A.SLIN, A.S1, // SLIN |7 10| S1 + A.GND, A.S0 // GND |8 9| S0 + // +--------------+ + ) +} + +//- Identifier: TTL_74260_DIP +//- Title: DM54LS260/DM74LS260 Dual 5-Input NOR Gate +//- Pinalias: A1,B1,C1,A2,Q1,Q2,GND,B2,C2,D2,E2,D1,E1,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009824.PDF +//- +//- +---+---+---+---+---++---+ +//- | A | B | C | D | E || Y | +//- +===+===+===+===+===++===+ +//- | 0 | 0 | 0 | 0 | 0 || 1 | +//- | X | X | X | X | 1 || 0 | +//- | X | X | X | 1 | X || 0 | +//- | X | X | 1 | X | X || 0 | +//- | X | 1 | X | X | X || 0 | +//- | 1 | X | X | X | X || 0 | +//- +---+---+---+---+---++---+ +//- +static NETLIST_START(TTL_74260_DIP) +{ + TTL_74260_NOR(A) + TTL_74260_NOR(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.C, A.VCC, // C1 |1 ++ 14| VCC + A.D, A.B, // D1 |2 13| B1 + A.E, A.A, // E1 |3 12| A1 + B.E, B.D, // E2 |4 74260 11| D2 + A.Q, B.C, // Y1 |5 10| C2 + B.Q, B.B, // Y2 |6 9| B2 + A.GND, B.A // GND |7 8| A2 + // +--------------+ + ) +} + +//- Identifier: TTL_74279_DIP +//- Title: 54279/DM74279 Quad Set-Reset Latch +//- Pinalias: 1RQ,1S1Q,1S2Q,1Q,2RQ,2SQ,2Q,GND,3Q,3RQ,3S1Q,3S2Q,4Q,4RQ,4SQ,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009785.PDF +//- +//- +-----+-----+----++---+ +//- | S1Q | S2Q | RQ || Q | +//- +=====+=====+====++===+ +//- | 0 | 0 | 0 || 1 | (as long as SQ1 or SQ2 are low) +//- | 0 | X | 1 || 1 | +//- | X | 0 | 1 || 1 | +//- | 1 | 1 | 0 || 0 | +//- | 1 | 1 | 1 || Q | +//- +-----+-----+----++---+ +//- +#ifndef __PLIB_PREPROCESSOR__ +#endif + +static NETLIST_START(TTL_74279_DIP) +{ + TTL_74279B(A) + TTL_74279A(B) + TTL_74279B(C) + TTL_74279A(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + + DIPPINS( // +--------------+ + A.R, A.VCC, // 1RQ |1 ++ 16| VCC + A.S1, D.S, // 1S1Q |2 15| 4SQ + A.S2, D.R, // 1S2Q |3 14| 4RQ + A.Q, D.Q, // 1Q |4 74279 13| 4Q + B.R, C.S2, // 2RQ |5 12| 3S2Q + B.S, C.S1, // 2SQ |6 11| 3S1Q + B.Q, C.R, // 2Q |7 10| 3RQ + A.GND, C.Q // GND |8 9| 3Q + // +--------------+ + ) +} + +// FIXME: Documentation +static NETLIST_START(TTL_74365_DIP) +{ + TTL_74365(A) + + DIPPINS( // +--------------+ + A.G1Q, A.VCC, // G1Q |1 ++ 16| VCC + A.A1, A.G2Q, // A1 |2 15| G2Q + A.Y1, A.A6, // Y1 |3 14| A6 + A.A2, A.Y6, // A2 |4 74365 13| Y6 + A.Y2, A.A5, // Y2 |5 12| A5 + A.A3, A.Y5, // A3 |6 11| Y5 + A.Y3, A.A4, // Y3 |7 10| A4 + A.GND, A.Y4 // GND |8 9| Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_74290_DIP +//- Title: SN54290/SN74290, SN54LS290/SN74LS290 Decade Counter +//- Pinalias: R91,NC,R92,QC,QB,NC,GND,QD,QA,CKA,CKB,R01,R02,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/27403/TI/SN74293.html +//- +//- BCD Count Sequence BCD Bi-Quinary +//- +-------++----+----+----+----+ +-------++----+----+----+----+ +//- | Count || QD | QC | QB | QA | | Count || QD | QC | QB | QA | +//- +=======++====+====+====+====+ +=======++====+====+====+====+ +//- | 0 || 0 | 0 | 0 | 0 | | 0 || 0 | 0 | 0 | 0 | +//- | 1 || 0 | 0 | 0 | 1 | | 1 || 0 | 0 | 0 | 1 | +//- | 2 || 0 | 0 | 1 | 0 | | 2 || 0 | 0 | 1 | 0 | +//- | 3 || 0 | 0 | 1 | 1 | | 3 || 0 | 0 | 1 | 1 | +//- | 4 || 0 | 1 | 0 | 0 | | 4 || 0 | 1 | 0 | 0 | +//- | 5 || 0 | 1 | 0 | 1 | | 5 || 1 | 0 | 0 | 0 | +//- | 6 || 0 | 1 | 1 | 0 | | 6 || 1 | 0 | 0 | 1 | +//- | 7 || 0 | 1 | 1 | 1 | | 7 || 1 | 0 | 1 | 0 | +//- | 8 || 1 | 0 | 0 | 0 | | 8 || 1 | 0 | 1 | 1 | +//- | 9 || 1 | 0 | 0 | 1 | | 9 || 1 | 1 | 0 | 0 | +//- +-------++----+----+----+----+ +-------++----+----+----+----+ +//- +//- Reset/Count Function Table +//- +-----+-----+-----+-----++----+----+----+----+ +//- | R01 | R02 | R91 | R92 || QD | QC | QB | QA | +//- +=====+=====+=====+=====++====+====+====+====+ +//- | 1 | 1 | 0 | X || 0 | 0 | 0 | 0 | +//- | 1 | 1 | X | 0 || 0 | 0 | 0 | 0 | +//- | X | X | 1 | 1 || 1 | 0 | 0 | 1 | +//- | X | 0 | X | 0 || COUNT | +//- | 0 | X | 0 | X || COUNT | +//- | 0 | X | X | 0 || COUNT | +//- | X | 0 | 0 | X || COUNT | +//- +-----+-----+-----+-----++----+----+----+----+ +//- +static NETLIST_START(TTL_74290_DIP) +{ + TTL_7490(A) + NC_PIN(NC) + + DIPPINS( // +--------------+ + A.R91, A.VCC, // R91 |1 ++ 14| VCC + NC.I, A.R2, // NC |2 13| R02 + A.R92, A.R1, // R92 |3 12| R01 + A.QC, A.B, // QC |4 74290 11| CKB + A.QB, A.A, // QB |5 10| CKA + NC.I, A.QA, // NC |6 9| QA + A.GND, A.QD // GND |7 8| QD + // +--------------+ + ) +} + +//- Identifier: TTL_74293_DIP +//- Title: SN54293/SN74293, SN54LS293/SN74LS293 Binary Counters +//- Pinalias: B,R01,R02,NC,VCC,NC,NC,QC,QB,GND,QD,QA,NC,A +//- Package: DIP +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- Limitations: Internal resistor network currently fixed to 5k +//- more limitations +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/27403/TI/SN74293.html +//- +//- Counter Sequence +//- +//- | COUNT || QD | QC | QB | QA | +//- |------:||:--:|:--:|:--:|:--:| +//- | 0 || 0 | 0 | 0 | 0 | +//- | 1 || 0 | 0 | 0 | 1 | +//- | 2 || 0 | 0 | 1 | 0 | +//- | 3 || 0 | 0 | 1 | 1 | +//- | 4 || 0 | 1 | 0 | 0 | +//- | 5 || 0 | 1 | 0 | 1 | +//- | 6 || 0 | 1 | 1 | 0 | +//- | 7 || 0 | 1 | 1 | 1 | +//- | 8 || 1 | 0 | 0 | 0 | +//- | 9 || 1 | 0 | 0 | 1 | +//- | 10 || 1 | 0 | 1 | 0 | +//- | 11 || 1 | 0 | 1 | 1 | +//- | 12 || 1 | 1 | 0 | 0 | +//- | 13 || 1 | 1 | 0 | 1 | +//- | 14 || 1 | 1 | 1 | 0 | +//- | 15 || 1 | 1 | 1 | 1 | +//- +//- Note C Output QA is connected to input B +//- +//- Reset Count Function table +//- +//- | R01 | R02 | QD | QC | QB | QA | +//- |:---:|:---:|:--:|:--:|:--:|:--:| +//- | 1 | 1 | 0 | 0 | 0 | 0 | +//- | 0 | X | COUNT |||| +//- | X | 0 | COUNT |||| +//- +//- + +static NETLIST_START(TTL_74293_DIP) +{ + TTL_7493(A) + NC_PIN(NC) + + DIPPINS( // +--------------+ + NC.I, A.VCC, // NC |1 ++ 14| VCC + NC.I, A.R2, // NC |2 13| R02 + NC.I, A.R1, // NC |3 12| R01 + A.QC, A.CLKB, // QC |4 74293 11| CKB + A.QB, A.CLKA, // QB |5 10| CKA + NC.I, A.QA, // NC |6 9| QA + A.GND, A.QD // GND |7 8| QD + // +--------------+ + ) +} + +//- Identifier: TTL_74368_DIP +//- Title: SN74368 Hex Inverting Buffers and Line Drivers With 3-State Outputs +//- Pinalias: 1G,1A1,1Y1,1A2,1Y2,1A3,1Y3,Gnd,1Y4,1A4,2Y1,2A1,2Y2,2A2,2G,Vcc +//- Package: DIP-16 +//- NamingConvention: Naming conventions follow Texas Instruments datasheet +//- FunctionTable: +//- https://www.ti.com/lit/ds/symlink/sn74hc368.pdf +//- https://www.ti.com/lit/ds/symlink/sn74ls368a.pdf +//- +//- +----+---++---+ +//- | OE | A || Y | +//- +====+===++===+ +//- | 1 | X || Z | +//- | 0 | 1 || 0 | +//- | 0 | 0 || 1 | +//- +---+----++---+ +//- +static NETLIST_START(TTL_74368_DIP) +{ + NET_REGISTER_DEV(TTL_74368_GATE, A) + NET_REGISTER_DEV(TTL_74368_GATE, B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + NET_C(A.A, B.A) + NET_C(A.B, B.B) + + DIPPINS( // +--------------+ + A.OE, A.VCC, // 1OE |1 ++ 16| VCC + A.A1, B.OE, // 1A1 |2 15| 2OE + A.Y1, B.A2, // 1Y1 |3 14| 2A2 + A.A2, B.Y2, // 1A2 |4 74368 13| 2Y2 + A.Y2, B.A1, // 1Y2 |5 12| 2A1 + A.A3, B.Y1, // 1A3 |6 11| 2Y1 + A.Y3, A.A4, // 1Y4 |7 10| 1A4 + A.GND, A.Y4 // GND |8 9| 1Y4 + // +--------------+ + ) +} + +//- Identifier: TTL_74377_DIP +//- Title: DM54LS377/DM74LS377 Octal D Flip-Flop with Common Enable and Clock +//- Pinalias: EQ,Q0,D0,D1,Q1,Q2,D2,D3,Q3,GND,CP,Q4,D4,D5,Q5,Q6,D6,D7,Q7,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009785.PDF +//- +//- +----+-----+----++----+ +//- | EQ | CP | Dn || Qn | +//- +====+=====+====++====+ +//- | 1 | X | X || Qn | +//- | 0 | 0-1 | 1 || 1 | +//- | 0 | 0-1 | 0 || 0 | +//- +----+-----+----++----+ +//- +static NETLIST_START(TTL_74377_DIP) +{ + TTL_74377_GATE(A) + TTL_74377_GATE(B) + TTL_74377_GATE(C) + TTL_74377_GATE(D) + TTL_74377_GATE(E) + TTL_74377_GATE(F) + TTL_74377_GATE(G) + TTL_74377_GATE(H) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC, G.VCC, H.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND, G.GND, H.GND) + NET_C(A.CP, B.CP, C.CP, D.CP, E.CP, F.CP, G.CP, H.CP) + NET_C(A.E, B.E, C.E, D.E, E.E, F.E, G.E, H.E) + + HINT(A.QQ, NC) + HINT(B.QQ, NC) + HINT(C.QQ, NC) + HINT(D.QQ, NC) + HINT(E.QQ, NC) + HINT(F.QQ, NC) + HINT(G.QQ, NC) + HINT(H.QQ, NC) + + DIPPINS( // +--------------+ + A.E, A.VCC, // EQ |1 ++ 20| VCC + A.Q, H.Q, // Q0 |2 19| Q7 + A.D, H.D, // D0 |3 18| D7 + B.D, G.D, // D1 |4 74377 17| D6 + B.Q, G.Q, // Q1 |5 16| Q6 + C.Q, F.Q, // Q2 |6 15| Q5 + C.D, F.D, // D2 |7 14| D5 + D.D, E.D, // D3 |8 13| D4 + D.Q, E.Q, // Q3 |9 12| Q4 + A.GND, A.CP // GND |10 11| CP + // +--------------+ + ) +} + +//- Identifier: TTL_74378_DIP +//- Title: DM54LS378/DM74LS378 Parallel D Register with Enable +//- Pinalias: EQ,Q0,D0,D1,Q1,D2,Q2,GND,CP,Q3,D3,Q4,D4,D5,Q6,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009832.PDF +//- +//- +----+-----+----++----+ +//- | EQ | CP | Dn || Qn | +//- +====+=====+====++====+ +//- | 1 | X | X || Qn | +//- | 0 | 0-1 | 1 || 1 | +//- | 0 | 0-1 | 0 || 0 | +//- +----+-----+----++----+ +//- +static NETLIST_START(TTL_74378_DIP) +{ + TTL_74377_GATE(A) + TTL_74377_GATE(B) + TTL_74377_GATE(C) + TTL_74377_GATE(D) + TTL_74377_GATE(E) + TTL_74377_GATE(F) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC, E.VCC, F.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND, E.GND, F.GND) + NET_C(A.CP, B.CP, C.CP, D.CP, E.CP, F.CP) + NET_C(A.E, B.E, C.E, D.E, E.E, F.E) + + DIPPINS( // +--------------+ + A.E, A.VCC, // EQ |1 ++ 16| VCC + A.Q, F.Q, // Q0 |2 15| Q5 + A.D, F.D, // D0 |3 14| D5 + B.D, E.D, // D1 |4 74378 13| D4 + B.Q, E.Q, // Q1 |5 12| Q4 + C.D, D.D, // D2 |6 11| D3 + C.Q, D.Q, // Q2 |7 10| Q3 + A.GND, A.CP // GND |8 9| CP + // +--------------+ + ) +} + +//- Identifier: TTL_74379_DIP +//- Title: 54LS379/DM74LS379 Quad Parallel Register with Enable +//- Pinalias: EEQ,Q0,QQ0,D0,QQ1,Q1,GND,CP,Q2,QQ2,D2,D3,QQ3,Q3,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS009832.PDF +//- +//- +----+-----+----++----+-----+ +//- | EQ | CP | Dn || Qn | QQn | +//- +====+=====+====++====+=====+ +//- | 1 | X | X || Qn | QQn | +//- | 0 | 0-1 | 1 || 1 | 0 | +//- | 0 | 0-1 | 0 || 0 | 1 | +//- +----+-----+----++----+-----+ +//- +static NETLIST_START(TTL_74379_DIP) +{ + TTL_74377_GATE(A) + TTL_74377_GATE(B) + TTL_74377_GATE(C) + TTL_74377_GATE(D) + + NET_C(A.VCC, B.VCC, C.VCC, D.VCC) + NET_C(A.GND, B.GND, C.GND, D.GND) + NET_C(A.CP, B.CP, C.CP, D.CP) + NET_C(A.E, B.E, C.E, D.E) + + DIPPINS( // +--------------+ + A.E, A.VCC, // EQ |1 ++ 16| VCC + A.Q, D.Q, // Q0 |2 15| Q3 + A.QQ, D.QQ, // QQ0 |3 14| QQ3 + A.D, D.D, // D0 |4 74379 13| D3 + B.D, C.D, // D1 |5 12| D2 + B.QQ, C.QQ, // QQ1 |6 11| QQ2 + B.Q, C.Q, // Q1 |7 10| Q2 + A.GND, A.CP // GND |8 9| CP + // +--------------+ + ) +} + +//- Identifier: TTL_74393_DIP +//- Title: Dual 4-Bit Binary Counter +//- Pinalias: 1A,1CLR,1QA,1QB,1QC,1QD,GND,2QD,2QC,2QB,2QA,2CLR,2A,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006434.PDF +//- +static NETLIST_START(TTL_74393_DIP) +{ + TTL_74393(A) + TTL_74393(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.CP, A.VCC, // 1A |1 ++ 14| VCC + A.MR, B.CP, // 1CLR |2 13| 2A + A.Q0, B.MR, // 1QA |3 12| 2CLR + A.Q1, B.Q0, // 1QB |4 74393 11| 2QA + A.Q2, B.Q1, // 1QC |5 10| 2QB + A.Q3, B.Q2, // 1QD |6 9| 2QC + A.GND, B.Q3 // GND |7 8| 2QD + // +--------------+ + ) +} + +//- Identifier: SN74LS629_DIP +//- Title: SN74LS629 VOLTAGE-CONTROLLED OSCILLATORS +//- Pinalias: 2FC,1FC,1RNG,1CX1,1CX2,1ENQ,1Y,OSC_GND,GND,2Y,2ENQ,2CX2,2CX1,2RNG,OSC_VCC,VCC +//- Package: DIP +//- Param: A.CAP +//- Capacitor value of capacitor connected to 1CX1 and 1CX2 pins +//- Param: B.CAP +//- Capacitor value of capacitor connected to 2CX1 and 2CX2 pins +//- Limitations: +//- The capacitor inputs are NC. Capacitor values need to be specified as +//- ``` +//- SN74LS629_DIP(X) +//- PARAM(X.A.CAP, CAP_U(1)) +//- PARAM(X.B.CAP, CAP_U(2)) +//- ``` +//- +//- Example: 74ls629.cpp,74ls629_example +//- +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheets/400/335051_DS.pdf +//- +static NETLIST_START(SN74LS629_DIP) +{ + SN74LS629(A, CAP_U(1)) + SN74LS629(B, CAP_U(1)) + + NET_C(A.GND, B.GND) + NET_C(A.VCC, B.VCC) + NET_C(A.OSCGND, B.OSCGND) + NET_C(A.OSCVCC, B.OSCVCC) + NC_PIN(NC) + + DIPPINS( // +--------------+ + B.FC, A.VCC, // 2FC |1 ++ 16| VCC + A.FC, A.OSCVCC, // 1FC |2 15| OSC VCC + A.RNG, B.RNG, // 1RNG |3 14| 2RNG + NC.I, NC.I, // 1CX1 |4 74LS629 13| 2CX1 + NC.I, NC.I, // 1CX2 |5 12| 2CX2 + A.ENQ, B.ENQ, // 1ENQ |6 11| 2ENQ + B.Y, B.Y, // 1Y |7 10| 2Y + A.OSCGND, A.GND // OSC GND |8 9| GND + // +--------------+ + ) +} + +//- Identifier: TTL_9310_DIP +//- Title: DM9310/DM8310 Synchronous 4-Bit Decade Counter +//- Pinalias: CLEARQ,CLOCK,A,B,C,D,ENABLEP,GND,LOADQ,ENABLET,QD,QC,QB,QA,RC,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- https://archive.org/download/bitsavers_nationaldaTTLDatabook_40452765/1976_National_TTL_Databook.pdf +//- +static NETLIST_START(TTL_9310_DIP) +{ + TTL_9310(A) + + DIPPINS( // +--------------+ + A.CLRQ, A.VCC, // /CLEAR |1 ++ 16| VCC + A.CLK, A.RC, // CLOCK |2 15| RC + A.A, A.QA, // A |3 14| QA + A.B, A.QB, // B |4 9310 13| QB + A.C, A.QC, // C |5 12| QC + A.D, A.QD, // D |6 11| QD + A.ENP, A.ENT, // Enable P |7 10| Enable T + A.GND, A.LOADQ // GND |8 9| /LOAD + // +--------------+ + ) +} + +//- Identifier: TTL_9312_DIP +//- Title: DM9312/DM8312 One of Eight Line Data Selectors/Multiplexers +//- Pinalias: D0,D1,D2,D3,D4,D5,D6,GND,D7,G,A,B,C,YQ,Y,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DM9312.pdf +//- +//- +---+---+---+---++----+-----+ +//- | C | B | A | G || Y | YQ | +//- +===+===+===+===++====+=====+ +//- | X | X | X | 1 || 0 | 1 | +//- | 0 | 0 | 0 | 0 || D0 | D0Q | +//- | 0 | 0 | 1 | 0 || D1 | D1Q | +//- | 0 | 1 | 0 | 0 || D2 | D2Q | +//- | 0 | 1 | 1 | 0 || D3 | D3Q | +//- | 1 | 0 | 0 | 0 || D4 | D4Q | +//- | 1 | 0 | 1 | 0 || D5 | D5Q | +//- | 1 | 1 | 0 | 0 || D6 | D6Q | +//- | 1 | 1 | 1 | 0 || D7 | D7Q | +//- +---+---+---+---++----+-----+ +//- +static NETLIST_START(TTL_9312_DIP) +{ + TTL_9312(A) + + DIPPINS( // +--------------+ + A.D0, A.VCC, // D0 |1 ++ 16| VCC + A.D1, A.Y, // D1 |2 15| Y + A.D2, A.YQ, // D2 |3 14| YQ + A.D3, A.C, // D3 |4 9312 13| C + A.D4, A.B, // D4 |5 12| B + A.D5, A.A, // D5 |6 11| A + A.D6, A.G, // Strobe // D6 |7 10| G + A.GND, A.D7 // GND |8 9| D7 + // +--------------+ + ) +} + +// FIXME: Documentation +static NETLIST_START(TTL_9314_DIP) +{ + TTL_9314(A) + + DIPPINS( // +--------------+ + A.EQ, A.VCC, // /E |1 ++ 16| VCC + A.S0Q, A.Q0, // /S0 |2 15| Q0 + A.D0, A.S1Q, // D0 |3 14| /S1 + A.D1, A.Q1, // D1 |4 DM9314 13| Q1 + A.S2Q, A.Q2, // /S2 |5 12| Q2 + A.D2, A.S3Q, // D2 |6 11| /S3 + A.D3, A.Q3, // D3 |7 10| Q3 + A.GND, A.MRQ // GND |8 9| /MR + // +--------------+ + ) +} + +//- Identifier: TTL_9316_DIP +//- Title: DM9316/DM8316 Synchronous 4-Bit Counters +//- Pinalias: CLEARQ,CLOCK,A,B,C,D,ENABLEP,GND,LOADQ,ENABLET,QD,QC,QB,QA,RC,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006606.PDF +//- +static NETLIST_START(TTL_9316_DIP) +{ + TTL_9316(A) + + DIPPINS( // +--------------+ + A.CLRQ, A.VCC, // CLEARQ |1 ++ 16| VCC + A.CLK, A.RC, // CLOCK |2 15| RC + A.A, A.QA, // A |3 14| QA + A.B, A.QB, // B |4 9316 13| QB + A.C, A.QC, // C |5 12| QC + A.D, A.QD, // D |6 11| QD + A.ENP, A.ENT, // Enable P |7 10| Enable T + A.GND, A.LOADQ // GND |8 9| LOADQ + // +--------------+ + ) +} + +//- Identifier: TTL_9322_DIP +//- Title: DM9322/DM8322 Quad 2-Line to 1-Line Data Selectors/Multiplexers +//- Pinalias: SELECT,A1,B1,Y1,A2,B2,Y2,GND,Y3,B3,A3,Y4,B4,A4,STROBE,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- FunctionTable: +//- http://pdf.datasheetcatalog.com/datasheet/nationalsemiconductor/DS006606.PDF +//- +static NETLIST_START(TTL_9322_DIP) +{ + TTL_9322(A) + + DIPPINS( // +--------------+ + A.SELECT, A.VCC, // SELECT |1 ++ 16| VCC + A.A1, A.STROBE, // A1 |2 15| STROBE + A.B1, A.A4, // B1 |3 14| A4 + A.Y1, A.B4, // Y1 |4 9322 13| B4 + A.A2, A.Y4, // A2 |5 12| Y4 + A.B2, A.A3, // B2 |6 11| A3 + A.Y2, A.B3, // Y2 |7 10| B3 + A.GND, A.Y3 // GND |8 9| Y3 + // +--------------+ + ) +} + +//- Identifier: TTL_9321_DIP +//- Title: DM9321/DM8321 Dual 4-Line to 1-Line Data Selectors/Multiplexers +//- Pinalias: AE,AA0,AA1,AD0,AD1,AD2,AD3,GND,BD3,BD2,BD1,BD0,BA1,BA0,BE,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow National Semiconductor datasheet +//- +static NETLIST_START(TTL_9321_DIP) +{ + TTL_9321(A) + TTL_9321(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.E, A.VCC, // /E |1 ++ 16| VCC + A.A0, B.E, // A0 |2 15| /E + A.A1, B.A0, // A1 |3 14| A0 + A.D0, B.A1, // /D0 |4 9321 13| A1 + A.D1, B.D0, // /D1 |5 12| /D0 + A.D2, B.D1, // /D2 |6 11| /D1 + A.D3, B.D2, // /D3 |7 10| /D2 + A.GND, B.D3 // GND |8 9| /D3 + // +--------------+ + ) +} + +// FIXME: Documentation +static NETLIST_START(TTL_9334_DIP) +{ + TTL_9334(A) + + DIPPINS( // +--------------+ + A.A0, A.VCC, // A0 |1 ++ 16| VCC + A.A1, A.CQ, // A1 |2 15| /C + A.A2, A.EQ, // A2 |3 14| /E + A.Q0, A.D, // Q0 |4 DM9334 13| D + A.Q1, A.Q7, // Q1 |5 12| Q7 + A.Q2, A.Q6, // Q2 |6 11| Q6 + A.Q3, A.Q5, // Q3 |7 10| Q5 + A.GND, A.Q4 // GND |8 9| Q4 + // +--------------+ + ) +} + +//- Identifier: TTL_9602_DIP +//- Title: DM9602/DM6802 Dual Retriggerable, Resettable One Shots +//- Pinalias: C1,RC1,CLRQ1,B1,A1,Q1,QQ1,GND,QQ2,Q2,A2,B2,CLRQ2,RC2,C2,VCC +//- Package: DIP +//- NamingConvention: Naming conventions follow Fairchild Semiconductor datasheet +//- Limitations: +//- Timing inaccuracies may occur for capacitances < 1nF. Please consult datasheet +//- +//- Example: 74123.cpp,74123_example +//- +//- FunctionTable: +//- https://pdf1.alldatasheet.com/datasheet-pdf/view/51137/FAIRCHILD/DM9602.html +//- +static NETLIST_START(TTL_9602_DIP) +{ + TTL_9602(A) + TTL_9602(B) + + NET_C(A.VCC, B.VCC) + NET_C(A.GND, B.GND) + + DIPPINS( // +--------------+ + A.C, A.VCC, // C1 |1 ++ 16| VCC + A.RC, B.C, // RC1 |2 15| C2 + A.CLRQ, B.RC, // CLRQ1 |3 14| RC2 + A.B, B.CLRQ, // B1 |4 9602 13| CLRQ2 + A.A, B.B, // A1 |5 12| B2 + A.Q, B.A, // Q1 |6 11| A2 + A.QQ, B.Q, // QQ1 |7 10| Q2 + A.GND, B.QQ // GND |8 9| QQ2 + // +--------------+ + ) +} + +// FIXME: Documentation and naming +static NETLIST_START(TTL_8277_DIP) +{ + TTL_8277(A) + + DIPPINS( // +--------------+ + A.RESET, A.VCC, // RESET |1 ++ 16| VCC + A.Q7QA, A.Q7QB, // /Q7A |2 15| /Q7B + A.Q7A, A.Q7B, // Q7A |3 14| Q7B + A.DSA, A.DSB, // DSA |4 8277 13| DSB + A.D1A, A.D1B, // D1A |5 12| D1B + A.D0A, A.D0B, // D0A |6 11| D0B + A.CLKA, A.CLKB, // CLKA |7 10| CLKB + A.GND, A.CLK // GND |8 9| CLK + // +--------------+ + ) +} + +// FIXME: Documentation, add model, seems to be a CMOS device +static NETLIST_START(TTL_AM2847_DIP) +{ + TTL_AM2847(A) + + DIPPINS( // +--------------+ + A.OUTA, A.VSS, // OUTA |1 ++ 16| VSS + A.RCA, A.IND, // RCA |2 15| IND + A.INA, A.RCD, // INA |3 14| RCD + A.OUTB, A.OUTD, // OUTB |4 Am2847 13| OUTD + A.RCB, A.VGG, // RCB |5 12| VGG + A.INB, A.CP, // INB |6 11| CP + A.OUTC, A.INC, // OUTC |7 10| INC + A.VDD, A.RCC // VDD |8 9| RCC + // +--------------+ + ) +} + +static TRUTH_TABLE(TTL_7400_NAND, 2, 1, "+A,+B,@VCC,@GND") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,X|1|22") + TT_LINE("X,0|1|22") + TT_LINE("1,1|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7402_NOR, 2, 1, "+A,+B,@VCC,@GND") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,0|1|22") + TT_LINE("X,1|0|15") + TT_LINE("1,X|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7404_INVERT, 1, 1, "+A,@VCC,@GND") +{ + TT_HEAD(" A | Q ") + TT_LINE(" 0 | 1 |22") + TT_LINE(" 1 | 0 |15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7406_GATE, 1, 1, "") +{ + TT_HEAD("A|Y ") + TT_LINE("0|1|15") + TT_LINE("1|0|23") + // Open Collector + TT_FAMILY("74XXOC") +} + +static TRUTH_TABLE(TTL_7407_GATE, 1, 1, "") +{ + TT_HEAD("A|Y ") + TT_LINE("0|0|15") + TT_LINE("1|1|23") + // Open Collector + TT_FAMILY("74XXOC") +} + +static TRUTH_TABLE(TTL_7408_GATE, 2, 1, "") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,X|0|15") + TT_LINE("X,0|0|15") + TT_LINE("1,1|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7408_AND, 2, 1, "+A,+B,@VCC,@GND") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,X|0|15") + TT_LINE("X,0|0|15") + TT_LINE("1,1|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7410_NAND, 3, 1, "+A,+B,+C,@VCC,@GND") +{ + TT_HEAD("A,B,C|Q ") + TT_LINE("0,X,X|1|22") + TT_LINE("X,0,X|1|22") + TT_LINE("X,X,0|1|22") + TT_LINE("1,1,1|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7410_GATE, 3, 1, "") +{ + TT_HEAD("A,B,C|Q ") + TT_LINE("0,X,X|1|22") + TT_LINE("X,0,X|1|22") + TT_LINE("X,X,0|1|22") + TT_LINE("1,1,1|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7411_AND, 3, 1, "+A,+B,+C,@VCC,@GND") +{ + TT_HEAD("A,B,C|Q ") + TT_LINE("0,X,X|0|15") + TT_LINE("X,0,X|0|15") + TT_LINE("X,X,0|0|15") + TT_LINE("1,1,1|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7411_GATE, 3, 1, "") +{ + TT_HEAD("A,B,C|Q ") + TT_LINE("0,X,X|0|15") + TT_LINE("X,0,X|0|15") + TT_LINE("X,X,0|0|15") + TT_LINE("1,1,1|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7416_GATE, 1, 1, "") +{ + TT_HEAD("A|Q") + TT_LINE("0|1|15") + TT_LINE("1|0|23") + // Open Collector + TT_FAMILY("74XXOC") +} + +static TRUTH_TABLE(TTL_7417_GATE, 1, 1, "") +{ + TT_HEAD("A|Q") + TT_LINE("0|0|15") + TT_LINE("1|1|23") + // Open Collector + TT_FAMILY("74XXOC") +} + +static TRUTH_TABLE(TTL_7420_NAND, 4, 1, "+A,+B,+C,+D,@VCC,@GND") +{ + TT_HEAD("A,B,C,D|Q ") + TT_LINE("0,X,X,X|1|22") + TT_LINE("X,0,X,X|1|22") + TT_LINE("X,X,0,X|1|22") + TT_LINE("X,X,X,0|1|22") + TT_LINE("1,1,1,1|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7421_AND, 4, 1, "+A,+B,+C,+D,@VCC,@GND") +{ + TT_HEAD("A,B,C,D|Q ") + TT_LINE("0,X,X,X|0|22") + TT_LINE("X,0,X,X|0|22") + TT_LINE("X,X,0,X|0|22") + TT_LINE("X,X,X,0|0|22") + TT_LINE("1,1,1,1|1|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7425_NOR, 4, 1, "+A,+B,+C,+D,@VCC,@GND") +{ + TT_HEAD("A,B,C,D|Q ") + TT_LINE("1,X,X,X|0|15") + TT_LINE("X,1,X,X|0|15") + TT_LINE("X,X,1,X|0|15") + TT_LINE("X,X,X,1|0|15") + TT_LINE("0,0,0,0|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7427_NOR, 3, 1, "+A,+B,+C,@VCC,@GND") +{ + TT_HEAD("A,B,C|Q ") + TT_LINE("1,X,X|0|15") + TT_LINE("X,1,X|0|15") + TT_LINE("X,X,1|0|15") + TT_LINE("0,0,0|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7430_NAND, 8, 1, "+A,+B,+C,+D,+E,+F,+G,+H,@VCC,@GND") +{ + TT_HEAD("A,B,C,D,E,F,G,H|Q ") + TT_LINE("0,X,X,X,X,X,X,X|1|22") + TT_LINE("X,0,X,X,X,X,X,X|1|22") + TT_LINE("X,X,0,X,X,X,X,X|1|22") + TT_LINE("X,X,X,0,X,X,X,X|1|22") + TT_LINE("X,X,X,X,0,X,X,X|1|22") + TT_LINE("X,X,X,X,X,0,X,X|1|22") + TT_LINE("X,X,X,X,X,X,0,X|1|22") + TT_LINE("X,X,X,X,X,X,X,0|1|22") + TT_LINE("1,1,1,1,1,1,1,1|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7432_OR, 2, 1, "+A,+B,@VCC,@GND") +{ + TT_HEAD("A,B|Q ") + TT_LINE("1,X|1|22") + TT_LINE("X,1|1|22") + TT_LINE("0,0|0|15") + TT_FAMILY("74XX") +} + +/* FIXME: Same as 7400, but drains higher output currents. + * Netlist currently does not model over currents (should it ever?) + */ + +static TRUTH_TABLE(TTL_7437_NAND, 2, 1, "+A,+B") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,X|1|22") + TT_LINE("X,0|1|22") + TT_LINE("1,1|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_7438_NAND, 2, 1, "+A,+B") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,X|1|22") + TT_LINE("X,0|1|22") + TT_LINE("1,1|0|15") + // Open Collector + TT_FAMILY("74XXOC") +} + +static TRUTH_TABLE(TTL_7442, 4, 10, "") +{ + TT_HEAD("D,C,B,A|0,1,2,3,4,5,6,7,8,9") + TT_LINE("0,0,0,0|0,1,1,1,1,1,1,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("0,0,0,1|1,0,1,1,1,1,1,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("0,0,1,0|1,1,0,1,1,1,1,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("0,0,1,1|1,1,1,0,1,1,1,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("0,1,0,0|1,1,1,1,0,1,1,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("0,1,0,1|1,1,1,1,1,0,1,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("0,1,1,0|1,1,1,1,1,1,0,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("0,1,1,1|1,1,1,1,1,1,1,0,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("1,0,0,0|1,1,1,1,1,1,1,1,0,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("1,0,0,1|1,1,1,1,1,1,1,1,1,0|30,30,30,30,30,30,30,30,30,30") + TT_LINE("1,0,1,X|1,1,1,1,1,1,1,1,1,1|30,30,30,30,30,30,30,30,30,30") + TT_LINE("1,1,X,X|1,1,1,1,1,1,1,1,1,1|30,30,30,30,30,30,30,30,30,30") +} + +static TRUTH_TABLE(TTL_7486_XOR, 2, 1, "+A,+B,@VCC,@GND") +{ + TT_HEAD("A,B|Q ") + TT_LINE("0,0|0|15") + TT_LINE("0,1|1|22") + TT_LINE("1,0|1|22") + TT_LINE("1,1|0|15") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74139_GATE, 3, 4, "") +{ + TT_HEAD("E,A,B|O0,O1,O2,O3") + TT_LINE("1,X,X|1,1,1,1|14") + TT_LINE("0,0,0|0,1,1,1|14") + TT_LINE("0,0,1|1,0,1,1|14") + TT_LINE("0,1,0|1,1,0,1|14") + TT_LINE("0,1,1|1,1,1,0|14") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74147_GATE, 9, 4, "") +{ + TT_HEAD("1,2,3,4,5,6,7,8,9|D,C,B,A") + TT_LINE("1,1,1,1,1,1,1,1,1|1,1,1,1|10") + TT_LINE("X,X,X,X,X,X,X,X,0|0,1,1,0|10") + TT_LINE("X,X,X,X,X,X,X,0,1|0,1,1,1|10") + TT_LINE("X,X,X,X,X,X,0,1,1|1,0,0,0|10") + TT_LINE("X,X,X,X,X,0,1,1,1|1,0,0,1|10") + TT_LINE("X,X,X,X,0,1,1,1,1|1,0,1,0|10") + TT_LINE("X,X,X,0,1,1,1,1,1|1,0,1,1|10") + TT_LINE("X,X,0,1,1,1,1,1,1|1,1,0,0|10") + TT_LINE("X,0,1,1,1,1,1,1,1|1,1,0,1|10") + TT_LINE("0,1,1,1,1,1,1,1,1|1,1,1,0|10") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74148_GATE, 9, 5, "") +{ + TT_HEAD("EI,0,1,2,3,4,5,6,7|A2,A1,A0,GS,EO") + TT_LINE( "1,X,X,X,X,X,X,X,X|1,1,1,1,1|10") + TT_LINE( "0,1,1,1,1,1,1,1,1|1,1,1,1,0|10") + TT_LINE( "0,X,X,X,X,X,X,X,0|0,0,0,0,1|10") + TT_LINE( "0,X,X,X,X,X,X,0,1|0,0,1,0,1|10") + TT_LINE( "0,X,X,X,X,X,0,1,1|0,1,0,0,1|10") + TT_LINE( "0,X,X,X,X,0,1,1,1|0,1,1,0,1|10") + TT_LINE( "0,X,X,X,0,1,1,1,1|1,0,0,0,1|10") + TT_LINE( "0,X,X,0,1,1,1,1,1|1,0,1,0,1|10") + TT_LINE( "0,X,0,1,1,1,1,1,1|1,1,0,0,1|10") + TT_LINE( "0,0,1,1,1,1,1,1,1|1,1,1,0,1|10") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74151_GATE, 12, 2, "") +{ + TT_HEAD("C,B,A,G,D0,D1,D2,D3,D4,D5,D6,D7|Y,W") + TT_LINE( "X,X,X,1,X,X,X,X,X,X,X,X|0,1|12,10") + TT_LINE( "0,0,0,0,1,X,X,X,X,X,X,X|1,0|12,10") + TT_LINE( "0,0,0,0,0,X,X,X,X,X,X,X|0,1|12,10") + TT_LINE( "0,0,1,0,X,1,X,X,X,X,X,X|1,0|12,10") + TT_LINE( "0,0,1,0,X,0,X,X,X,X,X,X|0,1|12,10") + TT_LINE( "0,1,0,0,X,X,1,X,X,X,X,X|1,0|12,10") + TT_LINE( "0,1,0,0,X,X,0,X,X,X,X,X|0,1|12,10") + TT_LINE( "0,1,1,0,X,X,X,1,X,X,X,X|1,0|12,10") + TT_LINE( "0,1,1,0,X,X,X,0,X,X,X,X|0,1|12,10") + TT_LINE( "1,0,0,0,X,X,X,X,1,X,X,X|1,0|12,10") + TT_LINE( "1,0,0,0,X,X,X,X,0,X,X,X|0,1|12,10") + TT_LINE( "1,0,1,0,X,X,X,X,X,1,X,X|1,0|12,10") + TT_LINE( "1,0,1,0,X,X,X,X,X,0,X,X|0,1|12,10") + TT_LINE( "1,1,0,0,X,X,X,X,X,X,1,X|1,0|12,10") + TT_LINE( "1,1,0,0,X,X,X,X,X,X,0,X|0,1|12,10") + TT_LINE( "1,1,1,0,X,X,X,X,X,X,X,1|1,0|12,10") + TT_LINE( "1,1,1,0,X,X,X,X,X,X,X,0|0,1|12,10") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74155A_GATE, 4, 4, "") +{ + TT_HEAD("B,A,G,C|Y0,Y1,Y2,Y3") + TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") + TT_LINE("X,X,0,0|1,1,1,1|13,13,13,13") + TT_LINE("0,0,0,1|0,1,1,1|13,13,13,13") + TT_LINE("0,1,0,1|1,0,1,1|13,13,13,13") + TT_LINE("1,0,0,1|1,1,0,1|13,13,13,13") + TT_LINE("1,1,0,1|1,1,1,0|13,13,13,13") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74155B_GATE, 4, 4, "") +{ + TT_HEAD("B,A,G,C|Y0,Y1,Y2,Y3") + TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") + TT_LINE("X,X,0,1|1,1,1,1|13,13,13,13") + TT_LINE("0,0,0,0|0,1,1,1|13,13,13,13") + TT_LINE("0,1,0,0|1,0,1,1|13,13,13,13") + TT_LINE("1,0,0,0|1,1,0,1|13,13,13,13") + TT_LINE("1,1,0,0|1,1,1,0|13,13,13,13") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74156A_GATE, 4, 4, "") +{ + TT_HEAD("B,A,G,C|Y0,Y1,Y2,Y3") + TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") + TT_LINE("X,X,0,0|1,1,1,1|13,13,13,13") + TT_LINE("0,0,0,1|0,1,1,1|13,13,13,13") + TT_LINE("0,1,0,1|1,0,1,1|13,13,13,13") + TT_LINE("1,0,0,1|1,1,0,1|13,13,13,13") + TT_LINE("1,1,0,1|1,1,1,0|13,13,13,13") + // Open Collector + TT_FAMILY("74XXOC") +} + +static TRUTH_TABLE(TTL_74156B_GATE, 4, 4, "") +{ + TT_HEAD("B,A,G,C|Y0,Y1,Y2,Y3") + TT_LINE("X,X,1,X|1,1,1,1|13,13,13,13") + TT_LINE("X,X,0,1|1,1,1,1|13,13,13,13") + TT_LINE("0,0,0,0|0,1,1,1|13,13,13,13") + TT_LINE("0,1,0,0|1,0,1,1|13,13,13,13") + TT_LINE("1,0,0,0|1,1,0,1|13,13,13,13") + TT_LINE("1,1,0,0|1,1,1,0|13,13,13,13") + // Open Collector + TT_FAMILY("74XXOC") +} + +static TRUTH_TABLE(TTL_74157_GATE, 4, 1, "") +{ + TT_HEAD("E,S,I,J|O") + TT_LINE("1,X,X,X|0|14") + TT_LINE("0,1,X,0|0|14") + TT_LINE("0,1,X,1|1|14") + TT_LINE("0,0,0,X|0|14") + TT_LINE("0,0,1,X|1|14") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74260_NOR, 5, 1, "+A,+B,+C,+D,+E,@VCC,@GND") +{ + TT_HEAD("A,B,C,D,E|Q") + TT_LINE("0,0,0,0,0|1|10") + TT_LINE("X,X,X,X,1|0|12") + TT_LINE("X,X,X,1,X|0|12") + TT_LINE("X,X,1,X,X|0|12") + TT_LINE("X,1,X,X,X|0|12") + TT_LINE("1,X,X,X,X|0|12") + TT_FAMILY("74XX") +} + +// FIXME: We need "private" devices +static TRUTH_TABLE(TTL_74279A, 3, 1, "") +{ + TT_HEAD("S,R,_Q|Q") + TT_LINE("0,X,X|1|22") + TT_LINE("1,0,X|0|27") + TT_LINE("1,1,0|0|27") + TT_LINE("1,1,1|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74279B, 4, 1, "") +{ + TT_HEAD("S1,S2,R,_Q|Q") + TT_LINE("0,X,X,X|1|22") + TT_LINE("X,0,X,X|1|22") + TT_LINE("1,1,0,X|0|27") + TT_LINE("1,1,1,0|0|27") + TT_LINE("1,1,1,1|1|22") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_74368_GATE, 5, 4, "") +{ + TT_HEAD("OE,A1,A2,A3,A4|Y1,Y2,Y3,Y4") + TT_LINE("1,X,X,X,X|0,0,0,0|12") + TT_LINE("0,0,0,0,0|1,1,1,1|12") + TT_LINE("0,0,0,0,1|1,1,1,0|12") + TT_LINE("0,0,0,1,0|1,1,0,1|12") + TT_LINE("0,0,0,1,1|1,1,0,0|12") + TT_LINE("0,0,1,0,0|1,0,1,1|12") + TT_LINE("0,0,1,0,1|1,0,1,0|12") + TT_LINE("0,0,1,1,0|1,0,0,1|12") + TT_LINE("0,0,1,1,1|1,0,0,0|12") + TT_LINE("0,1,0,0,0|0,1,1,1|12") + TT_LINE("0,1,0,0,1|0,1,1,0|12") + TT_LINE("0,1,0,1,0|0,1,0,1|12") + TT_LINE("0,1,0,1,1|0,1,0,0|12") + TT_LINE("0,1,1,0,0|0,0,1,1|12") + TT_LINE("0,1,1,0,1|0,0,1,0|12") + TT_LINE("0,1,1,1,0|0,0,0,1|12") + TT_LINE("0,1,1,1,1|0,0,0,0|12") + TT_FAMILY("74XX") +} + +static TRUTH_TABLE(TTL_9312, 12, 2, + "+A,+B,+C,+G,+D0,+D1,+D2,+D3,+D4,+D5,+D6,+D7,@VCC,@GND") +{ + TT_HEAD(" C, B, A, G,D0,D1,D2,D3,D4,D5,D6,D7| Y,YQ") + TT_LINE(" X, X, X, 1, X, X, X, X, X, X, X, X| 0, 1|33,19") + TT_LINE(" 0, 0, 0, 0, 0, X, X, X, X, X, X, X| 0, 1|33,28") + TT_LINE(" 0, 0, 0, 0, 1, X, X, X, X, X, X, X| 1, 0|33,28") + TT_LINE(" 0, 0, 1, 0, X, 0, X, X, X, X, X, X| 0, 1|33,28") + TT_LINE(" 0, 0, 1, 0, X, 1, X, X, X, X, X, X| 1, 0|33,28") + TT_LINE(" 0, 1, 0, 0, X, X, 0, X, X, X, X, X| 0, 1|33,28") + TT_LINE(" 0, 1, 0, 0, X, X, 1, X, X, X, X, X| 1, 0|33,28") + TT_LINE(" 0, 1, 1, 0, X, X, X, 0, X, X, X, X| 0, 1|33,28") + TT_LINE(" 0, 1, 1, 0, X, X, X, 1, X, X, X, X| 1, 0|33,28") + TT_LINE(" 1, 0, 0, 0, X, X, X, X, 0, X, X, X| 0, 1|33,28") + TT_LINE(" 1, 0, 0, 0, X, X, X, X, 1, X, X, X| 1, 0|33,28") + TT_LINE(" 1, 0, 1, 0, X, X, X, X, X, 0, X, X| 0, 1|33,28") + TT_LINE(" 1, 0, 1, 0, X, X, X, X, X, 1, X, X| 1, 0|33,28") + TT_LINE(" 1, 1, 0, 0, X, X, X, X, X, X, 0, X| 0, 1|33,28") + TT_LINE(" 1, 1, 0, 0, X, X, X, X, X, X, 1, X| 1, 0|33,28") + TT_LINE(" 1, 1, 1, 0, X, X, X, X, X, X, X, 0| 0, 1|33,28") + TT_LINE(" 1, 1, 1, 0, X, X, X, X, X, X, X, 1| 1, 0|33,28") + TT_FAMILY("74XX") +} + +NETLIST_START(ttl74xx_lib) +{ + NET_MODEL( + "DM7414 SCHMITT_TRIGGER(VTP=1.7 VTM=0.9 VI=4.35 RI=6.15k VOH=3.5 ROH=120 VOL=0.1 ROL=37.5 TPLH=15 TPHL=15)") + NET_MODEL( + "TTL_7414_GATE SCHMITT_TRIGGER(VTP=1.7 VTM=0.9 VI=4.35 RI=6.15k VOH=3.5 ROH=120 VOL=0.1 ROL=37.5 TPLH=15 TPHL=15)") + NET_MODEL( + "DM74LS14 SCHMITT_TRIGGER(VTP=1.6 VTM=0.8 VI=4.4 RI=19.3k VOH=3.45 ROH=130 VOL=0.1 ROL=31.2 TPLH=15 TPHL=15)") + // NET_MODEL("DM7414 FAMILY(IVL=0.16 IVH=0.4 OVL=0.1 OVH=0.05 ORL=10.0 + // ORH=1.0e8)") + + TRUTHTABLE_ENTRY(TTL_7400_NAND) + TRUTHTABLE_ENTRY(TTL_7402_NOR) + TRUTHTABLE_ENTRY(TTL_7404_INVERT) + TRUTHTABLE_ENTRY(TTL_7406_GATE) + TRUTHTABLE_ENTRY(TTL_7407_GATE) + TRUTHTABLE_ENTRY(TTL_7408_GATE) + TRUTHTABLE_ENTRY(TTL_7408_AND) + TRUTHTABLE_ENTRY(TTL_7410_NAND) + TRUTHTABLE_ENTRY(TTL_7410_GATE) + TRUTHTABLE_ENTRY(TTL_7411_AND) + TRUTHTABLE_ENTRY(TTL_7411_GATE) + TRUTHTABLE_ENTRY(TTL_7416_GATE) + TRUTHTABLE_ENTRY(TTL_7417_GATE) + TRUTHTABLE_ENTRY(TTL_7420_NAND) + TRUTHTABLE_ENTRY(TTL_7421_AND) + TRUTHTABLE_ENTRY(TTL_7425_NOR) + TRUTHTABLE_ENTRY(TTL_7427_NOR) + TRUTHTABLE_ENTRY(TTL_7430_NAND) + TRUTHTABLE_ENTRY(TTL_7432_OR) + TRUTHTABLE_ENTRY(TTL_7437_NAND) + TRUTHTABLE_ENTRY(TTL_7438_NAND) + TRUTHTABLE_ENTRY(TTL_7442) + TRUTHTABLE_ENTRY(TTL_7486_XOR) + TRUTHTABLE_ENTRY(TTL_74139_GATE) + TRUTHTABLE_ENTRY(TTL_74147_GATE) + TRUTHTABLE_ENTRY(TTL_74148_GATE) + TRUTHTABLE_ENTRY(TTL_74151_GATE) + TRUTHTABLE_ENTRY(TTL_74155A_GATE) + TRUTHTABLE_ENTRY(TTL_74155B_GATE) + TRUTHTABLE_ENTRY(TTL_74156A_GATE) + TRUTHTABLE_ENTRY(TTL_74156B_GATE) + TRUTHTABLE_ENTRY(TTL_74157_GATE) + TRUTHTABLE_ENTRY(TTL_74260_NOR) + TRUTHTABLE_ENTRY(TTL_74279A) + TRUTHTABLE_ENTRY(TTL_74279B) + TRUTHTABLE_ENTRY(TTL_74368_GATE) + TRUTHTABLE_ENTRY(TTL_9312) + + LOCAL_LIB_ENTRY(TTL_7400_DIP) + LOCAL_LIB_ENTRY(TTL_7402_DIP) + LOCAL_LIB_ENTRY(TTL_7404_DIP) + LOCAL_LIB_ENTRY(TTL_7406_DIP) + LOCAL_LIB_ENTRY(TTL_7407_DIP) + LOCAL_LIB_ENTRY(TTL_7408_DIP) + LOCAL_LIB_ENTRY(TTL_7410_DIP) + LOCAL_LIB_ENTRY(TTL_7411_DIP) + LOCAL_LIB_ENTRY(TTL_7414_GATE) + LOCAL_LIB_ENTRY(TTL_74LS14_GATE) + LOCAL_LIB_ENTRY(TTL_7414_DIP) + LOCAL_LIB_ENTRY(TTL_74LS14_DIP) + LOCAL_LIB_ENTRY(TTL_7416_DIP) + LOCAL_LIB_ENTRY(TTL_7417_DIP) + LOCAL_LIB_ENTRY(TTL_7420_DIP) + LOCAL_LIB_ENTRY(TTL_7421_DIP) + LOCAL_LIB_ENTRY(TTL_7425_DIP) + LOCAL_LIB_ENTRY(TTL_7427_DIP) + LOCAL_LIB_ENTRY(TTL_7430_DIP) + LOCAL_LIB_ENTRY(TTL_7432_DIP) + LOCAL_LIB_ENTRY(TTL_7437_DIP) + LOCAL_LIB_ENTRY(TTL_7438_DIP) + LOCAL_LIB_ENTRY(TTL_7442_DIP) + LOCAL_LIB_ENTRY(TTL_7448_DIP) + LOCAL_LIB_ENTRY(TTL_7450_DIP) + LOCAL_LIB_ENTRY(TTL_7473_DIP) + LOCAL_LIB_ENTRY(TTL_7473A_DIP) + LOCAL_LIB_ENTRY(TTL_7474_DIP) + LOCAL_LIB_ENTRY(TTL_7475_DIP) + LOCAL_LIB_ENTRY(TTL_7477_DIP) + LOCAL_LIB_ENTRY(TTL_7483_DIP) + LOCAL_LIB_ENTRY(TTL_7485_DIP) + LOCAL_LIB_ENTRY(TTL_7486_DIP) + LOCAL_LIB_ENTRY(TTL_7490_DIP) + LOCAL_LIB_ENTRY(TTL_7492_DIP) + LOCAL_LIB_ENTRY(TTL_7493_DIP) + LOCAL_LIB_ENTRY(TTL_7497_DIP) + LOCAL_LIB_ENTRY(TTL_74107_DIP) + LOCAL_LIB_ENTRY(TTL_74107A_DIP) + LOCAL_LIB_ENTRY(TTL_74113_DIP) + LOCAL_LIB_ENTRY(TTL_74113A_DIP) + LOCAL_LIB_ENTRY(TTL_74121_DIP) + LOCAL_LIB_ENTRY(TTL_74123_DIP) + LOCAL_LIB_ENTRY(TTL_9602_DIP) + LOCAL_LIB_ENTRY(TTL_74125_DIP) + LOCAL_LIB_ENTRY(TTL_74126_DIP) + LOCAL_LIB_ENTRY(TTL_74139_DIP) + LOCAL_LIB_ENTRY(TTL_74147_DIP) + LOCAL_LIB_ENTRY(TTL_74148_DIP) + LOCAL_LIB_ENTRY(TTL_74151_DIP) + LOCAL_LIB_ENTRY(TTL_74153_DIP) + LOCAL_LIB_ENTRY(TTL_74155_DIP) + LOCAL_LIB_ENTRY(TTL_74156_DIP) + LOCAL_LIB_ENTRY(TTL_74157_DIP) + LOCAL_LIB_ENTRY(TTL_74161_DIP) + LOCAL_LIB_ENTRY(TTL_74163_DIP) + LOCAL_LIB_ENTRY(TTL_74164_DIP) + LOCAL_LIB_ENTRY(TTL_74165_DIP) + LOCAL_LIB_ENTRY(TTL_74166_DIP) + LOCAL_LIB_ENTRY(TTL_74174_DIP) + LOCAL_LIB_ENTRY(TTL_74175_DIP) + LOCAL_LIB_ENTRY(TTL_74192_DIP) + LOCAL_LIB_ENTRY(TTL_74193_DIP) + LOCAL_LIB_ENTRY(TTL_74194_DIP) + LOCAL_LIB_ENTRY(TTL_74260_DIP) + LOCAL_LIB_ENTRY(TTL_74279_DIP) + LOCAL_LIB_ENTRY(TTL_74290_DIP) + LOCAL_LIB_ENTRY(TTL_74293_DIP) + LOCAL_LIB_ENTRY(TTL_74365_DIP) + LOCAL_LIB_ENTRY(TTL_74368_DIP) + LOCAL_LIB_ENTRY(TTL_74377_DIP) + LOCAL_LIB_ENTRY(TTL_74378_DIP) + LOCAL_LIB_ENTRY(TTL_74379_DIP) + LOCAL_LIB_ENTRY(TTL_74393_DIP) + LOCAL_LIB_ENTRY(SN74LS629_DIP) + LOCAL_LIB_ENTRY(TTL_9310_DIP) + LOCAL_LIB_ENTRY(TTL_9312_DIP) + LOCAL_LIB_ENTRY(TTL_9314_DIP) + LOCAL_LIB_ENTRY(TTL_9316_DIP) + LOCAL_LIB_ENTRY(TTL_9321_DIP) + LOCAL_LIB_ENTRY(TTL_9322_DIP) + LOCAL_LIB_ENTRY(TTL_9334_DIP) + LOCAL_LIB_ENTRY(TTL_8277_DIP) + LOCAL_LIB_ENTRY(TTL_AM2847_DIP) +} diff --git a/src/lib/netlist/netlist.cppcheck b/src/lib/netlist/netlist.cppcheck new file mode 100644 index 00000000000..642815cb052 --- /dev/null +++ b/src/lib/netlist/netlist.cppcheck @@ -0,0 +1,26 @@ +<?xml version="1.0" encoding="UTF-8"?> +<project version="1"> + <platform>Native</platform> + <analyze-all-vs-configs>false</analyze-all-vs-configs> + <check-headers>true</check-headers> + <check-unused-templates>false</check-unused-templates> + <max-ctu-depth>10</max-ctu-depth> + <includedir> + <dir name="plib/"/> + <dir name="../"/> + </includedir> + <paths> + <dir name="/mnt/mfhome/andre/mame/mamegit/src/lib/netlist"/> + </paths> + <libraries> + <library>bsd</library> + <library>cppcheck-lib</library> + <library>gnu</library> + <library>posix</library> + <library>zlib</library> + </libraries> + <addons> + <addon>threadsafety</addon> + <addon>cert</addon> + </addons> +</project> diff --git a/src/lib/netlist/nl_base.cpp b/src/lib/netlist/nl_base.cpp index 851c7b8059f..ddb4f1bca6a 100644 --- a/src/lib/netlist/nl_base.cpp +++ b/src/lib/netlist/nl_base.cpp @@ -1,1083 +1,1199 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nlbase.c - * - */ + +#include "nl_errstr.h" + +#include "core/devices.h" +#include "core/logic.h" +#include "core/setup.h" + +#include "devices/nlid_proxy.h" #include "solver/nld_matrix_solver.h" #include "solver/nld_solver.h" #include "plib/palloc.h" +#include "plib/pdynlib.h" +#include "plib/pfmtlog.h" #include "plib/pmempool.h" #include "plib/putil.h" -#include "devices/nlid_proxy.h" -#include "devices/nlid_system.h" -#include "macro/nlm_base.h" -#include "nl_base.h" - -#include "nl_errstr.h" - -#include <cmath> -//#include <cstring> #include <limits> -namespace netlist -{ - -// ---------------------------------------------------------------------------------------- -// logic_family_ttl_t -// ---------------------------------------------------------------------------------------- - -// NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init, modernize-use-equals-default) -logic_family_desc_t::logic_family_desc_t() -{ -} - -class logic_family_ttl_t : public logic_family_desc_t -{ -public: - logic_family_ttl_t() : logic_family_desc_t() - { - m_fixed_V = 5.0; - m_low_thresh_PCNT = 0.8 / 5.0; - m_high_thresh_PCNT = 2.0 / 5.0; - // m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications. - m_low_VO = 0.1; - m_high_VO = 1.0; // 4.0 - m_R_low = 1.0; - m_R_high = 130.0; - } - pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const override; - pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override; -}; - -pool_owned_ptr<devices::nld_base_d_to_a_proxy> logic_family_ttl_t::create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const -{ - return pool().make_poolptr<devices::nld_d_to_a_proxy>(anetlist, name, proxied); -} -pool_owned_ptr<devices::nld_base_a_to_d_proxy> logic_family_ttl_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const -{ - return pool().make_poolptr<devices::nld_a_to_d_proxy>(anetlist, name, proxied); -} - -class logic_family_cd4xxx_t : public logic_family_desc_t -{ -public: - logic_family_cd4xxx_t() : logic_family_desc_t() - { - m_fixed_V = 0.0; - m_low_thresh_PCNT = 1.5 / 5.0; - m_high_thresh_PCNT = 3.5 / 5.0; - // m_low_V - these depend on sinked/sourced current. Values should be suitable for typical applications. - m_low_VO = 0.05; - m_high_VO = 0.05; // 4.95 - m_R_low = 10.0; - m_R_high = 10.0; - } - pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const override; - pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override; -}; - -pool_owned_ptr<devices::nld_base_d_to_a_proxy> logic_family_cd4xxx_t::create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, logic_output_t *proxied) const -{ - return pool().make_poolptr<devices::nld_d_to_a_proxy>(anetlist, name, proxied); -} - -pool_owned_ptr<devices::nld_base_a_to_d_proxy> logic_family_cd4xxx_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const -{ - return pool().make_poolptr<devices::nld_a_to_d_proxy>(anetlist, name, proxied); -} +NETLIST_EXTERNAL(base_lib) -const logic_family_desc_t *family_TTL() -{ - static logic_family_ttl_t obj; - return &obj; -} -const logic_family_desc_t *family_CD4XXX() +namespace netlist { - static logic_family_cd4xxx_t obj; - return &obj; -} + // ------------------------------------------------------------------------- + // detail::core_terminal_t + // ------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------- -// queue_t -// ---------------------------------------------------------------------------------------- + detail::terminal_type detail::core_terminal_t::type() const noexcept(false) + { + if (plib::dynamic_downcast<const terminal_t *>(this)) + return terminal_type::TERMINAL; + if (plib::dynamic_downcast<const logic_input_t *>(this) + || plib::dynamic_downcast<const analog_input_t *>(this)) + return terminal_type::INPUT; + if (plib::dynamic_downcast<const logic_output_t *>(this) + || plib::dynamic_downcast<const analog_output_t *>(this)) + return terminal_type::OUTPUT; -detail::queue_t::queue_t(netlist_state_t &nl) - : timed_queue<pqentry_t<net_t *, netlist_time>, false, true>(512) - , netlist_ref(nl) - , m_qsize(0) - , m_times(512) - , m_net_ids(512) -{ -} + state().log().fatal(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); + throw nl_exception(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); + // return terminal_type::TERMINAL; // please compiler + } -void detail::queue_t::register_state(plib::state_manager_t &manager, const pstring &module) -{ - //state().log().debug("register_state\n"); - manager.save_item(this, m_qsize, module + "." + "qsize"); - manager.save_item(this, &m_times[0], module + "." + "times", m_times.size()); - manager.save_item(this, &m_net_ids[0], module + "." + "names", m_net_ids.size()); -} + // ------------------------------------------------------------------------- + // detail::device_object_t + // ------------------------------------------------------------------------- -void detail::queue_t::on_pre_save(plib::state_manager_t &manager) -{ - plib::unused_var(manager); - m_qsize = this->size(); - for (std::size_t i = 0; i < m_qsize; i++ ) + detail::device_object_t::device_object_t(core_device_t *dev, + const pstring &aname) + : object_t(aname) + , m_device(dev) { - m_times[i] = this->listptr()[i].m_exec_time.as_raw(); - m_net_ids[i] = state().find_net_id(this->listptr()[i].m_object); } -} - -void detail::queue_t::on_post_load(plib::state_manager_t &manager) -{ - plib::unused_var(manager); - this->clear(); - for (std::size_t i = 0; i < m_qsize; i++ ) + netlist_state_t &detail::device_object_t::state() noexcept { - detail::net_t *n = state().nets()[m_net_ids[i]].get(); - this->push(queue_t::entry_t(netlist_time::from_raw(m_times[i]),n)); + return m_device->state(); } -} - -// ---------------------------------------------------------------------------------------- -// netlist_ref_t -// ---------------------------------------------------------------------------------------- -detail::netlist_ref::netlist_ref(netlist_state_t &nl) -: m_netlist(nl.exec()) { } + const netlist_state_t &detail::device_object_t::state() const noexcept + { + return m_device->state(); + } -// ---------------------------------------------------------------------------------------- -// device_object_t -// ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // detail::netlist_object_t + // ------------------------------------------------------------------------- -detail::device_object_t::device_object_t(core_device_t &dev, const pstring &aname) -: object_t(aname) -, m_device(dev) -{ -} + netlist_state_t &detail::netlist_object_t::state() noexcept + { + return m_netlist.nl_state(); + } -detail::terminal_type detail::core_terminal_t::type() const -{ - if (dynamic_cast<const terminal_t *>(this) != nullptr) - return terminal_type::TERMINAL; - else if (dynamic_cast<const logic_input_t *>(this) != nullptr) - return terminal_type::INPUT; - else if (dynamic_cast<const logic_output_t *>(this) != nullptr) - return terminal_type::OUTPUT; - else if (dynamic_cast<const analog_input_t *>(this) != nullptr) - return terminal_type::INPUT; - else if (dynamic_cast<const analog_output_t *>(this) != nullptr) - return terminal_type::OUTPUT; - else + const netlist_state_t &detail::netlist_object_t::state() const noexcept { - state().log().fatal(MF_UNKNOWN_TYPE_FOR_OBJECT(name())); - return terminal_type::TERMINAL; // please compiler + return m_netlist.nl_state(); } -} -// ---------------------------------------------------------------------------------------- -// netlist_t -// ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // netlist_t + // ------------------------------------------------------------------------- -netlist_t::netlist_t(const pstring &aname, plib::unique_ptr<callbacks_t> callbacks) - : m_state(plib::make_unique<netlist_state_t>(aname, *this, std::move(callbacks))) + netlist_t::netlist_t(netlist_state_t &state, const pstring &aname) + : m_state(state) , m_solver(nullptr) - , m_time(netlist_time::zero()) - , m_mainclock(nullptr) - , m_queue(*m_state) - , m_stats(false) -{ - devices::initialize_factory(nlstate().setup().factory()); - NETLIST_NAME(base)(nlstate().setup()); - run_state_manager().save_item(this, static_cast<plib::state_manager_t::callback_t &>(m_queue), "m_queue"); - run_state_manager().save_item(this, m_time, "m_time"); -} - -// ---------------------------------------------------------------------------------------- -// netlist_t -// ---------------------------------------------------------------------------------------- - -netlist_state_t::netlist_state_t(const pstring &aname, - netlist_t & anetlist, - plib::unique_ptr<callbacks_t> &&callbacks) -: m_name(aname) -, m_netlist(anetlist) -, m_state() -, m_callbacks(std::move(callbacks)) // Order is important here -, m_log(*m_callbacks) -, m_setup(plib::make_unique<setup_t>(*this)) -{ - pstring libpath = plib::util::environment("NL_BOOSTLIB", plib::util::buildpath({".", "nlboost.so"})); - m_lib = plib::make_unique<plib::dynlib>(libpath); -} - - -void netlist_t::stop() -{ - log().debug("Printing statistics ...\n"); - print_stats(); - log().debug("Stopping solver device ...\n"); - if (m_solver != nullptr) - m_solver->stop(); -} - -detail::net_t *netlist_state_t::find_net(const pstring &name) const -{ - for (auto & net : m_nets) - if (net->name() == name) - return net.get(); - - return nullptr; -} - -std::size_t netlist_state_t::find_net_id(const detail::net_t *net) const -{ - for (std::size_t i = 0; i < m_nets.size(); i++) - if (m_nets[i].get() == net) - return i; - return std::numeric_limits<std::size_t>::max(); -} - - - -void netlist_state_t::rebuild_lists() -{ - for (auto & net : m_nets) - net->rebuild_list(); -} - - -void netlist_state_t::compile_defines(std::vector<std::pair<pstring, pstring>> &defs) -{ -//#define ENTRY(x) { #x, PSTRINGIFY(x) } -#define ENTRY(x) std::pair<pstring, pstring>(#x, PSTRINGIFY(x)) - defs.emplace_back(ENTRY(PHAS_RDTSCP)); - defs.emplace_back(ENTRY(PUSE_ACCURATE_STATS)); - defs.emplace_back(ENTRY(PHAS_INT128)); - defs.emplace_back(ENTRY(USE_ALIGNED_OPTIMIZATIONS)); - defs.emplace_back(ENTRY(NVCCBUILD)); - defs.emplace_back(ENTRY(USE_MEMPOOL)); - defs.emplace_back(ENTRY(USE_QUEUE_STATS)); - defs.emplace_back(ENTRY(USE_COPY_INSTEAD_OF_REFERENCE)); - defs.emplace_back(ENTRY(USE_TRUTHTABLE_7448)); - defs.emplace_back(ENTRY(NL_DEBUG)); - defs.emplace_back(ENTRY(HAS_OPENMP)); - defs.emplace_back(ENTRY(USE_OPENMP)); - - defs.emplace_back(ENTRY(PPMF_TYPE)); - defs.emplace_back(ENTRY(PHAS_PMF_INTERNAL)); - -#undef ENTRY -} - -void netlist_t::reset() -{ - log().debug("Searching for mainclock\n"); - m_mainclock = m_state->get_single_device<devices::NETLIB_NAME(mainclock)>("mainclock"); - - log().debug("Searching for solver\n"); - m_solver = m_state->get_single_device<devices::NETLIB_NAME(solver)>("solver"); + , m_time(netlist_time_ext::zero()) + , m_main_clock(nullptr) + , m_use_stats(false) + , m_queue( + state.pool(), config::max_queue_size::value, + detail::queue_t::id_delegate(&netlist_state_t ::find_net_id, &state), + detail::queue_t::obj_delegate(&netlist_state_t ::net_by_id, &state)) + { + state.save(*this, + static_cast<plib::state_manager_t::callback_t &>(m_queue), + aname, "m_queue"); + state.save(*this, m_time, aname, "m_time"); + } - m_time = netlist_time::zero(); - m_queue.clear(); - if (m_mainclock != nullptr) - m_mainclock->m_Q.net().set_next_scheduled_time(netlist_time::zero()); - //if (m_solver != nullptr) - // m_solver->reset(); + void netlist_t::reset() + { + log().debug("Searching for main clock\n"); + m_main_clock = m_state + .get_single_device<devices::NETLIB_NAME(mainclock)>( + "mainclock"); + + log().debug("Searching for solver\n"); + m_solver = m_state.get_single_device<devices::NETLIB_NAME(solver)>( + "solver"); + + // Don't reset time + // m_time = netlist_time_ext::zero(); + m_queue.clear(); + if (m_main_clock != nullptr) + m_main_clock->m_Q.net().set_next_scheduled_time(m_time); + // if (m_solver != nullptr) + // m_solver->reset(); + + m_state.reset(); + } - m_state->reset(); -} + void netlist_t::stop() + { + log().debug("Printing statistics ...\n"); + print_stats(); + log().debug("Stopping solver device ...\n"); + if (m_solver != nullptr) + m_solver->stop(); + } -void netlist_state_t::reset() -{ - //FIXME: never used ??? - std::unordered_map<core_device_t *, bool> m; + void netlist_t::print_stats() const + { + if (m_use_stats) + { + netlist_state_t::stats_info si{m_queue, m_stat_mainloop, + m_perf_out_processed}; + m_state.print_stats(si); + } + log().verbose("Current pool memory allocated: {1:12} kB", + nl_state().pool().cur_alloc() >> 10); + log().verbose("Maximum pool memory allocated: {1:12} kB", + nl_state().pool().max_alloc() >> 10); + } - // Reset all nets once ! - log().verbose("Call reset on all nets:"); - for (auto & n : nets()) - n->reset(); + // ------------------------------------------------------------------------- + // netlist_state_t + // ------------------------------------------------------------------------- - // Reset all devices once ! - log().verbose("Call reset on all devices:"); - for (auto & dev : m_devices) - dev.second->reset(); + netlist_state_t::netlist_state_t(const pstring & name, + plib::plog_delegate logger) + : m_log(logger) + , m_dummy_version(1) + { + m_setup = plib::make_unique<setup_t, host_arena>(*this); + // create the run interface + m_netlist = plib::make_unique<netlist_t>(m_pool, *this, name); + + // Make sure save states are invalidated when a new version is deployed + + m_state.save_item(this, m_dummy_version, pstring("V") + version()); + + // Initialize factory + devices::initialize_factory(m_setup->parser().factory()); + + // Add default include file + const pstring content + = "#define RES_R(res) (res) \n" + "#define RES_K(res) ((res) * 1e3) \n" + "#define RES_M(res) ((res) * 1e6) \n" + "#define CAP_U(cap) ((cap) * 1e-6) \n" + "#define CAP_N(cap) ((cap) * 1e-9) \n" + "#define CAP_P(cap) ((cap) * 1e-12) \n" + "#define IND_U(ind) ((ind) * 1e-6) \n" + "#define IND_N(ind) ((ind) * 1e-9) \n" + "#define IND_P(ind) ((ind) * 1e-12) \n"; + m_setup->parser().add_include<plib::psource_str_t>( + "netlist/devices/net_lib.h", content); + + // This is for core macro libraries + m_setup->parser().add_include<plib::psource_str_t>("devices/net_lib.h", + content); +#if 1 + NETLIST_NAME(base_lib)(m_setup->parser()); + //#m_setup->parser().register_source<source_pattern_t>("../macro/modules/nlmod_{1}.cpp"); + //#m_setup->parser().register_source<source_pattern_t>("../macro/nlm_{1}.cpp"); +#else + #if 1 + pstring dir = "src/lib/netlist/"; + m_setup->parser().register_source<source_pattern_t>( + dir + "/macro/nlm_{1}.cpp", true); + m_setup->parser().register_source<source_pattern_t>( + dir + "/generated/nlm_{1}.cpp", true); + m_setup->parser().register_source<source_pattern_t>( + dir + "/macro/modules/nlmod_{1}.cpp", true); + m_setup->parser().include("base_lib"); + #else + // FIXME: This is very slow - need optimized parsing scanning + pstring dir = "src/lib/netlist/macro/"; + // m_setup->parser().register_source<source_pattern_t>("src/lib/netlist/macro/nlm_{}.cpp"); + m_setup->parser().register_source<source_file_t>(dir + + "nlm_base_lib.cpp"); + m_setup->parser().register_source<source_file_t>(dir + + "nlm_opamp_lib.cpp"); + m_setup->parser().register_source<source_file_t>(dir + + "nlm_roms_lib.cpp"); + m_setup->parser().register_source<source_file_t>( + dir + "nlm_cd4xxx_lib.cpp"); + m_setup->parser().register_source<source_file_t>( + dir + "nlm_otheric_lib.cpp"); + m_setup->parser().register_source<source_file_t>( + dir + "nlm_ttl74xx_lib.cpp"); + m_setup->parser().include("base_lib"); + #endif +#endif + } - // Make sure everything depending on parameters is set - // Currently analog input and logic input also - // push their outputs to queue. + void netlist_state_t::set_static_solver_lib( + std::unique_ptr<plib::dynamic_library_base> &&lib) + { + m_lib = std::move(lib); + } - log().verbose("Call update_param on all devices:"); - for (auto & dev : m_devices) - dev.second->update_param(); + std::size_t netlist_state_t::find_net_id(const detail::net_t *net) const + { + // special case for queue end processing items + if (net == nullptr) + return std::numeric_limits<std::size_t>::max() - 1; - // Step all devices once ! - /* - * INFO: The order here affects power up of e.g. breakout. However, such - * variations are explicitly stated in the breakout manual. - */ + for (std::size_t i = 0; i < m_nets.size(); i++) + if (m_nets[i].get() == net) + return i; - auto *netlist_params = get_single_device<devices::NETLIB_NAME(netlistparams)>("parameter"); + return std::numeric_limits<std::size_t>::max(); + } - switch (netlist_params->m_startup_strategy()) + detail::net_t *netlist_state_t::net_by_id(std::size_t id) const { - case 0: - { - std::vector<core_device_t *> d; - std::vector<nldelegate *> t; - log().verbose("Using default startup strategy"); - for (auto &n : m_nets) - for (auto & term : n->core_terms()) - if (term->m_delegate.has_object()) - { - if (!plib::container::contains(t, &term->m_delegate)) - { - t.push_back(&term->m_delegate); - term->m_delegate(); - } - auto *dev = reinterpret_cast<core_device_t *>(term->m_delegate.object()); - if (!plib::container::contains(d, dev)) - d.push_back(dev); - } - log().verbose("Devices not yet updated:"); - for (auto &dev : m_devices) - if (!plib::container::contains(d, dev.second.get())) - { - log().verbose("\t ...{1}", dev.second->name()); - dev.second->update(); - } - } - break; - case 1: // brute force backward - { - log().verbose("Using brute force backward startup strategy"); + // special case for queue end processing items + if (id == std::numeric_limits<std::size_t>::max() - 1) + return nullptr; - for (auto &n : m_nets) // only used if USE_COPY_INSTEAD_OF_REFERENCE == 1 - n->update_inputs(); + return m_nets[id].get(); + } - std::size_t i = m_devices.size(); - while (i>0) - m_devices[--i].second->update(); + void netlist_state_t::rebuild_lists() + { + for (auto &net : m_nets) + net->rebuild_list(); + } - for (auto &n : m_nets) // only used if USE_COPY_INSTEAD_OF_REFERENCE == 1 - n->update_inputs(); + void netlist_state_t::compile_defines( + std::vector<std::pair<pstring, pstring>> &defs) + { +#define ENTRY(x) \ + if (pstring(#x) != PSTRINGIFY(x)) \ + defs.emplace_back(std::pair<pstring, pstring>(#x, PSTRINGIFY(x))); \ + else \ + defs.emplace_back(std::pair<pstring, pstring>(#x, "<NOT DEFINED>")); +#define ENTRY_EX(x) \ + defs.emplace_back(std::pair<pstring, pstring>(#x, plib::pfmt("{}")(x))); + ENTRY(NL_VERSION_MAJOR) + ENTRY(NL_VERSION_MINOR) + ENTRY(NL_VERSION_PATCHLEVEL) + + ENTRY(PUSE_ACCURATE_STATS) + ENTRY(PHAS_INT128) + ENTRY(PUSE_ALIGNED_OPTIMIZATIONS) + ENTRY(PHAS_OPENMP) + ENTRY(PUSE_OPENMP) + ENTRY(PUSE_FLOAT128) + ENTRY_EX(config::use_mempool::value) + ENTRY_EX(config::use_queue_stats::value) + ENTRY(NL_USE_COPY_INSTEAD_OF_REFERENCE) + ENTRY(NL_USE_FLOAT128) + ENTRY_EX(config::use_float_matrix::value) + ENTRY_EX(config::use_long_double_matrix::value) + ENTRY(NL_DEBUG) + ENTRY(__NVCC__) + + ENTRY(__cplusplus) + ENTRY(__VERSION__) + + ENTRY(__GNUC__) + ENTRY(__GNUC_MINOR__) + ENTRY(__GNUC_PATCHLEVEL__) + + ENTRY(__clang__) + ENTRY(__clang_major__) + ENTRY(__clang_minor__) + ENTRY(__clang_patchlevel__) + ENTRY(__clang_version__) + + ENTRY(OPENMP) + ENTRY(_OPENMP) + + ENTRY(__x86_64__) + ENTRY(__i386__) + ENTRY(_WIN32) + ENTRY(_MSC_VER) + ENTRY(__APPLE__) + ENTRY(__unix__) + ENTRY(__linux__) + + ENTRY_EX(sizeof(base_device_t)) + ENTRY_EX(sizeof(device_t)) + ENTRY_EX(sizeof(logic_t)) + ENTRY_EX(sizeof(logic_input_t)) + ENTRY_EX(sizeof(logic_output_t)) + ENTRY_EX(sizeof(param_model_t)) + ENTRY_EX(sizeof(param_logic_t)) + ENTRY_EX(sizeof(state_var<int>)) + ENTRY_EX(sizeof(pstring)) + ENTRY_EX(sizeof(core_device_t::stats_t)) + ENTRY_EX(sizeof(std::vector<detail::core_terminal_t *>)) + ENTRY_EX(sizeof(plib::plog_level)) + + ENTRY_EX(sizeof(nl_delegate)) + ENTRY(PPMF_FORCE_TYPE) + ENTRY(PHAS_PMF_INTERNAL) - } - break; - case 2: // brute force forward - { - log().verbose("Using brute force forward startup strategy"); - for (auto &d : m_devices) - d.second->update(); - } - break; +#undef ENTRY +#undef ENTRY_EX } -#if 1 - /* the above may screw up m_active and the list */ - rebuild_lists(); -#endif -} - -void netlist_t::process_queue(const netlist_time delta) NL_NOEXCEPT -{ - if (!m_stats) - process_queue_stats<false>(delta); - else + pstring netlist_state_t::version() { - auto sm_guard(m_stat_mainloop.guard()); - process_queue_stats<true>(delta); + return plib::pfmt("{1}.{2}")(NL_VERSION_MAJOR, NL_VERSION_MINOR); } -} -template <bool KEEP_STATS> -void netlist_t::process_queue_stats(const netlist_time delta) NL_NOEXCEPT -{ - netlist_time stop(m_time + delta); + pstring netlist_state_t::version_patchlevel() + { + return plib::pfmt("{1}.{2}.{3}")(NL_VERSION_MAJOR, NL_VERSION_MINOR, + NL_VERSION_PATCHLEVEL); + } - qpush(detail::queue_t::entry_t(stop, nullptr)); + void netlist_state_t::free_setup_resources() { m_setup = nullptr; } - if (m_mainclock == nullptr) + void netlist_state_t::reset() { - detail::queue_t::entry_t e(m_queue.pop()); - m_time = e.m_exec_time; - while (e.m_object != nullptr) + // Reset all nets once ! + log().verbose("Call reset on all nets:"); + for (auto &n : nets()) + n->reset(); + + // Reset all devices once ! + log().verbose("Call reset on all devices:"); + for (auto &dev : m_devices) + dev.second->reset(); + + // Make sure everything depending on parameters is set + // Currently analog input and logic input also + // push their outputs to queue. + + std::vector<core_device_t *> devices_called; + log().verbose("Call update_param on all devices:"); + for (auto &dev : m_devices) { - e.m_object->template update_devs<KEEP_STATS>(); - if (KEEP_STATS) m_perf_out_processed.inc(); - e = m_queue.pop(); - m_time = e.m_exec_time; + dev.second->update_param(); + if (!plib::container::contains(devices_called, dev.second.get())) + devices_called.push_back(dev.second.get()); } - } - else - { - logic_net_t &mc_net(m_mainclock->m_Q.net()); - const netlist_time inc(m_mainclock->m_inc); - netlist_time mc_time(mc_net.next_scheduled_time()); - do + // Step all devices once ! + // + // INFO: The order here affects power up of e.g. breakout. However, such + // variations are explicitly stated in the breakout manual. + + auto *netlist_params = get_single_device< + devices::NETLIB_NAME(netlistparams)>("parameter"); + + switch (netlist_params->m_startup_strategy()) { - while (m_queue.top().m_exec_time > mc_time) + case 0: { - m_time = mc_time; - mc_net.toggle_new_Q(); - mc_net.update_devs<KEEP_STATS>(); - mc_time += inc; + std::vector<const nl_delegate *> t; + log().verbose("Using default startup strategy"); + for (auto &n : m_nets) + { + n->update_inputs(); // only used if + // USE_COPY_INSTEAD_OF_REFERENCE == 1 + for (detail::core_terminal_t *term : n->core_terms_copy()) + { + if (!plib::container::contains(t, &term->delegate())) + { + t.push_back(&term->delegate()); + term->run_delegate(); + } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *dev = reinterpret_cast<core_device_t *>( + term->delegate().object()); + if (!plib::container::contains(devices_called, dev)) + devices_called.push_back(dev); + } + } + log().verbose("Devices not yet updated:"); + for (auto &dev : m_devices) + if (!plib::container::contains(devices_called, + dev.second.get())) + { + // FIXME: doesn't seem to be needed, use cases include + // analog output devices. Check and remove + log().error("\t Device {1} not yet updated", + dev.second->name()); + // dev.second->update(); + } } + break; + } - detail::queue_t::entry_t e(m_queue.pop()); - m_time = e.m_exec_time; - if (e.m_object != nullptr) - { - e.m_object->template update_devs<KEEP_STATS>(); - if (KEEP_STATS) m_perf_out_processed.inc(); - } - else - break; - } while (true); //while (e.m_object != nullptr); - mc_net.set_next_scheduled_time(mc_time); + // the above may screw up m_active and the list + rebuild_lists(); } -} -void netlist_t::print_stats() const -{ - if (m_stats) + void netlist_state_t::print_stats(stats_info &si) const { std::vector<size_t> index; - for (size_t i=0; i < m_state->m_devices.size(); i++) + for (size_t i = 0; i < this->m_devices.size(); i++) index.push_back(i); std::sort(index.begin(), index.end(), - [&](size_t i1, size_t i2) { return m_state->m_devices[i1].second->m_stats->m_stat_total_time.total() < m_state->m_devices[i2].second->m_stats->m_stat_total_time.total(); }); - - nperftime_t<true>::type total_time(0); - nperftime_t<true>::ctype total_count(0); - - for (auto & j : index) + [&](size_t i1, size_t i2) + { + return this->m_devices[i1] + .second->stats() + ->m_stat_total_time.total() + < this->m_devices[i2] + .second->stats() + ->m_stat_total_time.total(); + }); + + plib::pperftime_t<true>::type total_time(0); + plib::pperftime_t<true>::ctype total_count(0); + + for (auto &j : index) { - auto entry = m_state->m_devices[j].second.get(); - auto stats = m_state->m_devices[j].second.get()->m_stats.get(); - log().verbose("Device {1:20} : {2:12} {3:12} {4:15} {5:12}", entry->name(), - stats->m_stat_call_count(), stats->m_stat_total_time.count(), - stats->m_stat_total_time.total(), stats->m_stat_inc_active()); + auto *entry = this->m_devices[j].second.get(); + auto *stats = entry->stats(); + log().verbose( + "Device {1:20} : {2:12} {3:12} {4:15} {5:12}", entry->name(), + stats->m_stat_call_count(), stats->m_stat_total_time.count(), + stats->m_stat_total_time.total(), stats->m_stat_inc_active()); total_time += stats->m_stat_total_time.total(); total_count += stats->m_stat_total_time.count(); } log().verbose("Total calls : {1:12} {2:12} {3:12}", total_count, - total_time, total_time / static_cast<decltype(total_time)>(total_count)); + total_time, + total_time + / gsl::narrow<decltype(total_time)>( + (total_count > 0) ? total_count : 1)); - log().verbose("Total loop {1:15}", m_stat_mainloop()); + log().verbose("Total loop {1:15}", si.m_stat_mainloop()); log().verbose("Total time {1:15}", total_time); // FIXME: clang complains about unreachable code without - const auto clang_workaround_unreachable_code = USE_QUEUE_STATS; + const bool clang_workaround_unreachable_code( + config::use_queue_stats::value); if (clang_workaround_unreachable_code) { - /* Only one serialization should be counted in total time */ - /* But two are contained in m_stat_mainloop */ - nperftime_t<true> overhead; - nperftime_t<true> test; + // Only one serialization should be counted in total time + // But two are contained in m_stat_mainloop + plib::pperftime_t<true> overhead; + plib::pperftime_t<true> test; { auto overhead_guard(overhead.guard()); - for (int j=0; j<100000;j++) + for (int j = 0; j < 100000; j++) { auto test_guard(test.guard()); } } - nperftime_t<true>::type total_overhead = overhead() - * static_cast<nperftime_t<true>::type>(total_count) - / static_cast<nperftime_t<true>::type>(200000); + plib::pperftime_t<true>::type total_overhead + = overhead() + * gsl::narrow<plib::pperftime_t<true>::type>(total_count) + / gsl::narrow<plib::pperftime_t<true>::type>(200000); - log().verbose("Queue Pushes {1:15}", m_queue.m_prof_call()); - log().verbose("Queue Moves {1:15}", m_queue.m_prof_sortmove()); - log().verbose("Queue Removes {1:15}", m_queue.m_prof_remove()); - log().verbose("Queue Retimes {1:15}", m_queue.m_prof_retime()); + log().verbose("Queue Pushes {1:15}", si.m_queue.m_prof_call()); + log().verbose("Queue Moves {1:15}", + si.m_queue.m_prof_sort_move()); + log().verbose("Queue Removes {1:15}", si.m_queue.m_prof_remove()); log().verbose(""); - log().verbose("Take the next lines with a grain of salt. They depend on the measurement implementation."); + log().verbose( + "Take the next lines with a grain of salt. They depend on the measurement implementation."); log().verbose("Total overhead {1:15}", total_overhead); - nperftime_t<true>::type overhead_per_pop = (m_stat_mainloop()-2*total_overhead - (total_time - total_overhead)) - / static_cast<nperftime_t<true>::type>(m_queue.m_prof_call()); - log().verbose("Overhead per pop {1:11}", overhead_per_pop ); + plib::pperftime_t<true>::type overhead_per_pop + = (si.m_stat_mainloop() - 2 * total_overhead + - (total_time - total_overhead)) + / gsl::narrow<plib::pperftime_t<true>::type>( + si.m_queue.m_prof_call()); + log().verbose("Overhead per pop {1:11}", overhead_per_pop); log().verbose(""); } auto trigger = total_count * 200 / 1000000; // 200 ppm - for (auto &entry : m_state->m_devices) + for (const auto &entry : this->m_devices) { - auto ep = entry.second.get(); - auto stats = ep->m_stats.get(); - // Factor of 3 offers best performace increase - if (stats->m_stat_inc_active() > 3 * stats->m_stat_total_time.count() + auto *ep = entry.second.get(); + auto *stats = ep->stats(); + // Factor of 3 offers best performance increase + if (stats->m_stat_inc_active() + > 3 * stats->m_stat_total_time.count() && stats->m_stat_inc_active() > trigger) log().verbose("HINT({}, NO_DEACTIVATE) // {} {} {}", ep->name(), - static_cast<double>(stats->m_stat_inc_active()) / static_cast<double>(stats->m_stat_total_time.count()), - stats->m_stat_inc_active(), stats->m_stat_total_time.count()); + gsl::narrow<nl_fptype>(stats->m_stat_inc_active()) + / gsl::narrow<nl_fptype>( + stats->m_stat_total_time.count()), + stats->m_stat_inc_active(), + stats->m_stat_total_time.count()); } + log().verbose(""); } -} -core_device_t *netlist_state_t::get_single_device(const pstring &classname, bool (*cc)(core_device_t *)) const -{ - core_device_t *ret = nullptr; - for (auto &d : m_devices) + core_device_t * + netlist_state_t::get_single_device(const pstring &classname, + bool (*cc)(core_device_t *)) const { - if (cc(d.second.get())) + core_device_t *ret = nullptr; + for (const auto &d : m_devices) { - if (ret != nullptr) - m_log.fatal(MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); - else + if (cc(d.second.get())) + { + if (ret != nullptr) + { + m_log.fatal(MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); + throw nl_exception( + MF_MORE_THAN_ONE_1_DEVICE_FOUND(classname)); + } ret = d.second.get(); + } } + return ret; } - return ret; -} + nlparse_t &netlist_state_t::parser() noexcept { return m_setup->parser(); } + const nlparse_t &netlist_state_t::parser() const noexcept + { + return m_setup->parser(); + } -// ---------------------------------------------------------------------------------------- -// core_device_t -// ---------------------------------------------------------------------------------------- + void netlist_state_t::remove_device(core_device_t *dev) + { + for (auto it = m_devices.begin(); it != m_devices.end(); it++) + if (it->second.get() == dev) + { + m_state.remove_save_items(dev); + m_devices.erase(it); + return; + } + } -core_device_t::core_device_t(netlist_state_t &owner, const pstring &name) - : object_t(name) - , logic_family_t() - , netlist_ref(owner) - , m_hint_deactivate(false) - , m_active_outputs(*this, "m_active_outputs", 1) -{ - if (logic_family() == nullptr) - set_logic_family(family_TTL()); - if (exec().stats_enabled()) - m_stats = plib::make_unique<stats_t>(); -} - -core_device_t::core_device_t(core_device_t &owner, const pstring &name) - : object_t(owner.name() + "." + name) - , logic_family_t() - , netlist_ref(owner.state()) + // ------------------------------------------------------------------------- + // core_device_t + // ------------------------------------------------------------------------- + + core_device_t::core_device_t(core_device_param_t data) + : netlist_object_t(data.owner.exec(), data.name) , m_hint_deactivate(false) , m_active_outputs(*this, "m_active_outputs", 1) -{ - set_logic_family(owner.logic_family()); - if (logic_family() == nullptr) - set_logic_family(family_TTL()); - state().add_dev(this->name(), pool_owned_ptr<core_device_t>(this, false)); - if (exec().stats_enabled()) - m_stats = plib::make_unique<stats_t>(); -} - -void core_device_t::set_default_delegate(detail::core_terminal_t &term) -{ - if (!term.m_delegate.is_set()) - term.m_delegate.set(&core_device_t::update, this); -} - -log_type & core_device_t::log() -{ - return state().log(); -} - -// ---------------------------------------------------------------------------------------- -// device_t -// ---------------------------------------------------------------------------------------- - -device_t::device_t(netlist_state_t &owner, const pstring &name) -: core_device_t(owner, name) -{ -} + { + if (exec().stats_enabled()) + m_stats = state().make_pool_object<stats_t>(); + } -device_t::device_t(core_device_t &owner, const pstring &name) -: core_device_t(owner, name) -{ -} + log_type &core_device_t::log() { return state().log(); } -setup_t &device_t::setup() -{ - return state().setup(); -} + // ------------------------------------------------------------------------- + // base_device_t + // ------------------------------------------------------------------------- -const setup_t &device_t::setup() const -{ - return state().setup(); -} + base_device_t::base_device_t(base_device_param_t data) + : core_device_t(data) + { + } -void device_t::register_subalias(const pstring &name, detail::core_terminal_t &term) -{ - pstring alias = this->name() + "." + name; + void base_device_t::register_sub_alias(const pstring & name, + const detail::core_terminal_t &term) + { + pstring alias = this->name() + "." + name; - // everything already fully qualified - setup().register_alias_nofqn(alias, term.name()); -} + // everything already fully qualified + state().parser().register_fqn_alias(detail::alias_type::FUNCTIONAL, + alias, term.name()); + } -void device_t::register_subalias(const pstring &name, const pstring &aliased) -{ - pstring alias = this->name() + "." + name; - pstring aliased_fqn = this->name() + "." + aliased; + void base_device_t::register_sub_alias(const pstring &name, + const pstring &aliased) + { + pstring alias = this->name() + "." + name; + pstring aliased_fqn = this->name() + "." + aliased; - // everything already fully qualified - setup().register_alias_nofqn(alias, aliased_fqn); -} + // everything already fully qualified + state().parser().register_fqn_alias(detail::alias_type::FUNCTIONAL, + alias, aliased_fqn); + } -void device_t::connect(detail::core_terminal_t &t1, detail::core_terminal_t &t2) -{ - setup().register_link_fqn(t1.name(), t2.name()); -} + void base_device_t::connect(const detail::core_terminal_t &t1, + const detail::core_terminal_t &t2) + { + state().parser().register_connection_fqn(t1.name(), t2.name()); + } -void device_t::connect(const pstring &t1, const pstring &t2) -{ - setup().register_link_fqn(name() + "." + t1, name() + "." + t2); -} + void base_device_t::connect(const pstring &t1, const pstring &t2) + { + state().parser().register_connection_fqn(name() + "." + t1, + name() + "." + t2); + } -/* FIXME: this is only used by solver code since matrix solvers are started in - * post_start. - */ -void device_t::connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2) -{ - if (!setup().connect(t1, t2)) - log().fatal(MF_ERROR_CONNECTING_1_TO_2(t1.name(), t2.name())); -} + // ------------------------------------------------------------------------- + // device_t + // ------------------------------------------------------------------------- + device_t::device_t(device_param_t data) + : base_device_t(data) + , m_model(*this, "MODEL", pstring(config::DEFAULT_LOGIC_FAMILY())) + { + set_logic_family(state().setup().family_from_model(m_model())); + if (logic_family() == nullptr) + throw nl_exception(MF_NULLPTR_FAMILY(this->name(), m_model())); + } -// ----------------------------------------------------------------------------- -// family_setter_t -// ----------------------------------------------------------------------------- + device_t::device_t(device_param_t data, const pstring &model) + : base_device_t(data) + , m_model(*this, "MODEL", model) + { + set_logic_family(state().setup().family_from_model(m_model())); + if (logic_family() == nullptr) + throw nl_exception(MF_NULLPTR_FAMILY(this->name(), m_model())); + } -// NOLINTNEXTLINE(modernize-use-equals-default) -detail::family_setter_t::family_setter_t() -{ -} + device_t::device_t(device_param_t data, const logic_family_desc_t *desc) + : base_device_t(data) + , m_model(*this, "MODEL", pstring("")) + { + set_logic_family(desc); + if (logic_family() == nullptr) + throw nl_exception(MF_NULLPTR_FAMILY( + this->name(), "<pointer provided by constructor>")); + } -detail::family_setter_t::family_setter_t(core_device_t &dev, const pstring &desc) -{ - dev.set_logic_family(dev.setup().family_from_model(desc)); -} + // ------------------------------------------------------------------------- + // analog_t + // ------------------------------------------------------------------------- -detail::family_setter_t::family_setter_t(core_device_t &dev, const logic_family_desc_t *desc) -{ - dev.set_logic_family(desc); -} + analog_t::analog_t(core_device_t &dev, const pstring &aname, + const state_e state, nl_delegate delegate) + : core_terminal_t(dev, aname, state, delegate) + { + } -// ---------------------------------------------------------------------------------------- -// net_t -// ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // net_t + // ------------------------------------------------------------------------- -detail::net_t::net_t(netlist_state_t &nl, const pstring &aname, core_terminal_t *mr) - : object_t(aname) - , netlist_ref(nl) - , m_new_Q(*this, "m_new_Q", 0) - , m_cur_Q (*this, "m_cur_Q", 0) + detail::net_t::net_t(netlist_state_t &nl, const pstring &aname, + core_terminal_t *rail_terminal) + : netlist_object_t(nl.exec(), aname) + , m_new_Q(*this, "m_new_Q", netlist_sig_t(0)) + , m_cur_Q(*this, "m_cur_Q", netlist_sig_t(0)) , m_in_queue(*this, "m_in_queue", queue_status::DELIVERED) - , m_next_scheduled_time(*this, "m_time", netlist_time::zero()) - , m_railterminal(mr) -{ -} - -void detail::net_t::rebuild_list() -{ - /* rebuild m_list */ + , m_next_scheduled_time(*this, "m_time", netlist_time_ext::zero()) + , m_rail_terminal(rail_terminal) + { + props::add(this, props::value_type()); + } - m_list_active.clear(); - for (auto & term : m_core_terms) - if (term->terminal_state() != logic_t::STATE_INP_PASSIVE) - { - m_list_active.push_back(term); - term->set_copied_input(m_cur_Q); - } -} + bool detail::net_t::is_logic() const noexcept + { + return bool(plib::dynamic_downcast<const logic_net_t *>(this)); + } -template <bool KEEP_STATS, typename T> -void detail::net_t::process(const T mask, netlist_sig_t sig) -{ - m_cur_Q = sig; + bool detail::net_t::is_analog() const noexcept + { + return bool(plib::dynamic_downcast<const analog_net_t *>(this)); + } - if (KEEP_STATS) + void detail::net_t::rebuild_list() { - for (auto & p : m_list_active) - { - p.set_copied_input(sig); - auto *stats = p.device().m_stats.get(); - stats->m_stat_call_count.inc(); - if ((p.terminal_state() & mask)) + // rebuild m_list + + m_list_active.clear(); + for (core_terminal_t *term : core_terms_ref()) + if (term->terminal_state() != logic_t::STATE_INP_PASSIVE) { - auto g(stats->m_stat_total_time.guard()); - p.m_delegate(); + m_list_active.push_back(term); + term->set_copied_input(m_cur_Q); } - } } - else + + void detail::net_t::reset() noexcept { - for (auto & p : m_list_active) + m_next_scheduled_time = exec().time(); + m_in_queue = queue_status::DELIVERED; + + m_new_Q = 0; + m_cur_Q = 0; + + if (auto p = plib::dynamic_downcast<analog_net_t *>(this)) + (*p)->set_Q_Analog(nlconst::zero()); + + // rebuild m_list and reset terminals to active or analog out state + + m_list_active.clear(); + for (core_terminal_t *ct : core_terms_copy()) { - p.set_copied_input(sig); - if ((p.terminal_state() & mask)) - p.m_delegate(); + ct->reset(); + if (ct->terminal_state() != logic_t::STATE_INP_PASSIVE) + m_list_active.push_back(ct); + ct->set_copied_input(m_cur_Q); } } -} -template <bool KEEP_STATS> -void detail::net_t::update_devs() NL_NOEXCEPT -{ - nl_assert(this->isRailNet()); +#if NL_USE_INPLACE_CORE_TERMS + void detail::net_t::remove_terminal(detail::core_terminal_t &term) + { + m_core_terms.remove(&term); + } + + void detail::net_t::remove_all_terminals() { m_core_terms.clear(); } - const unsigned int new_Q(m_new_Q); + void detail::net_t::add_terminal(detail::core_terminal_t &terminal) + { + for (detail::core_terminal_t *t : m_core_terms) + if (t == &terminal) + { + state().log().fatal( + MF_NET_1_DUPLICATE_TERMINAL_2(this->name(), t->name())); + throw nl_exception( + MF_NET_1_DUPLICATE_TERMINAL_2(this->name(), t->name())); + } - const unsigned int mask((new_Q << core_terminal_t::INP_LH_SHIFT) - | (m_cur_Q << core_terminal_t::INP_HL_SHIFT)); + terminal.set_net(this); + + m_core_terms.push_back(&terminal); + } - m_in_queue = queue_status::DELIVERED; /* mark as taken ... */ - switch (mask) +#else + void detail::net_t::remove_terminal(detail::core_terminal_t &term) { - case core_terminal_t::STATE_INP_HL: - case core_terminal_t::STATE_INP_LH: - process<KEEP_STATS>(mask | core_terminal_t::STATE_INP_ACTIVE, new_Q); - break; - default: - /* do nothing */ - break; + // net.core_terms().remove(p); + for (auto pp = state().core_terms(*this).begin(); + pp != state().core_terms(*this).end(); pp++) + if (*pp == &term) + { + state().core_terms(*this).erase(pp); + break; + } } -} -void detail::net_t::reset() -{ - m_next_scheduled_time = netlist_time::zero(); - m_in_queue = queue_status::DELIVERED; + void detail::net_t::remove_all_terminals() + { + state().core_terms(*this).clear(); + } - m_new_Q = 0; - m_cur_Q = 0; + void detail::net_t::add_terminal(detail::core_terminal_t &terminal) + { + for (detail::core_terminal_t *t : core_terms_ref()) + if (t == &terminal) + { + state().log().fatal( + MF_NET_1_DUPLICATE_TERMINAL_2(this->name(), t->name())); + throw nl_exception( + MF_NET_1_DUPLICATE_TERMINAL_2(this->name(), t->name())); + } - auto *p = dynamic_cast<analog_net_t *>(this); + terminal.set_net(this); - if (p != nullptr) - p->m_cur_Analog = 0.0; + state().core_terms(*this).push_back(&terminal); + } +#endif - /* rebuild m_list and reset terminals to active or analog out state */ + // ------------------------------------------------------------------------- + // logic_net_t + // ------------------------------------------------------------------------- - m_list_active.clear(); - for (core_terminal_t *ct : m_core_terms) + logic_net_t::logic_net_t(netlist_state_t &nl, const pstring &aname, + detail::core_terminal_t *rail_terminal) + : net_t(nl, aname, rail_terminal) { - ct->reset(); - if (ct->terminal_state() != logic_t::STATE_INP_PASSIVE) - m_list_active.push_back(ct); - ct->set_copied_input(m_cur_Q); } -} -void detail::net_t::add_terminal(detail::core_terminal_t &terminal) -{ - for (auto &t : m_core_terms) - if (t == &terminal) - state().log().fatal(MF_NET_1_DUPLICATE_TERMINAL_2(name(), t->name())); + // ------------------------------------------------------------------------- + // analog_net_t + // ------------------------------------------------------------------------- - terminal.set_net(this); + analog_net_t::analog_net_t(netlist_state_t &nl, const pstring &aname, + detail::core_terminal_t *rail_terminal) + : net_t(nl, aname, rail_terminal) + , m_cur_Analog(*this, "m_cur_Analog", nlconst::zero()) + , m_solver(nullptr) + { + } - m_core_terms.push_back(&terminal); -} + void analog_net_t::reset() noexcept + { + net_t::reset(); + m_cur_Analog = nlconst::zero(); + } -void detail::net_t::remove_terminal(detail::core_terminal_t &terminal) -{ - if (plib::container::contains(m_core_terms, &terminal)) + // ------------------------------------------------------------------------- + // core_terminal_t + // ------------------------------------------------------------------------- + + detail::core_terminal_t::core_terminal_t(core_device_t &dev, + const pstring &aname, + const state_e state, + nl_delegate delegate) + : device_object_t(&dev, dev.name() + "." + aname) + , m_Q_CIR(*this, "m_Q", 0) + , m_delegate(delegate) + , m_net(nullptr) + , m_state(*this, "m_state", state) { - terminal.set_net(nullptr); - plib::container::remove(m_core_terms, &terminal); } - else - state().log().fatal(MF_REMOVE_TERMINAL_1_FROM_NET_2(terminal.name(), this->name())); -} -void detail::net_t::move_connections(detail::net_t &dest_net) -{ - for (auto &ct : m_core_terms) - dest_net.add_terminal(*ct); - m_core_terms.clear(); -} + bool detail::core_terminal_t::is_logic() const noexcept + { + return bool(plib::dynamic_downcast<const logic_t *>(this)); + } -// ---------------------------------------------------------------------------------------- -// logic_net_t -// ---------------------------------------------------------------------------------------- + bool detail::core_terminal_t::is_logic_input() const noexcept + { + return bool(plib::dynamic_downcast<const logic_input_t *>(this)); + } -logic_net_t::logic_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *mr) - : net_t(nl, aname, mr) -{ -} + bool detail::core_terminal_t::is_logic_output() const noexcept + { + return bool(plib::dynamic_downcast<const logic_output_t *>(this)); + } -// ---------------------------------------------------------------------------------------- -// analog_net_t -// ---------------------------------------------------------------------------------------- + bool detail::core_terminal_t::is_tristate_output() const noexcept + { + return bool(plib::dynamic_downcast<const tristate_output_t *>(this)); + } -analog_net_t::analog_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *mr) - : net_t(nl, aname, mr) - , m_cur_Analog(*this, "m_cur_Analog", 0.0) - , m_solver(nullptr) -{ -} - -// ---------------------------------------------------------------------------------------- -// core_terminal_t -// ---------------------------------------------------------------------------------------- - -detail::core_terminal_t::core_terminal_t(core_device_t &dev, const pstring &aname, - const state_e state, nldelegate delegate) -: device_object_t(dev, dev.name() + "." + aname) -, plib::linkedlist_t<core_terminal_t>::element_t() -, m_delegate(delegate) -#if USE_COPY_INSTEAD_OF_REFERENCE -, m_Q(*this, "m_Q", 0) -#endif -, m_net(nullptr) -, m_state(*this, "m_state", state) -{ -} + bool detail::core_terminal_t::is_analog() const noexcept + { + return bool(plib::dynamic_downcast<const analog_t *>(this)); + } -analog_t::analog_t(core_device_t &dev, const pstring &aname, const state_e state, - nldelegate delegate) -: core_terminal_t(dev, aname, state, delegate) -{ -} + bool detail::core_terminal_t::is_analog_input() const noexcept + { + return bool(plib::dynamic_downcast<const analog_input_t *>(this)); + } -logic_t::logic_t(core_device_t &dev, const pstring &aname, const state_e state, - nldelegate delegate) - : core_terminal_t(dev, aname, state, delegate) - , logic_family_t() - , m_proxy(nullptr) -{ -} - -// ---------------------------------------------------------------------------------------- -// terminal_t -// ---------------------------------------------------------------------------------------- - -terminal_t::terminal_t(core_device_t &dev, const pstring &aname, terminal_t *otherterm) -: analog_t(dev, aname, STATE_BIDIR) -, m_Idr1(nullptr) -, m_go1(nullptr) -, m_gt1(nullptr) -, m_connected_terminal(otherterm) -{ - state().setup().register_term(*this); -} + bool detail::core_terminal_t::is_analog_output() const noexcept + { + return bool(plib::dynamic_downcast<const analog_output_t *>(this)); + } -void terminal_t::solve_now() -{ - // Nets may belong to railnets which do not have a solver attached - if (this->has_net()) - if (net().solver() != nullptr) - net().solver()->update_forced(); -} + // ------------------------------------------------------------------------- + // terminal_t + // ------------------------------------------------------------------------- -void terminal_t::schedule_solve_after(const netlist_time after) -{ - // Nets may belong to railnets which do not have a solver attached - if (this->has_net()) - if (net().solver() != nullptr) - net().solver()->update_after(after); -} - -// ---------------------------------------------------------------------------------------- -// net_input_t -// ---------------------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------------------- -// net_output_t -// ---------------------------------------------------------------------------------------- - -// ---------------------------------------------------------------------------------------- -// logic_output_t -// ---------------------------------------------------------------------------------------- - -logic_output_t::logic_output_t(core_device_t &dev, const pstring &aname) - : logic_t(dev, aname, STATE_OUT) - , m_my_net(dev.state(), name() + ".net", this) -{ - this->set_net(&m_my_net); - state().register_net(pool_owned_ptr<logic_net_t>(&m_my_net, false)); - set_logic_family(dev.logic_family()); - state().setup().register_term(*this); -} + terminal_t::terminal_t(core_device_t &dev, const pstring &aname, + terminal_t *other_terminal, nl_delegate delegate) + : terminal_t(dev, aname, other_terminal, {nullptr, nullptr}, delegate) + { + } -void logic_output_t::initial(const netlist_sig_t val) -{ - if (has_net()) - net().initial(val); -} + terminal_t::terminal_t(core_device_t &dev, const pstring &aname, + terminal_t * other_terminal, + const std::array<terminal_t *, 2> &splitter_terms, + nl_delegate delegate) + : analog_t(dev, aname, STATE_BIDIR, delegate) + , m_Idr(nullptr) + , m_go(nullptr) + , m_gt(nullptr) + { + state().setup().register_term(*this, other_terminal, splitter_terms); + } -// ---------------------------------------------------------------------------------------- -// analog_input_t -// ---------------------------------------------------------------------------------------- + void terminal_t::set_ptrs(nl_fptype *gt, nl_fptype *go, + nl_fptype *Idr) noexcept(false) + { + // NOLINTNEXTLINE(readability-implicit-bool-conversion) + if (!(gt && go && Idr) && (gt || go || Idr)) + { + throw nl_exception( + "Either all pointers must be set or none for terminal {}", + name()); + } -analog_input_t::analog_input_t(core_device_t &dev, const pstring &aname, - nldelegate delegate) -: analog_t(dev, aname, STATE_INP_ACTIVE, delegate) -{ - state().setup().register_term(*this); -} + m_gt = gt; + m_go = go; + m_Idr = Idr; + } -// ---------------------------------------------------------------------------------------- -// analog_output_t -// ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // logic_t + // ------------------------------------------------------------------------- -analog_output_t::analog_output_t(core_device_t &dev, const pstring &aname) - : analog_t(dev, aname, STATE_OUT) - , m_my_net(dev.state(), name() + ".net", this) -{ - state().register_net(pool_owned_ptr<analog_net_t>(&m_my_net, false)); - this->set_net(&m_my_net); + logic_t::logic_t(device_t &dev, const pstring &aname, + const state_e terminal_state, nl_delegate delegate) + : core_terminal_t(dev, aname, terminal_state, delegate) + , logic_family_t(dev.logic_family()) + { + } - //net().m_cur_Analog = NL_FCONST(0.0); - state().setup().register_term(*this); -} + // ------------------------------------------------------------------------- + // logic_input_t + // ------------------------------------------------------------------------- -void analog_output_t::initial(const nl_double val) -{ - net().set_Q_Analog(val); -} + logic_input_t::logic_input_t(device_t &dev, const pstring &aname, + nl_delegate delegate) + : logic_t(dev, aname, STATE_INP_ACTIVE, delegate) + { + state().setup().register_term(*this); + } -// ----------------------------------------------------------------------------- -// logic_input_t -// ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // logic_output_t + // ------------------------------------------------------------------------- -logic_input_t::logic_input_t(core_device_t &dev, const pstring &aname, - nldelegate delegate) - : logic_t(dev, aname, STATE_INP_ACTIVE, delegate) -{ - set_logic_family(dev.logic_family()); - state().setup().register_term(*this); -} + logic_output_t::logic_output_t(device_t &dev, const pstring &aname, + [[maybe_unused]] bool dummy) + : logic_t(dev, aname, STATE_OUT, nl_delegate()) + , m_my_net(dev.state(), name() + ".net", this) + { + this->set_net(&m_my_net); + state().register_net( + device_arena::owned_ptr<logic_net_t>(&m_my_net, false)); + state().setup().register_term(*this); + } -// ---------------------------------------------------------------------------------------- -// Parameters ... -// ---------------------------------------------------------------------------------------- + void logic_output_t::initial(const netlist_sig_t val) noexcept + { + if (has_net()) + net().initial(val); + } -param_t::param_t(device_t &device, const pstring &name) - : device_object_t(device, device.name() + "." + name) -{ - device.setup().register_param_t(this->name(), *this); -} + // ------------------------------------------------------------------------- + // tristate_output_t + // ------------------------------------------------------------------------- + + tristate_output_t::tristate_output_t(device_t &dev, const pstring &aname, + bool force_logic) + : logic_output_t(dev, aname) + , m_last_logic(dev, name() + "." + "m_last_logic", 1) // force change + , m_tristate(dev, name() + "." + "m_tristate", + force_logic ? 0 : 2) // force change + , m_force_logic(force_logic) + { + } -param_t::param_type_t param_t::param_type() const -{ - if (dynamic_cast<const param_str_t *>(this) != nullptr) - return STRING; - else if (dynamic_cast<const param_double_t *>(this) != nullptr) - return DOUBLE; - else if (dynamic_cast<const param_int_t *>(this) != nullptr) - return INTEGER; - else if (dynamic_cast<const param_logic_t *>(this) != nullptr) - return LOGIC; - else if (dynamic_cast<const param_ptr_t *>(this) != nullptr) - return POINTER; - else + // ------------------------------------------------------------------------- + // analog_input_t + // ------------------------------------------------------------------------- + + analog_input_t::analog_input_t(core_device_t &dev, const pstring &aname, + nl_delegate delegate) + : analog_t(dev, aname, STATE_INP_ACTIVE, delegate) { - state().log().fatal(MF_UNKNOWN_PARAM_TYPE(name())); - return POINTER; /* Please compiler */ + state().setup().register_term(*this); } -} + // ------------------------------------------------------------------------- + // analog_output_t + // ------------------------------------------------------------------------- -void param_t::update_param() -{ - device().update_param(); -} + analog_output_t::analog_output_t(core_device_t &dev, const pstring &aname) + : analog_t(dev, aname, STATE_OUT, nl_delegate()) + , m_my_net(dev.state(), name() + ".net", this) + { + state().register_net( + device_arena::owned_ptr<analog_net_t>(&m_my_net, false)); + this->set_net(&m_my_net); -pstring param_t::get_initial(const device_t &dev, bool *found) -{ - pstring res = dev.setup().get_initial_param_val(this->name(), ""); - *found = (res != ""); - return res; -} + // net().m_cur_Analog = NL_FCONST(0.0); + state().setup().register_term(*this); + } -const pstring param_model_t::type() -{ - return state().setup().models().type(str()); -} + void analog_output_t::initial(nl_fptype val) noexcept + { + net().set_Q_Analog(val); + } -param_str_t::param_str_t(device_t &device, const pstring &name, const pstring &val) -: param_t(device, name) -{ - m_param = device.setup().get_initial_param_val(this->name(),val); -} + // ------------------------------------------------------------------------- + // Parameters ... + // ------------------------------------------------------------------------- -void param_str_t::changed() -{ -} + // device-less, it's the responsibility of the owner to register! + param_t::param_t(const pstring &name) + : device_object_t(nullptr, name) + { + } -param_ptr_t::param_ptr_t(device_t &device, const pstring &name, uint8_t * val) -: param_t(device, name) -{ - m_param = val; //device.setup().get_initial_param_val(this->name(),val); - //netlist().save(*this, m_param, "m_param"); -} + param_t::param_t(core_device_t &device, const pstring &name) + : device_object_t(&device, device.name() + "." + name) + { + device.state().setup().register_param_t(*this); + } -void param_model_t::changed() -{ - state().log().fatal(MF_MODEL_1_CAN_NOT_BE_CHANGED_AT_RUNTIME(name())); -} + // placed here to avoid weak vtable warnings + param_t::~param_t() noexcept = default; -const pstring param_model_t::value_str(const pstring &entity) -{ - return state().setup().models().value_str(str(), entity); -} + param_t::param_type_t param_t::param_type() const noexcept(false) + { + if (plib::dynamic_downcast<const param_str_t *>(this)) + return STRING; + if (plib::dynamic_downcast<const param_fp_t *>(this)) + return DOUBLE; + if (plib::dynamic_downcast<const param_int_t *>(this)) + return INTEGER; + if (plib::dynamic_downcast<const param_logic_t *>(this)) + return LOGIC; + if (plib::dynamic_downcast<const param_ptr_t *>(this)) + return POINTER; -nl_double param_model_t::value(const pstring &entity) -{ - return state().setup().models().value(str(), entity); -} + state().log().fatal(MF_UNKNOWN_PARAM_TYPE(name())); + throw nl_exception(MF_UNKNOWN_PARAM_TYPE(name())); + } + pstring param_t::get_initial(const core_device_t *dev, bool *found) const + { + pstring res = dev->state().setup().get_initial_param_val(this->name(), + ""); + *found = (!res.empty()); + return res; + } -plib::unique_ptr<std::istream> param_data_t::stream() -{ - return device().setup().get_data_stream(str()); -} + param_str_t::param_str_t(core_device_t &device, const pstring &name, + const pstring &val) + : param_t(device, name) + { + m_param = plib::make_unique<pstring, host_arena>(val); + *m_param = device.state().setup().get_initial_param_val(this->name(), + val); + } - bool detail::core_terminal_t::is_logic() const NL_NOEXCEPT + param_str_t::param_str_t(netlist_state_t &state, const pstring &name, + const pstring &val) + : param_t(name) { - return dynamic_cast<const logic_t *>(this) != nullptr; + // device-less parameter, no registration, owner is responsible + m_param = plib::make_unique<pstring, host_arena>(val); + *m_param = state.setup().get_initial_param_val(this->name(), val); } - bool detail::core_terminal_t::is_logic_input() const NL_NOEXCEPT + void param_str_t::changed() noexcept {} + + param_ptr_t::param_ptr_t(core_device_t &device, const pstring &name, + uint8_t *val) + : param_t(device, name) + , m_param(val) { - return dynamic_cast<const logic_input_t *>(this) != nullptr; } - bool detail::core_terminal_t::is_logic_output() const NL_NOEXCEPT + void param_model_t::changed() noexcept {} + + pstring param_model_t::type() { - return dynamic_cast<const logic_output_t *>(this) != nullptr; + auto mod = state().setup().models().get_model(str()); + return mod.type(); } - bool detail::core_terminal_t::is_analog() const NL_NOEXCEPT + pstring param_model_t::value_str(const pstring &entity) { - return dynamic_cast<const analog_t *>(this) != nullptr; + return state().setup().models().get_model(str()).value_str(entity); } - bool detail::core_terminal_t::is_analog_input() const NL_NOEXCEPT + nl_fptype param_model_t::value(const pstring &entity) { - return dynamic_cast<const analog_input_t *>(this) != nullptr; + return state().setup().models().get_model(str()).value(entity); } - bool detail::core_terminal_t::is_analog_output() const NL_NOEXCEPT + plib::istream_uptr param_data_t::stream() { - return dynamic_cast<const analog_output_t *>(this) != nullptr; + return device().state().parser().get_data_stream(str()); } + // ------------------------------------------------------------------------- + // netlist_t + // + // Hot section + // + // Any changes below will impact performance. + // ------------------------------------------------------------------------- - bool detail::net_t::is_logic() const NL_NOEXCEPT + template <bool KEEP_STATS> + void netlist_t::process_queue_stats(const netlist_time_ext delta) noexcept { - return dynamic_cast<const logic_net_t *>(this) != nullptr; + netlist_time_ext stop(m_time + delta); + + queue_push(stop, nullptr); + + if (m_main_clock == nullptr) + { + m_time = m_queue.top().exec_time(); + detail::net_t *obj(m_queue.top().object()); + m_queue.pop(); + + while (obj != nullptr) + { + obj->template update_devs<KEEP_STATS>(); + if (KEEP_STATS) + m_perf_out_processed.inc(); + const detail::queue_t::entry_t *top = &m_queue.top(); + m_time = top->exec_time(); + obj = top->object(); + m_queue.pop(); + } + } + else + { + logic_net_t & mc_net(m_main_clock->m_Q.net()); + const netlist_time inc(m_main_clock->m_inc); + netlist_time_ext mc_time(mc_net.next_scheduled_time()); + + do + { + const detail::queue_t::entry_t *top = &m_queue.top(); + while (top->exec_time() > mc_time) + { + m_time = mc_time; + mc_net.toggle_new_Q(); + mc_net.update_devs<KEEP_STATS>(); + top = &m_queue.top(); + mc_time += inc; + } + + m_time = top->exec_time(); + detail::net_t *const obj(top->object()); + m_queue.pop(); + + if (!!(obj == nullptr)) + break; + + obj->template update_devs<KEEP_STATS>(); + + if (KEEP_STATS) + m_perf_out_processed.inc(); + } while (true); + + mc_net.set_next_scheduled_time(mc_time); + } } - bool detail::net_t::is_analog() const NL_NOEXCEPT + void netlist_t::process_queue(netlist_time_ext delta) noexcept { - return dynamic_cast<const analog_net_t *>(this) != nullptr; + if (!m_use_stats) + process_queue_stats<false>(delta); + else + { + auto sm_guard(m_stat_mainloop.guard()); + process_queue_stats<true>(delta); + } } + template struct state_var<std::uint8_t>; + template struct state_var<std::uint16_t>; + template struct state_var<std::uint32_t>; + template struct state_var<std::uint64_t>; + template struct state_var<std::int8_t>; + template struct state_var<std::int16_t>; + template struct state_var<std::int32_t>; + template struct state_var<std::int64_t>; + template struct state_var<bool>; + + template class param_num_t<std::uint8_t>; + template class param_num_t<std::uint16_t>; + template class param_num_t<std::uint32_t>; + template class param_num_t<std::uint64_t>; + template class param_num_t<std::int8_t>; + template class param_num_t<std::int16_t>; + template class param_num_t<std::int32_t>; + template class param_num_t<std::int64_t>; + template class param_num_t<long double>; + template class param_num_t<double>; + template class param_num_t<float>; + template class param_num_t<bool>; + + template class param_model_t::value_base_t<float>; + template class param_model_t::value_base_t<double>; + template class param_model_t::value_base_t<long double>; + + template class object_array_t<logic_input_t, 1>; + template class object_array_t<logic_input_t, 2>; + template class object_array_t<logic_input_t, 3>; + template class object_array_t<logic_input_t, 4>; + template class object_array_t<logic_input_t, 5>; + template class object_array_t<logic_input_t, 6>; + template class object_array_t<logic_input_t, 7>; + template class object_array_t<logic_input_t, 8>; + + template class object_array_t<logic_output_t, 1>; + template class object_array_t<logic_output_t, 2>; + template class object_array_t<logic_output_t, 3>; + template class object_array_t<logic_output_t, 4>; + template class object_array_t<logic_output_t, 5>; + template class object_array_t<logic_output_t, 6>; + template class object_array_t<logic_output_t, 7>; + template class object_array_t<logic_output_t, 8>; } // namespace netlist diff --git a/src/lib/netlist/nl_base.h b/src/lib/netlist/nl_base.h index eb796bf7834..d191a4537ba 100644 --- a/src/lib/netlist/nl_base.h +++ b/src/lib/netlist/nl_base.h @@ -1,1847 +1,23 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*! - * - * \file nl_base.h - * - */ #ifndef NLBASE_H_ #define NLBASE_H_ -#ifdef NL_PROHIBIT_BASEH_INCLUDE -#error "nl_base.h included. Please correct." -#endif +/// +/// \file nl_base.h +/// -#include "plib/palloc.h" // owned_ptr -#include "plib/pdynlib.h" -#include "plib/pfmtlog.h" -#include "plib/pmempool.h" -#include "plib/ppmf.h" -#include "plib/pstate.h" -#include "plib/pstream.h" - -#include "nl_errstr.h" -#include "nl_lists.h" -#include "nltypes.h" -#include "plib/ptime.h" - -#include <unordered_map> -#include <vector> - -//============================================================ -// MACROS / New Syntax -//============================================================ - -/*! Construct a netlist device name */ -#define NETLIB_NAME(chip) nld_ ## chip - -#define NETLIB_OBJECT_DERIVED(name, pclass) \ -class NETLIB_NAME(name) : public NETLIB_NAME(pclass) - -/*! Start a netlist device class. - * Used to start defining a netlist device class. - * The simplest device without inputs or outputs would look like this: - * - * NETLIB_OBJECT(some_object) - * { - * public: - * NETLIB_CONSTRUCTOR(some_object) { } - * }; - * - * Also refer to #NETLIB_CONSTRUCTOR. - */ -#define NETLIB_OBJECT(name) \ -class NETLIB_NAME(name) : public device_t - -#define NETLIB_CONSTRUCTOR_DERIVED(cname, pclass) \ - private: detail::family_setter_t m_famsetter; \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \ - : NETLIB_NAME(pclass)(owner, name) - -#define NETLIB_CONSTRUCTOR_DERIVED_EX(cname, pclass, ...) \ - private: detail::family_setter_t m_famsetter; \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name, __VA_ARGS__) \ - : NETLIB_NAME(pclass)(owner, name) - -/*! Used to define the constructor of a netlist device. - * Use this to define the constructor of a netlist device. Please refer to - * #NETLIB_OBJECT for an example. - */ -#define NETLIB_CONSTRUCTOR(cname) \ - private: detail::family_setter_t m_famsetter; \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name) \ - : device_t(owner, name) - - /*! Used to define the destructor of a netlist device. - * The use of a destructor for netlist device should normally not be necessary. - */ -#define NETLIB_DESTRUCTOR(name) public: virtual ~NETLIB_NAME(name)() noexcept - - /*! Define an extended constructor and add further parameters to it. - * The macro allows to add further parameters to a device constructor. This is - * normally used for sub-devices and system devices only. - */ -#define NETLIB_CONSTRUCTOR_EX(cname, ...) \ - private: detail::family_setter_t m_famsetter; \ - public: template <class CLASS> NETLIB_NAME(cname)(CLASS &owner, const pstring &name, __VA_ARGS__) \ - : device_t(owner, name) - - /*! Add this to a device definition to mark the device as dynamic. - * - * If NETLIB_IS_DYNAMIC(true) is added to the device definition the device - * is treated as an analog dynamic device, i.e. #NETLIB_UPDATE_TERMINALSI - * is called on a each step of the Newton-Raphson step - * of solving the linear equations. - * - * You may also use e.g. NETLIB_IS_DYNAMIC(m_func() != "") to only make the - * device a dynamic device if parameter m_func is set. - */ -#define NETLIB_IS_DYNAMIC(expr) \ - public: virtual bool is_dynamic() const override { return expr; } - - /*! Add this to a device definition to mark the device as a time-stepping device. - * - * You have to implement NETLIB_TIMESTEP in this case as well. Currently, only - * the capacitor and inductor devices uses this. - * - * You may also use e.g. NETLIB_IS_TIMESTEP(m_func() != "") to only make the - * device a dynamic device if parameter m_func is set. This is used by the - * Voltage Source element. - * - * Example: - * - * NETLIB_TIMESTEP_IS_TIMESTEP() - * NETLIB_TIMESTEPI() - * { - * // Gpar should support convergence - * const nl_double G = m_C.Value() / step + m_GParallel; - * const nl_double I = -G * deltaV(); - * set(G, 0.0, I); - * } - * - */ -#define NETLIB_IS_TIMESTEP(expr) \ - public: virtual bool is_timestep() const override { return expr; } - - /*! Used to implement the time stepping code. - * - * Please see NETLIB_IS_TIMESTEP for an example. - */ -#define NETLIB_TIMESTEPI() \ - public: virtual void timestep(const nl_double step) override - -#define NETLIB_FAMILY(family) , m_famsetter(*this, family) - -#define NETLIB_DELEGATE(chip, name) nldelegate(&NETLIB_NAME(chip) :: name, this) - -#define NETLIB_UPDATE_TERMINALSI() virtual void update_terminals() override -#define NETLIB_HANDLERI(name) virtual void name() NL_NOEXCEPT -#define NETLIB_UPDATEI() virtual void update() NL_NOEXCEPT override -#define NETLIB_UPDATE_PARAMI() virtual void update_param() override -#define NETLIB_RESETI() virtual void reset() override - -#define NETLIB_TIMESTEP(chip) void NETLIB_NAME(chip) :: timestep(const nl_double step) - -#define NETLIB_SUB(chip) nld_ ## chip -#define NETLIB_SUBXX(ns, chip) pool_owned_ptr< ns :: nld_ ## chip > - -#define NETLIB_HANDLER(chip, name) void NETLIB_NAME(chip) :: name() NL_NOEXCEPT -#define NETLIB_UPDATE(chip) NETLIB_HANDLER(chip, update) - -#define NETLIB_RESET(chip) void NETLIB_NAME(chip) :: reset(void) - -#define NETLIB_UPDATE_PARAM(chip) void NETLIB_NAME(chip) :: update_param() -#define NETLIB_FUNC_VOID(chip, name, params) void NETLIB_NAME(chip) :: name params - -#define NETLIB_UPDATE_TERMINALS(chip) void NETLIB_NAME(chip) :: update_terminals() - -//============================================================ -// Asserts -//============================================================ - -#if defined(MAME_DEBUG) -#define nl_assert(x) do { if (1) if (!(x)) throw nl_exception(plib::pfmt("assert: {1}:{2}: {3}")(__FILE__)(__LINE__)(#x) ); } while (0) -#define NL_NOEXCEPT -#else -#define nl_assert(x) do { if (0) if (!(x)) { /*throw nl_exception(plib::pfmt("assert: {1}:{2}: {3}")(__FILE__)(__LINE__)(#x) ); */} } while (0) -#define NL_NOEXCEPT noexcept -#endif -#define nl_assert_always(x, msg) do { if (!(x)) throw nl_exception("Fatal error: {1}\nCaused by assert: {2}:{3}: {4}", msg, __FILE__, __LINE__, #x); } while (0) - -//============================================================ -// Namespace starts -//============================================================ +#include "core/device.h" +#include "core/device_macros.h" +#include "core/devices.h" +#include "core/logic.h" +#include "core/object_array.h" namespace netlist { - /*! Delegate type for device notification. - * - */ - using nldelegate = plib::pmfp<void>; - - // ----------------------------------------------------------------------------- - // forward definitions - // ----------------------------------------------------------------------------- - - namespace devices - { - class matrix_solver_t; - class NETLIB_NAME(gnd); - class NETLIB_NAME(solver); - class NETLIB_NAME(mainclock); - class NETLIB_NAME(netlistparams); - class NETLIB_NAME(base_proxy); - class NETLIB_NAME(base_d_to_a_proxy); - class NETLIB_NAME(base_a_to_d_proxy); - } // namespace devices - - namespace detail { - struct family_setter_t; - class queue_t; - } // namespace detail - - class logic_output_t; - class logic_input_t; - class analog_net_t; - class logic_net_t; - class setup_t; - class netlist_t; - class netlist_state_t; - class core_device_t; - class device_t; - class callbacks_t; - - //============================================================ - // Exceptions - //============================================================ - - /*! Generic netlist exception. - * The exception is used in all events which are considered fatal. - */ - class nl_exception : public plib::pexception - { - public: - /*! Constructor. - * Allows a descriptive text to be assed to the exception - */ - explicit nl_exception(const pstring &text //!< text to be passed - ) - : plib::pexception(text) { } - - template<typename... Args> - explicit nl_exception(const pstring &fmt //!< format to be used - , Args&&... args //!< arguments to be passed - ) - : plib::pexception(plib::pfmt(fmt)(std::forward<Args>(args)...)) { } - }; - - /*! Logic families descriptors are used to create proxy devices. - * The logic family describes the analog capabilities of logic devices, - * inputs and outputs. - */ - class logic_family_desc_t - { - public: - logic_family_desc_t(); - - COPYASSIGNMOVE(logic_family_desc_t, delete) - - virtual ~logic_family_desc_t() noexcept = default; - - virtual pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, - logic_output_t *proxied) const = 0; - virtual pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, - logic_input_t *proxied) const = 0; - - double fixed_V() const { return m_fixed_V; } - double low_thresh_V(const double VN, const double VP) const { return VN + (VP - VN) * m_low_thresh_PCNT; } - double high_thresh_V(const double VN, const double VP) const { return VN + (VP - VN) * m_high_thresh_PCNT; } - double low_offset_V() const { return m_low_VO; } - double high_offset_V() const { return m_high_VO; } - double R_low() const { return m_R_low; } - double R_high() const { return m_R_high; } - - double m_fixed_V; //!< For variable voltage families, specify 0. For TTL this would be 5. */ - double m_low_thresh_PCNT; //!< low input threshhold offset. If the input voltage is below this value times supply voltage, a "0" input is signalled - double m_high_thresh_PCNT; //!< high input threshhold offset. If the input voltage is above the value times supply voltage, a "0" input is signalled - double m_low_VO; //!< low output voltage offset. This voltage is output if the ouput is "0" - double m_high_VO; //!< high output voltage offset. The supply voltage minus this offset is output if the ouput is "1" - double m_R_low; //!< low output resistance. Value of series resistor used for low output - double m_R_high; //!< high output resistance. Value of series resistor used for high output - }; - - /*! Base class for devices, terminals, outputs and inputs which support - * logic families. - * This class is a storage container to store the logic family for a - * netlist object. You will not directly use it. Please refer to - * #NETLIB_FAMILY to learn how to define a logic family for a device. - * - * All terminals inherit the family description from the device - * The default is the ttl family, but any device can override the family. - * For individual terminals, the family can be overwritten as well. - * - */ - class logic_family_t - { - public: - - logic_family_t() : m_logic_family(nullptr) {} - COPYASSIGNMOVE(logic_family_t, delete) - - - const logic_family_desc_t *logic_family() const { return m_logic_family; } - void set_logic_family(const logic_family_desc_t *fam) { m_logic_family = fam; } - - protected: - ~logic_family_t() noexcept = default; // prohibit polymorphic destruction - const logic_family_desc_t *m_logic_family; - }; - - const logic_family_desc_t *family_TTL(); //*!< logic family for TTL devices. - const logic_family_desc_t *family_CD4XXX(); //*!< logic family for CD4XXX CMOS devices. - - /*! A persistent variable template. - * Use the state_var template to define a variable whose value is saved. - * Within a device definition use - * - * NETLIB_OBJECT(abc) - * { - * NETLIB_CONSTRUCTOR(abc) - * , m_var(*this, "myvar", 0) - * ... - * state_var<unsigned> m_var; - * } - */ - - template <typename T> - struct state_var - { - public: - template <typename O> - //! Constructor. - state_var(O &owner, //!< owner must have a netlist() method. - const pstring &name, //!< identifier/name for this state variable - const T &value //!< Initial value after construction - ); - - //! Destructor. - ~state_var() noexcept = default; - //! Copy Constructor. - constexpr state_var(const state_var &rhs) = default; - //! Move Constructor. - constexpr state_var(state_var &&rhs) noexcept = default; - //! Assignment operator to assign value of a state var. - C14CONSTEXPR state_var &operator=(const state_var &rhs) = default; - //! Assignment move operator to assign value of a state var. - C14CONSTEXPR state_var &operator=(state_var &&rhs) noexcept = default; - //! Assignment operator to assign value of type T. - C14CONSTEXPR state_var &operator=(const T &rhs) noexcept { m_value = rhs; return *this; } - //! Assignment move operator to assign value of type T. - C14CONSTEXPR state_var &operator=(T &&rhs) noexcept { std::swap(m_value, rhs); return *this; } - //! Return value of state variable. - C14CONSTEXPR operator T & () noexcept { return m_value; } - //! Return const value of state variable. - constexpr operator const T & () const noexcept { return m_value; } - C14CONSTEXPR T * ptr() noexcept { return &m_value; } - constexpr const T * ptr() const noexcept{ return &m_value; } - - private: - T m_value; - }; - - /*! A persistent array template. - * Use this state_var template to define an array whose contents are saved. - * Please refer to \ref state_var. - */ - template <typename T, std::size_t N> - struct state_array - { - public: - //! Constructor. - template <typename O> - state_array(O &owner, //!< owner must have a netlist() method. - const pstring &name, //!< identifier/name for this state variable - const T &value //!< Initial value after construction - ); - //! Copy Constructor. - state_array(const state_array &rhs) noexcept = default; - //! Destructor. - ~state_array() noexcept = default; - //! Move Constructor. - state_array(state_array &&rhs) noexcept = default; - state_array &operator=(const state_array &rhs) noexcept = default; - state_array &operator=(state_array &&rhs) noexcept = default; - - state_array &operator=(const T &rhs) noexcept { m_value = rhs; return *this; } - T & operator[](const std::size_t i) noexcept { return m_value[i]; } - constexpr const T & operator[](const std::size_t i) const noexcept { return m_value[i]; } - private: - std::array<T, N> m_value; - }; - - // ----------------------------------------------------------------------------- - // State variables - predefined and c++11 non-optional - // ----------------------------------------------------------------------------- - - /*! predefined state variable type for uint8_t */ - using state_var_u8 = state_var<std::uint8_t>; - /*! predefined state variable type for int8_t */ - using state_var_s8 = state_var<std::int8_t>; - - /*! predefined state variable type for uint32_t */ - using state_var_u32 = state_var<std::uint32_t>; - /*! predefined state variable type for int32_t */ - using state_var_s32 = state_var<std::int32_t>; - /*! predefined state variable type for sig_t */ - using state_var_sig = state_var<netlist_sig_t>; - - namespace detail { - - template <typename C, typename T> - struct property_store_t - { - static void add(const C *obj, const T &aname) - { - store().insert({obj, aname}); - } - - static const T get(const C *obj) - { - return store().find(obj)->second; - } - - static void remove(const C *obj) - { - store().erase(store().find(obj)); - } - - static std::unordered_map<const C *, T> &store() - { - static std::unordered_map<const C *, T> lstore; - return lstore; - } - - }; - - // ----------------------------------------------------------------------------- - // object_t - // ----------------------------------------------------------------------------- - - /*! The base class for netlist devices, terminals and parameters. - * - * This class serves as the base class for all device, terminal and - * objects. It provides new and delete operators to support e.g. pooled - * memory allocation to enhance locality. Please refer to \ref USE_MEMPOOL as - * well. - */ - class object_t - { - public: - - /*! Constructor. - * - * Every class derived from the object_t class must have a name. - */ - explicit object_t(const pstring &aname /*!< string containing name of the object */) - { - props::add(this, aname); - } - - COPYASSIGNMOVE(object_t, delete) - /*! return name of the object - * - * \returns name of the object. - */ - pstring name() const - { - return props::get(this); - } - - protected: - - using props = property_store_t<object_t, pstring>; - - // only childs should be destructible - ~object_t() noexcept - { - props::remove(this); - } - - private: - }; - - struct netlist_ref - { - explicit netlist_ref(netlist_state_t &nl); - - COPYASSIGNMOVE(netlist_ref, delete) - - netlist_state_t & state() noexcept; - const netlist_state_t & state() const noexcept; - - setup_t & setup() noexcept; - const setup_t & setup() const noexcept; - - netlist_t & exec() noexcept { return m_netlist; } - const netlist_t & exec() const noexcept { return m_netlist; } - - protected: - ~netlist_ref() noexcept = default; // prohibit polymorphic destruction - - private: - netlist_t & m_netlist; - - }; - - // ----------------------------------------------------------------------------- - // device_object_t - // ----------------------------------------------------------------------------- - - /*! Base class for all objects being owned by a device. - * - * Serves as the base class of all objects being owned by a device. - * - */ - class device_object_t : public object_t - { - public: - /*! Constructor. - * - * \param dev device owning the object. - * \param name string holding the name of the device - */ - device_object_t(core_device_t &dev, const pstring &name); - - /*! returns reference to owning device. - * \returns reference to owning device. - */ - core_device_t &device() noexcept { return m_device; } - const core_device_t &device() const noexcept { return m_device; } - - /*! The netlist owning the owner of this object. - * \returns reference to netlist object. - */ - netlist_state_t &state() NL_NOEXCEPT; - const netlist_state_t &state() const NL_NOEXCEPT; - - netlist_t &exec() NL_NOEXCEPT; - const netlist_t &exec() const NL_NOEXCEPT; - - private: - core_device_t & m_device; - }; - - // ----------------------------------------------------------------------------- - // core_terminal_t - // ----------------------------------------------------------------------------- - - /*! Base class for all terminals. - * - * All terminals are derived from this class. - * - */ - - class net_t; - - class core_terminal_t : public device_object_t, - public plib::linkedlist_t<core_terminal_t>::element_t - { - public: - - using list_t = std::vector<core_terminal_t *>; - - static constexpr const unsigned int INP_HL_SHIFT = 0; - static constexpr const unsigned int INP_LH_SHIFT = 1; - static constexpr const unsigned int INP_ACTIVE_SHIFT = 2; - - enum state_e { - STATE_INP_PASSIVE = 0, - STATE_INP_HL = (1 << INP_HL_SHIFT), - STATE_INP_LH = (1 << INP_LH_SHIFT), - STATE_INP_ACTIVE = (1 << INP_ACTIVE_SHIFT), - STATE_OUT = 128, - STATE_BIDIR = 256 - }; - - core_terminal_t(core_device_t &dev, const pstring &aname, - const state_e state, nldelegate delegate = nldelegate()); - virtual ~core_terminal_t() noexcept = default; - - COPYASSIGNMOVE(core_terminal_t, delete) - - /*! The object type. - * \returns type of the object - */ - terminal_type type() const; - /*! Checks if object is of specified type. - * \param atype type to check object against. - * \returns true if object is of specified type else false. - */ - bool is_type(const terminal_type atype) const noexcept { return (type() == atype); } - - void set_net(net_t *anet) noexcept { m_net = anet; } - void clear_net() noexcept { m_net = nullptr; } - bool has_net() const noexcept { return (m_net != nullptr); } - - const net_t & net() const noexcept { return *m_net;} - net_t & net() noexcept { return *m_net;} - - bool is_logic() const NL_NOEXCEPT; - bool is_logic_input() const NL_NOEXCEPT; - bool is_logic_output() const NL_NOEXCEPT; - bool is_analog() const NL_NOEXCEPT; - bool is_analog_input() const NL_NOEXCEPT; - bool is_analog_output() const NL_NOEXCEPT; - - bool is_state(state_e astate) const noexcept { return (m_state == astate); } - state_e terminal_state() const noexcept { return m_state; } - void set_state(state_e astate) noexcept { m_state = astate; } - - void reset() noexcept { set_state(is_type(OUTPUT) ? STATE_OUT : STATE_INP_ACTIVE); } - - nldelegate m_delegate; - #if USE_COPY_INSTEAD_OF_REFERENCE - void set_copied_input(netlist_sig_t val) - { - m_Q = val; - } - - state_var_sig m_Q; - #else - void set_copied_input(netlist_sig_t val) const { plib::unused_var(val); } - #endif - - private: - net_t * m_net; - state_var<state_e> m_state; - }; - - // ----------------------------------------------------------------------------- - // net_t - // ----------------------------------------------------------------------------- - - class net_t : - public object_t, - public netlist_ref - { - public: - - enum class queue_status - { - DELAYED_DUE_TO_INACTIVE = 0, - QUEUED, - DELIVERED - }; - - net_t(netlist_state_t &nl, const pstring &aname, core_terminal_t *mr = nullptr); - - COPYASSIGNMOVE(net_t, delete) - - virtual ~net_t() noexcept = default; - - void reset(); - - void toggle_new_Q() noexcept { m_new_Q = (m_cur_Q ^ 1); } - - void toggle_and_push_to_queue(netlist_time delay) NL_NOEXCEPT - { - toggle_new_Q(); - push_to_queue(delay); - } - - void push_to_queue(netlist_time delay) NL_NOEXCEPT; - bool is_queued() const noexcept { return m_in_queue == queue_status::QUEUED; } - - template <bool KEEP_STATS> - void update_devs() NL_NOEXCEPT; - - netlist_time next_scheduled_time() const noexcept { return m_next_scheduled_time; } - void set_next_scheduled_time(netlist_time ntime) noexcept { m_next_scheduled_time = ntime; } - - bool isRailNet() const noexcept { return !(m_railterminal == nullptr); } - core_terminal_t & railterminal() const noexcept { return *m_railterminal; } - - std::size_t num_cons() const noexcept { return m_core_terms.size(); } - - void add_to_active_list(core_terminal_t &term) NL_NOEXCEPT; - void remove_from_active_list(core_terminal_t &term) NL_NOEXCEPT; - - /* setup stuff */ - - void add_terminal(core_terminal_t &terminal); - void remove_terminal(core_terminal_t &terminal); - - bool is_logic() const NL_NOEXCEPT; - bool is_analog() const NL_NOEXCEPT; - - void rebuild_list(); /* rebuild m_list after a load */ - void move_connections(net_t &dest_net); - - std::vector<core_terminal_t *> &core_terms() { return m_core_terms; } - #if USE_COPY_INSTEAD_OF_REFERENCE - void update_inputs() - { - for (auto & term : m_core_terms) - term->m_Q = m_cur_Q; - } - #else - void update_inputs() const - { - /* nothing needs to be done */ - } - #endif - - protected: - - /* only used for logic nets */ - netlist_sig_t Q() const noexcept { return m_cur_Q; } - - /* only used for logic nets */ - void initial(const netlist_sig_t val) noexcept - { - m_cur_Q = m_new_Q = val; - update_inputs(); - } - - /* only used for logic nets */ - void set_Q_and_push(const netlist_sig_t newQ, const netlist_time delay) NL_NOEXCEPT - { - if (newQ != m_new_Q) - { - m_new_Q = newQ; - push_to_queue(delay); - } - } - - /* only used for logic nets */ - void set_Q_time(const netlist_sig_t newQ, const netlist_time at) NL_NOEXCEPT - { - if (newQ != m_new_Q) - { - m_in_queue = queue_status::DELAYED_DUE_TO_INACTIVE; - m_next_scheduled_time = at; - } - m_cur_Q = m_new_Q = newQ; - update_inputs(); - } - - /* internal state support - * FIXME: get rid of this and implement export/import in MAME - */ - /* only used for logic nets */ - netlist_sig_t *Q_state_ptr() { return m_cur_Q.ptr(); } - - private: - state_var<netlist_sig_t> m_new_Q; - state_var<netlist_sig_t> m_cur_Q; - state_var<queue_status> m_in_queue; /* 0: not in queue, 1: in queue, 2: last was taken */ - state_var<netlist_time> m_next_scheduled_time; - - core_terminal_t * m_railterminal; - plib::linkedlist_t<core_terminal_t> m_list_active; - std::vector<core_terminal_t *> m_core_terms; // save post-start m_list ... - - template <bool KEEP_STATS, typename T> - void process(const T mask, netlist_sig_t sig); - }; - } // namespace detail - - // ----------------------------------------------------------------------------- - // analog_t - // ----------------------------------------------------------------------------- - - class analog_t : public detail::core_terminal_t - { - public: - - analog_t(core_device_t &dev, const pstring &aname, const state_e state, - nldelegate delegate = nldelegate()); - - const analog_net_t & net() const NL_NOEXCEPT; - analog_net_t & net() NL_NOEXCEPT; - }; - - // ----------------------------------------------------------------------------- - // terminal_t - // ----------------------------------------------------------------------------- - - class terminal_t : public analog_t - { - public: - - terminal_t(core_device_t &dev, const pstring &aname, terminal_t *otherterm); - - nl_double operator ()() const NL_NOEXCEPT; - - void set_conductivity(const nl_double G) noexcept - { - set_go_gt_I(-G, G, 0.0); - } - - void set_go_gt(const nl_double GO, const nl_double GT) noexcept - { - set_go_gt_I(GO, GT, 0.0); - } - - void set_go_gt_I(const nl_double GO, const nl_double GT, const nl_double I) noexcept - { - if (m_go1 != nullptr) - { - if (*m_Idr1 != I) *m_Idr1 = I; - if (*m_go1 != GO) *m_go1 = GO; - if (*m_gt1 != GT) *m_gt1 = GT; - } - } - - void solve_now(); - void schedule_solve_after(const netlist_time after); - - void set_ptrs(nl_double *gt, nl_double *go, nl_double *Idr) noexcept; - - terminal_t *connected_terminal() const noexcept { return m_connected_terminal; } - private: - - nl_double *m_Idr1; // drive current - nl_double *m_go1; // conductance for Voltage from other term - nl_double *m_gt1; // conductance for total conductance - - terminal_t *m_connected_terminal; - - }; - - - // ----------------------------------------------------------------------------- - // logic_t - // ----------------------------------------------------------------------------- - - class logic_t : public detail::core_terminal_t, public logic_family_t - { - public: - logic_t(core_device_t &dev, const pstring &aname, - const state_e state, nldelegate delegate = nldelegate()); - - bool has_proxy() const { return (m_proxy != nullptr); } - devices::nld_base_proxy *get_proxy() const { return m_proxy; } - void set_proxy(devices::nld_base_proxy *proxy) { m_proxy = proxy; } - - logic_net_t & net() NL_NOEXCEPT; - const logic_net_t & net() const NL_NOEXCEPT; - - protected: - - private: - devices::nld_base_proxy *m_proxy; - }; - - // ----------------------------------------------------------------------------- - // logic_input_t - // ----------------------------------------------------------------------------- - - class logic_input_t : public logic_t - { - public: - logic_input_t(core_device_t &dev, const pstring &aname, - nldelegate delegate = nldelegate()); - - netlist_sig_t operator()() const NL_NOEXCEPT - { - return Q(); - } - - void inactivate() NL_NOEXCEPT; - void activate() NL_NOEXCEPT; - void activate_hl() NL_NOEXCEPT; - void activate_lh() NL_NOEXCEPT; - private: - netlist_sig_t Q() const NL_NOEXCEPT; - }; - - // ----------------------------------------------------------------------------- - // analog_input_t - // ----------------------------------------------------------------------------- - - /*! terminal providing analog input voltage. - * - * This terminal class provides a voltage measurement. The conductance against - * ground is infinite. - */ - class analog_input_t : public analog_t - { - public: - /*! Constructor */ - analog_input_t(core_device_t &dev, /*!< owning device */ - const pstring &aname, /*!< name of terminal */ - nldelegate delegate = nldelegate() /*!< delegate */ - ); - - /*! returns voltage at terminal. - * \returns voltage at terminal. - */ - nl_double operator()() const NL_NOEXCEPT { return Q_Analog(); } - - /*! returns voltage at terminal. - * \returns voltage at terminal. - */ - nl_double Q_Analog() const NL_NOEXCEPT; - - }; - - - class logic_net_t : public detail::net_t - { - public: - - logic_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *mr = nullptr); - - using detail::net_t::Q; - using detail::net_t::initial; - using detail::net_t::set_Q_and_push; - using detail::net_t::set_Q_time; - using detail::net_t::Q_state_ptr; - - }; - - class analog_net_t : public detail::net_t - { - public: - - using list_t = std::vector<analog_net_t *>; - - friend class detail::net_t; - - analog_net_t(netlist_state_t &nl, const pstring &aname, detail::core_terminal_t *mr = nullptr); - - nl_double Q_Analog() const NL_NOEXCEPT { return m_cur_Analog; } - void set_Q_Analog(const nl_double v) NL_NOEXCEPT { m_cur_Analog = v; } - nl_double *Q_Analog_state_ptr() NL_NOEXCEPT { return m_cur_Analog.ptr(); } - - //FIXME: needed by current solver code - devices::matrix_solver_t *solver() const NL_NOEXCEPT { return m_solver; } - void set_solver(devices::matrix_solver_t *solver) NL_NOEXCEPT { m_solver = solver; } - - private: - state_var<nl_double> m_cur_Analog; - devices::matrix_solver_t *m_solver; - }; - - // ----------------------------------------------------------------------------- - // logic_output_t - // ----------------------------------------------------------------------------- - - class logic_output_t : public logic_t - { - public: - - logic_output_t(core_device_t &dev, const pstring &aname); + // nothing in here. This should not change. - void initial(const netlist_sig_t val); - - void push(const netlist_sig_t newQ, const netlist_time delay) NL_NOEXCEPT - { - m_my_net.set_Q_and_push(newQ, delay); // take the shortcut - } - - void set_Q_time(const netlist_sig_t newQ, const netlist_time at) NL_NOEXCEPT - { - m_my_net.set_Q_time(newQ, at); // take the shortcut - } - - private: - logic_net_t m_my_net; - }; - - class analog_output_t : public analog_t - { - public: - analog_output_t(core_device_t &dev, const pstring &aname); - - void push(const nl_double val) NL_NOEXCEPT { set_Q(val); } - void initial(const nl_double val); - - private: - void set_Q(const nl_double newQ) NL_NOEXCEPT; - analog_net_t m_my_net; - }; - - // ----------------------------------------------------------------------------- - // param_t - // ----------------------------------------------------------------------------- - - class param_t : public detail::device_object_t - { - public: - - enum param_type_t { - STRING, - DOUBLE, - INTEGER, - LOGIC, - POINTER // Special-case which is always initialized at MAME startup time - }; - - param_t(device_t &device, const pstring &name); - - COPYASSIGNMOVE(param_t, delete) - - param_type_t param_type() const; - - protected: - virtual ~param_t() noexcept = default; /* not intended to be destroyed */ - - void update_param(); - - pstring get_initial(const device_t &dev, bool *found); - - template<typename C> - void set(C &p, const C v) - { - if (p != v) - { - p = v; - update_param(); - } - } - - }; - - // ----------------------------------------------------------------------------- - // numeric parameter template - // ----------------------------------------------------------------------------- - - template <typename T> - class param_num_t final: public param_t - { - public: - param_num_t(device_t &device, const pstring &name, const T val); - - const T operator()() const NL_NOEXCEPT { return m_param; } - void setTo(const T ¶m) { set(m_param, param); } - private: - T m_param; - }; - - /* FIXME: these should go as well */ - using param_logic_t = param_num_t<bool>; - using param_int_t = param_num_t<int>; - using param_double_t = param_num_t<double>; - - // ----------------------------------------------------------------------------- - // pointer parameter - // ----------------------------------------------------------------------------- - - class param_ptr_t final: public param_t - { - public: - param_ptr_t(device_t &device, const pstring &name, std::uint8_t* val); - std::uint8_t * operator()() const NL_NOEXCEPT { return m_param; } - void setTo(std::uint8_t *param) { set(m_param, param); } - private: - std::uint8_t* m_param; - }; - - // ----------------------------------------------------------------------------- - // string parameter - // ----------------------------------------------------------------------------- - - class param_str_t : public param_t - { - public: - param_str_t(device_t &device, const pstring &name, const pstring &val); - - const pstring &operator()() const NL_NOEXCEPT { return str(); } - void setTo(const pstring ¶m) NL_NOEXCEPT - { - if (m_param != param) - { - m_param = param; - changed(); - update_param(); - } - } - protected: - virtual void changed(); - const pstring &str() const NL_NOEXCEPT { return m_param; } - private: - PALIGNAS_CACHELINE() - pstring m_param; - }; - - // ----------------------------------------------------------------------------- - // model parameter - // ----------------------------------------------------------------------------- - - class param_model_t : public param_str_t - { - public: - - template <typename T> - class value_base_t - { - public: - value_base_t(param_model_t ¶m, const pstring &name) - : m_value(static_cast<T>(param.value(name))) - { - } - T operator()() const noexcept { return m_value; } - operator T() const noexcept { return m_value; } - private: - const T m_value; - }; - - using value_t = value_base_t<nl_double>; - - template <typename T> - friend class value_base_t; - - param_model_t(device_t &device, const pstring &name, const pstring &val) - : param_str_t(device, name, val) { } - - const pstring value_str(const pstring &entity) /*const*/; - nl_double value(const pstring &entity) /*const*/; - const pstring type() /*const*/; - /* hide this */ - void setTo(const pstring ¶m) = delete; - protected: - void changed() override; - private: -}; - - // ----------------------------------------------------------------------------- - // data parameter - // ----------------------------------------------------------------------------- - - class param_data_t : public param_str_t - { - public: - param_data_t(device_t &device, const pstring &name) - : param_str_t(device, name, "") - { - } - - plib::unique_ptr<std::istream> stream(); - protected: - void changed() override { } - }; - - // ----------------------------------------------------------------------------- - // rom parameter - // ----------------------------------------------------------------------------- - - template <typename ST, std::size_t AW, std::size_t DW> - class param_rom_t final: public param_data_t - { - public: - - param_rom_t(device_t &device, const pstring &name); - - ST operator[] (std::size_t n) const NL_NOEXCEPT { return m_data[n]; } - protected: - void changed() override - { - stream()->read(reinterpret_cast<std::istream::char_type *>(&m_data[0]),1<<AW); - } - - private: - std::array<ST, 1 << AW> m_data; - }; - - // ----------------------------------------------------------------------------- - // core_device_t - // ----------------------------------------------------------------------------- - - class core_device_t : - public detail::object_t, - public logic_family_t, - public detail::netlist_ref - { - public: - core_device_t(netlist_state_t &owner, const pstring &name); - core_device_t(core_device_t &owner, const pstring &name); - - COPYASSIGNMOVE(core_device_t, delete) - - virtual ~core_device_t() noexcept = default; - - void do_inc_active() NL_NOEXCEPT - { - if (m_hint_deactivate) - { - if (++m_active_outputs == 1) - { - if (m_stats/*NL_KEEP_STATISTICS*/) - m_stats->m_stat_inc_active.inc(); - inc_active(); - } - } - } - - void do_dec_active() NL_NOEXCEPT - { - if (m_hint_deactivate) - if (--m_active_outputs == 0) - { - dec_active(); - } - } - - void set_hint_deactivate(bool v) { m_hint_deactivate = v; } - bool get_hint_deactivate() { return m_hint_deactivate; } - /* Has to be set in device reset */ - void set_active_outputs(int n) { m_active_outputs = n; } - - void set_default_delegate(detail::core_terminal_t &term); - - /* stats */ - struct stats_t - { - // NL_KEEP_STATISTICS - nperftime_t<true> m_stat_total_time; - nperfcount_t<true> m_stat_call_count; - nperfcount_t<true> m_stat_inc_active; - }; - - plib::unique_ptr<stats_t> m_stats; - - virtual void update() NL_NOEXCEPT { } - virtual void reset() { } - - protected: - - virtual void inc_active() NL_NOEXCEPT { } - virtual void dec_active() NL_NOEXCEPT { } - - log_type & log(); - - public: - virtual void timestep(const nl_double st) { plib::unused_var(st); } - virtual void update_terminals() { } - - virtual void update_param() {} - virtual bool is_dynamic() const { return false; } - virtual bool is_timestep() const { return false; } - - private: - bool m_hint_deactivate; - state_var_s32 m_active_outputs; - }; - - // ----------------------------------------------------------------------------- - // device_t - // ----------------------------------------------------------------------------- - - class device_t : public core_device_t - { - public: - - device_t(netlist_state_t &owner, const pstring &name); - device_t(core_device_t &owner, const pstring &name); - - COPYASSIGNMOVE(device_t, delete) - - ~device_t() noexcept override = default; - - setup_t &setup(); - const setup_t &setup() const; - - template<class C, typename... Args> - void create_and_register_subdevice(const pstring &name, pool_owned_ptr<C> &dev, Args&&... args) - { - dev = pool().make_poolptr<C>(*this, name, std::forward<Args>(args)...); - } - - void register_subalias(const pstring &name, detail::core_terminal_t &term); - void register_subalias(const pstring &name, const pstring &aliased); - - void connect(const pstring &t1, const pstring &t2); - void connect(detail::core_terminal_t &t1, detail::core_terminal_t &t2); - void connect_post_start(detail::core_terminal_t &t1, detail::core_terminal_t &t2); - protected: - - NETLIB_UPDATEI() { } - NETLIB_UPDATE_TERMINALSI() { } - - private: - }; - - // ----------------------------------------------------------------------------- - // family_setter_t - // ----------------------------------------------------------------------------- - - struct detail::family_setter_t - { - /* clang will complain about an unused private field if - * a defaulted constructor is used - */ - // NOLINTNEXTLINE(modernize-use-equals-default) - family_setter_t(); - family_setter_t(core_device_t &dev, const pstring &desc); - family_setter_t(core_device_t &dev, const logic_family_desc_t *desc); - }; - - // ----------------------------------------------------------------------------- - // queue_t - // ----------------------------------------------------------------------------- - - /* We don't need a thread-safe queue currently. Parallel processing of - * solvers will update inputs after parallel processing. - */ - class detail::queue_t : - //public timed_queue<pqentry_t<net_t *, netlist_time>, false, NL_KEEP_STATISTICS>, - public timed_queue<pqentry_t<net_t *, netlist_time>, false, true>, - public detail::netlist_ref, - public plib::state_manager_t::callback_t - { - public: - using base_queue = timed_queue<pqentry_t<net_t *, netlist_time>, false, true>; - using entry_t = pqentry_t<net_t *, netlist_time>; - explicit queue_t(netlist_state_t &nl); - virtual ~queue_t() noexcept = default; - - queue_t(const queue_t &) = delete; - queue_t(queue_t &&) = delete; - queue_t &operator=(const queue_t &) = delete; - queue_t &operator=(queue_t &&) = delete; - - protected: - - void register_state(plib::state_manager_t &manager, const pstring &module) override; - void on_pre_save(plib::state_manager_t &manager) override; - void on_post_load(plib::state_manager_t &manager) override; - - private: - std::size_t m_qsize; - std::vector<netlist_time::internal_type> m_times; - std::vector<std::size_t> m_net_ids; - }; - - // ----------------------------------------------------------------------------- - // netlist_state__t - // ----------------------------------------------------------------------------- - - class netlist_state_t - { - public: - - using nets_collection_type = std::vector<pool_owned_ptr<detail::net_t>>; - - /* need to preserve order of device creation ... */ - using devices_collection_type = std::vector<std::pair<pstring, pool_owned_ptr<core_device_t>>>; - netlist_state_t(const pstring &aname, - netlist_t & anetlist, - plib::unique_ptr<callbacks_t> &&callbacks); - - COPYASSIGNMOVE(netlist_state_t, delete) - - ~netlist_state_t() noexcept = default; - - friend class netlist_t; // allow access to private members - - template<class C> - static bool check_class(core_device_t *p) - { - return dynamic_cast<C *>(p) != nullptr; - } - - core_device_t *get_single_device(const pstring &classname, bool (*cc)(core_device_t *)) const; - - template<class C> - C *get_single_device(const pstring &classname) const - { - return dynamic_cast<C *>(get_single_device(classname, check_class<C>)); - } - - /* logging and name */ - - pstring name() const { return m_name; } - - log_type & log() { return m_log; } - const log_type &log() const { return m_log; } - - plib::dynlib &lib() { return *m_lib; } - - netlist_t &exec() { return m_netlist; } - const netlist_t &exec() const { return m_netlist; } - - /* state handling */ - plib::state_manager_t &run_state_manager() { return m_state; } - - template<typename O, typename C> - void save(O &owner, C &state, const pstring &module, const pstring &stname) - { - this->run_state_manager().save_item(static_cast<void *>(&owner), state, module + pstring(".") + stname); - } - template<typename O, typename C> - void save(O &owner, C *state, const pstring &module, const pstring &stname, const std::size_t count) - { - this->run_state_manager().save_state_ptr(static_cast<void *>(&owner), module + pstring(".") + stname, plib::state_manager_t::dtype<C>(), count, state); - } - - detail::net_t *find_net(const pstring &name) const; - std::size_t find_net_id(const detail::net_t *net) const; - - template <typename T> - void register_net(pool_owned_ptr<T> &&net) { m_nets.push_back(std::move(net)); } - - template<class device_class> - inline std::vector<device_class *> get_device_list() - { - std::vector<device_class *> tmp; - for (auto &d : m_devices) - { - auto dev = dynamic_cast<device_class *>(d.second.get()); - if (dev != nullptr) - tmp.push_back(dev); - } - return tmp; - } - - core_device_t *find_device(const pstring &name) - { - for (auto & d : m_devices) - if (d.first == name) - return d.second.get(); - return nullptr; - } - - template <typename T> - void add_dev(const pstring &name, pool_owned_ptr<T> &&dev) - { - for (auto & d : m_devices) - if (d.first == name) - { - dev.release(); - log().fatal(MF_DUPLICATE_NAME_DEVICE_LIST(name)); - } - //m_devices.push_back(std::move(dev)); - m_devices.insert(m_devices.end(), { name, std::move(dev) }); - } - - /** - * @brief Remove device - * - * Care needs to be applied if this is called to remove devices with - * sub-devices which may have registered state. - * - * @param dev Device to be removed - */ - void remove_dev(core_device_t *dev) - { - for (auto it = m_devices.begin(); it != m_devices.end(); it++) - if (it->second.get() == dev) - { - m_state.remove_save_items(dev); - m_devices.erase(it); - return; - } - } - - /* sole use is to manage lifetime of family objects */ - std::unordered_map<pstring, plib::unique_ptr<logic_family_desc_t>> m_family_cache; - - setup_t &setup() NL_NOEXCEPT { return *m_setup; } - const setup_t &setup() const NL_NOEXCEPT { return *m_setup; } - - nets_collection_type & nets() { return m_nets; } - devices_collection_type & devices() { return m_devices; } - - // FIXME: make a postload member and include code there - void rebuild_lists(); /* must be called after post_load ! */ - - static void compile_defines(std::vector<std::pair<pstring, pstring>> &defs); - - private: - - void reset(); - - pstring m_name; - netlist_t &m_netlist; - plib::unique_ptr<plib::dynlib> m_lib; // external lib needs to be loaded as long as netlist exists - plib::state_manager_t m_state; - plib::unique_ptr<callbacks_t> m_callbacks; - log_type m_log; - plib::unique_ptr<setup_t> m_setup; - - nets_collection_type m_nets; - /* sole use is to manage lifetime of net objects */ - devices_collection_type m_devices; - - - - }; - - // ----------------------------------------------------------------------------- - // netlist_t - // ----------------------------------------------------------------------------- - - class netlist_t - { - public: - - explicit netlist_t(const pstring &aname, plib::unique_ptr<callbacks_t> callbacks); - - COPYASSIGNMOVE(netlist_t, delete) - - virtual ~netlist_t() noexcept = default; - - /* run functions */ - - netlist_time time() const NL_NOEXCEPT { return m_time; } - - void process_queue(const netlist_time delta) NL_NOEXCEPT; - void abort_current_queue_slice() NL_NOEXCEPT { m_queue.retime(detail::queue_t::entry_t(m_time, nullptr)); } - - const detail::queue_t &queue() const NL_NOEXCEPT { return m_queue; } - - void qpush(detail::queue_t::entry_t && e) noexcept - { - if (!USE_QUEUE_STATS || !m_stats) - m_queue.push_nostats(std::move(e)); - else - m_queue.push(std::move(e)); - } - - template <class R> - void qremove(const R &elem) noexcept - { - if (!USE_QUEUE_STATS || !m_stats) - m_queue.remove_nostats(elem); - else - m_queue.remove(elem); - } - - /* Control functions */ - - void stop(); - void reset(); - - /* state handling */ - - plib::state_manager_t &run_state_manager() { return m_state->run_state_manager(); } - - /* only used by nltool to create static c-code */ - devices::NETLIB_NAME(solver) *solver() const NL_NOEXCEPT { return m_solver; } - - /* force late type resolution */ - template <typename X = devices::NETLIB_NAME(solver)> - nl_double gmin(X *solv = nullptr) const NL_NOEXCEPT - { - plib::unused_var(solv); - return static_cast<X *>(m_solver)->gmin(); - } - - netlist_state_t &nlstate() NL_NOEXCEPT { return *m_state; } - const netlist_state_t &nlstate() const { return *m_state; } - - log_type & log() { return m_state->log(); } - const log_type &log() const { return m_state->log(); } - - void print_stats() const; - - bool stats_enabled() const { return m_stats; } - void enable_stats(bool val) { m_stats = val; } - - private: - - template <bool KEEP_STATS> - void process_queue_stats(const netlist_time delta) NL_NOEXCEPT; - - plib::unique_ptr<netlist_state_t> m_state; - devices::NETLIB_NAME(solver) * m_solver; - - /* mostly rw */ - PALIGNAS_CACHELINE() - netlist_time m_time; - devices::NETLIB_NAME(mainclock) * m_mainclock; - - PALIGNAS_CACHELINE() - detail::queue_t m_queue; - bool m_stats; - - // performance - nperftime_t<true> m_stat_mainloop; - nperfcount_t<true> m_perf_out_processed; -}; - - // ----------------------------------------------------------------------------- - // Support classes for devices - // ----------------------------------------------------------------------------- - - template<class C, int N> - class object_array_t : public plib::uninitialised_array_t<C, N> - { - public: - struct init - { - std::array<const char *, N> p; - }; - template<typename... Args> - object_array_t(core_device_t &dev, init names, Args&&... args) - { - for (std::size_t i = 0; i<N; i++) - this->emplace(i, dev, pstring(names.p[i]), std::forward<Args>(args)...); - } - }; - - // ----------------------------------------------------------------------------- - // inline implementations - // ----------------------------------------------------------------------------- - - inline netlist_state_t & detail::netlist_ref::state() noexcept - { - return m_netlist.nlstate(); - } - - inline const netlist_state_t & detail::netlist_ref::state() const noexcept - { - return m_netlist.nlstate(); - } - - inline setup_t & detail::netlist_ref::setup() noexcept - { - return m_netlist.nlstate().setup(); - } - - inline const setup_t & detail::netlist_ref::setup() const noexcept - { - return m_netlist.nlstate().setup(); - } - - template <typename T> - param_num_t<T>::param_num_t(device_t &device, const pstring &name, const T val) - : param_t(device, name) - { - //m_param = device.setup().get_initial_param_val(this->name(),val); - bool found = false; - pstring p = this->get_initial(device, &found); - if (found) - { - bool err = false; - auto vald = plib::pstonum_ne<T, true>(p, err); - if (err) - device.state().log().fatal(MF_INVALID_NUMBER_CONVERSION_1_2(name, p)); - m_param = vald; - } - else - m_param = val; - - device.state().save(*this, m_param, this->name(), "m_param"); - } - - template <typename ST, std::size_t AW, std::size_t DW> - param_rom_t<ST, AW, DW>::param_rom_t(device_t &device, const pstring &name) - : param_data_t(device, name) - { - auto f = stream(); - if (f != nullptr) - f->read(reinterpret_cast<std::istream::char_type *>(&m_data[0]),1<<AW); - else - device.state().log().warning(MW_ROM_NOT_FOUND(str())); - } - - inline void logic_input_t::inactivate() NL_NOEXCEPT - { - if (!is_state(STATE_INP_PASSIVE)) - { - set_state(STATE_INP_PASSIVE); - net().remove_from_active_list(*this); - } - } - - inline void logic_input_t::activate() NL_NOEXCEPT - { - if (is_state(STATE_INP_PASSIVE)) - { - net().add_to_active_list(*this); - set_state(STATE_INP_ACTIVE); - } - } - - inline void logic_input_t::activate_hl() NL_NOEXCEPT - { - if (is_state(STATE_INP_PASSIVE)) - { - net().add_to_active_list(*this); - set_state(STATE_INP_HL); - } - } - - inline void logic_input_t::activate_lh() NL_NOEXCEPT - { - if (is_state(STATE_INP_PASSIVE)) - { - net().add_to_active_list(*this); - set_state(STATE_INP_LH); - } - } - - inline void detail::net_t::push_to_queue(const netlist_time delay) NL_NOEXCEPT - { - if ((num_cons() != 0)) - { - auto &lexec(exec()); - const auto nst(lexec.time() + delay); - - if (is_queued()) - lexec.qremove(this); - - if (!m_list_active.empty()) - { - m_in_queue = queue_status::QUEUED; - lexec.qpush(queue_t::entry_t(nst, this)); - } - else - { - m_in_queue = queue_status::DELAYED_DUE_TO_INACTIVE; - update_inputs(); - } - m_next_scheduled_time = nst; - } - } - - inline void detail::net_t::add_to_active_list(core_terminal_t &term) NL_NOEXCEPT - { - if (m_list_active.empty()) - { - m_list_active.push_front(&term); - railterminal().device().do_inc_active(); - if (m_in_queue == queue_status::DELAYED_DUE_TO_INACTIVE) - { - if (m_next_scheduled_time > exec().time()) - { - m_in_queue = queue_status::QUEUED; /* pending */ - exec().qpush({m_next_scheduled_time, this}); - } - else - { - m_in_queue = queue_status::DELIVERED; - m_cur_Q = m_new_Q; - } - update_inputs(); - } - else - term.set_copied_input(m_cur_Q); - } - else - { - term.set_copied_input(m_cur_Q); - m_list_active.push_front(&term); - } - } - - inline void detail::net_t::remove_from_active_list(core_terminal_t &term) NL_NOEXCEPT - { - m_list_active.remove(&term); - if (m_list_active.empty()) - railterminal().device().do_dec_active(); - } - - inline const analog_net_t & analog_t::net() const NL_NOEXCEPT - { - return static_cast<const analog_net_t &>(core_terminal_t::net()); - } - - inline analog_net_t & analog_t::net() NL_NOEXCEPT - { - return static_cast<analog_net_t &>(core_terminal_t::net()); - } - - inline nl_double terminal_t::operator ()() const NL_NOEXCEPT { return net().Q_Analog(); } - - inline void terminal_t::set_ptrs(nl_double *gt, nl_double *go, nl_double *Idr) noexcept - { - if (!(gt && go && Idr) && (gt || go || Idr)) - state().log().fatal("Inconsistent nullptrs for terminal {}", name()); - else - { - m_gt1 = gt; - m_go1 = go; - m_Idr1 = Idr; - } - } - - inline logic_net_t & logic_t::net() NL_NOEXCEPT - { - return static_cast<logic_net_t &>(core_terminal_t::net()); - } - - inline const logic_net_t & logic_t::net() const NL_NOEXCEPT - { - return static_cast<const logic_net_t &>(core_terminal_t::net()); - } - - inline netlist_sig_t logic_input_t::Q() const NL_NOEXCEPT - { - nl_assert(terminal_state() != STATE_INP_PASSIVE); - //if (net().Q() != m_Q) - // printf("term: %s, %d %d TS %d\n", this->name().c_str(), net().Q(), m_Q, terminal_state()); -#if USE_COPY_INSTEAD_OF_REFERENCE - return m_Q; -#else - return net().Q(); -#endif - } - - inline nl_double analog_input_t::Q_Analog() const NL_NOEXCEPT - { - return net().Q_Analog(); - } - - inline void analog_output_t::set_Q(const nl_double newQ) NL_NOEXCEPT - { - if (newQ != m_my_net.Q_Analog()) - { - m_my_net.set_Q_Analog(newQ); - m_my_net.toggle_and_push_to_queue(netlist_time::quantum()); - } - } - - inline netlist_state_t &detail::device_object_t::state() NL_NOEXCEPT - { - return m_device.state(); - } - - inline const netlist_state_t &detail::device_object_t::state() const NL_NOEXCEPT - { - return m_device.state(); - } - - inline netlist_t &detail::device_object_t::exec() NL_NOEXCEPT - { - return m_device.exec(); - } - - inline const netlist_t &detail::device_object_t::exec() const NL_NOEXCEPT - { - return m_device.exec(); - } - - template <typename T> - template <typename O> - state_var<T>::state_var(O &owner, const pstring &name, const T &value) - : m_value(value) - { - owner.state().save(owner, m_value, owner.name(), name); - } - - template <typename T, std::size_t N> - template <typename O> - state_array<T,N>::state_array(O &owner, const pstring &name, const T & value) - { - owner.state().save(owner, m_value, owner.name(), name); - for (std::size_t i=0; i<N; i++) - m_value[i] = value; - } } // namespace netlist -namespace plib -{ - template<typename X> - struct ptype_traits<netlist::state_var<X>> : ptype_traits<X> - { - }; -} // namespace plib - - - -#endif /* NLBASE_H_ */ +#endif // NLBASE_H_ diff --git a/src/lib/netlist/nl_config.h b/src/lib/netlist/nl_config.h index f2005602443..7306de88cde 100644 --- a/src/lib/netlist/nl_config.h +++ b/src/lib/netlist/nl_config.h @@ -1,105 +1,419 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*! - * - * \file nl_config.h - * - */ + +/// \file nl_config.h +/// #ifndef NLCONFIG_H_ #define NLCONFIG_H_ +// Names +// spell-checker: words Woodbury + #include "plib/pconfig.h" +#include "plib/pexception.h" -//============================================================ -// SETUP -//============================================================ - - -//============================================================ -// GENERAL -//============================================================ - -/*! Make use of a memory pool for performance related objects. - * - * Set to 1 to compile netlist with memory allocations from a - * linear memory pool. This is based of the assumption that - * due to enhanced locality there will be less cache misses. - * Your mileage may vary. - * - */ -#ifndef USE_MEMPOOL -#define USE_MEMPOOL (1) -#endif +#include <type_traits> -/*! Enable queue statistics. - * - * Queue statistics come at a performance cost. Although - * the cost is low, we disable them here since they are - * only needed during development. - * - */ -#ifndef USE_QUEUE_STATS -#define USE_QUEUE_STATS (0) -#endif +/// +/// \brief Version - Major. +/// +#define NL_VERSION_MAJOR 0 +/// +/// \brief Version - Minor. +/// +#define NL_VERSION_MINOR 14 +/// \brief Version - Patch level. +/// +#define NL_VERSION_PATCHLEVEL 0 + +/// +/// \addtogroup compiledefine +/// \{ + +// ----------------------------------------------------------------------------- +// General +// ----------------------------------------------------------------------------- -/*! Store input values in logic_terminal_t. - * - * Set to 1 to store values in logic_terminal_t instead of - * accessing them indirectly by pointer from logic_net_t. - * This approach is stricter and should identify bugs in - * the netlist core faster. - * By default it is disabled since it is not as fast as - * the default approach. It is up to 5% slower. - * - */ -#ifndef USE_COPY_INSTEAD_OF_REFERENCE -#define USE_COPY_INSTEAD_OF_REFERENCE (0) +/// \brief Compile in academic solvers +/// +/// Set to 0 to disable compiling the following solvers: +/// +/// Sherman-Morrison, Woodbury, SOR and GMRES +/// +/// In addition, compilation of FLOAT, LONGDOUBLE and FLOATQ128 matrix +/// solvers will be disabled. +/// GMRES may be added to productive solvers in the future +/// again. Compiling in all solvers may increase compile +/// time significantly. +/// +#ifndef NL_USE_ACADEMIC_SOLVERS + #define NL_USE_ACADEMIC_SOLVERS (1) #endif -/* - * FIXME: Using truthtable is a lot slower than the explicit device - * in breakout. Performance drops by 20%. This can be fixed by - * setting param USE_DEACTIVATE for the device. - */ +/// \brief Use backward Euler integration +/// +/// This will use backward Euler instead of trapezoidal integration. +/// +/// FIXME: Long term this will become a runtime setting. Only the capacitor +/// model currently has a trapezoidal version and there is no support currently +/// for variable capacitors. The change will have impact on timings since +/// trapezoidal improves timing accuracy. +#ifndef NL_USE_BACKWARD_EULER + #define NL_USE_BACKWARD_EULER (1) // FIXME: Move to config struct later +#endif -#define USE_TRUTHTABLE_7448 (0) +/// \brief Compile with core terminals owned by net_t +/// +/// Set to 1 to enable that net_t owns core terminal collection. +/// In addition, this approach will use plib::list_t so that the doubled linked +/// list pointers are part of the core_terminal_t. +/// +/// This approach requires that terminals at each point in time are only owned +/// by one net. The approach helped to identify bugs. Since the approach +/// involves that containers are located in different locations, it needs a +/// pre-processor define. +/// +/// By default the setting is currently disabled. +/// +#ifndef NL_USE_INPLACE_CORE_TERMS + #define NL_USE_INPLACE_CORE_TERMS (0) +#endif -/* - * FIXME: The truthtable implementation of 74107 (JK-Flipflop) - * is included for educational purposes to demonstrate how - * to implement state holding devices as truthtables. - * It will completely nuke performance for pong. - */ +/// \brief Use alternative truth table execution approach +/// +/// Enabling this will define a separate truth table execution approach which +/// will use a separate delegate for each input. This approach needs more +/// refinement yet. It works, but is not as fast as the standard approach. +/// +/// Unfortunately this has to be macro since it needs another member variable. +/// +#ifndef NL_USE_TT_ALTERNATIVE + #define NL_USE_TT_ALTERNATIVE (0) +#endif -#define USE_TRUTHTABLE_74107 (0) +/// \brief Compile matrix solvers using the __float128 type. +/// +/// Defaults to \ref PUSE_FLOAT128 +#ifndef NL_USE_FLOAT128 + #define NL_USE_FLOAT128 PUSE_FLOAT128 +#endif -//============================================================ +// ----------------------------------------------------------------------------- // DEBUGGING -//============================================================ +// ----------------------------------------------------------------------------- + +/// \brief Enable compile time debugging code +/// #ifndef NL_DEBUG -#define NL_DEBUG (false) -//#define NL_DEBUG (true) + #define NL_DEBUG (false) #endif -//============================================================ -// Time resolution -//============================================================ +/// +/// \} +/// + +namespace netlist +{ + // ------------------------------------------------------------------------- + // GENERAL + // ------------------------------------------------------------------------- + + struct config_default + { + /// \brief Make use of a memory pool for performance related objects. + /// + /// Set to 1 to compile netlist with memory allocations from a + /// linear memory pool. This is based of the assumption that + /// due to enhanced locality there will be less cache misses. + /// Your mileage may vary. + /// + using use_mempool = std::integral_constant<bool, true>; + + /// brief default minimum alignment of mempool_arena + /// + /// 256 is the best compromise between logic applications like MAME + /// TTL games (e.g. pong) and analog applications like e.g. kidniki + /// sound. + /// + /// Best performance for pong is achieved with a value of 16, but this + /// degrades kidniki performance by ~10%. + /// + /// More work is needed here. + using mempool_align = std::integral_constant<std::size_t, 16>; + + /// \brief Prefer 128bit int type for ptime if supported + /// + /// Set this to one if you want to use 128 bit int for ptime. + /// This is about 10% slower on a skylake processor for pong. + /// + using prefer_int128 = std::integral_constant<bool, false>; + + /// \brief Enable queue statistics. + /// + /// Queue statistics come at a performance cost. Although + /// the cost is low, we disable them here since they are + /// only needed during development. + /// + using use_queue_stats = std::integral_constant<bool, false>; + + // --------------------------------------------------------------------- + // Time resolution + // --------------------------------------------------------------------- + + /// \brief Resolution as clocks per second for timing + /// + /// Uses 100 picosecond resolution. This is aligned to MAME's + /// `attotime` resolution. + /// + /// The table below shows the maximum run times depending on + /// time type size and resolution. + /// + /// | Bits | Res | Seconds | Days | Years | + /// | ====-| ===-| =======-| ====-| =====-| + /// | 63 | 1,000,000,000 | 9,223,372,037 | 106,752| 292.3 | + /// | 63 | 10,000,000,000 | 922,337,204 | 10,675| 29.2 | + /// | 63 | 100,000,000,000 | 92,233,720 | 1,068| 2.9 | + /// | 63 | 1,000,000,000,000 | 9,223,372 | 107| 0.3 | + /// + using INTERNAL_RES = std::integral_constant<long long int, + 10'000'000'000LL>; // NOLINT + + /// \brief Recommended clock to be used + /// + /// This is the recommended clock to be used in fixed clock applications + /// limited to 32 bit clock resolution. The MAME code (netlist.cpp) + /// contains code illustrating how to deal with remainders if \ref + /// INTERNAL_RES is bigger than NETLIST_CLOCK. + using DEFAULT_CLOCK = std::integral_constant<int, + 1'000'000'000>; // NOLINT + + /// \brief Default logic family + /// + static constexpr const char *DEFAULT_LOGIC_FAMILY() { return "74XX"; } + + /// \brief Maximum queue size + /// + using max_queue_size = std::integral_constant<std::size_t, + 1024>; // NOLINT + + /// \brief Maximum queue size for solvers + /// + using max_solver_queue_size = std::integral_constant<std::size_t, + 512>; // NOLINT + + /// \brief Support float type for matrix calculations. + /// + /// Defaults to NL_USE_ACADEMIC_SOLVERS to provide faster build times + using use_float_matrix = std::integral_constant< + bool, NL_USE_ACADEMIC_SOLVERS>; -// Use nano-second resolution - Sufficient for now + /// \brief Support long double type for matrix calculations. + /// + /// Defaults to NL_USE_ACADEMIC_SOLVERS to provide faster build times + using use_long_double_matrix = std::integral_constant< + bool, NL_USE_ACADEMIC_SOLVERS>; -static constexpr const auto NETLIST_INTERNAL_RES = 1000000000; -//static constexpr const auto NETLIST_INTERNAL_RES = 1000000000000; -static constexpr const auto NETLIST_CLOCK = NETLIST_INTERNAL_RES; + using use_float128_matrix = std::integral_constant<bool, + NL_USE_FLOAT128>; -//#define NETLIST_INTERNAL_RES (UINT64_C(1000000000)) -//#define NETLIST_CLOCK (NETLIST_INTERNAL_RES) -//#define NETLIST_INTERNAL_RES (UINT64_C(1000000000000)) -//#define NETLIST_CLOCK (UINT64_C(1000000000)) + /// \brief Floating point types used + /// + /// nl_fptype is the floating point type used throughout the + /// netlist core. + /// + /// Don't change this! Simple analog circuits like pong + /// work with float. Kidniki just doesn't work at all. + /// + /// FIXME: More work needed. Review magic numbers. + /// + using fptype = double; + /// \brief Store input values in logic_terminal_t. + /// + /// Set to 1 to store values in logic_terminal_t instead of + /// accessing them indirectly by pointer from logic_net_t. + /// This approach is stricter and should identify bugs in + /// the netlist core faster. The approach needs + /// NL_USE_INPLACE_CORE_TERMS enabled to achieve some performance. + /// + /// By default it is disabled since it is not as fast as + /// the default approach. It is ~20% slower. + /// + using use_copy_instead_of_reference = std::integral_constant<bool, + false>; -//#define nl_double float -using nl_double = double; + /// \brief Avoid unnecessary queue pushes + /// + /// Enable the setting below to avoid queue pushes were at execution + /// no action will be taken. This is academically cleaner, but + /// ~6% slower than allowing this to happen and filter it during + /// during "process". + /// + using avoid_noop_queue_pushes = std::integral_constant<bool, false>; + + /// \brief Which sorted queue to use + /// + /// Use timed_queue_heap to use stdc++ heap functions instead of the + /// linear processing queue. This slows down execution by about 35% + /// on a Kaby Lake. + /// + /// The default is the linear queue. + + // template <class A, class T> + // using timed_queue = plib::timed_queue_heap<A, T>; + + template <typename A, typename T> + using timed_queue = plib::timed_queue_linear<A, T>; + }; + + /// \brief Netlist configuration. + /// + /// You can override all netlist build defaults here which are defined + /// in \ref config_default. + /// + struct config : public config_default + { + // using mempool_align = std::integral_constant<std::size_t, 32>; + // using avoid_noop_queue_pushes = std::integral_constant<bool, true>; + // using use_copy_instead_of_reference = std::integral_constant<bool, + // true>; + }; + + using nl_fptype = config::fptype; + + /// \brief Specific constants depending on floating type + /// + /// \tparam FT floating point type: double/float + /// + template <typename FT> + struct fp_constants + { + }; + + /// \brief Specific constants for long double floating point type + /// + template <> + struct fp_constants<long double> + { + static constexpr long double DIODE_MAXDIFF() noexcept + { + return 1e100L; + } // NOLINT + static constexpr long double DIODE_MAXVOLT() noexcept + { + return 300.0L; + } // NOLINT + + static constexpr long double TIMESTEP_MAXDIFF() noexcept + { + return 1e100L; + } // NOLINT + static constexpr long double TIMESTEP_MINDIV() noexcept + { + return 1e-60L; + } // NOLINT + + static constexpr const char *name() noexcept { return "long double"; } + static constexpr const char *suffix() noexcept { return "L"; } + }; + + /// \brief Specific constants for double floating point type + /// + template <> + struct fp_constants<double> + { + static constexpr double DIODE_MAXDIFF() noexcept + { + return 1e100; + } // NOLINT + static constexpr double DIODE_MAXVOLT() noexcept + { + return 300.0; + } // NOLINT + + static constexpr double TIMESTEP_MAXDIFF() noexcept + { + return 1e100; + } // NOLINT + static constexpr double TIMESTEP_MINDIV() noexcept + { + return 1e-60; + } // NOLINT + + static constexpr const char *name() noexcept { return "double"; } + static constexpr const char *suffix() noexcept { return ""; } + }; + + /// \brief Specific constants for float floating point type + /// + template <> + struct fp_constants<float> + { + static constexpr float DIODE_MAXDIFF() noexcept + { + return 1e20F; + } // NOLINT + static constexpr float DIODE_MAXVOLT() noexcept + { + return 90.0F; + } // NOLINT + + static constexpr float TIMESTEP_MAXDIFF() noexcept + { + return 1e30F; + } // NOLINT + static constexpr float TIMESTEP_MINDIV() noexcept + { + return 1e-8F; + } // NOLINT + + static constexpr const char *name() noexcept { return "float"; } + static constexpr const char *suffix() noexcept { return "f"; } + }; + +#if (NL_USE_FLOAT128) + /// \brief Specific constants for FLOAT128 floating point type + /// + template <> + struct fp_constants<FLOAT128> + { + #if 0 + // MAME compile doesn't support Q + static constexpr FLOAT128 DIODE_MAXDIFF() noexcept { return 1e100Q; } + static constexpr FLOAT128 DIODE_MAXVOLT() noexcept { return 300.0Q; } + + static constexpr FLOAT128 TIMESTEP_MAXDIFF() noexcept { return 1e100Q; } + static constexpr FLOAT128 TIMESTEP_MINDIV() noexcept { return 1e-60Q; } + + static constexpr const char * name() noexcept { return "FLOAT128"; } + static constexpr const char * suffix() noexcept { return "Q"; } + #else + static constexpr FLOAT128 DIODE_MAXDIFF() noexcept + { + return static_cast<FLOAT128>(1e100L); + } + static constexpr FLOAT128 DIODE_MAXVOLT() noexcept + { + return static_cast<FLOAT128>(300.0L); + } + + static constexpr FLOAT128 TIMESTEP_MAXDIFF() noexcept + { + return static_cast<FLOAT128>(1e100L); + } + static constexpr FLOAT128 TIMESTEP_MINDIV() noexcept + { + return static_cast<FLOAT128>(1e-60L); + } + + static constexpr const char *name() noexcept { return "__float128"; } + static constexpr const char *suffix() noexcept { return "Q"; } + + #endif + }; +#endif +} // namespace netlist -#endif /* NLCONFIG_H_ */ +#endif // NLCONFIG_H_ diff --git a/src/lib/netlist/nl_create_mame_solvers.sh b/src/lib/netlist/nl_create_mame_solvers.sh new file mode 100755 index 00000000000..4786e11eaed --- /dev/null +++ b/src/lib/netlist/nl_create_mame_solvers.sh @@ -0,0 +1,24 @@ +#!/bin/sh + +GENERATED=src/lib/netlist/generated/static_solvers.cpp +FILES=`find src/mame -name "nl_*.cpp" | grep -v pongdoubles` + +OUTDIR=/tmp/static_syms + +if [ _$OS = "_Windows_NT" ]; then + NLTOOL=./nltool.exe +else + NLTOOL=./nltool +fi + +rm -rf ${OUTDIR} +mkdir ${OUTDIR} + +#--dir src/lib/netlist/generated/static --static-include + +if ${NLTOOL} --cmd static --output=${GENERATED}.tmp --include=src/mame/shared ${FILES} ; then + mv -f ${GENERATED}.tmp ${GENERATED} + echo Created ${GENERATED} file +else + echo Failed to create ${GENERATED} +fi diff --git a/src/lib/netlist/nl_dice_compat.h b/src/lib/netlist/nl_dice_compat.h index 48695e393ec..aff1ac4da6f 100644 --- a/src/lib/netlist/nl_dice_compat.h +++ b/src/lib/netlist/nl_dice_compat.h @@ -1,4 +1,4 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud /* * nl_dice_compat.h @@ -16,7 +16,7 @@ sed -e 's/#define \(.*\)"\(.*\)"[ \t]*,[ \t]*\(.*\)/NET_ALIAS(\1,\2.\3)/' src/ma | sed -e 's/) RES(/)\n RES(/g' \ | sed -e 's/) CAP(/)\n CAP(/g' \ | sed -e 's/) NET_C(/)\n NET_C(/g' \ -| sed -e 's/NL_EMPTY//' \ +| sed -e 's/NL_EMPTY//' * */ @@ -25,11 +25,7 @@ sed -e 's/#define \(.*\)"\(.*\)"[ \t]*,[ \t]*\(.*\)/NET_ALIAS(\1,\2.\3)/' src/ma #define NL_DICE_COMPAT_H_ #ifndef NL_CONVERT_CPP -#include "devices/net_lib.h" -#include "analog/nld_twoterm.h" - -#include <cmath> - +#include "netlist/devices/net_lib.h" #endif @@ -59,8 +55,8 @@ sed -e 's/#define \(.*\)"\(.*\)"[ \t]*,[ \t]*\(.*\)/NET_ALIAS(\1,\2.\3)/' src/ma #define CONNECTION( ... ) CONNECTIONY( CONNECTIONX( __VA_ARGS__ ) ) #define CONNECTIONY(a) a -#define CONNECTIONX(a, b, c, d) setup.register_link(a "." # b, c "." # d); -#define NET_CSTR(a, b) setup.register_link( a, b); +#define CONNECTIONX(a, b, c, d) setup.register_connection(a "." # b, c "." # d); +#define NET_CSTR(a, b) setup.register_connection( a, b); #define OHM(x) (x) #define K_OHM(x) ((x) * 1000.0) @@ -72,40 +68,40 @@ sed -e 's/#define \(.*\)"\(.*\)"[ \t]*,[ \t]*\(.*\)/NET_ALIAS(\1,\2.\3)/' src/ma struct Mono555Desc { public: - nl_double r, c; + netlist::nl_fptype r, c; - Mono555Desc(nl_double res, nl_double cap) : r(res), c(cap) { } + Mono555Desc(netlist::nl_fptype res, netlist::nl_fptype cap) : r(res), c(cap) { } }; struct Astable555Desc { public: - nl_double r1, r2, c; + netlist::nl_fptype r1, r2, c; - Astable555Desc(nl_double res1, nl_double res2, nl_double cap) : r1(res1), r2(res2), c(cap) { } + Astable555Desc(netlist::nl_fptype res1, netlist::nl_fptype res2, netlist::nl_fptype cap) : r1(res1), r2(res2), c(cap) { } }; struct Mono9602Desc { public: - nl_double r1, c1, r2, c2; + netlist::nl_fptype r1, c1, r2, c2; - Mono9602Desc(nl_double res1, nl_double cap1, nl_double res2, nl_double cap2) + Mono9602Desc(netlist::nl_fptype res1, netlist::nl_fptype cap1, netlist::nl_fptype res2, netlist::nl_fptype cap2) : r1(res1), c1(cap1), r2(res2), c2(cap2) { } }; struct SeriesRCDesc { public: - nl_double r, c; + netlist::nl_fptype r, c; - SeriesRCDesc(nl_double res, nl_double cap) : r(res), c(cap) { } + SeriesRCDesc(netlist::nl_fptype res, netlist::nl_fptype cap) : r(res), c(cap) { } }; struct CapacitorDesc : public SeriesRCDesc { public: - CapacitorDesc(nl_double cap) : SeriesRCDesc(0.0, cap) { } + CapacitorDesc(netlist::nl_fptype cap) : SeriesRCDesc(0.0, cap) { } }; #else @@ -121,14 +117,15 @@ public: #endif -#define CIRCUIT_LAYOUT(x) NETLIST_START(x) -#define CIRCUIT_LAYOUT_END NETLIST_END() +#define CIRCUIT_LAYOUT(x) NETLIST_START(x) { + +#define CIRCUIT_LAYOUT_END } #define CHIP_555_Mono(name, pdesc) \ NE555_DIP(name) \ NET_C(name.6, name.7) \ - RES(name ## _R, (pdesc)->r) \ - CAP(name ## _C, (pdesc)->c) \ + RES(name ## _R, pdesc ## _R) \ + CAP(name ## _C, pdesc ## _C) \ NET_C(name.6, name ## _R.1) \ NET_C(name.6, name ## _C.1) \ NET_C(name ## _R.2, V5) \ @@ -169,8 +166,8 @@ public: NET_C(name.14, name ## _R2.2) \ NET_C(VCC, name ## _R2.1) #define CHIP_SERIES_RC(name, pdesc) \ - RES(name ## _R, (pdesc)->r) \ - CAP(name ## _C, (pdesc)->c) \ + RES(name ## _R, pdesc ## _R) \ + CAP(name ## _C, pdesc ## _C) \ NET_C(name ## _R.1, name ## _C.2) \ ALIAS(name.3, name ## _R.1) \ ALIAS(name.2, name ## _R.2) \ @@ -204,7 +201,7 @@ inline int CAPACITOR_tc_hl(const double c, const double r) * Vt = (VH-VL)*exp(-t/RC) * ln(Vt/(VH-VL))*RC = -t */ - static const double TIME_CONSTANT = -std::log(0.8 / (4.0-0.1)); + static const double TIME_CONSTANT = -plib::log(0.8 / (4.0-0.1)); int ret = (int) (TIME_CONSTANT * (1.0 + r) * c * 1e9); return ret; } @@ -215,7 +212,7 @@ inline int CAPACITOR_tc_lh(const double c, const double r) * Vt = (VH-VL)*(1-exp(-t/RC)) * -t=ln(1-Vt/(VH-VL))*RC */ - static const double TIME_CONSTANT = -std::log(1.0 - 2.0 / (4.0-0.1)); + static const double TIME_CONSTANT = -plib::log(1.0 - 2.0 / (4.0-0.1)); int ret = (int) (TIME_CONSTANT * (130.0 + r) * c * 1e9); return ret; } diff --git a/src/lib/netlist/nl_errstr.h b/src/lib/netlist/nl_errstr.h index b42b7476934..c65ff257846 100644 --- a/src/lib/netlist/nl_errstr.h +++ b/src/lib/netlist/nl_errstr.h @@ -1,48 +1,71 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*! - * - * \file nl_errstr.h - * - */ + +/// +/// \file nl_errstr.h +/// #ifndef NL_ERRSTR_H_ #define NL_ERRSTR_H_ +#include "plib/pexception.h" #include "plib/pfmtlog.h" -#define PERRMSG(name, str) \ - struct name \ - { \ - operator pstring() const { return str; } \ - }; +namespace netlist +{ -#define PERRMSGV(name, narg, str) \ - struct name \ - { \ - template<typename... Args> name(Args&&... args) \ - : m_m(plib::pfmt(str)(std::forward<Args>(args)...)) \ - { static_assert(narg == sizeof...(args), "Argument count mismatch"); } \ - operator pstring() const { return m_m; } \ - pstring m_m; \ + static constexpr const char sHINT_NO_DEACTIVATE[] + = ".HINT_NO_DEACTIVATE"; // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + static constexpr const char sHINT_NC[] + = ".HINT_NC"; // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + + // ------------------------------------------------------------------------- + // Exceptions + // ------------------------------------------------------------------------- + + /// \brief Generic netlist exception. + /// The exception is used in all events which are considered fatal. + + class nl_exception : public plib::pexception + { + public: + /// \brief Constructor. + /// Allows a descriptive text to be passed to the exception + + explicit nl_exception(const pstring &text //!< text to be passed + ) + : plib::pexception(text) + { + } + + /// \brief Constructor. + /// Allows to use \ref plib::pfmt logic to be used in exception + + template <typename... Args> + explicit nl_exception(const pstring &fmt, //!< format to be used + Args &&...args //!< arguments to be passed + ) + : plib::pexception(plib::pfmt(fmt)(std::forward<Args>(args)...)) + { + } }; -namespace netlist -{ + // ------------------------------------------------------------------------- + // Error messages + // ------------------------------------------------------------------------- - static constexpr const char * sHINT_NO_DEACTIVATE = ".HINT_NO_DEACTIVATE"; - static constexpr const char * sPowerDevRes = "_RVG"; + // clang-format off // nl_base.cpp PERRMSGV(MF_DUPLICATE_NAME_DEVICE_LIST, 1, "Error adding {1} to device list. Duplicate name.") PERRMSGV(MF_UNKNOWN_TYPE_FOR_OBJECT, 1, "Unknown type for object {1},") PERRMSGV(MF_NET_1_DUPLICATE_TERMINAL_2, 2, "net {1}: duplicate terminal {2}") + PERRMSGV(MF_NULLPTR_FAMILY, 2, "Unable to determine family for device {1} from model {2}") PERRMSGV(MF_REMOVE_TERMINAL_1_FROM_NET_2, 2, "Can not remove terminal {1} from net {2}.") PERRMSGV(MF_UNKNOWN_PARAM_TYPE, 1, "Can not determine param_type for {1}") - PERRMSGV(MF_ERROR_CONNECTING_1_TO_2, 2, "Error connecting {1} to {2}") - PERRMSGV(MF_NO_SOLVER, 0, "No solver found for this netlist although analog elements are present") - PERRMSGV(MF_HND_VAL_NOT_SUPPORTED, 1, "HINT_NO_DEACTIVATE value not supported: <{1}>") + //PERRMSGV(MF_ERROR_CONNECTING_1_TO_2, 2, "Error connecting {1} to {2}") + //PERRMSGV(ME_HND_VAL_NOT_SUPPORTED, 1, "HINT_NO_DEACTIVATE value not supported: <{1}>") PERRMSGV(MW_ROM_NOT_FOUND, 1, "Rom {1} not found") // nl_factory.cpp @@ -53,22 +76,42 @@ namespace netlist // nl_base.cpp PERRMSGV(MF_MODEL_1_CAN_NOT_BE_CHANGED_AT_RUNTIME, 1, "Model {1} can not be changed at runtime") - PERRMSGV(MF_MORE_THAN_ONE_1_DEVICE_FOUND, 1, "more than one {1} device found") + PERRMSGV(MF_MORE_THAN_ONE_1_DEVICE_FOUND, 1, "More than one {1} device found") // nl_parser.cpp + PERRMSGV(MF_PARSER_UNEXPECTED_1, 1, "Unexpected {}") PERRMSGV(MF_UNEXPECTED_NETLIST_END, 0, "Unexpected NETLIST_END") - PERRMSGV(MF_UNEXPECTED_NETLIST_START, 0, "Unexpected NETLIST_START") + PERRMSGV(MF_UNEXPECTED_END_OF_FILE, 0, "Unexpected end of file, missing NETLIST_END") + //PERRMSGV(MF_UNEXPECTED_NETLIST_START, 0, "Unexpected NETLIST_START") + PERRMSGV(MF_UNEXPECTED_NETLIST_EXTERNAL, 0, "Unexpected NETLIST_EXTERNAL within a netlist") + PERRMSGV(MF_EXPECTED_NETLIST_START_1, 1, "Expected NETLIST_START but got {1}") + PERRMSGV(MF_EXPECTED_IDENTIFIER_GOT_1, 1, "Expected an identifier, but got {1}") + PERRMSGV(MF_EXPECTED_COMMA_OR_RP_1, 1, "Expected comma or right parenthesis but found <{1}>") + PERRMSGV(MF_DIPPINS_EQUAL_NUMBER_1, 1, "DIPPINS requires equal number of pins to DIPPINS, first pin is {}") + //PERRMSGV(MF_PARAM_NOT_FP_1, 1, "Parameter value <{1}> not floating point") + PERRMSGV(MF_TT_LINE_WITHOUT_HEAD, 0, "TT_LINE found without TT_HEAD") + PERRMSGV(MF_LOCAL_SOURCE_NOT_FOUND_1, 1, "Local source not found: <{1}>") + PERRMSGV(MF_EXTERNAL_SOURCE_IS_LOCAL_1, 1, "External lib entry appears as a local one: <{1}>") + PERRMSGV(MF_TRUTHTABLE_NOT_FOUND_1, 1, "Truth table not found: <{1}>") // nl_setup.cpp PERRMSGV(MF_UNABLE_TO_PARSE_MODEL_1, 1, "Unable to parse model: {1}") - PERRMSGV(MF_MODEL_ALREADY_EXISTS_1, 1, "Model already exists: {1}") + // FIXME: Add an directive MODEL_OVERWRITE to netlist language + //PERRMSGV(MF_MODEL_ALREADY_EXISTS_1, 1, "Model already exists: {1}") + PERRMSGV(MI_MODEL_OVERWRITE_1, 2, "Model already exists, overwriting {1} with {2}") PERRMSGV(MF_DEVICE_ALREADY_EXISTS_1, 1, "Device already exists: {1}") - PERRMSGV(MF_ADDING_ALI1_TO_ALIAS_LIST, 1, "Error adding alias {1} to alias list") + PERRMSGV(MF_UNUSED_HINT_1, 1, "Error hint {1} is not used") + PERRMSGV(MF_ADDING_HINT_1, 1, "Error adding hint {1} to hint list") + PERRMSGV(MF_ALIAS_ALREAD_EXISTS_1, 1, "Alias already exists: {1}") PERRMSGV(MF_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1, 1,"You must pass an equal number of pins to DIPPINS {1}") - PERRMSGV(MF_UNKNOWN_OBJECT_TYPE_1, 1, "Unknown object type {1}") + PERRMSGV(MF_PARAM_COUNT_MISMATCH_2, 2, "Parameter count mismatch for {1} - only found {2}") + PERRMSGV(MF_PARAM_COUNT_EXCEEDED_2, 2, "Parameter count exceed for {1} - found {2}") + //PERRMSGV(MF_UNKNOWN_OBJECT_TYPE_1, 1, "Unknown object type {1}") + PERRMSGV(MF_UNKNOWN_FAMILY_TYPE_1, 2, "Unknown family type {1} in model {2}") PERRMSGV(MF_INVALID_NUMBER_CONVERSION_1_2, 2, "Invalid number conversion {1} : {2}") + PERRMSGV(MF_INVALID_ENUM_CONVERSION_1_2, 2, "Invalid element found {1} : {2}") PERRMSGV(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST,1, "Error adding parameter {1} to parameter list") PERRMSGV(MF_ADDING_1_2_TO_TERMINAL_LIST, 2, "Error adding {1} {2} to terminal list") PERRMSGV(MF_NET_C_NEEDS_AT_LEAST_2_TERMINAL, 0, "You must pass at least 2 terminals to NET_C") @@ -77,6 +120,7 @@ namespace netlist PERRMSGV(MF_OBJECT_1_2_WRONG_TYPE, 2, "object {1}({2}) found but wrong type") PERRMSGV(MF_PARAMETER_1_2_NOT_FOUND, 2, "parameter {1}({2}) not found!") PERRMSGV(MF_CONNECTING_1_TO_2, 2, "Error connecting {1} to {2}") + PERRMSGV(MF_DUPLICATE_PROXY_1, 1, "Terminal {1} already has proxy") PERRMSGV(MF_MERGE_RAIL_NETS_1_AND_2, 2, "Trying to merge two rail nets: {1} and {2}") PERRMSGV(MF_OBJECT_INPUT_TYPE_1, 1, "Unable to determine input type of {1}") PERRMSGV(MF_OBJECT_OUTPUT_TYPE_1, 1, "Unable to determine output type of {1}") @@ -87,47 +131,76 @@ namespace netlist PERRMSGV(MF_MODEL_ERROR_ON_PAIR_1, 1, "Model error on pair {1}") PERRMSGV(MF_MODEL_PARAMETERS_NOT_UPPERCASE_1_2, 2, "Model parameters should be uppercase:{1} {2}") PERRMSGV(MF_ENTITY_1_NOT_FOUND_IN_MODEL_2, 2, "Entity {1} not found in model {2}") - PERRMSGV(MF_UNKNOWN_NUMBER_FACTOR_IN_1, 1, "Unknown number factor in: {1}") + PERRMSGV(MF_UNKNOWN_NUMBER_FACTOR_IN_2, 2, "Unknown number factor in: {1}:{2}") PERRMSGV(MF_MODEL_NUMBER_CONVERSION_ERROR, 4, "Can't convert {1}={2} to {3} for model {4}") PERRMSGV(MF_NOT_FOUND_IN_SOURCE_COLLECTION, 1, "unable to find {1} in sources collection") - PERRMSGV(MW_OVERWRITING_PARAM_1_OLD_2_NEW_3, 3, "Overwriting {1} old <{2}> new <{3}>") - PERRMSGV(MW_CONNECTING_1_TO_ITSELF, 1, "Connecting {1} to itself. This may be right, though") - PERRMSGV(MI_DUMMY_1_WITHOUT_CONNECTIONS, 1, "Found dummy terminal {1} without connections") + PERRMSGV(MI_OVERWRITING_PARAM_1_OLD_2_NEW_3, 3, "Overwriting {1} old <{2}> new <{3}>") + PERRMSGV(MW_CONNECTING_1_TO_ITSELF, 1, "Connecting net {1} to itself.") + PERRMSGV(MI_CONNECTING_1_TO_2_SAME_NET, 3, "Connecting terminals {1} and {2} which are already both on net {3}. " + "It is ok if you read this warning and it relates to pin which is connected internally to GND and the schematics " + "show an external connection as well. One example is the CD4538. In other cases this warning may indicate " + "an error in your netlist.") + PERRMSGV(ME_NC_PIN_1_WITH_CONNECTIONS, 1, "Found NC (not connected) terminal {1} with connections") PERRMSGV(MI_ANALOG_OUTPUT_1_WITHOUT_CONNECTIONS,1, "Found analog output {1} without connections") PERRMSGV(MI_LOGIC_OUTPUT_1_WITHOUT_CONNECTIONS, 1, "Found logic output {1} without connections") PERRMSGV(MW_LOGIC_INPUT_1_WITHOUT_CONNECTIONS, 1, "Found logic input {1} without connections") PERRMSGV(MW_TERMINAL_1_WITHOUT_CONNECTIONS, 1, "Found terminal {1} without connections") PERRMSGV(ME_TERMINAL_1_WITHOUT_NET, 1, "Found terminal {1} without a net") + PERRMSGV(ME_TERMINALS_1_2_WITHOUT_NET, 2, "Found terminals {1} and {2} without a net") PERRMSGV(MF_TERMINALS_WITHOUT_NET, 0, "Found terminals without a net") - - PERRMSGV(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3, 3, "Found device {1} connected only to railterminals {2}/{3}. Will be removed") - PERRMSGV(MI_POWER_TERMINALS_1_CONNECTED_ANALOG_2_3, 3, "Power terminals {1} connected to analog nets {2}/{3}.") + PERRMSGV(ME_TRISTATE_NO_PROXY_FOUND_2, 2, + "Tristate output {1} on device {2} is not connected to a proxy. You " + "need to set parameter FORCE_TRISTATE_LOGIC for device {2} if " + "tristate enable inputs are all connected to fixed inputs. If this " + "is not the case: Review your netlist. Something is wrong.") + PERRMSGV(ME_TRISTATE_PROXY_FOUND_2, 2, + "The tristate output {1} on device {2} is connected to an analog net " + "but has been forced to act as a logic output. Parameter " + " FORCE_TRISTATE_LOGIC for device {2} needs to be disabled!.") + + PERRMSGV(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3, 3, "Found device {1} connected only to rail terminals {2}/{3}." + " This may reflect the schematic - but as well be an error. Please review.") PERRMSGV(MW_DATA_1_NOT_FOUND, 1, "unable to find data {1} in sources collection") - PERRMSGV(MW_DEVICE_NOT_FOUND_FOR_HINT, 1, "Device not found for hint {1}") - PERRMSGV(MW_UNKNOWN_PARAMETER, 1, "Unknown parameter {1}") + //PERRMSGV(ME_DEVICE_NOT_FOUND_FOR_HINT, 1, "Device not found for hint {1}") + PERRMSGV(ME_UNKNOWN_PARAMETER, 1, "Unknown parameter {1}") + PERRMSGV(MF_ERRORS_FOUND, 1, "Counted {1} errors which need to be fixed") + + PERRMSGV(MF_NO_SOLVER, 0, "No solver found for this netlist although analog elements are present") + PERRMSGV(MF_DELEGATE_NOT_SET_1, 1, "delegate not set for terminal {1}") // nlid_proxy.cpp - PERRMSGV(MI_NO_POWER_TERMINALS_ON_DEVICE_1, 1, "D/A Proxy: Found no valid combination of power terminals on device {1}") + PERRMSGV(MF_NO_POWER_TERMINALS_ON_DEVICE_2, 2, "D/A Proxy {1}: Found no valid combination of power terminals on device {2}") PERRMSGV(MI_MULTIPLE_POWER_TERMINALS_ON_DEVICE, 5, "D/A Proxy: Found multiple power terminals on device {1}: {2} {3} {4} {5}") + PERRMSGV(MF_NULLPTR_FAMILY_NP, 1, "Encountered nullptr to family in {1}") // nld_matrix_solver.cpp PERRMSGV(MF_UNHANDLED_ELEMENT_1_FOUND, 1, "setup_base:unhandled element <{1}> found") - PERRMSGV(MF_FOUND_TERM_WITH_MISSING_OTHERNET, 1, "found term with missing othernet {1}") + PERRMSGV(MF_FOUND_TERM_WITH_MISSING_OTHERNET, 1, "found term with missing other net {1}") - PERRMSGV(MW_NEWTON_LOOPS_EXCEEDED_ON_NET_1, 1, "NEWTON_LOOPS exceeded on net {1}... reschedule") + PERRMSGV(MW_NEWTON_LOOPS_EXCEEDED_INVOCATION_3, 3, "NEWTON_LOOPS exceeded resolution invoked {1} times on net {2} at {3} us") + PERRMSGV(MW_NEWTON_LOOPS_EXCEEDED_ON_NET_2, 2, "NEWTON_LOOPS exceeded resolution failed on net {1} ... reschedule at {2} us") // nld_solver.cpp - PERRMSGV(MF_UNKNOWN_SOLVER_TYPE, 1, "Unknown solver type: {1}") - PERRMSGV(MF_NETGROUP_SIZE_EXCEEDED_1, 1, "Encountered netgroup with > {1} nets") - PERRMSGV(MI_NO_SPECIFIC_SOLVER, 1, "No specific solver found for netlist of size {1}") + PERRMSGV(MW_SOLVER_METHOD_NOT_SUPPORTED, 2, "Solver method {1} not supported. Falling back to {2}") + + PERRMSGV(ME_SOLVER_CONSISTENCY_NOT_ANALOG_NET, 1, "Solver consistency: {1} is not an analog net") + PERRMSGV(ME_SOLVER_CONSISTENCY_RAIL_NET, 1, "Solver consistency: {1} is a rail net") + PERRMSGV(ME_SOLVER_TERMINAL_NO_NET, 1, "Solver consistency: Terminal {1} has no net") + PERRMSGV(ME_SOLVER_NO_RAIL_TERMINAL, 1, "Solver consistency: No rail terminals in group with nets: {1}\n" + "At least one rail terminal (like ANALOG_INPUT) needs to be part of a group of nets\n" + "solved by a solver. Without a singular matrix would be created\n" + "which has the potential to cause a crash now or in the future.\n" + "A common cause of this error are BJT or FET devices which\n" + "are defined but not used in the netlist.") + PERRMSGV(MF_SOLVER_CONSISTENCY_ERRORS, 1, "Found {1} errors during solver consistency test") // nld_mm5837.cpp @@ -142,13 +215,31 @@ namespace netlist PERRMSGV(MW_MOSFET_THRESHOLD_VOLTAGE, 1, "Mosfet: Threshold voltage not specified for {1}") - // nl_tool.cpp + // nld_bjt.cpp - PERRMSGV(MF_FILE_OPEN_ERROR, 1, "Error opening file: {1}") + PERRMSGV(MF_DEVICE_FRY_1, 1, + "Please don't fry device {}. Most likely this error is caused by the" + " fact that you want to exclude the analog device from the netlist." + " This is not the right approach. If you want to exclude the device," + " exclude the device altogether, i.e. by using #ifdef/#if statements.") + // nl_tool.cpp + PERRMSGV(MF_FILE_OPEN_ERROR, 1, "Error opening file: {1}") + // clang-format on } // namespace netlist +// ------------------------------------------------------------------------- +// Asserts +// ------------------------------------------------------------------------- + +#define nl_assert(x) \ + do \ + { \ + if (NL_DEBUG) \ + passert_always(x); \ + } while (0) +#define nl_assert_always(x, msg) passert_always_msg(x, msg) -#endif /* NL_ERRSTR_H_ */ +#endif // NL_ERRSTR_H_ diff --git a/src/lib/netlist/nl_factory.cpp b/src/lib/netlist/nl_factory.cpp index f8fc40d27db..6ab9e84cafd 100644 --- a/src/lib/netlist/nl_factory.cpp +++ b/src/lib/netlist/nl_factory.cpp @@ -1,93 +1,99 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*************************************************************************** - nl_factory.c - - Discrete netlist implementation. - -****************************************************************************/ +/// +/// \file nl_factory.cpp +/// #include "nl_factory.h" -#include "nl_base.h" + #include "nl_errstr.h" #include "nl_setup.h" + +#include "core/core_device.h" + #include "plib/putil.h" -namespace netlist { namespace factory +namespace netlist::factory { - class NETLIB_NAME(wrapper) : public device_t + // FIXME: this doesn't do anything, check how to remove + class NETLIB_NAME(wrapper) + : public base_device_t { public: - NETLIB_NAME(wrapper)(netlist_state_t &anetlist, const pstring &name) - : device_t(anetlist, name) + NETLIB_NAME(wrapper)(base_device_param_t data) + : base_device_t(data) { } + protected: - NETLIB_RESETI() { } - NETLIB_UPDATEI() { } + // NETLIB_RESETI() {} }; - element_t::element_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &sourcefile) - : m_name(name), m_classname(classname), m_def_param(def_param), - m_sourcefile(sourcefile) - { - } - - element_t::element_t(const pstring &name, const pstring &classname, - const pstring &def_param) - : m_name(name), m_classname(classname), m_def_param(def_param), - m_sourcefile("<unknown>") + element_t::element_t(const pstring &name, properties &&props) + : m_name(name) + , m_properties(props) { } - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // net_device_t_base_factory - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- list_t::list_t(log_type &alog) : m_log(alog) { } - void list_t::register_device(plib::unique_ptr<element_t> &&factory) + bool exists(const pstring &name); + + bool list_t::exists(const pstring &name) const noexcept + { + for (const auto &e : *this) + if (e->name() == name) + return true; + return false; + } + + void list_t::add(host_arena::unique_ptr<element_t> &&factory) { - for (auto & e : *this) - if (e->name() == factory->name()) - m_log.fatal(MF_FACTORY_ALREADY_CONTAINS_1(factory->name())); + if (exists(factory->name())) + { + m_log.fatal(MF_FACTORY_ALREADY_CONTAINS_1(factory->name())); + throw nl_exception(MF_FACTORY_ALREADY_CONTAINS_1(factory->name())); + } push_back(std::move(factory)); } - factory::element_t * list_t::factory_by_name(const pstring &devname) + factory::element_t *list_t::factory_by_name(const pstring &devname) { - for (auto & e : *this) + for (auto &e : *this) { if (e->name() == devname) return e.get(); } m_log.fatal(MF_CLASS_1_NOT_FOUND(devname)); - return nullptr; // appease code analysis + throw nl_exception(MF_CLASS_1_NOT_FOUND(devname)); } - // ----------------------------------------------------------------------------- - // factory_lib_entry_t: factory class to wrap macro based chips/elements - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // library_element_t: factory class to wrap macro based chips/elements + // ------------------------------------------------------------------------- - pool_owned_ptr<device_t> library_element_t::Create(netlist_state_t &anetlist, const pstring &name) + library_element_t::library_element_t(const pstring &name, + properties && props) + : element_t(name, + std::move(properties(props).set_type(element_type::MACRO))) { - return pool().make_poolptr<NETLIB_NAME(wrapper)>(anetlist, name); } - void library_element_t::macro_actions(nlparse_t &nparser, const pstring &name) + device_arena::unique_ptr<core_device_t> library_element_t::make_device( + device_arena &pool, netlist_state_t &anetlist, const pstring &name) { - nparser.namespace_push(name); - nparser.include(this->name()); - nparser.namespace_pop(); + return plib::make_unique<NETLIB_NAME(wrapper)>(pool, + base_device_data_t{anetlist, name}); } - -} // namespace factory - } // namespace netlist +} // namespace netlist::factory diff --git a/src/lib/netlist/nl_factory.h b/src/lib/netlist/nl_factory.h index 271bf72bf90..ed4eb276c1f 100644 --- a/src/lib/netlist/nl_factory.h +++ b/src/lib/netlist/nl_factory.h @@ -1,164 +1,234 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_factory.h - * - * - */ + +/// +/// \file nl_factory.h +/// #ifndef NLFACTORY_H_ #define NLFACTORY_H_ #include "nltypes.h" + #include "plib/palloc.h" +#include "plib/pmempool.h" +#include "plib/psource.h" #include "plib/ptypes.h" +#include <tuple> +#include <utility> #include <vector> -#define NETLIB_DEVICE_IMPL_ALIAS(p_alias, chip, p_name, p_def_param) \ - NETLIB_DEVICE_IMPL_BASE(devices, p_alias, chip, p_name, p_def_param) \ +#define NETLIB_DEVICE_IMPL_ALIAS(p_alias, chip, p_name, p_def_param) \ + NETLIB_DEVICE_IMPL_BASE(devices, p_alias, chip, p_name, p_def_param) -#define NETLIB_DEVICE_IMPL(chip, p_name, p_def_param) \ +#define NETLIB_DEVICE_IMPL(chip, p_name, p_def_param) \ NETLIB_DEVICE_IMPL_NS(devices, chip, p_name, p_def_param) -#define NETLIB_DEVICE_IMPL_NS(ns, chip, p_name, p_def_param) \ - NETLIB_DEVICE_IMPL_BASE(ns, chip, chip, p_name, p_def_param) \ - -#define NETLIB_DEVICE_IMPL_BASE(ns, p_alias, chip, p_name, p_def_param) \ - static plib::unique_ptr<factory::element_t> NETLIB_NAME(p_alias ## _c) \ - (const pstring &classname) \ - { \ - return plib::make_unique<factory::device_element_t<ns :: NETLIB_NAME(chip)>>(p_name, classname, p_def_param, pstring(__FILE__)); \ - } \ - \ - factory::constructor_ptr_t decl_ ## p_alias = NETLIB_NAME(p_alias ## _c); - -namespace netlist { - class device_t; - class nlparse_t; - class setup_t; - class netlist_state_t; - -namespace factory { - // ----------------------------------------------------------------------------- +#define NETLIB_DEVICE_IMPL_NS(ns, chip, p_name, p_def_param) \ + NETLIB_DEVICE_IMPL_BASE(ns, chip, chip, p_name, p_def_param) + +#define NETLIB_DEVICE_IMPL_BASE(ns, p_alias, chip, p_name, p_def_param) \ + static factory::element_t::uptr NETLIB_NAME(p_alias##_c)() \ + { \ + using devtype = factory::device_element_t<ns ::NETLIB_NAME(chip)>; \ + factory::properties sl(p_def_param, PSOURCELOC()); \ + return devtype::create(p_name, std::move(sl)); \ + } \ + \ + extern factory::constructor_ptr_t decl_##p_alias; \ + factory::constructor_ptr_t decl_##p_alias = NETLIB_NAME(p_alias##_c); + +namespace netlist::factory +{ + enum class element_type + { + BUILTIN, + MACRO + }; + + struct properties + { + properties(const pstring & default_parameter, + plib::source_location &&location) + : m_default_parameter(default_parameter) + , m_location(std::move(location)) + , m_type(element_type::BUILTIN) + { + } + + ~properties() = default; + PCOPYASSIGNMOVE(properties, default) + + pstring default_parameter() const noexcept + { + return m_default_parameter; + } + + plib::source_location source() const noexcept { return m_location; } + + element_type type() const noexcept { return m_type; } + + properties &set_type(element_type t) noexcept + { + m_type = t; + return *this; + } + + private: + pstring m_default_parameter; + plib::source_location m_location; + element_type m_type; + }; + + // ------------------------------------------------------------------------- // net_dev class factory - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- class element_t { public: - element_t(const pstring &name, const pstring &classname, - const pstring &def_param); - element_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &sourcefile); + using dev_uptr = device_arena::unique_ptr<core_device_t>; + using uptr = host_arena::unique_ptr<element_t>; + using pointer = element_t *; + + element_t(const pstring &name, properties &&props); virtual ~element_t() = default; - COPYASSIGNMOVE(element_t, default) + PCOPYASSIGNMOVE(element_t, default) + + virtual dev_uptr + make_device(device_arena &pool, netlist_state_t &anetlist, + const pstring &name) + = 0; - virtual pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) = 0; - virtual void macro_actions(nlparse_t &nparser, const pstring &name) + pstring name() const noexcept { return m_name; } + pstring param_desc() const noexcept { - plib::unused_var(nparser); - plib::unused_var(name); + return m_properties.default_parameter(); } - - const pstring &name() const { return m_name; } - const pstring &classname() const { return m_classname; } - const pstring ¶m_desc() const { return m_def_param; } - const pstring &sourcefile() const { return m_sourcefile; } + plib::source_location source() const noexcept + { + return m_properties.source(); + } + element_type type() const noexcept { return m_properties.type(); } private: - pstring m_name; /* device name */ - pstring m_classname; /* device class name */ - pstring m_def_param; /* default parameter */ - pstring m_sourcefile; /* source file */ + pstring m_name; //!< device name + properties m_properties; //!< source file and other information and + //!< settings }; - template <class C> + template <class C, typename... Args> class device_element_t : public element_t { public: - device_element_t(const pstring &name, const pstring &classname, - const pstring &def_param) - : element_t(name, classname, def_param) { } - device_element_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &sourcefile) - : element_t(name, classname, def_param, sourcefile) { } - - pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override + using constructor_data_t = typename C::constructor_data_t; + + device_element_t(const pstring &name, properties &&props, + Args &&...args) + : element_t(name, std::move(props)) + , m_args(std::forward<Args>(args)...) + { + } + + template <std::size_t... Is> + dev_uptr make_device(device_arena &pool, netlist_state_t &anetlist, + const pstring &name, std::tuple<Args...> &args, + std::index_sequence<Is...>) + { + return plib::make_unique<C>( + pool, constructor_data_t{anetlist, name}, + std::forward<Args>(std::get<Is>(args))...); + } + + dev_uptr make_device(device_arena &pool, netlist_state_t &anetlist, + const pstring &name, std::tuple<Args...> &args) + { + return make_device(pool, anetlist, name, args, + std::index_sequence_for<Args...>{}); + } + + dev_uptr make_device(device_arena &pool, netlist_state_t &anetlist, + const pstring &name) override { - return pool().make_poolptr<C>(anetlist, name); + return make_device(pool, anetlist, name, m_args); } + + static uptr + create(const pstring &name, properties &&props, Args &&...args) + { + return plib::make_unique<device_element_t<C, Args...>, host_arena>( + name, std::move(props), std::forward<Args>(args)...); + } + + private: + std::tuple<Args...> m_args; }; - class list_t : public std::vector<plib::unique_ptr<element_t>> + class list_t : public std::vector<element_t::uptr> { public: explicit list_t(log_type &alog); ~list_t() = default; - COPYASSIGNMOVE(list_t, delete) + PCOPYASSIGNMOVE(list_t, delete) - template<class device_class> - void register_device(const pstring &name, const pstring &classname, - const pstring &def_param) + template <class device_class, typename... Args> + void add(const pstring &name, properties &&props, Args &&...args) { - register_device(plib::make_unique<device_element_t<device_class>>(name, classname, def_param)); + add(device_element_t<device_class, Args...>::create( + name, std::move(props), std::forward<Args>(args)...)); } - void register_device(plib::unique_ptr<element_t> &&factory); + void add(element_t::uptr &&factory) noexcept(false); - element_t * factory_by_name(const pstring &devname); + element_t::pointer + factory_by_name(const pstring &devname) noexcept(false); template <class C> - bool is_class(element_t *f) + bool is_class(element_t::pointer f) noexcept { - return dynamic_cast<device_element_t<C> *>(f) != nullptr; + return bool(plib::dynamic_downcast<device_element_t<C> *>(f)); } + bool exists(const pstring &name) const noexcept; + private: log_type &m_log; }; - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // factory_creator_ptr_t - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - using constructor_ptr_t = plib::unique_ptr<element_t> (*)(const pstring &classname); + using constructor_ptr_t = element_t::uptr (*const)(); template <typename T> - plib::unique_ptr<element_t> constructor_t(const pstring &name, const pstring &classname, - const pstring &def_param) + element_t::uptr constructor_t(const pstring &name, properties &&props) { - return plib::make_unique<device_element_t<T>>(name, classname, def_param); + return plib::make_unique<device_element_t<T>, host_arena>( + name, std::move(props)); } - // ----------------------------------------------------------------------------- - // factory_lib_entry_t: factory class to wrap macro based chips/elements - // ----------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // library_element_t: factory class to wrap macro based chips/elements + // ------------------------------------------------------------------------- class library_element_t : public element_t { public: + library_element_t(const pstring &name, properties &&props); - library_element_t(const pstring &name, const pstring &classname, - const pstring &def_param, const pstring &source) - : element_t(name, classname, def_param, source) - { - } - - pool_owned_ptr<device_t> Create(netlist_state_t &anetlist, const pstring &name) override; - - void macro_actions(nlparse_t &nparser, const pstring &name) override; - - private: + dev_uptr make_device(device_arena &pool, netlist_state_t &anetlist, + const pstring &name) override; }; - } // namespace factory +} // namespace netlist::factory - namespace devices { - void initialize_factory(factory::list_t &factory); - } // namespace devices -} // namespace netlist +namespace netlist::devices +{ + void initialize_factory(factory::list_t &factory); +} // namespace netlist::devices -#endif /* NLFACTORY_H_ */ +#endif // NLFACTORY_H_ diff --git a/src/lib/netlist/nl_interface.h b/src/lib/netlist/nl_interface.h new file mode 100644 index 00000000000..eb187bad241 --- /dev/null +++ b/src/lib/netlist/nl_interface.h @@ -0,0 +1,248 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file nl_interface.h +/// +/// This header contains objects for interfacing with the netlist core. +/// + +#ifndef NLINTERFACE_H_ +#define NLINTERFACE_H_ + +#include "nl_setup.h" + +#include "core/analog.h" +#include "core/device.h" +#include "core/device_macros.h" +#include "core/logic.h" +#include "core/setup.h" + +#include <array> +#include <memory> + +namespace netlist::interface +{ + /// \brief analog_callback device + /// + /// This device is used to call back into the application which + /// is controlling the execution of the netlist. + /// + /// The device will call the provided lambda with a reference to + /// itself and the current value of the net it is connected to. + /// + /// The following code is an example on how to add the device to + /// the netlist factory. + /// + /// ``` + /// const pstring pin(m_in); + /// pstring dname = pstring("OUT_") + pin; + /// + /// const auto lambda = [this](auto &in, netlist::nl_fptype val) + /// { + /// this->cpu()->update_icount(in.exec().time()); + /// this->m_delegate(val, this->cpu()->local_time()); + /// this->cpu()->check_mame_abort_slice(); + /// }; + /// + /// using lb_t = decltype(lambda); + /// using cb_t = + /// netlist::interface::NETLIB_NAME(analog_callback)<lb_t>; + /// + /// parser.factory().add<cb_t, netlist::nl_fptype, lb_t>(dname, + /// netlist::factory::properties("-", PSOURCELOC()), 1e-6, + /// std::forward<lb_t>(lambda)); + /// ``` + + template <typename FUNC> + class nld_analog_callback : public device_t + { + public: + nld_analog_callback(constructor_param_t data, nl_fptype threshold, + FUNC &&func) + : device_t(data) + , m_in(*this, "IN", NETLIB_DELEGATE(in)) + , m_threshold(threshold) + , m_last(*this, "m_last", 0) + , m_func(func) + { + } + + NETLIB_RESETI() { m_last = 0.0; } + + NETLIB_HANDLERI(in) + { + const nl_fptype cur = m_in(); + if (plib::abs(cur - m_last) > m_threshold) + { + m_last = cur; + m_func(*this, cur); + } + } + + private: + analog_input_t m_in; + nl_fptype m_threshold; + state_var<nl_fptype> m_last; + FUNC m_func; + }; + + /// \brief logic_callback device + /// + /// This device must be connected to a logic net. It has no power + /// terminals and conversion with proxies will not work. + /// + /// Background: This device may be inserted later into the driver and + /// should not modify the resulting analog representation of the + /// netlist. + /// + /// If you get error messages on missing power terminals you have to use + /// the analog callback device instead. + + template <typename FUNC> + class nld_logic_callback : public device_t + { + public: + nld_logic_callback(constructor_param_t data, FUNC &&func) + : device_t(data) + , m_in(*this, "IN", NETLIB_DELEGATE(in)) + , m_func(func) + { + } + + NETLIB_HANDLERI(in) + { + const netlist_sig_t cur = m_in(); + m_func(*this, cur); + } + + private: + logic_input_t m_in; + FUNC m_func; + }; + + /// \brief Set parameters to buffers contents at regular intervals + /// + /// This device will update a parameter from a buffer passed to the + /// device. It is the responsibility of the controlling application to + /// ensure that the buffer is filled at regular intervals. + /// + /// \tparam T The buffer type + /// \tparam N Maximum number of supported buffers + /// + template <typename T> + class nld_buffered_param_setter : public device_t + { + public: + nld_buffered_param_setter(constructor_param_t data) + : device_t(data) + , m_sample_time(netlist_time::zero()) + , m_feedback(*this, "FB", NETLIB_DELEGATE(feedback)) // clock part + , m_Q(*this, "Q") + , m_pos(0) + , m_samples(0) + , m_param_name(*this, "CHAN", "") + , m_param_mult(*this, "MULT", 1.0) + , m_param_offset(*this, "OFFSET", 0.0) + , m_param(nullptr) + , m_id(*this, "ID", 0) + { + connect("FB", "Q"); + m_buffer = nullptr; + } + + protected: + NETLIB_RESETI() {} + + NETLIB_HANDLERI(feedback) + { + if (m_pos < m_samples) + { + // check if called outside of stream_update + if (m_buffer != nullptr) + { + const nl_fptype v = (*m_buffer)[m_pos]; + m_param_setter(v * m_param_mult() + m_param_offset()); + } + } + else + { + // FIXME: The logic has a rounding issue because time + // resolution divided by 48,000 is not a natural + // number. The fractional part adds up to one samples + // every 13 seconds for 100 ps resolution. Fixing + // this is possible but complicated and expensive. + } + m_pos++; + + m_Q.net().toggle_and_push_to_queue(m_sample_time); + } + + public: + /// \brief resolve parameter names to pointers + /// + /// This function must be called after all device were constructed + /// but before reset is called. + void resolve_params(netlist_time sample_time) + { + m_pos = 0; + m_sample_time = sample_time; + if (m_param_name() != pstring("")) + { + param_t *p = &state() + .setup() + .find_param(m_param_name()) + .param(); + m_param = p; + if (plib::dynamic_downcast<param_fp_t *>(p)) + m_param_setter = setter_t( + &NETLIB_NAME(buffered_param_setter)::setter<param_fp_t>, + this); + else if (plib::dynamic_downcast<param_logic_t *>(p)) + m_param_setter = setter_t( + &NETLIB_NAME(buffered_param_setter)::setter< + param_logic_t>, + this); + } + } + + void buffer_reset(netlist_time sample_time, std::size_t num_samples, + T *inputs) + { + m_samples = num_samples; + m_sample_time = sample_time; + m_pos = 0; + m_buffer = inputs; + } + + std::size_t id() const { return m_id; } + + private: + using setter_t = plib::pmfp<void(nl_fptype)>; + + template <typename S> + void setter(nl_fptype v) + { + static_cast<S *>(m_param)->set(v); + } + + netlist_time m_sample_time; + + logic_input_t m_feedback; + logic_output_t m_Q; + + std::size_t m_pos; + std::size_t m_samples; + + param_str_t m_param_name; + param_fp_t m_param_mult; + param_fp_t m_param_offset; + param_t * m_param; + setter_t m_param_setter; + T * m_buffer; + param_num_t<std::size_t> m_id; + }; + +} // namespace netlist::interface + +#endif // NLINTERFACE_H_ diff --git a/src/lib/netlist/nl_lists.h b/src/lib/netlist/nl_lists.h deleted file mode 100644 index f4b1c4e8ff5..00000000000 --- a/src/lib/netlist/nl_lists.h +++ /dev/null @@ -1,358 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * nllists.h - * - */ - -#pragma once - -#ifndef NLLISTS_H_ -#define NLLISTS_H_ - -#include "plib/pchrono.h" -#include "plib/plists.h" -#include "plib/ptypes.h" - -#include "nl_config.h" -#include "nltypes.h" - -#include <algorithm> -#include <atomic> -#include <mutex> -#include <thread> -#include <utility> - - -// ---------------------------------------------------------------------------------------- -// timed queue -// ---------------------------------------------------------------------------------------- - -namespace netlist -{ - //FIXME: move to an appropriate place - template<bool enabled_ = true> - class pspin_mutex - { - public: - pspin_mutex() noexcept = default; - void lock() noexcept{ while (m_lock.test_and_set(std::memory_order_acquire)) { } } - void unlock() noexcept { m_lock.clear(std::memory_order_release); } - private: - PALIGNAS_CACHELINE() - std::atomic_flag m_lock = ATOMIC_FLAG_INIT; - }; - - template<> - class pspin_mutex<false> - { - public: - void lock() const noexcept { } - void unlock() const noexcept { } - }; - - template <class Element, class Time> - struct pqentry_t final - { - constexpr pqentry_t() noexcept : m_exec_time(), m_object(nullptr) { } - constexpr pqentry_t(const Time t, const Element o) noexcept : m_exec_time(t), m_object(o) { } -#if 0 - ~pqentry_t() = default; - constexpr pqentry_t(const pqentry_t &e) noexcept = default; - constexpr pqentry_t(pqentry_t &&e) noexcept = default; - pqentry_t& operator=(pqentry_t && other) noexcept = default; - pqentry_t& operator=(const pqentry_t &other) noexcept = default; - - void swap(pqentry_t &other) noexcept - { - std::swap(m_exec_time, other.m_exec_time); - std::swap(m_object, other.m_object); - } -#endif - struct QueueOp - { - inline static constexpr bool less(const pqentry_t &lhs, const pqentry_t &rhs) noexcept - { - return (lhs.m_exec_time < rhs.m_exec_time); - } - - inline static constexpr bool lessequal(const pqentry_t &lhs, const pqentry_t &rhs) noexcept - { - return (lhs.m_exec_time <= rhs.m_exec_time); - } - - inline static constexpr bool equal(const pqentry_t &lhs, const pqentry_t &rhs) noexcept - { - return lhs.m_object == rhs.m_object; - } - - inline static constexpr bool equal(const pqentry_t &lhs, const Element &rhs) noexcept - { - return lhs.m_object == rhs; - } - - inline static constexpr pqentry_t never() noexcept { return pqentry_t(Time::never(), nullptr); } - }; - - Time m_exec_time; - Element m_object; - }; - - /* Use TS = true for a threadsafe queue */ - template <class T, bool TS, bool KEEPSTAT, class QueueOp = typename T::QueueOp> - class timed_queue_linear : plib::nocopyassignmove - { - public: - - explicit timed_queue_linear(const std::size_t list_size) - : m_list(list_size) - { - clear(); - } - - std::size_t capacity() const noexcept { return m_list.capacity() - 1; } - bool empty() const noexcept { return (m_end == &m_list[1]); } - - void push(T && e) noexcept - { - /* Lock */ - lock_guard_type lck(m_lock); - T * i(m_end-1); - for (; QueueOp::less(*(i), e); --i) - { - *(i+1) = *(i); - m_prof_sortmove.inc(); - } - *(i+1) = std::move(e); - ++m_end; - m_prof_call.inc(); - } - - void push_nostats(T && e) noexcept - { - /* Lock */ - lock_guard_type lck(m_lock); -#if 1 - T * i(m_end-1); - for (; QueueOp::less(*(i), e); --i) - { - *(i+1) = *(i); - } - *(i+1) = std::move(e); - ++m_end; -#else - T * i(m_end++); - while (QueueOp::less(*(--i), e)) - { - *(i+1) = *(i); - } - *(i+1) = std::move(e); -#endif - } - - T pop() noexcept { return *(--m_end); } - const T &top() const noexcept { return *(m_end-1); } - - template <class R> - void remove(const R &elem) noexcept - { - m_prof_remove.inc(); - remove_nostats(elem); - } - - template <class R> - void remove_nostats(const R &elem) noexcept - { - /* Lock */ - lock_guard_type lck(m_lock); -#if 1 - for (T * i = m_end - 1; i > &m_list[0]; --i) - { - if (QueueOp::equal(*i, elem)) - { - std::copy(i+1, m_end--, i); - return; - } - } -#else - for (T * i = &m_list[1]; i < m_end; ++i) - { - if (QueueOp::equal(*i, elem)) - { - std::copy(i+1, m_end--, i); - return; - } - } -#endif - } - - void retime(T && elem) noexcept - { - /* Lock */ - lock_guard_type lck(m_lock); - m_prof_retime.inc(); - - for (T * i = m_end - 1; i > &m_list[0]; --i) - { - if (QueueOp::equal(*i, elem)) // partial equal! - { - *i = std::move(elem); - while (QueueOp::less(*(i-1), *i)) - { - std::swap(*(i-1), *i); - --i; - } - while (i < m_end && QueueOp::less(*i, *(i+1))) - { - std::swap(*(i+1), *i); - ++i; - } - return; - } - } - } - - void clear() noexcept - { - lock_guard_type lck(m_lock); - m_end = &m_list[0]; - /* put an empty element with maximum time into the queue. - * the insert algo above will run into this element and doesn't - * need a comparison with queue start. - */ - m_list[0] = QueueOp::never(); - m_end++; - } - - // save state support & mame disasm - - const T *listptr() const noexcept { return &m_list[1]; } - std::size_t size() const noexcept { return static_cast<std::size_t>(m_end - &m_list[1]); } - const T & operator[](const std::size_t index) const noexcept { return m_list[ 1 + index]; } - private: - using mutex_type = pspin_mutex<TS>; - using lock_guard_type = std::lock_guard<mutex_type>; - - mutex_type m_lock; - PALIGNAS_CACHELINE() - T * m_end; - //std::vector<T> m_list; - plib::aligned_vector<T> m_list; - - public: - // profiling - nperfcount_t<KEEPSTAT> m_prof_sortmove; - nperfcount_t<KEEPSTAT> m_prof_call; - nperfcount_t<KEEPSTAT> m_prof_remove; - nperfcount_t<KEEPSTAT> m_prof_retime; - }; - - template <class T, bool TS, bool KEEPSTAT, class QueueOp = typename T::QueueOp> - class timed_queue_heap : plib::nocopyassignmove - { - public: - - struct compare - { - constexpr bool operator()(const T &a, const T &b) const { return QueueOp::lessequal(b,a); } - }; - - explicit timed_queue_heap(const std::size_t list_size) - : m_list(list_size) - { - clear(); - } - - std::size_t capacity() const noexcept { return m_list.capacity(); } - bool empty() const noexcept { return &m_list[0] == m_end; } - - void push(T &&e) noexcept - { - /* Lock */ - lock_guard_type lck(m_lock); - *m_end++ = e; - std::push_heap(&m_list[0], m_end, compare()); - m_prof_call.inc(); - } - - T pop() noexcept - { - T ret(m_list[0]); - std::pop_heap(&m_list[0], m_end, compare()); - m_end--; - return ret; - } - - const T &top() const noexcept { return m_list[0]; } - - template <class R> - void remove(const R &elem) noexcept - { - /* Lock */ - lock_guard_type lck(m_lock); - for (T * i = m_end - 1; i >= &m_list[0]; i--) - { - if (QueueOp::equal(*i, elem)) - { - m_end--; - for (;i < m_end; i++) - *i = std::move(*(i+1)); - std::make_heap(&m_list[0], m_end, compare()); - return; - } - } - } - - void retime(const T &elem) noexcept - { - /* Lock */ - lock_guard_type lck(m_lock); - for (T * i = m_end - 1; i >= &m_list[0]; i--) - { - if (QueueOp::equal(*i, elem)) // partial equal! - { - *i = elem; - std::make_heap(&m_list[0], m_end, compare()); - return; - } - } - } - - void clear() - { - lock_guard_type lck(m_lock); - m_list.clear(); - m_end = &m_list[0]; - } - - // save state support & mame disasm - - constexpr const T *listptr() const { return &m_list[0]; } - constexpr std::size_t size() const noexcept { return m_list.size(); } - constexpr const T & operator[](const std::size_t index) const { return m_list[ 0 + index]; } - private: - using mutex_type = pspin_mutex<TS>; - using lock_guard_type = std::lock_guard<mutex_type>; - - mutex_type m_lock; - std::vector<T> m_list; - T *m_end; - - public: - // profiling - nperfcount_t<KEEPSTAT> m_prof_sortmove; - nperfcount_t<KEEPSTAT> m_prof_call; - }; - - /* - * Use timed_queue_heap to use stdc++ heap functions instead of linear processing. - * - * This slows down processing by about 25% on a Kaby Lake. - */ - - template <class T, bool TS, bool KEEPSTAT, class QueueOp = typename T::QueueOp> - using timed_queue = timed_queue_linear<T, TS, KEEPSTAT, QueueOp>; - -} // namespace netlist - -#endif /* NLLISTS_H_ */ diff --git a/src/lib/netlist/nl_parser.cpp b/src/lib/netlist/nl_parser.cpp index dfae907fe96..4d4638bea21 100644 --- a/src/lib/netlist/nl_parser.cpp +++ b/src/lib/netlist/nl_parser.cpp @@ -1,437 +1,588 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_parser.c - * - */ #include "nl_parser.h" -#include "nl_base.h" + #include "nl_errstr.h" #include "nl_factory.h" +#include "nl_setup.h" namespace netlist { -// ---------------------------------------------------------------------------------------- -// A netlist parser -// ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // A netlist parser + // ------------------------------------------------------------------------- -void parser_t::verror(const pstring &msg, int line_num, const pstring &line) -{ - m_setup.log().fatal("line {1}: error: {2}\n\t\t{3}\n", line_num, - msg, line); + void parser_t::verror(const pstring &msg) + { + m_setup.log().fatal("{1}", msg); + throw nl_exception(plib::pfmt("{1}")(msg)); + } - //throw error; -} + parser_t::parser_t(nlparse_t &setup) + : m_setup(setup) + , m_cur_local(nullptr) + { + m_tokenizer + .identifier_chars( + "abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-$@") + .number_chars(".0123456789", "0123456789eE-.") // FIXME: processing + // of numbers + .whitespace(pstring("") + ' ' + static_cast<char>(9) + + static_cast<char>(10) + static_cast<char>(13)) + .comment("/*", "*/", "//"); + m_tok_paren_left = m_tokenizer.register_token("("); + m_tok_paren_right = m_tokenizer.register_token(")"); + m_tok_brace_left = m_tokenizer.register_token("{"); + m_tok_brace_right = m_tokenizer.register_token("}"); + m_tok_comma = m_tokenizer.register_token(","); + + m_tok_static = m_tokenizer.register_token("static"); + m_tok_ALIAS = m_tokenizer.register_token("ALIAS"); + m_tok_DIPPINS = m_tokenizer.register_token("DIPPINS"); + m_tok_NET_C = m_tokenizer.register_token("NET_C"); + m_tok_FRONTIER = m_tokenizer.register_token("OPTIMIZE_FRONTIER"); + m_tok_PARAM = m_tokenizer.register_token("PARAM"); + m_tok_DEFPARAM = m_tokenizer.register_token("DEFPARAM"); + m_tok_HINT = m_tokenizer.register_token("HINT"); + m_tok_NET_MODEL = m_tokenizer.register_token("NET_MODEL"); + m_tok_NET_REGISTER_DEV = m_tokenizer.register_token("NET_REGISTER_DEV"); + m_tok_INCLUDE = m_tokenizer.register_token("INCLUDE"); + m_tok_LOCAL_SOURCE = m_tokenizer.register_token("LOCAL_SOURCE"); + m_tok_LOCAL_LIB_ENTRY = m_tokenizer.register_token("LOCAL_LIB_ENTRY"); + m_tok_EXTERNAL_LIB_ENTRY = m_tokenizer.register_token( + "EXTERNAL_LIB_ENTRY"); + m_tok_SUBMODEL = m_tokenizer.register_token("SUBMODEL"); + m_tok_NETLIST_START = m_tokenizer.register_token("NETLIST_START"); + m_tok_NETLIST_EXTERNAL = m_tokenizer.register_token("NETLIST_EXTERNAL"); + m_tok_EXTERNAL_SOURCE = m_tokenizer.register_token("EXTERNAL_SOURCE"); + m_tok_TRUTH_TABLE = m_tokenizer.register_token("TRUTH_TABLE"); + m_tok_TRUTHTABLE_ENTRY = m_tokenizer.register_token("TRUTHTABLE_ENTRY"); + m_tok_TT_HEAD = m_tokenizer.register_token("TT_HEAD"); + m_tok_TT_LINE = m_tokenizer.register_token("TT_LINE"); + m_tok_TT_FAMILY = m_tokenizer.register_token("TT_FAMILY"); + + m_tokenizer.register_token("RES_R"); + m_tokenizer.register_token("RES_K"); + m_tokenizer.register_token("RES_M"); + m_tokenizer.register_token("CAP_U"); + m_tokenizer.register_token("CAP_N"); + m_tokenizer.register_token("CAP_P"); + } -bool parser_t::parse(const pstring &nlname) -{ - this->identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-") - .number_chars(".0123456789", "0123456789eE-.") //FIXME: processing of numbers - //set_whitespace(pstring("").cat(' ').cat(9).cat(10).cat(13)); - .whitespace(pstring("") + ' ' + static_cast<char>(9) + static_cast<char>(10) + static_cast<char>(13)) - .comment("/*", "*/", "//"); - m_tok_param_left = register_token("("); - m_tok_param_right = register_token(")"); - m_tok_comma = register_token(","); - - m_tok_ALIAS = register_token("ALIAS"); - m_tok_DIPPINS = register_token("DIPPINS"); - m_tok_NET_C = register_token("NET_C"); - m_tok_FRONTIER = register_token("OPTIMIZE_FRONTIER"); - m_tok_PARAM = register_token("PARAM"); - m_tok_HINT = register_token("HINT"); - m_tok_NET_MODEL = register_token("NET_MODEL"); - m_tok_INCLUDE = register_token("INCLUDE"); - m_tok_LOCAL_SOURCE = register_token("LOCAL_SOURCE"); - m_tok_LOCAL_LIB_ENTRY = register_token("LOCAL_LIB_ENTRY"); - m_tok_SUBMODEL = register_token("SUBMODEL"); - m_tok_NETLIST_START = register_token("NETLIST_START"); - m_tok_NETLIST_END = register_token("NETLIST_END"); - m_tok_TRUTHTABLE_START = register_token("TRUTHTABLE_START"); - m_tok_TRUTHTABLE_END = register_token("TRUTHTABLE_END"); - m_tok_TT_HEAD = register_token("TT_HEAD"); - m_tok_TT_LINE = register_token("TT_LINE"); - m_tok_TT_FAMILY = register_token("TT_FAMILY"); - - bool in_nl = false; - - while (true) + bool parser_t::parse(plib::istream_uptr &&strm, const pstring &nlname) { - token_t token = get_token(); - if (token.is_type(ENDOFFILE)) - { - return false; - } + token_store_t tokstor; + parse_tokens(std::move(strm), tokstor); + return parse(tokstor, nlname); + } + + void + parser_t::parse_tokens(plib::istream_uptr &&strm, token_store_t &tokstor) + { + plib::putf8_reader u8reader(strm.release_stream()); + m_tokenizer.append_to_store(&u8reader, tokstor); + } - if (token.is(m_tok_NETLIST_END)) + bool parser_t::parse(const token_store_t &store, const pstring &nlname) + { + set_token_source(&store); + + bool in_nl = false; + + while (true) { - require_token(m_tok_param_left); - if (!in_nl) - error (MF_UNEXPECTED_NETLIST_END()); - else + // FIXME: line numbers in cached local netlists are wrong + // need to process raw tokens here. + token_t token = get_token_raw(); + if (token.is_type(token_type::ENDOFFILE)) { - in_nl = false; + return false; } - require_token(m_tok_param_right); - } - else if (token.is(m_tok_NETLIST_START)) - { - if (in_nl) - error (MF_UNEXPECTED_NETLIST_START()); - require_token(m_tok_param_left); - token_t name = get_token(); - require_token(m_tok_param_right); - if (name.str() == nlname || nlname == "") + + if (token.is(m_tok_brace_right)) // Netlist ended? + { + if (!in_nl) + error(MF_PARSER_UNEXPECTED_1(token.str())); + else + in_nl = false; + m_cur_local->push_back(token); + } + else if (token.is(m_tok_NETLIST_START) + || token.is(m_tok_TRUTH_TABLE)) { - parse_netlist(name.str()); - return true; - } else + if (in_nl) + error(MF_PARSER_UNEXPECTED_1(token.str())); + require_token(m_tok_paren_left); + token_t name = get_token(); + if (token.is(m_tok_NETLIST_START) + && (name.str() == nlname || nlname.empty())) + { + parse_netlist(); + return true; + } + if (token.is(m_tok_TRUTH_TABLE)) + { + if (name.str() == nlname) + { + net_truth_table_start(nlname); + return true; + } + } + + // create a new cached local store + m_local.emplace(name.str(), token_store_t()); + m_cur_local = &m_local[name.str()]; + auto sl = location(); + auto li = plib::pfmt("# {1} \"{2}\"")(sl.line(), + sl.file_name()); + + m_cur_local->push_back(token_t(token_type::LINEMARKER, li)); + m_cur_local->push_back(token); + m_cur_local->push_back(token_t(m_tok_paren_left)); + m_cur_local->push_back(name); + // m_cur_local->push_back(token_t(m_tok_paren_right)); in_nl = true; + } + else if (token.is(m_tok_brace_left)) + { + // FIXME - do nothing for now + if (!in_nl) + printf("FIXME\n"); + else + m_cur_local->push_back(token); + } + // FIXME: do we really need this going forward ? there should be no + // need + // for NETLIST_EXTERNAL in netlist files + else if (token.is(m_tok_NETLIST_EXTERNAL)) + { + if (in_nl) + error(MF_UNEXPECTED_NETLIST_EXTERNAL()); + require_token(m_tok_paren_left); + token_t name = get_token(); + require_token(m_tok_paren_right); + } + else if (!in_nl) + { + if (!token.is(m_tok_static) + && !token.is_type(token_type::SOURCELINE) + && !token.is_type(token_type::LINEMARKER)) + error(MF_EXPECTED_NETLIST_START_1(token.str())); + } + else + { + m_cur_local->push_back(token); + } } } -} -void parser_t::parse_netlist(const pstring &nlname) -{ - while (true) + void parser_t::parse_netlist() { - token_t token = get_token(); - - if (token.is_type(ENDOFFILE)) - return; - - require_token(m_tok_param_left); - m_setup.log().debug("Parser: Device: {1}\n", token.str()); - - if (token.is(m_tok_ALIAS)) - net_alias(); - else if (token.is(m_tok_DIPPINS)) - dippins(); - else if (token.is(m_tok_NET_C)) - net_c(); - else if (token.is(m_tok_FRONTIER)) - frontier(); - else if (token.is(m_tok_PARAM)) - netdev_param(); - else if (token.is(m_tok_HINT)) - netdev_hint(); - else if (token.is(m_tok_NET_MODEL)) - net_model(); - else if (token.is(m_tok_SUBMODEL)) - net_submodel(); - else if (token.is(m_tok_INCLUDE)) - net_include(); - else if (token.is(m_tok_LOCAL_SOURCE)) - net_local_source(); - else if (token.is(m_tok_TRUTHTABLE_START)) - net_truthtable_start(nlname); - else if (token.is(m_tok_LOCAL_LIB_ENTRY)) - { - m_setup.register_lib_entry(get_identifier(), "parser: " + nlname); - require_token(m_tok_param_right); - } - else if (token.is(m_tok_NETLIST_END)) + require_token(m_tok_paren_right); + require_token(m_tok_brace_left); + + while (true) { - netdev_netlist_end(); - return; + token_t token = get_token(); + + if (token.is_type(token_type::ENDOFFILE)) + error(MF_UNEXPECTED_END_OF_FILE()); + + m_setup.log().debug("Parser: Device: {1}\n", token.str()); + + if (token.is(m_tok_ALIAS)) + net_alias(); + else if (token.is(m_tok_DIPPINS)) + dip_pins(); + else if (token.is(m_tok_NET_C)) + net_c(); + else if (token.is(m_tok_FRONTIER)) + frontier(); + else if (token.is(m_tok_PARAM)) + netdev_param(); + else if (token.is(m_tok_DEFPARAM)) + netdev_default_param(); + else if (token.is(m_tok_HINT)) + netdev_hint(); + else if (token.is(m_tok_NET_MODEL)) + net_model(); + else if (token.is(m_tok_SUBMODEL)) + net_sub_model(); + else if (token.is(m_tok_INCLUDE)) + net_include(); + else if (token.is(m_tok_LOCAL_SOURCE)) + net_local_source(); + else if (token.is(m_tok_EXTERNAL_SOURCE)) + net_external_source(); + else if (token.is(m_tok_LOCAL_LIB_ENTRY)) + net_lib_entry(true); + else if (token.is(m_tok_EXTERNAL_LIB_ENTRY)) + net_lib_entry(false); + else if (token.is(m_tok_TRUTHTABLE_ENTRY)) + { + require_token(m_tok_paren_left); + pstring name(get_identifier()); + register_local_as_source(name); + m_setup.include(name); + require_token(m_tok_paren_right); + } + else if (token.is(m_tok_NET_REGISTER_DEV)) + net_register_dev(); + else if (token.is(m_tok_brace_right)) + return; + else if (!token.is_type(token_type::IDENTIFIER)) + error(MF_EXPECTED_IDENTIFIER_GOT_1(token.str())); + else + device(token.str()); } - else - device(token.str()); } -} -void parser_t::net_truthtable_start(const pstring &nlname) -{ - pstring name = get_identifier(); - require_token(m_tok_comma); - long ni = get_number_long(); - require_token(m_tok_comma); - long no = get_number_long(); - require_token(m_tok_comma); - pstring def_param = get_string(); - require_token(m_tok_param_right); - - netlist::tt_desc desc; - desc.classname = name; - desc.name = name; - desc.ni = static_cast<unsigned long>(ni); - desc.no = static_cast<unsigned long>(no); - desc.def_param = "+" + def_param; - desc.family = ""; - - while (true) + void parser_t::net_lib_entry(bool is_local) { - token_t token = get_token(); + require_token(m_tok_paren_left); + pstring name(get_identifier()); + + if (is_local) + register_local_as_source(name); + else if (m_local.find(name) != m_local.end()) + error(MF_EXTERNAL_SOURCE_IS_LOCAL_1(name)); + + // FIXME: Need to pass in parameter definition FIXME: get line number + // right + m_setup.register_lib_entry(name, "", location()); + require_token(m_tok_paren_right); + } - if (token.is(m_tok_TT_HEAD)) - { - require_token(m_tok_param_left); - desc.desc.push_back(get_string()); - require_token(m_tok_param_right); - } - else if (token.is(m_tok_TT_LINE)) - { - require_token(m_tok_param_left); - desc.desc.push_back(get_string()); - require_token(m_tok_param_right); - } - else if (token.is(m_tok_TT_FAMILY)) - { - require_token(m_tok_param_left); - desc.family = get_string(); - require_token(m_tok_param_right); - } - else + void parser_t::net_truth_table_start(const pstring &nlname) + { + bool head_found(false); + + // parse remaining parameters + require_token(m_tok_comma); + long ni = get_number_long(); + require_token(m_tok_comma); + long no = get_number_long(); + require_token(m_tok_comma); + pstring def_param = get_string(); + require_token(m_tok_paren_right); + require_token(m_tok_brace_left); + + netlist::tt_desc desc; + desc.name = nlname; + desc.ni = gsl::narrow<unsigned long>(ni); + desc.no = gsl::narrow<unsigned long>(no); + desc.family = ""; + + while (true) { - require_token(token, m_tok_TRUTHTABLE_END); - require_token(m_tok_param_left); - require_token(m_tok_param_right); - m_setup.tt_factory_create(desc, nlname); - return; + token_t token = get_token(); + + if (token.is(m_tok_TT_HEAD)) + { + require_token(m_tok_paren_left); + desc.desc.push_back(get_string()); + require_token(m_tok_paren_right); + head_found = true; + } + else if (token.is(m_tok_TT_LINE)) + { + if (!head_found) + error(MF_TT_LINE_WITHOUT_HEAD()); + require_token(m_tok_paren_left); + desc.desc.push_back(get_string()); + require_token(m_tok_paren_right); + } + else if (token.is(m_tok_TT_FAMILY)) + { + require_token(m_tok_paren_left); + desc.family = get_string(); + require_token(m_tok_paren_right); + } + else + { + require_token(token, m_tok_brace_right); + // FIXME: proper location + m_setup.truth_table_create(desc, def_param, location()); + return; + } } } -} + void parser_t::net_model() + { + require_token(m_tok_paren_left); + pstring model = get_string(); + m_setup.register_model(model); + require_token(m_tok_paren_right); + } -void parser_t::netdev_netlist_start() -{ - // don't do much - token_t name = get_token(); - require_token(m_tok_param_right); -} + void parser_t::net_sub_model() + { + require_token(m_tok_paren_left); + pstring model(get_identifier()); + require_token(m_tok_comma); + pstring name = get_identifier(); + require_token(m_tok_paren_right); + + m_setup.namespace_push(name); + m_setup.include(model); + m_setup.namespace_pop(); + } -void parser_t::netdev_netlist_end() -{ - // don't do much - require_token(m_tok_param_right); -} + void parser_t::frontier() + { + require_token(m_tok_paren_left); + // don't do much + pstring attach_at = get_identifier(); + require_token(m_tok_comma); + auto tok = get_token(); + auto r_IN = stringify_expression(tok); + require_token(tok, m_tok_comma); + tok = get_token(); + auto r_OUT = stringify_expression(tok); + require_token(tok, m_tok_paren_right); + + m_setup.register_frontier(attach_at, r_IN, r_OUT); + } -void parser_t::net_model() -{ - // don't do much - pstring model = get_string(); - m_setup.register_model(model); - require_token(m_tok_param_right); -} + void parser_t::net_include() + { + require_token(m_tok_paren_left); + pstring name(get_identifier()); + require_token(m_tok_paren_right); -void parser_t::net_submodel() -{ - // don't do much - pstring model = get_identifier(); - require_token(m_tok_comma); - pstring name = get_identifier(); - require_token(m_tok_param_right); - - m_setup.namespace_push(name); - m_setup.include(model); - m_setup.namespace_pop(); -} - -void parser_t::frontier() -{ - // don't do much - pstring attachat = get_identifier(); - require_token(m_tok_comma); - double r_IN = eval_param(get_token()); - require_token(m_tok_comma); - double r_OUT = eval_param(get_token()); - require_token(m_tok_param_right); - - m_setup.register_frontier(attachat, r_IN, r_OUT); -} - -void parser_t::net_include() -{ - // don't do much - pstring name = get_identifier(); - require_token(m_tok_param_right); + m_setup.include(name); + } - m_setup.include(name); -} + void parser_t::net_local_source() + { + // This directive is only for hardcoded netlists. Ignore it here. + require_token(m_tok_paren_left); + pstring name(get_identifier()); + require_token(m_tok_paren_right); -void parser_t::net_local_source() -{ - // This directive is only for hardcoded netlists. Ignore it here. - pstring name = get_identifier(); - require_token(m_tok_param_right); + register_local_as_source(name); + } -} + void parser_t::register_local_as_source(const pstring &name) + { + auto p = m_local.find(name); + if (p != m_local.end()) + m_setup.register_source<source_token_t>(name, p->second); + else + error(MF_LOCAL_SOURCE_NOT_FOUND_1(name)); + } -void parser_t::net_alias() -{ - pstring alias = get_identifier_or_number(); + void parser_t::net_external_source() + { + // This directive is only for hardcoded netlists. Ignore it here. + require_token(m_tok_paren_left); + pstring name(get_identifier()); + require_token(m_tok_paren_right); + } - require_token(m_tok_comma); + void parser_t::net_alias() + { + require_token(m_tok_paren_left); + pstring alias = get_identifier_or_number(); - pstring out = get_identifier(); + require_token(m_tok_comma); - require_token(m_tok_param_right); + pstring out = get_identifier(); - m_setup.log().debug("Parser: Alias: {1} {2}\n", alias, out); - m_setup.register_alias(alias, out); -} + require_token(m_tok_paren_right); -void parser_t::net_c() -{ - pstring first = get_identifier(); - require_token(m_tok_comma); + m_setup.log().debug("Parser: Alias: {1} {2}\n", alias, out); + m_setup.register_alias(alias, out); + } - while (true) + void parser_t::net_c() { - pstring t1 = get_identifier(); - m_setup.register_link(first , t1); - m_setup.log().debug("Parser: Connect: {1} {2}\n", first, t1); - token_t n = get_token(); - if (n.is(m_tok_param_right)) - break; - if (!n.is(m_tok_comma)) - error(plib::pfmt("expected a comma, found <{1}>")(n.str()) ); + require_token(m_tok_paren_left); + pstring first = get_identifier(); + require_token(m_tok_comma); + + while (true) + { + pstring t1 = get_identifier(); + m_setup.register_connection(first, t1); + m_setup.log().debug("Parser: Connect: {1} {2}\n", first, t1); + token_t n = get_token(); + if (n.is(m_tok_paren_right)) + break; + if (!n.is(m_tok_comma)) + error(MF_EXPECTED_COMMA_OR_RP_1(n.str())); + } } -} + void parser_t::dip_pins() + { + std::vector<pstring> pins; -void parser_t::dippins() -{ - std::vector<pstring> pins; + require_token(m_tok_paren_left); + pins.push_back(get_identifier()); + require_token(m_tok_comma); - pins.push_back(get_identifier()); - require_token(m_tok_comma); + while (true) + { + pstring t1 = get_identifier(); + pins.push_back(t1); + token_t n = get_token(); + if (n.is(m_tok_paren_right)) + break; + if (!n.is(m_tok_comma)) + error(MF_EXPECTED_COMMA_OR_RP_1(n.str())); + } + if ((pins.size() % 2) == 1) + error(MF_DIPPINS_EQUAL_NUMBER_1(pins[0])); + std::size_t n = pins.size(); + for (std::size_t i = 0; i < n / 2; i++) + { + m_setup.register_alias(detail::alias_type::PACKAGE_PIN, + plib::pfmt("{1}")(i + 1), pins[i * 2]); + m_setup.register_alias(detail::alias_type::PACKAGE_PIN, + plib::pfmt("{1}")(n - i), pins[i * 2 + 1]); + } + } - while (true) + void parser_t::netdev_param() { - pstring t1 = get_identifier(); - pins.push_back(t1); - token_t n = get_token(); - if (n.is(m_tok_param_right)) - break; - if (!n.is(m_tok_comma)) - error(plib::pfmt("expected a comma, found <{1}>")(n.str()) ); + require_token(m_tok_paren_left); + pstring param(get_identifier()); + require_token(m_tok_comma); + token_t tok = get_token(); + if (tok.is_type(token_type::STRING)) + { + m_setup.log().debug("Parser: Param: {1} {2}\n", param, tok.str()); + m_setup.register_param(param, tok.str()); + require_token(m_tok_paren_right); + } + else + { + auto val = stringify_expression(tok); + m_setup.log().debug("Parser: Param: {1} {2}\n", param, val); + m_setup.register_param(param, val); + require_token(tok, m_tok_paren_right); + } } - if ((pins.size() % 2) == 1) - error(plib::pfmt("You must pass an equal number of pins to DIPPINS, first pin is {}")(pins[0])); - std::size_t n = pins.size(); - for (std::size_t i = 0; i < n / 2; i++) + + void parser_t::netdev_default_param() { - m_setup.register_alias(plib::pfmt("{1}")(i+1), pins[i*2]); - m_setup.register_alias(plib::pfmt("{1}")(n-i), pins[i*2 + 1]); + require_token(m_tok_paren_left); + pstring param(get_identifier()); + require_token(m_tok_comma); + token_t tok = get_token(); + if (tok.is_type(token_type::STRING)) + { + m_setup.log().debug("Parser: DefParam: {1} {2}\n", param, + tok.str()); + m_setup.register_default_param(param, tok.str()); + require_token(m_tok_paren_right); + } + else + { + auto val = stringify_expression(tok); + m_setup.log().debug("Parser: Param: {1} {2}\n", param, val); + m_setup.register_default_param(param, val); + require_token(tok, m_tok_paren_right); + } } -} -void parser_t::netdev_param() -{ - pstring param; - param = get_identifier(); - require_token(m_tok_comma); - token_t tok = get_token(); - if (tok.is_type(STRING)) + void parser_t::netdev_hint() { - m_setup.log().debug("Parser: Param: {1} {2}\n", param, tok.str()); - m_setup.register_param(param, tok.str()); + require_token(m_tok_paren_left); + pstring id(get_identifier()); + require_token(m_tok_comma); + pstring hint(get_identifier()); + m_setup.register_hint(id, ".HINT_" + hint); + require_token(m_tok_paren_right); } - else + + void parser_t::net_register_dev() { - nl_double val = eval_param(tok); - m_setup.log().debug("Parser: Param: {1} {2}\n", param, val); - m_setup.register_param(param, val); - } - require_token(m_tok_param_right); -} + require_token(m_tok_paren_left); + pstring type(get_identifier()); + require_token(m_tok_comma); + pstring name(get_identifier()); + require_token(m_tok_paren_right); -void parser_t::netdev_hint() -{ - pstring dev(get_identifier()); - require_token(m_tok_comma); - pstring hint(get_identifier()); - m_setup.register_param(dev + ".HINT_" + hint, 1); - require_token(m_tok_param_right); -} - -void parser_t::device(const pstring &dev_type) -{ - factory::element_t *f = m_setup.factory().factory_by_name(dev_type); - auto paramlist = plib::psplit(f->param_desc(), ","); + m_setup.register_dev(type, name); + } - pstring devname = get_identifier(); + void parser_t::device(const pstring &dev_type) + { + std::vector<pstring> params; - m_setup.register_dev(dev_type, devname); - m_setup.log().debug("Parser: IC: {1}\n", devname); + require_token(m_tok_paren_left); + pstring devname(get_identifier()); - for (const pstring &tp : paramlist) - { - if (plib::startsWith(tp, "+")) - { - require_token(m_tok_comma); - pstring output_name = get_identifier(); - m_setup.log().debug("Link: {1} {2}\n", tp, output_name); + m_setup.log().debug("Parser: IC: {1}\n", devname); - m_setup.register_link(devname + "." + tp.substr(1), output_name); - } - else if (plib::startsWith(tp, "@")) - { - pstring term = tp.substr(1); - m_setup.log().debug("Link: {1} {2}\n", tp, term); + auto tok(get_token()); - //FIXME - if (term == "VCC") - m_setup.register_link(devname + "." + term, "V5"); - else - m_setup.register_link(devname + "." + term, term); - } - else + while (tok.is(m_tok_comma)) { - require_token(m_tok_comma); - pstring paramfq = devname + "." + tp; - - m_setup.log().debug("Defparam: {1}\n", paramfq); - token_t tok = get_token(); - if (tok.is_type(STRING)) + tok = get_token(); + if (tok.is_type(token_type::STRING)) { - m_setup.register_param(paramfq, tok.str()); + params.push_back(tok.str()); + tok = get_token(); } else { - nl_double val = eval_param(tok); - m_setup.register_param(paramfq, val); + auto value = stringify_expression(tok); + params.push_back(value); } } - } - // error(plib::pfmt("Input count mismatch for {1} - expected {2} found {3}")(devname)(termlist.size())(cnt)); - require_token(m_tok_param_right); -} + require_token(tok, m_tok_paren_right); + m_setup.register_dev(dev_type, devname, params); + } + // ------------------------------------------------------------------------- + // private + // ------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------- -// private -// ---------------------------------------------------------------------------------------- + pstring parser_t::stringify_expression(token_t &tok) + { + int pc(0); + pstring ret; + while (!tok.is(m_tok_comma)) + { + if (tok.is(m_tok_paren_left)) + pc++; + else if (tok.is(m_tok_paren_right)) + { + if (pc <= 0) + break; + pc--; + } + ret += tok.str(); + tok = get_token(); + } + return ret; + } + // ------------------------------------------------------------------------- + // source_token_t + // ------------------------------------------------------------------------- -nl_double parser_t::eval_param(const token_t &tok) -{ - static std::array<pstring, 6> macs = {"", "RES_K", "RES_M", "CAP_U", "CAP_N", "CAP_P"}; - static std::array<nl_double, 6> facs = {1, 1e3, 1e6, 1e-6, 1e-9, 1e-12}; - std::size_t f=0; - nl_double ret; - - for (std::size_t i=1; i<macs.size();i++) - if (tok.str() == macs[i]) - f = i; - if (f>0) + bool source_token_t::parse(nlparse_t &setup, const pstring &name) { - require_token(m_tok_param_left); - ret = get_number_double(); - require_token(m_tok_param_right); + if (name == m_name) + { + auto ret = setup.parse_tokens(m_store, name); + return ret; + } + + return false; } - else + + plib::istream_uptr + source_token_t::stream([[maybe_unused]] const pstring &name) { - bool err; - ret = plib::pstonum_ne<nl_double, true>(tok.str(), err); - if (err) - error(plib::pfmt("Parameter value <{1}> not double \n")(tok.str())); + return plib::istream_uptr(); } - return ret * facs[f]; - -} } // namespace netlist diff --git a/src/lib/netlist/nl_parser.h b/src/lib/netlist/nl_parser.h index 92459c4b87b..a17780dcff6 100644 --- a/src/lib/netlist/nl_parser.h +++ b/src/lib/netlist/nl_parser.h @@ -1,80 +1,119 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_parser.c - * - */ + +/// +/// \file nl_parser.h +/// #ifndef NL_PARSER_H_ #define NL_PARSER_H_ -#include "nl_setup.h" -#include "plib/pparser.h" +#include "nltypes.h" // for setup_t + +#include "core/setup.h" + +#include "plib/ptokenizer.h" + +#include <unordered_map> namespace netlist { - class parser_t : public plib::ptokenizer + class parser_t : public plib::token_reader_t { public: - template <typename T> - parser_t(T &&strm, nlparse_t &setup) - : plib::ptokenizer(std::forward<T>(strm)) - , m_setup(setup) - { - } + using token_t = plib::tokenizer_t::token_t; + using token_type = plib::tokenizer_t::token_type; + using token_id_t = plib::tokenizer_t::token_id_t; + using token_store_t = plib::tokenizer_t::token_store_t; + + parser_t(nlparse_t &setup); - bool parse(const pstring &nlname = ""); + bool parse(plib::istream_uptr &&strm, const pstring &nlname); + bool parse(const token_store_t &store, const pstring &nlname); + void parse_tokens(plib::istream_uptr &&strm, token_store_t &tokstore); protected: - void parse_netlist(const pstring &nlname); + void parse_netlist(); void net_alias(); - void dippins(); + void dip_pins(); void netdev_param(); + void netdev_default_param(); void netdev_hint(); void net_c(); void frontier(); void device(const pstring &dev_type); - void netdev_netlist_start(); - void netdev_netlist_end(); void net_model(); - void net_submodel(); + void net_sub_model(); void net_include(); void net_local_source(); - void net_truthtable_start(const pstring &nlname); + void net_external_source(); + void net_lib_entry(bool is_local); + void net_register_dev(); + void net_truth_table_start(const pstring &nlname); - /* for debugging messages */ - //netlist_state_t &netlist() { return m_setup.netlist(); } + void verror(const pstring &msg) override; - void verror(const pstring &msg, int line_num, const pstring &line) override; private: + void register_local_as_source(const pstring &name); - nl_double eval_param(const token_t &tok); + pstring stringify_expression(token_t &tok); - token_id_t m_tok_param_left; - token_id_t m_tok_param_right; + token_id_t m_tok_paren_left; + token_id_t m_tok_paren_right; + token_id_t m_tok_brace_left; + token_id_t m_tok_brace_right; token_id_t m_tok_comma; + token_id_t m_tok_static; token_id_t m_tok_ALIAS; token_id_t m_tok_NET_C; token_id_t m_tok_DIPPINS; token_id_t m_tok_FRONTIER; token_id_t m_tok_PARAM; + token_id_t m_tok_DEFPARAM; token_id_t m_tok_HINT; token_id_t m_tok_NET_MODEL; + token_id_t m_tok_NET_REGISTER_DEV; token_id_t m_tok_NETLIST_START; - token_id_t m_tok_NETLIST_END; + token_id_t m_tok_NETLIST_EXTERNAL; token_id_t m_tok_SUBMODEL; token_id_t m_tok_INCLUDE; + token_id_t m_tok_EXTERNAL_SOURCE; token_id_t m_tok_LOCAL_SOURCE; token_id_t m_tok_LOCAL_LIB_ENTRY; - token_id_t m_tok_TRUTHTABLE_START; - token_id_t m_tok_TRUTHTABLE_END; + token_id_t m_tok_EXTERNAL_LIB_ENTRY; + token_id_t m_tok_TRUTH_TABLE; + token_id_t m_tok_TRUTHTABLE_ENTRY; token_id_t m_tok_TT_HEAD; token_id_t m_tok_TT_LINE; token_id_t m_tok_TT_FAMILY; - nlparse_t &m_setup; -}; + plib::tokenizer_t m_tokenizer; + nlparse_t & m_setup; + + std::unordered_map<pstring, token_store_t> m_local; + token_store_t * m_cur_local; + }; + + class source_token_t : public source_netlist_t + { + public: + source_token_t(const pstring & name, + const parser_t::token_store_t &store) + : m_store(store) + , m_name(name) + { + } + + bool parse(nlparse_t &setup, const pstring &name) override; + + protected: + plib::istream_uptr stream(const pstring &name) override; + + private: + parser_t::token_store_t m_store; + pstring m_name; + }; } // namespace netlist -#endif /* NL_PARSER_H_ */ +#endif // NL_PARSER_H_ diff --git a/src/lib/netlist/nl_setup.cpp b/src/lib/netlist/nl_setup.cpp index 447e78cfe2e..30393603daa 100644 --- a/src/lib/netlist/nl_setup.cpp +++ b/src/lib/netlist/nl_setup.cpp @@ -1,1244 +1,1911 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nlsetup.c - * - */ -#include "plib/palloc.h" -#include "analog/nld_twoterm.h" -#include "devices/nlid_proxy.h" -#include "devices/nlid_system.h" -#include "devices/nlid_truthtable.h" -#include "nl_base.h" +#include "nl_setup.h" + +#include "nl_errstr.h" #include "nl_factory.h" #include "nl_parser.h" -#include "nl_setup.h" -#include "plib/putil.h" + +#include "core/devices.h" +#include "core/setup.h" + +#include "devices/nlid_proxy.h" +#include "devices/nlid_truthtable.h" + #include "solver/nld_solver.h" -#include <cmath> +#include "plib/palloc.h" +#include "plib/penum.h" +#include "plib/pstonum.h" +#include "plib/pstrutil.h" +#include "plib/putil.h" + +#include <sstream> namespace netlist { - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // nl_parse_t - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- - nlparse_t::nlparse_t(setup_t &setup, log_type &log) - : m_factory(log) - , m_setup(setup) + nlparse_t::nlparse_t(log_type &log, detail::abstract_t &abstract) + : m_abstract(abstract) , m_log(log) , m_frontier_cnt(0) - { } + { + } - void nlparse_t::register_alias(const pstring &alias, const pstring &out) + void + nlparse_t::register_fqn_alias(detail::alias_type type, const pstring &alias, + const pstring &points_to) + { + if (!m_abstract.m_aliases + .insert({alias, detail::alias_t(type, alias, points_to)}) + .second) + { + log().fatal(MF_ALIAS_ALREAD_EXISTS_1(alias)); + throw nl_exception(MF_ALIAS_ALREAD_EXISTS_1(alias)); + } + } + + void + nlparse_t::register_alias(const pstring &alias, const pstring &points_to) + { + detail::alias_type type = detail::alias_type::PACKAGE_PIN; + for (auto &c : alias) + if (c < '0' || c > '9') + { + type = detail::alias_type::READABILITY; + break; + } + + register_alias(type, alias, points_to); + } + + void + nlparse_t::register_alias(detail::alias_type type, const pstring &alias, + const pstring &points_to) { pstring alias_fqn = build_fqn(alias); - pstring out_fqn = build_fqn(out); - register_alias_nofqn(alias_fqn, out_fqn); + pstring points_to_fqn = build_fqn(points_to); + register_fqn_alias(type, alias_fqn, points_to_fqn); } - void nlparse_t::register_dippins_arr(const pstring &terms) + void nlparse_t::register_dip_alias_arr(const pstring &terms) { - std::vector<pstring> list(plib::psplit(terms,", ")); - if (list.size() == 0 || (list.size() % 2) == 1) - log().fatal(MF_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1(build_fqn(""))); + const auto list(plib::psplit(terms, pstring(", "))); + if (list.empty() || (list.size() % 2) == 1) + { + log().fatal( + MF_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1(build_fqn(""))); + throw nl_exception( + MF_DIP_PINS_MUST_BE_AN_EQUAL_NUMBER_OF_PINS_1(build_fqn(""))); + } std::size_t n = list.size(); for (std::size_t i = 0; i < n / 2; i++) { - register_alias(plib::pfmt("{1}")(i+1), list[i * 2]); - register_alias(plib::pfmt("{1}")(n-i), list[i * 2 + 1]); + register_alias(detail::alias_type::PACKAGE_PIN, + plib::pfmt("{1}")(i + 1), list[i * 2]); + register_alias(detail::alias_type::PACKAGE_PIN, + plib::pfmt("{1}")(n - i), list[i * 2 + 1]); } } - void nlparse_t::register_dev(const pstring &classname, const pstring &name) + void + nlparse_t::register_dev(const pstring & classname, + std::initializer_list<const char *> more_parameters) { - auto f = m_factory.factory_by_name(classname); - if (f == nullptr) - log().fatal(MF_CLASS_1_NOT_FOUND(classname)); - else + std::vector<pstring> params; + const auto * i(more_parameters.begin()); + pstring name(*i); + ++i; + for (; i != more_parameters.end(); ++i) { - /* make sure we parse macro library entries */ - f->macro_actions(*this, name); - pstring key = build_fqn(name); - if (device_exists(key)) - log().fatal(MF_DEVICE_ALREADY_EXISTS_1(name)); - else - m_device_factory.insert(m_device_factory.end(), {key, f}); + params.emplace_back(*i); + } + register_dev(classname, name, params); + } + + void + nlparse_t::register_dev(const pstring &classname, const pstring &name, + const std::vector<pstring> ¶ms_and_connections, + factory::element_t ** factory_element) + { + + auto *f = factory().factory_by_name(classname); + + // make sure we parse macro library entries + // FIXME: this could be done here if e.g. f + // would have an indication that this is macro element. + if (f->type() == factory::element_type::MACRO) + { + namespace_push(name); + include(f->name()); + namespace_pop(); + } + + pstring key = build_fqn(name); + if (device_exists(key)) + { + log().fatal(MF_DEVICE_ALREADY_EXISTS_1(key)); + throw nl_exception(MF_DEVICE_ALREADY_EXISTS_1(key)); + } + + m_abstract.m_device_factory.insert(m_abstract.m_device_factory.end(), + {key, f}); + + auto parameter_list = plib::psplit(f->param_desc(), ','); + + if (!params_and_connections.empty()) + { + auto token_ptr(params_and_connections.begin()); + auto token_end(params_and_connections.end()); + + for (const pstring &tp : parameter_list) + { + if (plib::startsWith(tp, "+")) + { + if (token_ptr == token_end) + { + auto err = MF_PARAM_COUNT_MISMATCH_2( + name, params_and_connections.size()); + log().fatal(err); + throw nl_exception(err); + // break; + } + pstring output_name = *token_ptr; + log().debug("Link: {1} {2}", tp, output_name); + + register_connection(name + "." + tp.substr(1), output_name); + ++token_ptr; + } + else if (plib::startsWith(tp, "@")) + { + pstring term = tp.substr(1); + log().debug("Link: {1} {2}", tp, term); + + register_connection(name + "." + term, term); + } + else + { + if (token_ptr == token_end) + { + auto err = MF_PARAM_COUNT_MISMATCH_2( + name, params_and_connections.size()); + log().fatal(err); + throw nl_exception(err); + } + pstring fully_qualified_name = name + "." + tp; + + log().debug("Default parameter: {1}\n", + fully_qualified_name); + + register_param(fully_qualified_name, *token_ptr); + + ++token_ptr; + } + } + if (token_ptr != params_and_connections.end()) + { + MF_PARAM_COUNT_EXCEEDED_2 err(name, + params_and_connections.size()); + log().fatal(err); + throw nl_exception(err); + } + } + if (factory_element != nullptr) + *factory_element = f; + } + + void nlparse_t::register_hint(const pstring &object_name, + const pstring &hint_name) + { + const auto name = build_fqn(object_name) + hint_name; + if (!m_abstract.m_hints.insert({name, false}).second) + { + log().fatal(MF_ADDING_HINT_1(name)); + throw nl_exception(MF_ADDING_HINT_1(name)); } } - void nlparse_t::register_link(const pstring &sin, const pstring &sout) + void nlparse_t::register_connection(const pstring &sin, const pstring &sout) { - register_link_fqn(build_fqn(sin), build_fqn(sout)); + register_connection_fqn(build_fqn(plib::trim(sin)), + build_fqn(plib::trim(sout))); } - void nlparse_t::register_link_arr(const pstring &terms) + void nlparse_t::register_connection_arr(const pstring &terms) { - std::vector<pstring> list(plib::psplit(terms,", ")); + const auto list(plib::psplit(terms, pstring(", "))); if (list.size() < 2) + { log().fatal(MF_NET_C_NEEDS_AT_LEAST_2_TERMINAL()); + throw nl_exception(MF_NET_C_NEEDS_AT_LEAST_2_TERMINAL()); + } for (std::size_t i = 1; i < list.size(); i++) { - register_link(list[0], list[i]); + register_connection(list[0], list[i]); } } void nlparse_t::include(const pstring &netlist_name) { - for (auto &source : m_sources) - { - if (source->parse(*this, netlist_name)) - return; - } + if (m_sources.for_all<source_netlist_t>( + [this, &netlist_name](source_netlist_t *src) + { return src->parse(*this, netlist_name); })) + return; log().fatal(MF_NOT_FOUND_IN_SOURCE_COLLECTION(netlist_name)); + throw nl_exception(MF_NOT_FOUND_IN_SOURCE_COLLECTION(netlist_name)); } - void nlparse_t::namespace_push(const pstring &aname) { if (m_namespace_stack.empty()) - //m_namespace_stack.push(netlist().name() + "." + aname); + // m_namespace_stack.push(netlist().name() + "." + aname); m_namespace_stack.push(aname); else m_namespace_stack.push(m_namespace_stack.top() + "." + aname); } - void nlparse_t::namespace_pop() - { - m_namespace_stack.pop(); - } + void nlparse_t::namespace_pop() { m_namespace_stack.pop(); } - void nlparse_t::register_param(const pstring ¶m, const double value) + void + nlparse_t::register_param_fp(const pstring ¶m, const nl_fptype value) { - if (std::abs(value - std::floor(value)) > 1e-30 || std::abs(value) > 1e9) + if (plib::abs(value - plib::floor(value)) > nlconst::magic(1e-30) + || plib::abs(value) > nlconst::magic(1e9)) register_param(param, plib::pfmt("{1:.9}").e(value)); else - register_param(param, plib::pfmt("{1}")(static_cast<long>(value))); + register_param(param, plib::pfmt("{1}")(gsl::narrow<long>(value))); } void nlparse_t::register_param(const pstring ¶m, const pstring &value) { pstring fqn = build_fqn(param); + pstring val(value); + + // strip " from stringified strings + if (plib::startsWith(value, "\"") && plib::endsWith(value, "\"")) + val = value.substr(1, value.length() - 2); - auto idx = m_param_values.find(fqn); - if (idx == m_param_values.end()) + // Replace "@." with the current namespace + val = plib::replace_all(val, "@.", namespace_prefix()); + auto idx = m_abstract.m_param_values.find(fqn); + if (idx == m_abstract.m_param_values.end()) { - if (!m_param_values.insert({fqn, value}).second) + if (!m_abstract.m_param_values.insert({fqn, val}).second) + { log().fatal(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(param)); + throw nl_exception( + MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(param)); + } } else { - log().warning(MW_OVERWRITING_PARAM_1_OLD_2_NEW_3(fqn, idx->second, - value)); - m_param_values[fqn] = value; + if (idx->second.find("$(") == pstring::npos) + { + // There may be reason ... so make it an INFO + log().info( + MI_OVERWRITING_PARAM_1_OLD_2_NEW_3(fqn, idx->second, val)); + } + m_abstract.m_param_values[fqn] = val; } } - void nlparse_t::register_lib_entry(const pstring &name, const pstring &sourcefile) + void + nlparse_t::register_default_param(const pstring &name, const pstring &def) + { + // strip " from stringified strings + pstring val(def); + if (plib::startsWith(def, "\"") && plib::endsWith(def, "\"")) + val = def.substr(1, def.length() - 2); + // Replace "@." with the current namespace + val = plib::replace_all(val, "@.", namespace_prefix()); + m_abstract.m_default_params.emplace_back(namespace_prefix() + name, + val); + } + + factory::list_t &nlparse_t::factory() noexcept { - m_factory.register_device(plib::make_unique<factory::library_element_t>(name, name, "", sourcefile)); + return m_abstract.m_factory; } - void nlparse_t::register_frontier(const pstring &attach, const double r_IN, const double r_OUT) + const factory::list_t &nlparse_t::factory() const noexcept + { + return m_abstract.m_factory; + } + + void nlparse_t::register_lib_entry(const pstring & name, + const pstring & def_params, + plib::source_location &&loc) + { + factory().add(plib::make_unique<factory::library_element_t, host_arena>( + name, factory::properties(def_params, std::move(loc)))); + } + + void nlparse_t::register_frontier(const pstring &attach, + const pstring &r_IN, const pstring &r_OUT) { pstring frontier_name = plib::pfmt("frontier_{1}")(m_frontier_cnt); m_frontier_cnt++; register_dev("FRONTIER_DEV", frontier_name); register_param(frontier_name + ".RIN", r_IN); register_param(frontier_name + ".ROUT", r_OUT); - register_link(frontier_name + ".G", "GND"); - pstring attfn = build_fqn(attach); + register_connection(frontier_name + ".G", "GND"); + pstring attach_fully_qualified_name = build_fqn(attach); pstring front_fqn = build_fqn(frontier_name); - bool found = false; - for (auto & link : m_links) + bool found = false; + for (auto &link : m_abstract.m_connections) { - if (link.first == attfn) + if (link.first == attach_fully_qualified_name) { link.first = front_fqn + ".I"; found = true; } - else if (link.second == attfn) + else if (link.second == attach_fully_qualified_name) { link.second = front_fqn + ".I"; found = true; } } if (!found) + { log().fatal(MF_FOUND_NO_OCCURRENCE_OF_1(attach)); - register_link(attach, frontier_name + ".Q"); + throw nl_exception(MF_FOUND_NO_OCCURRENCE_OF_1(attach)); + } + register_connection(attach, frontier_name + ".Q"); } - void nlparse_t::tt_factory_create(tt_desc &desc, const pstring &sourcefile) + void nlparse_t::register_source_proc(const pstring &name, nlsetup_func func) { - auto fac = devices::tt_factory_create(desc, sourcefile); - m_factory.register_device(std::move(fac)); + register_source<netlist::source_proc_t>(name, func); } - pstring nlparse_t::build_fqn(const pstring &obj_name) const + void nlparse_t::truth_table_create(tt_desc &desc, const pstring &def_params, + plib::source_location &&loc) { - if (m_namespace_stack.empty()) - //return netlist().name() + "." + obj_name; - return obj_name; - else - return m_namespace_stack.top() + "." + obj_name; + auto fac = factory::truth_table_create( + desc, netlist::factory::properties(def_params, std::move(loc))); + factory().add(std::move(fac)); } - void nlparse_t::register_alias_nofqn(const pstring &alias, const pstring &out) + pstring nlparse_t::namespace_prefix() const { - if (!m_alias.insert({alias, out}).second) - log().fatal(MF_ADDING_ALI1_TO_ALIAS_LIST(alias)); + return (m_namespace_stack.empty() ? "" : m_namespace_stack.top() + "."); } - void nlparse_t::register_link_fqn(const pstring &sin, const pstring &sout) + pstring nlparse_t::build_fqn(const pstring &obj_name) const { - link_t temp = link_t(sin, sout); + return namespace_prefix() + obj_name; + } + + void + nlparse_t::register_connection_fqn(const pstring &sin, const pstring &sout) + { + detail::abstract_t::connection_t temp(sin, sout); log().debug("link {1} <== {2}", sin, sout); - m_links.push_back(temp); + m_abstract.m_connections.push_back(temp); } bool nlparse_t::device_exists(const pstring &name) const { - for (auto &d : m_device_factory) + for (const auto &d : m_abstract.m_device_factory) if (d.first == name) return true; return false; } - bool nlparse_t::parse_stream(plib::unique_ptr<std::istream> &&istrm, const pstring &name) + bool nlparse_t::parse_tokens(const plib::detail::token_store_t &tokens, + const pstring & name) + { + parser_t parser(*this); + return parser.parse(tokens, name); + } + + bool + nlparse_t::parse_stream(plib::istream_uptr &&in_stream, const pstring &name) { - plib::ppreprocessor y(&m_defines); - plib::ppreprocessor &x(y.process(std::move(istrm))); - return parser_t(std::move(x), *this).parse(name); - //return parser_t(std::move(plib::ppreprocessor(&m_defines).process(std::move(istrm))), *this).parse(name); +#if 0 + auto key = in_stream.filename(); + + if (m_source_cache.find(key) != m_source_cache.end()) + { + return parser_t(*this).parse(m_source_cache[key], name); + } + else + { + auto preprocessed = std::make_unique<std::stringstream>( + plib::ppreprocessor(m_includes, &m_defines).process(std::move(in_stream), in_stream.filename())); + + parser_t::token_store_t &st = m_source_cache[key]; + parser_t parser(*this); + parser.parse_tokens(plib::istream_uptr(std::move(preprocessed), key), st); + return parser.parse(st, name); + } +#else + const auto filename = in_stream.filename(); + auto preprocessed = std::make_unique<std::stringstream>( + putf8string(plib::ppreprocessor(m_includes, &m_defines) + .process(std::move(in_stream), filename))); + + parser_t::token_store_t st; + parser_t parser(*this); + parser.parse_tokens( + plib::istream_uptr(std::move(preprocessed), filename), st); + return parser.parse(st, name); +#endif } - void nlparse_t::add_define(const pstring &defstr) + void nlparse_t::add_define(const pstring &define) { - auto p = defstr.find('='); + auto p = define.find('='); if (p != pstring::npos) - add_define(plib::left(defstr, p), defstr.substr(p+1)); + add_define(plib::left(define, p), define.substr(p + 1)); else - add_define(defstr, "1"); + add_define(define, "1"); } - // ---------------------------------------------------------------------------------------- - // setup_t - // ---------------------------------------------------------------------------------------- + void nlparse_t::register_dynamic_log_devices( + const std::vector<pstring> &log_list) + { + log().debug("Creating dynamic logs ..."); + for (const pstring &ll : log_list) + { + pstring name = "log_" + ll; + register_dev("LOG", name); + register_connection(name + ".I", ll); + } + } + + void nlparse_t::remove_connections(const pstring &pin) + { + // FIXME: check use_cases - remove_connections may be dead + pstring pin_fully_qualified_name = build_fqn(pin); + bool found = false; -setup_t::setup_t(netlist_state_t &nlstate) - : nlparse_t(*this, nlstate.log()) + for (auto link = m_abstract.m_connections.begin(); + link != m_abstract.m_connections.end();) + { + if ((link->first == pin_fully_qualified_name) + || (link->second == pin_fully_qualified_name)) + { + log().verbose("removing connection: {1} <==> {2}\n", + link->first, link->second); + link = m_abstract.m_connections.erase(link); + found = true; + } + else + link++; + } + if (!found) + { + log().fatal(MF_FOUND_NO_OCCURRENCE_OF_1(pin)); + throw nl_exception(MF_FOUND_NO_OCCURRENCE_OF_1(pin)); + } + } + + void nlparse_t::register_model(const pstring &model_in) + { + auto pos = model_in.find(' '); + if (pos == pstring::npos) + throw nl_exception(MF_UNABLE_TO_PARSE_MODEL_1(model_in)); + pstring model = plib::ucase(plib::trim(plib::left(model_in, pos))); + pstring def = plib::trim(model_in.substr(pos + 1)); + if (!m_abstract.m_models.insert({model, def}).second) + { + // FIXME: Add an directive MODEL_OVERWRITE to netlist language + // throw nl_exception(MF_MODEL_ALREADY_EXISTS_1(model_in)); + log().info(MI_MODEL_OVERWRITE_1(model, model_in)); + m_abstract.m_models[model] = def; + } + } + + // ------------------------------------------------------------------------- + // Sources + // ------------------------------------------------------------------------- + + plib::istream_uptr nlparse_t::get_data_stream(const pstring &name) + { + auto strm = m_sources.get_stream<source_data_t>(name); + if (!strm.empty()) + return strm; + log().warning(MW_DATA_1_NOT_FOUND(name)); + return plib::istream_uptr(); + } + + // ------------------------------------------------------------------------- + // setup_t + // ------------------------------------------------------------------------- + + setup_t::setup_t(netlist_state_t &nlstate) + : m_abstract(nlstate.log()) + , m_parser(nlstate.log(), m_abstract) , m_nlstate(nlstate) + , m_models(m_abstract.m_models) // FIXME : parse abstract_t only , m_netlist_params(nullptr) , m_proxy_cnt(0) - , m_validation(false) -{ -} - -setup_t::~setup_t() noexcept -{ - // FIXME: can't see a need any longer - m_links.clear(); - m_params.clear(); - m_terminals.clear(); - m_param_values.clear(); - m_sources.clear(); -} - -pstring setup_t::termtype_as_str(detail::core_terminal_t &in) const -{ - switch (in.type()) { - case detail::terminal_type::TERMINAL: - return pstring("TERMINAL"); - case detail::terminal_type::INPUT: - return pstring("INPUT"); - case detail::terminal_type::OUTPUT: - return pstring("OUTPUT"); } - log().fatal(MF_UNKNOWN_OBJECT_TYPE_1(static_cast<unsigned>(in.type()))); - return pstring("Error"); -} -pstring setup_t::get_initial_param_val(const pstring &name, const pstring &def) const -{ - auto i = m_param_values.find(name); - if (i != m_param_values.end()) - return i->second; - else - return def; -} - -void setup_t::register_term(detail::core_terminal_t &term) -{ - if (!m_terminals.insert({term.name(), &term}).second) + pstring setup_t::termtype_as_str(detail::core_terminal_t &in) { - log().fatal(MF_ADDING_1_2_TO_TERMINAL_LIST(termtype_as_str(term), term.name())); + switch (in.type()) + { + case detail::terminal_type::TERMINAL: return "TERMINAL"; + case detail::terminal_type::INPUT: return "INPUT"; + case detail::terminal_type::OUTPUT: return "OUTPUT"; + } + return "Error"; // Tease gcc } - log().debug("{1} {2}\n", termtype_as_str(term), term.name()); -} -void setup_t::remove_connections(const pstring &pin) -{ - pstring pinfn = build_fqn(pin); - bool found = false; + pstring setup_t::get_initial_param_val(const pstring &name, + const pstring &def) const + { + // When `get_intial_param_val` is called the parameter `<name>` is + // already registered and the value `(value_string())` is set to the + // default value, e.g. "74XX" If thus `$(IC5E.A.MODEL)` is given for + // `name=="IC5E.A.MODEL"` `value_string()` below will return the + // default. + // FIXME: It may be more explicit and stable to test if pattern==name + // and return `def` in this case. + + auto i = m_abstract.m_param_values.find(name); + auto found_pat(false); + pstring v = (i == m_abstract.m_param_values.end()) ? def : i->second; - for (auto link = m_links.begin(); link != m_links.end(); ) + do + { + found_pat = false; + auto sp(plib::psplit(v, std::vector<pstring>({"$(", ")"}))); + std::size_t p(0); + v = ""; + while (p < sp.size()) + { + if (sp[p] == "$(") + { + p++; + pstring r; + while (p < sp.size() && sp[p] != ")") + r += sp[p++]; + p++; + auto k = m_params.find(r); + if (k != m_params.end()) + { + v = v + k->second.param().value_string(); + found_pat = true; + } + else + { + // pass - on + v = v + "$(" + r + ")"; + } + } + else + v += sp[p++]; + } + } while (found_pat); + + return v; + } + + void setup_t::register_term(detail::core_terminal_t &term) { - if ((link->first == pinfn) || (link->second == pinfn)) + log().debug("{1} {2}\n", termtype_as_str(term), term.name()); + if (!m_terminals.insert({term.name(), &term}).second) { - log().verbose("removing connection: {1} <==> {2}\n", link->first, link->second); - link = m_links.erase(link); - found = true; + log().fatal(MF_ADDING_1_2_TO_TERMINAL_LIST(termtype_as_str(term), + term.name())); + throw nl_exception(MF_ADDING_1_2_TO_TERMINAL_LIST( + termtype_as_str(term), term.name())); } - else - link++; } - if (!found) - log().fatal(MF_FOUND_NO_OCCURRENCE_OF_1(pin)); -} -void setup_t::register_param_t(const pstring &name, param_t ¶m) -{ - if (!m_params.insert({param.name(), param_ref_t(param.name(), param.device(), param)}).second) - log().fatal(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(name)); -} + void + setup_t::register_term(terminal_t &term, terminal_t *other_term, + const std::array<terminal_t *, 2> &splitter_terms) + { + this->register_term(term); + m_connected_terminals.insert( + {&term, + {other_term, splitter_terms[0], splitter_terms[1], nullptr}}); + } -pstring setup_t::resolve_alias(const pstring &name) const -{ - pstring temp = name; - pstring ret; + void setup_t::register_param_t(param_t ¶m) + { + if (!m_params.insert({param.name(), param_ref_t(param.device(), param)}) + .second) + { + log().fatal(MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(param.name())); + throw nl_exception( + MF_ADDING_PARAMETER_1_TO_PARAMETER_LIST(param.name())); + } + } - /* FIXME: Detect endless loop */ - do { - ret = temp; - auto p = m_alias.find(ret); - temp = (p != m_alias.end() ? p->second : ""); - } while (temp != "" && temp != ret); + pstring setup_t::resolve_alias(const pstring &name) const + { + pstring temp = name; + pstring ret; - log().debug("{1}==>{2}\n", name, ret); - return ret; -} + // FIXME: Detect endless loop + do + { + ret = temp; + auto p = m_abstract.m_aliases.find(ret); + temp = (p != m_abstract.m_aliases.end() ? p->second.references() + : ""); + } while (!temp.empty() && temp != ret); -pstring setup_t::de_alias(const pstring &alias) const -{ - pstring temp = alias; - pstring ret; + log().debug("{1}==>{2}\n", name, ret); + return ret; + } - /* FIXME: Detect endless loop */ - do { - ret = temp; - temp = ""; - for (auto &e : m_alias) + pstring setup_t::de_alias(const pstring &alias) const + { + pstring temp = alias; + pstring ret; + + // FIXME: Detect endless loop + do { - // FIXME: this will resolve first one found - if (e.second == ret) + ret = temp; + temp = ""; + for (const auto &e : m_abstract.m_aliases) { - temp = e.first; - break; + // FIXME: this will resolve first one found + if (e.second.references() == ret) + { + temp = e.first; + break; + } } - } - } while (temp != "" && temp != ret); + } while (!temp.empty() && temp != ret); - log().debug("{1}==>{2}\n", alias, ret); - return ret; -} + log().debug("{1}==>{2}\n", alias, ret); + return ret; + } -std::vector<pstring> setup_t::get_terminals_for_device_name(const pstring &devname) const -{ - std::vector<pstring> terms; - for (auto & t : m_terminals) + std::vector<pstring> + setup_t::get_terminals_for_device_name(const pstring &devname) const { - if (plib::startsWith(t.second->name(), devname)) + std::vector<pstring> terms; + for (const auto &t : m_terminals) { - pstring tn(t.second->name().substr(devname.length()+1)); - if (tn.find('.') == pstring::npos) - terms.push_back(tn); + if (plib::startsWith(t.second->name(), devname)) + { + pstring tn(t.second->name().substr(devname.length() + 1)); + if (tn.find('.') == pstring::npos) + terms.push_back(tn); + } } - } - for (auto & t : m_alias) - { - if (plib::startsWith(t.first, devname)) + for (const auto &t : m_abstract.m_aliases) { - pstring tn(t.first.substr(devname.length()+1)); - //printf("\t%s %s %s\n", t.first.c_str(), t.second.c_str(), tn.c_str()); - if (tn.find('.') == pstring::npos) + if (plib::startsWith(t.first, devname)) { - terms.push_back(tn); - pstring resolved = resolve_alias(t.first); - //printf("\t%s %s %s\n", t.first.c_str(), t.second.c_str(), resolved.c_str()); - if (resolved != t.first) + pstring tn(t.first.substr(devname.length() + 1)); + if (tn.find('.') == pstring::npos) { - auto found = std::find(terms.begin(), terms.end(), resolved.substr(devname.length()+1)); - if (found!=terms.end()) - terms.erase(found); + terms.push_back(tn); + pstring resolved = resolve_alias(t.first); + if (resolved != t.first) + { + auto found = std::find( + terms.begin(), terms.end(), + resolved.substr(devname.length() + 1)); + if (found != terms.end()) + terms.erase(found); + } } } } + return terms; } - return terms; -} -detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, bool required) const -{ - const pstring &tname = resolve_alias(terminal_in); - auto ret = m_terminals.find(tname); - /* look for default */ - if (ret == m_terminals.end()) + detail::core_terminal_t * + setup_t::find_terminal(const pstring &terminal_in, bool required) const { - /* look for ".Q" std output */ - ret = m_terminals.find(tname + ".Q"); - } + const pstring &tname = resolve_alias(terminal_in); + auto ret = m_terminals.find(tname); + // look for default + if (ret == m_terminals.end()) + { + // look for ".Q" std output + ret = m_terminals.find(tname + ".Q"); + } - detail::core_terminal_t *term = (ret == m_terminals.end() ? nullptr : ret->second); + detail::core_terminal_t *term = (ret == m_terminals.end() + ? nullptr + : ret->second); - if (term == nullptr && required) - log().fatal(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); - if (term != nullptr) - log().debug("Found input {1}\n", tname); - return term; -} + if (term == nullptr && required) + { + log().fatal(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); + throw nl_exception(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); + } + if (term != nullptr) + { + log().debug("Found input {1}\n", tname); + } -detail::core_terminal_t *setup_t::find_terminal(const pstring &terminal_in, - detail::terminal_type atype, bool required) const -{ - const pstring &tname = resolve_alias(terminal_in); - auto ret = m_terminals.find(tname); - /* look for default */ - if (ret == m_terminals.end() && atype == detail::terminal_type::OUTPUT) - { - /* look for ".Q" std output */ - ret = m_terminals.find(tname + ".Q"); + return term; } - if (ret == m_terminals.end() && required) - log().fatal(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); - - detail::core_terminal_t *term = (ret == m_terminals.end() ? nullptr : ret->second); - if (term != nullptr && term->type() != atype) + detail::core_terminal_t * + setup_t::find_terminal(const pstring & terminal_in, + detail::terminal_type atype, bool required) const { - if (required) - log().fatal(MF_OBJECT_1_2_WRONG_TYPE(terminal_in, tname)); - else + const pstring &tname = resolve_alias(terminal_in); + auto ret = m_terminals.find(tname); + // look for default + if (ret == m_terminals.end() && atype == detail::terminal_type::OUTPUT) + { + // look for ".Q" std output + ret = m_terminals.find(tname + ".Q"); + } + if (ret == m_terminals.end() && required) + { + log().fatal(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); + throw nl_exception(MF_TERMINAL_1_2_NOT_FOUND(terminal_in, tname)); + } + detail::core_terminal_t *term = (ret == m_terminals.end() + ? nullptr + : ret->second); + + if (term != nullptr && term->type() != atype) + { + if (required) + { + log().fatal(MF_OBJECT_1_2_WRONG_TYPE(terminal_in, tname)); + throw nl_exception( + MF_OBJECT_1_2_WRONG_TYPE(terminal_in, tname)); + } + term = nullptr; + } + if (term != nullptr) + log().debug("Found input {1}\n", tname); + + return term; } - if (term != nullptr) - log().debug("Found input {1}\n", tname); - return term; -} + param_ref_t setup_t::find_param(const pstring ¶m_in) const + { + const pstring resolved_param_name(resolve_alias(param_in)); + auto ret(m_params.find(resolved_param_name)); + if (ret == m_params.end()) + { + log().fatal( + MF_PARAMETER_1_2_NOT_FOUND(param_in, resolved_param_name)); + throw nl_exception( + MF_PARAMETER_1_2_NOT_FOUND(param_in, resolved_param_name)); + } + return ret->second; + } -param_t *setup_t::find_param(const pstring ¶m_in, bool required) const -{ - const pstring param_in_fqn = build_fqn(param_in); - - const pstring &outname = resolve_alias(param_in_fqn); - auto ret = m_params.find(outname); - if (ret == m_params.end() && required) - log().fatal(MF_PARAMETER_1_2_NOT_FOUND(param_in_fqn, outname)); - if (ret != m_params.end()) - log().debug("Found parameter {1}\n", outname); - return (ret == m_params.end() ? nullptr : &ret->second.m_param); -} - -devices::nld_base_proxy *setup_t::get_d_a_proxy(detail::core_terminal_t &out) -{ - nl_assert(out.is_logic()); + // NOLINTNEXTLINE(misc-no-recursion) + devices::nld_base_proxy * + setup_t::get_d_a_proxy(const detail::core_terminal_t &out) + { + auto iter_proxy(m_proxies.find(&out)); - auto &out_cast = static_cast<logic_output_t &>(out); - devices::nld_base_proxy *proxy = out_cast.get_proxy(); + if (iter_proxy != m_proxies.end()) + return iter_proxy->second; - if (proxy == nullptr) - { // create a new one ... + + auto out_cast = plib::dynamic_downcast<const logic_output_t *>(out); + nl_assert_always(bool(out_cast), "Not able to cast to logic_output_t&"); + pstring x = plib::pfmt("proxy_da_{1}_{2}")(out.name())(m_proxy_cnt); - auto new_proxy = - out_cast.logic_family()->create_d_a_proxy(m_nlstate, x, &out_cast); + auto new_proxy = (*out_cast)->logic_family()->create_d_a_proxy( + m_nlstate, x, *out_cast); m_proxy_cnt++; - /* connect all existing terminals to new net */ + // connect all existing terminals to new net - for (auto & p : out.net().core_terms()) + // Get a copy first + auto temp_terminals(out.net().core_terms_copy()); + // remove all terminals from out.net() + out.net().remove_all_terminals(); + + for (detail::core_terminal_t *p : temp_terminals) { p->clear_net(); // de-link from all nets ... if (!connect(new_proxy->proxy_term(), *p)) - log().fatal(MF_CONNECTING_1_TO_2( - new_proxy->proxy_term().name(), (*p).name())); + { + log().fatal(MF_CONNECTING_1_TO_2(new_proxy->proxy_term().name(), + (*p).name())); + throw nl_exception(MF_CONNECTING_1_TO_2( + new_proxy->proxy_term().name(), (*p).name())); + } } - out.net().core_terms().clear(); // clear the list out.net().add_terminal(new_proxy->in()); - out_cast.set_proxy(proxy); - proxy = new_proxy.get(); + auto *proxy(new_proxy.get()); + if (!m_proxies.insert({&out, proxy}).second) + throw nl_exception(MF_DUPLICATE_PROXY_1(out.name())); - m_nlstate.add_dev(new_proxy->name(), std::move(new_proxy)); + m_nlstate.register_device(new_proxy->name(), std::move(new_proxy)); + return proxy; } - return proxy; -} -devices::nld_base_proxy *setup_t::get_a_d_proxy(detail::core_terminal_t &inp) -{ - nl_assert(inp.is_logic()); + // NOLINTNEXTLINE(misc-no-recursion) + devices::nld_base_proxy * + setup_t::get_a_d_proxy(detail::core_terminal_t &inp) + { + gsl_Expects(inp.is_logic()); - auto &incast = dynamic_cast<logic_input_t &>(inp); - devices::nld_base_proxy *proxy = incast.get_proxy(); + const auto &logic_input_terminal = dynamic_cast<const logic_input_t &>( + inp); + + auto iter_proxy(m_proxies.find(&inp)); + + if (iter_proxy != m_proxies.end()) + return iter_proxy->second; - if (proxy != nullptr) - return proxy; - else - { log().debug("connect_terminal_input: connecting proxy\n"); - pstring x = plib::pfmt("proxy_ad_{1}_{2}")(inp.name())(m_proxy_cnt); - auto new_proxy = incast.logic_family()->create_a_d_proxy(m_nlstate, x, &incast); - //auto new_proxy = plib::owned_ptr<devices::nld_a_to_d_proxy>::Create(netlist(), x, &incast); - incast.set_proxy(new_proxy.get()); - m_proxy_cnt++; + auto new_proxy = logic_input_terminal.logic_family()->create_a_d_proxy( + m_nlstate, plib::pfmt("proxy_ad_{1}_{2}")(inp.name())(m_proxy_cnt), + &logic_input_terminal); - auto ret = new_proxy.get(); + auto *ret(new_proxy.get()); - /* connect all existing terminals to new net */ + if (!m_proxies.insert({&inp, ret}).second) + throw nl_exception(MF_DUPLICATE_PROXY_1(inp.name())); + + m_proxy_cnt++; + + // connect all existing terminals to new net if (inp.has_net()) { - for (auto & p : inp.net().core_terms()) + auto temp_terminals(inp.net().core_terms_copy()); + + inp.net().remove_all_terminals(); + + for (detail::core_terminal_t *p : temp_terminals) { - p->clear_net(); // de-link from all nets ... - if (!connect(ret->proxy_term(), *p)) - log().fatal(MF_CONNECTING_1_TO_2( + // inp may already belongs to the logic net. Thus skip it here. + // It will be removed by the clear further down. + if (p != &inp) + { + p->clear_net(); // de-link from all nets ... + if (!connect(ret->proxy_term(), *p)) + { + log().fatal(MF_CONNECTING_1_TO_2( ret->proxy_term().name(), (*p).name())); + throw nl_exception(MF_CONNECTING_1_TO_2( + ret->proxy_term().name(), (*p).name())); + } + } } - inp.net().core_terms().clear(); // clear the list } + inp.clear_net(); ret->out().net().add_terminal(inp); - m_nlstate.add_dev(new_proxy->name(), std::move(new_proxy)); + m_nlstate.register_device(new_proxy->name(), std::move(new_proxy)); return ret; } -} -void setup_t::merge_nets(detail::net_t &thisnet, detail::net_t &othernet) -{ - log().debug("merging nets ...\n"); - if (&othernet == &thisnet) + detail::core_terminal_t & + setup_t::resolve_proxy(detail::core_terminal_t &term) { - log().warning(MW_CONNECTING_1_TO_ITSELF(thisnet.name())); - return; // Nothing to do + if (term.is_logic()) + { + const auto &out = dynamic_cast<const logic_t &>(term); + auto iter_proxy(m_proxies.find(&out)); + if (iter_proxy != m_proxies.end()) + return iter_proxy->second->proxy_term(); + } + return term; } - if (thisnet.isRailNet() && othernet.isRailNet()) - log().fatal(MF_MERGE_RAIL_NETS_1_AND_2(thisnet.name(), othernet.name())); - - if (othernet.isRailNet()) + // NOLINTNEXTLINE(misc-no-recursion) + void setup_t::merge_nets(detail::net_t &this_net, detail::net_t &other_net) { - log().debug("othernet is railnet\n"); - merge_nets(othernet, thisnet); - } - else - { - othernet.move_connections(thisnet); - } -} + log().debug("merging nets ...\n"); + if (&other_net == &this_net) + { + log().warning(MW_CONNECTING_1_TO_ITSELF(this_net.name())); + return; // Nothing to do + } + if (this_net.is_rail_net() && other_net.is_rail_net()) + { + log().fatal( + MF_MERGE_RAIL_NETS_1_AND_2(this_net.name(), other_net.name())); + throw nl_exception( + MF_MERGE_RAIL_NETS_1_AND_2(this_net.name(), other_net.name())); + } + if (other_net.is_rail_net()) + { + log().debug("other net is a rail net\n"); + merge_nets(other_net, this_net); + } + else + { + move_connections(other_net, this_net); + } + } -void setup_t::connect_input_output(detail::core_terminal_t &in, detail::core_terminal_t &out) -{ - if (out.is_analog() && in.is_logic()) + // NOLINTNEXTLINE(misc-no-recursion) + void setup_t::connect_input_output(detail::core_terminal_t &input, + detail::core_terminal_t &output) { - auto proxy = get_a_d_proxy(in); + if (input.has_net() && input.net().is_rail_net()) + { + log().fatal(MF_INPUT_1_ALREADY_CONNECTED(input.name())); + throw nl_exception(MF_INPUT_1_ALREADY_CONNECTED(input.name())); + } + if (output.is_analog() && input.is_logic()) + { + auto *proxy = get_a_d_proxy(input); - out.net().add_terminal(proxy->proxy_term()); - } - else if (out.is_logic() && in.is_analog()) - { - devices::nld_base_proxy *proxy = get_d_a_proxy(out); + output.net().add_terminal(proxy->proxy_term()); + } + else if (output.is_logic() && input.is_analog()) + { + devices::nld_base_proxy *proxy = get_d_a_proxy(output); - connect_terminals(proxy->proxy_term(), in); - //proxy->out().net().register_con(in); - } - else - { - if (in.has_net()) - merge_nets(out.net(), in.net()); + connect_terminals(proxy->proxy_term(), input); + } else - out.net().add_terminal(in); + { + if (input.has_net()) + merge_nets(output.net(), input.net()); + else if (output.has_net()) + output.net().add_terminal(input); + else + { + log().fatal( + ME_TERMINALS_1_2_WITHOUT_NET(input.name(), output.name())); + throw nl_exception( + ME_TERMINALS_1_2_WITHOUT_NET(input.name(), output.name())); + } + } } -} - -void setup_t::connect_terminal_input(terminal_t &term, detail::core_terminal_t &inp) -{ - if (inp.is_analog()) + // NOLINTNEXTLINE(misc-no-recursion) + void setup_t::connect_terminal_input(detail::core_terminal_t &terminal, + detail::core_terminal_t &input) { - connect_terminals(inp, term); + if (input.is_analog()) + { + connect_terminals(input, terminal); + } + else if (input.is_logic()) + { + log().verbose("connect terminal {1} (in, {2}) to {3}\n", + input.name(), + input.is_analog() ? "analog" + : input.is_logic() ? "logic" + : "?", + terminal.name()); + auto *proxy = get_a_d_proxy(input); + + // out.net().register_con(proxy->proxy_term()); + connect_terminals(terminal, proxy->proxy_term()); + } + else + { + log().fatal(MF_OBJECT_INPUT_TYPE_1(input.name())); + throw nl_exception(MF_OBJECT_INPUT_TYPE_1(input.name())); + } } - else if (inp.is_logic()) - { - log().verbose("connect terminal {1} (in, {2}) to {3}\n", inp.name(), - inp.is_analog() ? pstring("analog") : inp.is_logic() ? pstring("logic") : pstring("?"), term.name()); - auto proxy = get_a_d_proxy(inp); - //out.net().register_con(proxy->proxy_term()); - connect_terminals(term, proxy->proxy_term()); - - } - else + // NOLINTNEXTLINE(misc-no-recursion) + void setup_t::connect_terminal_output(detail::core_terminal_t &terminal, + detail::core_terminal_t &output) { - log().fatal(MF_OBJECT_INPUT_TYPE_1(inp.name())); - } -} + if (output.is_analog()) + { + log().debug("connect_terminal_output: {1} {2}\n", terminal.name(), + output.name()); + // no proxy needed, just merge existing terminal net + if (terminal.has_net()) + { + if (&output.net() != &terminal.net()) + merge_nets(output.net(), terminal.net()); + else + // Only an info - some ICs (CD4538) connect pins internally + // to GND and the schematics again externally. This will + // cause this warning. + // FIXME: Add a hint to suppress the warning. + log().info(MI_CONNECTING_1_TO_2_SAME_NET( + terminal.name(), output.name(), terminal.net().name())); + } + else + output.net().add_terminal(terminal); + } + else if (output.is_logic()) + { + log().debug("connect_terminal_output: connecting proxy\n"); + devices::nld_base_proxy *proxy = get_d_a_proxy(output); -void setup_t::connect_terminal_output(terminal_t &in, detail::core_terminal_t &out) -{ - if (out.is_analog()) - { - log().debug("connect_terminal_output: {1} {2}\n", in.name(), out.name()); - /* no proxy needed, just merge existing terminal net */ - if (in.has_net()) - merge_nets(out.net(), in.net()); + connect_terminals(proxy->proxy_term(), terminal); + } else - out.net().add_terminal(in); + { + log().fatal(MF_OBJECT_OUTPUT_TYPE_1(output.name())); + throw nl_exception(MF_OBJECT_OUTPUT_TYPE_1(output.name())); + } } - else if (out.is_logic()) - { - log().debug("connect_terminal_output: connecting proxy\n"); - devices::nld_base_proxy *proxy = get_d_a_proxy(out); - connect_terminals(proxy->proxy_term(), in); - } - else + void setup_t::connect_terminals(detail::core_terminal_t &t1, + detail::core_terminal_t &t2) { - log().fatal(MF_OBJECT_OUTPUT_TYPE_1(out.name())); + if (t1.has_net() && t2.has_net()) + { + log().debug("T2 and T1 have net\n"); + merge_nets(t1.net(), t2.net()); + } + else if (t2.has_net()) + { + log().debug("T2 has net\n"); + t2.net().add_terminal(t1); + } + else if (t1.has_net()) + { + log().debug("T1 has net\n"); + t1.net().add_terminal(t2); + } + else + { + log().debug("adding analog net ...\n"); + // FIXME: Nets should have a unique name + auto new_net_uptr = plib::make_owned<analog_net_t>( + nlstate().pool(), m_nlstate, "net." + t1.name()); + auto *new_net_ptr = new_net_uptr.get(); + m_nlstate.register_net(std::move(new_net_uptr)); + t1.set_net(new_net_ptr); + new_net_ptr->add_terminal(t2); + new_net_ptr->add_terminal(t1); + } } -} -void setup_t::connect_terminals(detail::core_terminal_t &t1, detail::core_terminal_t &t2) -{ - if (t1.has_net() && t2.has_net()) - { - log().debug("T2 and T1 have net\n"); - merge_nets(t1.net(), t2.net()); - } - else if (t2.has_net()) - { - log().debug("T2 has net\n"); - t2.net().add_terminal(t1); - } - else if (t1.has_net()) + // NOLINTNEXTLINE(misc-no-recursion) + bool setup_t::connect_input_input(detail::core_terminal_t &input1, + detail::core_terminal_t &input2) { - log().debug("T1 has net\n"); - t1.net().add_terminal(t2); + bool ret = false; + if (input1.has_net()) // if input 1 already has a net + { + if (input1.net().is_rail_net()) // and the net is a rail net + ret = connect(input2, input1.net().rail_terminal()); // try to + // connect + // input 2 + // to rail + // terminal + // of input + // 1 net + if (!ret) + { + // the above was not successfull - try to connect input2 to + // TERMINAL type terminals of input 1 net's terminals + for (detail::core_terminal_t *t : + input1.net().core_terms_copy()) + { + if (t->is_type(detail::terminal_type::TERMINAL)) + ret = connect(input2, *t); + if (ret) + break; + } + } + } + // FIXME: We could use a helper connect_input_input_helper(input2, + // input1) here. + if (!ret && input2.has_net()) + { + if (input2.net().is_rail_net()) + ret = connect(input1, input2.net().rail_terminal()); + if (!ret) + { + for (detail::core_terminal_t *t : + input2.net().core_terms_copy()) + { + if (t->is_type(detail::terminal_type::TERMINAL)) + ret = connect(input1, *t); + if (ret) + break; + } + } + } + return ret; } - else + + // NOLINTNEXTLINE(misc-no-recursion) + bool setup_t::connect(detail::core_terminal_t &t1_in, + detail::core_terminal_t &t2_in) { - log().debug("adding analog net ...\n"); - // FIXME: Nets should have a unique name - auto anet = pool().make_poolptr<analog_net_t>(m_nlstate,"net." + t1.name()); - auto anetp = anet.get(); - m_nlstate.register_net(std::move(anet)); - t1.set_net(anetp); - anetp->add_terminal(t2); - anetp->add_terminal(t1); + using namespace detail; + + log().debug("Connecting {1} to {2}\n", t1_in.name(), t2_in.name()); + detail::core_terminal_t &t1 = resolve_proxy(t1_in); + detail::core_terminal_t &t2 = resolve_proxy(t2_in); + detail::terminal_type t1_type = t1.type(); + detail::terminal_type t2_type = t2.type(); + bool ret = true; + + switch (t1_type) + { + case terminal_type::TERMINAL: + { + switch (t2_type) + { + case terminal_type::TERMINAL: + connect_terminals(t1, t2); + break; + case terminal_type::INPUT: + connect_terminal_input(t1, t2); + break; + case terminal_type::OUTPUT: + connect_terminal_output(t1, t2); + break; + } + break; + } + case terminal_type::INPUT: + { + switch (t2_type) + { + case terminal_type::TERMINAL: + connect_terminal_input(t2, t1); + break; + case terminal_type::INPUT: + ret = connect_input_input(t1, t2); + break; + case terminal_type::OUTPUT: + connect_input_output(t1, t2); + break; + } + break; + } + case terminal_type::OUTPUT: + { + switch (t2_type) + { + case terminal_type::TERMINAL: + connect_terminal_output(t2, t1); + break; + case terminal_type::INPUT: + connect_input_output(t2, t1); + break; + case terminal_type::OUTPUT: ret = false; break; + } + break; + } + } + return ret; } -} -static detail::core_terminal_t &resolve_proxy(detail::core_terminal_t &term) -{ - if (term.is_logic()) + void setup_t::resolve_inputs() { - auto &out = dynamic_cast<logic_t &>(term); - if (out.has_proxy()) - return out.get_proxy()->proxy_term(); - } - return term; -} + log().verbose("Resolving inputs ..."); + + // Netlist can directly connect input to input. + // We therefore first park connecting inputs and retry + // after all other terminals were connected. -bool setup_t::connect_input_input(detail::core_terminal_t &t1, detail::core_terminal_t &t2) + unsigned tries = m_netlist_params->m_max_link_loops(); +#if 0 + // This code fails for some netlists when the element at position 0 + // is deleted. It will fail somewhere deep in std::pair releasing + // std::string called from erase. + // + // One example is the this netlist: + // + // #include "netlist/devices/net_lib.h" + // NETLIST_START(charge_discharge) { - bool ret = false; - if (t1.has_net()) - { - if (t1.net().isRailNet()) - ret = connect(t2, t1.net().railterminal()); - if (!ret) + // SOLVER(solver, 48000) // Fixed frequency solver + // CLOCK(I, 200) // 200 Hz clock as input, TTL logic output + // RES(R, RES_K(1)) + // CAP(C, CAP_U(1)) + // + // NET_C(I.Q, R.1) + // NET_C(R.2, C.1) + // NET_C(C.2, GND) + // + // ALIAS(O, R.2) // Output O == C.1 == R.2 + // // } + // + // Just save the net list as /tmp/test1.cpp, run + // ./nltool --cmd=run -t 0.05 -l O -l I /tmp/test1.cpp + // and see it crash with this code enabled. + // + // g++-7 (Ubuntu 7.4.0-1ubuntu1~16.04~ppa1) 7.4.0 + // + while (!m_connections.empty() && tries > 0) { - for (auto & t : t1.net().core_terms()) + auto li = m_connections.begin(); + while (li != m_connections.end()) { - if (t->is_type(detail::terminal_type::TERMINAL)) - ret = connect(t2, *t); - if (ret) - break; + const pstring t1s = li->first; + const pstring t2s = li->second; + detail::core_terminal_t *t1 = find_terminal(t1s); + detail::core_terminal_t *t2 = find_terminal(t2s); + + if (connect(*t1, *t2)) + li = m_connections.erase(li); + else + li++; } + tries--; } - } - if (!ret && t2.has_net()) - { - if (t2.net().isRailNet()) - ret = connect(t1, t2.net().railterminal()); - if (!ret) +#else + while (!m_abstract.m_connections.empty() && tries > 0) { - for (auto & t : t2.net().core_terms()) + for (std::size_t i = 0; i < m_abstract.m_connections.size();) { - if (t->is_type(detail::terminal_type::TERMINAL)) - ret = connect(t1, *t); - if (ret) - break; + const pstring t1s(m_abstract.m_connections[i].first); + const pstring t2s(m_abstract.m_connections[i].second); + detail::core_terminal_t *t1 = find_terminal(t1s); + detail::core_terminal_t *t2 = find_terminal(t2s); + if (connect(*t1, *t2)) + m_abstract.m_connections.erase( + m_abstract.m_connections.begin() + + plib::narrow_cast<std::ptrdiff_t>(i)); + else + i++; } + tries--; + } +#endif + if (tries == 0) + { + for (auto &link : m_abstract.m_connections) + log().warning(MF_CONNECTING_1_TO_2(de_alias(link.first), + de_alias(link.second))); + + log().fatal( + MF_LINK_TRIES_EXCEEDED(m_netlist_params->m_max_link_loops())); + throw nl_exception( + MF_LINK_TRIES_EXCEEDED(m_netlist_params->m_max_link_loops())); } - } - return ret; -} -bool setup_t::connect(detail::core_terminal_t &t1_in, detail::core_terminal_t &t2_in) -{ - log().debug("Connecting {1} to {2}\n", t1_in.name(), t2_in.name()); - detail::core_terminal_t &t1 = resolve_proxy(t1_in); - detail::core_terminal_t &t2 = resolve_proxy(t2_in); - bool ret = true; + log().verbose("deleting empty nets ..."); - if (t1.is_type(detail::terminal_type::OUTPUT) && t2.is_type(detail::terminal_type::INPUT)) - { - if (t2.has_net() && t2.net().isRailNet()) - log().fatal(MF_INPUT_1_ALREADY_CONNECTED(t2.name())); - connect_input_output(t2, t1); - } - else if (t1.is_type(detail::terminal_type::INPUT) && t2.is_type(detail::terminal_type::OUTPUT)) - { - if (t1.has_net() && t1.net().isRailNet()) - log().fatal(MF_INPUT_1_ALREADY_CONNECTED(t1.name())); - connect_input_output(t1, t2); - } - else if (t1.is_type(detail::terminal_type::OUTPUT) && t2.is_type(detail::terminal_type::TERMINAL)) - { - connect_terminal_output(dynamic_cast<terminal_t &>(t2), t1); - } - else if (t1.is_type(detail::terminal_type::TERMINAL) && t2.is_type(detail::terminal_type::OUTPUT)) - { - connect_terminal_output(dynamic_cast<terminal_t &>(t1), t2); - } - else if (t1.is_type(detail::terminal_type::INPUT) && t2.is_type(detail::terminal_type::TERMINAL)) - { - connect_terminal_input(dynamic_cast<terminal_t &>(t2), t1); - } - else if (t1.is_type(detail::terminal_type::TERMINAL) && t2.is_type(detail::terminal_type::INPUT)) - { - connect_terminal_input(dynamic_cast<terminal_t &>(t1), t2); - } - else if (t1.is_type(detail::terminal_type::TERMINAL) && t2.is_type(detail::terminal_type::TERMINAL)) - { - connect_terminals(dynamic_cast<terminal_t &>(t1), dynamic_cast<terminal_t &>(t2)); - } - else if (t1.is_type(detail::terminal_type::INPUT) && t2.is_type(detail::terminal_type::INPUT)) - { - ret = connect_input_input(t1, t2); - } - else - ret = false; - return ret; -} + // delete empty nets -void setup_t::resolve_inputs() -{ - log().verbose("Resolving inputs ..."); + delete_empty_nets(); - /* Netlist can directly connect input to input. - * We therefore first park connecting inputs and retry - * after all other terminals were connected. - */ - unsigned tries = m_netlist_params->m_max_link_loops(); - while (m_links.size() > 0 && tries > 0) - { + bool err(false); + + log().verbose("looking for terminals not connected ..."); + for (auto &i : m_terminals) + { + detail::core_terminal_t *term = i.second; + const pstring name_da = de_alias(term->name()); + bool is_nc_pin( + dynamic_cast<devices::NETLIB_NAME(nc_pin) *>(&term->device()) + != nullptr); + bool is_nc_flagged(false); + + auto hnc = m_abstract.m_hints.find(name_da + sHINT_NC); + if (hnc != m_abstract.m_hints.end()) + { + hnc->second = true; // mark as used + is_nc_flagged = true; + } + + if (term->has_net() && is_nc_pin) + { + log().error(ME_NC_PIN_1_WITH_CONNECTIONS(name_da)); + err = true; + } + else if (is_nc_pin) + { + // ignore + } + else if (!term->has_net()) + { + log().error(ME_TERMINAL_1_WITHOUT_NET(name_da)); + err = true; + } + else if (term->net().core_terms_empty()) + { + if (term->is_logic_input()) + log().warning( + MW_LOGIC_INPUT_1_WITHOUT_CONNECTIONS(name_da)); + else if (term->is_logic_output()) + { + if (!is_nc_flagged) + log().info( + MI_LOGIC_OUTPUT_1_WITHOUT_CONNECTIONS(name_da)); + } + else if (term->is_analog_output()) + { + if (!is_nc_flagged) + log().info( + MI_ANALOG_OUTPUT_1_WITHOUT_CONNECTIONS(name_da)); + } + else + log().warning(MW_TERMINAL_1_WITHOUT_CONNECTIONS(name_da)); + } + } - for (auto li = m_links.begin(); li != m_links.end(); ) + log().verbose("checking tristate consistency ..."); + for (auto &i : m_terminals) { - const pstring t1s = li->first; - const pstring t2s = li->second; - detail::core_terminal_t *t1 = find_terminal(t1s); - detail::core_terminal_t *t2 = find_terminal(t2s); + detail::core_terminal_t *term = i.second; + if (term->is_tristate_output()) + { + const auto &tri(dynamic_cast<tristate_output_t &>(*term)); + // check if we are connected to a proxy + const auto iter_proxy(m_proxies.find(&tri)); - //printf("%s %s\n", t1s.c_str(), t2s.c_str()); - if (connect(*t1, *t2)) - li = m_links.erase(li); - else - li++; + if (iter_proxy == m_proxies.end() && !tri.is_force_logic()) + { + log().error(ME_TRISTATE_NO_PROXY_FOUND_2( + term->name(), term->device().name())); + err = true; + } + else if (iter_proxy != m_proxies.end() && tri.is_force_logic()) + { + log().error(ME_TRISTATE_PROXY_FOUND_2( + term->name(), term->device().name())); + err = true; + } + } + } + if (err) + { + log().fatal(MF_TERMINALS_WITHOUT_NET()); + throw nl_exception(MF_TERMINALS_WITHOUT_NET()); } - tries--; } - if (tries == 0) - { - for (auto & link : m_links) - log().warning(MF_CONNECTING_1_TO_2(setup().de_alias(link.first), setup().de_alias(link.second))); - log().fatal(MF_LINK_TRIES_EXCEEDED(m_netlist_params->m_max_link_loops())); - } + void setup_t::move_connections(detail::net_t &net, detail::net_t &dest_net) + { + auto temp(net.core_terms_copy()); - log().verbose("deleting empty nets ..."); + net.remove_all_terminals(); - // delete empty nets + for (detail::core_terminal_t *ct : temp) + { + dest_net.add_terminal(*ct); + } + } - delete_empty_nets(); + log_type & setup_t::log() noexcept { return m_nlstate.log(); } + const log_type &setup_t::log() const noexcept { return m_nlstate.log(); } - bool err(false); + // ------------------------------------------------------------------------- + // Models + // ------------------------------------------------------------------------- - log().verbose("looking for terminals not connected ..."); - for (auto & i : m_terminals) + // NOLINTNEXTLINE(misc-no-recursion) + void models_t::model_parse(const pstring &model_in, map_t &map) { - detail::core_terminal_t *term = i.second; - if (!term->has_net() && dynamic_cast< devices::NETLIB_NAME(dummy_input) *>(&term->device()) != nullptr) - log().info(MI_DUMMY_1_WITHOUT_CONNECTIONS(term->name())); - else if (!term->has_net()) + pstring model = model_in; + std::size_t pos = 0; + pstring key; + + while (true) { - log().error(ME_TERMINAL_1_WITHOUT_NET(setup().de_alias(term->name()))); - err = true; + pos = model.find('('); + if (pos != pstring::npos) + break; + + key = plib::ucase(model); + auto i = m_models.find(key); + if (i == m_models.end()) + { + throw nl_exception(MF_MODEL_NOT_FOUND(pstring("xx") + model)); + } + + model = i->second; } - else if (term->net().num_cons() == 0) + pstring base_model = plib::left(model, pos); + + if (base_model == "_") + map["COREMODEL"] = key; + else { - if (term->is_logic_input()) - log().warning(MW_LOGIC_INPUT_1_WITHOUT_CONNECTIONS(term->name())); - else if (term->is_logic_output()) - log().info(MI_LOGIC_OUTPUT_1_WITHOUT_CONNECTIONS(term->name())); - else if (term->is_analog_output()) - log().info(MI_ANALOG_OUTPUT_1_WITHOUT_CONNECTIONS(term->name())); + auto i = m_models.find(base_model); + if (i != m_models.end()) + model_parse(base_model, map); else - log().warning(MW_TERMINAL_1_WITHOUT_CONNECTIONS(term->name())); + throw nl_exception(MF_MODEL_NOT_FOUND(model_in)); } - } - if (err) - log().fatal(MF_TERMINALS_WITHOUT_NET()); - -} -void setup_t::register_dynamic_log_devices() -{ - pstring env = plib::util::environment("NL_LOGS", ""); + pstring remainder = plib::trim(model.substr(pos + 1)); + if (!plib::endsWith(remainder, ")")) + throw nl_exception(MF_MODEL_ERROR_1(model)); + // FIMXE: Not optimal + remainder = plib::left(remainder, remainder.length() - 1); - if (env != "") - { - log().debug("Creating dynamic logs ..."); - std::vector<pstring> loglist(plib::psplit(env, ":")); - for (const pstring &ll : loglist) + const auto pairs(plib::psplit(remainder, ' ', true)); + for (const pstring &pe : pairs) { - pstring name = "log_" + ll; - auto nc = factory().factory_by_name("LOG")->Create(m_nlstate, name); - register_link(name + ".I", ll); - log().debug(" dynamic link {1}: <{2}>\n",ll, name); - m_nlstate.add_dev(nc->name(), std::move(nc)); + auto pose = pe.find('='); + if (pose == pstring::npos) + throw nl_exception(MF_MODEL_ERROR_ON_PAIR_1(model)); + map[plib::ucase(plib::left(pe, pose))] = pe.substr(pose + 1); } } -} - -log_type &setup_t::log() -{ - return m_nlstate.log(); -} -const log_type &setup_t::log() const -{ - return m_nlstate.log(); -} - -// ---------------------------------------------------------------------------------------- -// Models -// ---------------------------------------------------------------------------------------- - -void models_t::register_model(const pstring &model_in) -{ - auto pos = model_in.find(' '); - if (pos == pstring::npos) - throw nl_exception(MF_UNABLE_TO_PARSE_MODEL_1(model_in)); - pstring model = plib::ucase(plib::trim(plib::left(model_in, pos))); - pstring def = plib::trim(model_in.substr(pos + 1)); - if (!m_models.insert({model, def}).second) - throw nl_exception(MF_MODEL_ALREADY_EXISTS_1(model_in)); -} - -void models_t::model_parse(const pstring &model_in, model_map_t &map) -{ - pstring model = model_in; - std::size_t pos = 0; - pstring key; - - while (true) + pstring models_t::model_t::model_string(const map_t &map) { - pos = model.find('('); - if (pos != pstring::npos) break; + // operator [] has no const implementation + pstring ret = map.at("COREMODEL") + "("; + for (const auto &i : map) + ret += (i.first + '=' + i.second + ' '); - key = plib::ucase(model); - auto i = m_models.find(key); - if (i == m_models.end()) - throw nl_exception(MF_MODEL_NOT_FOUND(model)); - model = i->second; + return ret + ")"; } - pstring xmodel = plib::left(model, pos); - if (xmodel == "_") - map["COREMODEL"] = key; - else + models_t::model_t models_t::get_model(const pstring &model) { - auto i = m_models.find(xmodel); - if (i != m_models.end()) - model_parse(xmodel, map); - else - throw nl_exception(MF_MODEL_NOT_FOUND(model_in)); - } + map_t &map = m_cache[model]; - pstring remainder = plib::trim(model.substr(pos + 1)); - if (!plib::endsWith(remainder, ")")) - throw nl_exception(MF_MODEL_ERROR_1(model)); - // FIMXE: Not optimal - remainder = plib::left(remainder, remainder.size() - 1); + if (map.empty()) + model_parse(model, map); - std::vector<pstring> pairs(plib::psplit(remainder," ", true)); - for (pstring &pe : pairs) - { - auto pose = pe.find('='); - if (pose == pstring::npos) - throw nl_exception(MF_MODEL_ERROR_ON_PAIR_1(model)); - map[plib::ucase(plib::left(pe, pose))] = pe.substr(pose + 1); + return {model, map}; } -} -pstring models_t::model_string(model_map_t &map) -{ - pstring ret = map["COREMODEL"] + "("; - for (auto & i : map) - ret += (i.first + '=' + i.second + ' '); + pstring models_t::model_t::value_str(const pstring &entity) const + { + if (entity != plib::ucase(entity)) + throw nl_exception(MF_MODEL_PARAMETERS_NOT_UPPERCASE_1_2( + entity, model_string(m_map))); + const auto it(m_map.find(entity)); + if (it == m_map.end()) + throw nl_exception( + MF_ENTITY_1_NOT_FOUND_IN_MODEL_2(entity, model_string(m_map))); - return ret + ")"; -} + return it->second; + } -pstring models_t::value_str(const pstring &model, const pstring &entity) -{ - model_map_t &map = m_cache[model]; + nl_fptype models_t::model_t::value(const pstring &entity) const + { + pstring tmp = value_str(entity); - if (map.size() == 0) - model_parse(model , map); + nl_fptype factor = nlconst::one(); + auto p = std::next( + tmp.begin(), + plib::narrow_cast<pstring::difference_type>(tmp.length() - 1)); + switch (*p) + { + case 'M': factor = nlconst::magic(1e6); break; // NOLINT + case 'k': + case 'K': factor = nlconst::magic(1e3); break; // NOLINT + case 'm': factor = nlconst::magic(1e-3); break; // NOLINT + case 'u': factor = nlconst::magic(1e-6); break; // NOLINT + case 'n': factor = nlconst::magic(1e-9); break; // NOLINT + case 'p': factor = nlconst::magic(1e-12); break; // NOLINT + case 'f': factor = nlconst::magic(1e-15); break; // NOLINT + case 'a': factor = nlconst::magic(1e-18); break; // NOLINT + default: + if (*p < '0' || *p > '9') + throw nl_exception( + MF_UNKNOWN_NUMBER_FACTOR_IN_2(m_model, entity)); + } + if (factor != nlconst::one()) + tmp = plib::left(tmp, tmp.length() - 1); + // FIXME: check for errors + bool err(false); + auto val = plib::pstonum_ne<nl_fptype>(tmp, err); + if (err) + throw nl_exception(MF_MODEL_NUMBER_CONVERSION_ERROR( + entity, tmp, "double", m_model)); + return val * factor; + } + + // ------------------------------------------------------------------------- + // logic_family_std_proxy_t + // + // FIXME: all this belongs elsewhere + // ------------------------------------------------------------------------- + PENUM(family_type, CUSTOM, TTL, MOS, CMOS, NMOS, PMOS) + + class logic_family_std_proxy_t : public logic_family_desc_t + { + public: + logic_family_std_proxy_t(family_type ft) + : m_family_type(ft) + { + } + + // FIXME: create proxies based on family type (far future) + device_arena::unique_ptr<devices::nld_base_d_to_a_proxy> + create_d_a_proxy(netlist_state_t &anetlist, const pstring &name, + const logic_output_t *proxied) const override + { + switch (m_family_type) + { + case family_type::CUSTOM: + case family_type::TTL: + case family_type::MOS: + case family_type::CMOS: + case family_type::NMOS: + case family_type::PMOS: + return anetlist.make_pool_object<devices::nld_d_to_a_proxy>( + device_data_t{anetlist, name}, proxied); + } + return anetlist.make_pool_object<devices::nld_d_to_a_proxy>( + device_data_t{anetlist, name}, proxied); + } - pstring ret; + device_arena::unique_ptr<devices::nld_base_a_to_d_proxy> + create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, + const logic_input_t *proxied) const override + { + switch (m_family_type) + { + case family_type::CUSTOM: + case family_type::TTL: + case family_type::MOS: + case family_type::CMOS: + case family_type::NMOS: + case family_type::PMOS: + return anetlist.make_pool_object<devices::nld_a_to_d_proxy>( + device_data_t{anetlist, name}, proxied); + } + return anetlist.make_pool_object<devices::nld_a_to_d_proxy>( + device_data_t{anetlist, name}, proxied); + } - if (entity != plib::ucase(entity)) - throw nl_exception(MF_MODEL_PARAMETERS_NOT_UPPERCASE_1_2(entity, model_string(map))); - if (map.find(entity) == map.end()) - throw nl_exception(MF_ENTITY_1_NOT_FOUND_IN_MODEL_2(entity, model_string(map))); - else - ret = map[entity]; + private: + family_type m_family_type; + }; + + // clang-format off + /// \brief Class representing the logic families. + /// + /// This is the model representation of the logic families. This is a + /// netlist specific model. Examples give values for TTL family + /// + // + /// |NL? |name |parameter |units| TTL | + /// |:--:|:-----|:----------------------------------------------------------|:----|------:| + /// | Y |IVL |Input voltage low threshold relative to supply voltage | |1.0e-14| + /// | Y |IVH |Input voltage high threshold relative to supply voltage | | 0| + /// | Y |OVL |Output voltage minimum voltage relative to supply voltage | |1.0e-14| + /// | Y |OVL |Output voltage maximum voltage relative to supply voltage | |1.0e-14| + /// | Y |ORL |Output output resistance for logic 0 | | 0| + /// | Y |ORH |Output output resistance for logic 1 | | 0| + /// + // clang-format on + class family_model_t + { + public: + template <typename P> + family_model_t(P &model) + : m_TYPE(model, "TYPE") + , m_IVL(model, "IVL") + , m_IVH(model, "IVH") + , m_OVL(model, "OVL") + , m_OVH(model, "OVH") + , m_ORL(model, "ORL") + , m_ORH(model, "ORH") + { + } - return ret; -} + param_model_t::value_str_t m_TYPE; //!< Family type (TTL, CMOS, ...) + param_model_t::value_t m_IVL; //!< Input voltage low threshold relative + //!< to supply voltage + param_model_t::value_t m_IVH; //!< Input voltage high threshold relative + //!< to supply voltage + param_model_t::value_t m_OVL; //!< Output voltage minimum voltage + //!< relative to supply voltage + param_model_t::value_t m_OVH; //!< Output voltage maximum voltage + //!< relative to supply voltage + param_model_t::value_t m_ORL; //!< Output output resistance for logic 0 + param_model_t::value_t m_ORH; //!< Output output resistance for logic 1 + }; -nl_double models_t::value(const pstring &model, const pstring &entity) -{ - model_map_t &map = m_cache[model]; - - if (map.size() == 0) - model_parse(model , map); - - pstring tmp = value_str(model, entity); - - nl_double factor = plib::constants<nl_double>::one(); - auto p = std::next(tmp.begin(), static_cast<pstring::difference_type>(tmp.size() - 1)); - switch (*p) - { - case 'M': factor = 1e6; break; - case 'k': factor = 1e3; break; - case 'K': factor = 1e3; break; - case 'm': factor = 1e-3; break; - case 'u': factor = 1e-6; break; - case 'n': factor = 1e-9; break; - case 'p': factor = 1e-12; break; - case 'f': factor = 1e-15; break; - case 'a': factor = 1e-18; break; - default: - if (*p < '0' || *p > '9') - throw nl_exception(MF_UNKNOWN_NUMBER_FACTOR_IN_1(entity)); - } - if (factor != plib::constants<nl_double>::one()) - tmp = plib::left(tmp, tmp.size() - 1); - // FIXME: check for errors - //printf("%s %s %e %e\n", entity.c_str(), tmp.c_str(), plib::pstonum<nl_double>(tmp), factor); - bool err(false); - auto val = plib::pstonum_ne<nl_double, true>(tmp, err); - if (err) - throw nl_exception(MF_MODEL_NUMBER_CONVERSION_ERROR(entity, tmp, "double", model)); - return val * factor; -} - -class logic_family_std_proxy_t : public logic_family_desc_t -{ -public: - logic_family_std_proxy_t() = default; - pool_owned_ptr<devices::nld_base_d_to_a_proxy> create_d_a_proxy(netlist_state_t &anetlist, - const pstring &name, logic_output_t *proxied) const override; - pool_owned_ptr<devices::nld_base_a_to_d_proxy> create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const override; -}; - -pool_owned_ptr<devices::nld_base_d_to_a_proxy> logic_family_std_proxy_t::create_d_a_proxy(netlist_state_t &anetlist, - const pstring &name, logic_output_t *proxied) const -{ - return pool().make_poolptr<devices::nld_d_to_a_proxy>(anetlist, name, proxied); -} -pool_owned_ptr<devices::nld_base_a_to_d_proxy> logic_family_std_proxy_t::create_a_d_proxy(netlist_state_t &anetlist, const pstring &name, logic_input_t *proxied) const -{ - return pool().make_poolptr<devices::nld_a_to_d_proxy>(anetlist, name, proxied); -} + const logic_family_desc_t *setup_t::family_from_model(const pstring &model) + { + family_type ft(family_type::CUSTOM); + auto mod(m_models.get_model(model)); + family_model_t modv(mod); -const logic_family_desc_t *setup_t::family_from_model(const pstring &model) -{ + if (!ft.set_from_string(modv.m_TYPE())) + throw nl_exception(MF_UNKNOWN_FAMILY_TYPE_1(modv.m_TYPE(), model)); - if (m_models.value_str(model, "TYPE") == "TTL") - return family_TTL(); - if (m_models.value_str(model, "TYPE") == "CD4XXX") - return family_CD4XXX(); + auto it = m_nlstate.family_cache().find(model); + if (it != m_nlstate.family_cache().end()) + return it->second.get(); - auto it = m_nlstate.m_family_cache.find(model); - if (it != m_nlstate.m_family_cache.end()) - return it->second.get(); + auto ret = plib::make_unique<logic_family_std_proxy_t, host_arena>(ft); - auto ret = plib::make_unique<logic_family_std_proxy_t>(); + ret->m_low_threshold_PCNT = modv.m_IVL(); + ret->m_high_threshold_PCNT = modv.m_IVH(); + ret->m_low_VO = modv.m_OVL(); + ret->m_high_VO = modv.m_OVH(); + ret->m_R_low = modv.m_ORL(); + ret->m_R_high = modv.m_ORH(); - ret->m_fixed_V = m_models.value(model, "FV"); - ret->m_low_thresh_PCNT = m_models.value(model, "IVL"); - ret->m_high_thresh_PCNT = m_models.value(model, "IVH"); - ret->m_low_VO = m_models.value(model, "OVL"); - ret->m_high_VO = m_models. value(model, "OVH"); - ret->m_R_low = m_models.value(model, "ORL"); - ret->m_R_high = m_models.value(model, "ORH"); + switch (ft) + { + case family_type::CUSTOM: + case family_type::TTL: + case family_type::NMOS: + ret->m_vcc = "VCC"; + ret->m_gnd = "GND"; + break; + case family_type::MOS: + case family_type::CMOS: + case family_type::PMOS: + ret->m_vcc = "VDD"; + ret->m_gnd = "VSS"; + break; + } - auto retp = ret.get(); + auto *retp = ret.get(); - m_nlstate.m_family_cache.emplace(model, std::move(ret)); + m_nlstate.family_cache().emplace(model, std::move(ret)); - return retp; -} + return retp; + } -// ---------------------------------------------------------------------------------------- -// Sources -// ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // Device handling + // ------------------------------------------------------------------------- -plib::unique_ptr<std::istream> setup_t::get_data_stream(const pstring &name) -{ - for (auto &source : m_sources) + void setup_t::delete_empty_nets() { - if (source->type() == source_t::DATA) - { - auto strm = source->stream(name); - if (strm) - return strm; - } + m_nlstate.nets().erase( + std::remove_if( + m_nlstate.nets().begin(), m_nlstate.nets().end(), + [](device_arena::owned_ptr<detail::net_t> &net) + { + if (net->core_terms_empty()) + { + // FIXME: need to remove from state->m_core_terms as + // well. + net->state().log().verbose("Deleting net {1} ...", + net->name()); + net->state().run_state_manager().remove_save_items( + net.get()); + return true; + } + return false; + }), + m_nlstate.nets().end()); } - log().warning(MW_DATA_1_NOT_FOUND(name)); - return plib::unique_ptr<std::istream>(nullptr); -} + // ------------------------------------------------------------------------- + // Run preparation + // ------------------------------------------------------------------------- -// ---------------------------------------------------------------------------------------- -// Device handling -// ---------------------------------------------------------------------------------------- + void setup_t::prepare_to_run() + { + pstring env_log_setting = plib::util::environment("NL_LOGS", ""); -void setup_t::delete_empty_nets() -{ - m_nlstate.nets().erase( - std::remove_if(m_nlstate.nets().begin(), m_nlstate.nets().end(), - [](pool_owned_ptr<detail::net_t> &x) - { - if (x->num_cons() == 0) - { - x->state().log().verbose("Deleting net {1} ...", x->name()); - x->state().run_state_manager().remove_save_items(x.get()); - return true; - } - else - return false; - }), m_nlstate.nets().end()); -} + if (!env_log_setting.empty()) + { + const auto list_of_logs(plib::psplit(env_log_setting, ':')); + m_parser.register_dynamic_log_devices(list_of_logs); + } -// ---------------------------------------------------------------------------------------- -// Run preparation -// ---------------------------------------------------------------------------------------- + // create default parameters first! -void setup_t::prepare_to_run() -{ - register_dynamic_log_devices(); + for (auto &e : m_abstract.m_default_params) + { + auto param(plib::make_unique<param_str_t, host_arena>( + nlstate(), e.first, e.second)); + register_param_t(*param); + m_defparam_lifetime.push_back(std::move(param)); + } - /* make sure the solver and parameters are started first! */ + // make sure the solver and parameters are started first! - for (auto & e : m_device_factory) - { - if ( factory().is_class<devices::NETLIB_NAME(solver)>(e.second) - || factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second)) + for (auto &e : m_abstract.m_device_factory) { - m_nlstate.add_dev(e.first, pool_owned_ptr<device_t>(e.second->Create(m_nlstate, e.first))); + if (m_parser.factory().is_class<devices::NETLIB_NAME(solver)>( + e.second) + || m_parser.factory() + .is_class<devices::NETLIB_NAME(netlistparams)>(e.second)) + { + m_nlstate.register_device( + e.first, e.second->make_device(nlstate().pool(), m_nlstate, + e.first)); + } } - } - log().debug("Searching for solver and parameters ...\n"); + log().debug("Searching for solver and parameters ...\n"); - auto solver = m_nlstate.get_single_device<devices::NETLIB_NAME(solver)>("solver"); - m_netlist_params = m_nlstate.get_single_device<devices::NETLIB_NAME(netlistparams)>("parameter"); + auto *solver = m_nlstate + .get_single_device<devices::NETLIB_NAME(solver)>( + "solver"); + m_netlist_params = m_nlstate.get_single_device< + devices::NETLIB_NAME(netlistparams)>("parameter"); - /* set default model parameters */ + // set default model parameters - m_models.register_model(plib::pfmt("NMOS_DEFAULT _(CAPMOD={1})")(m_netlist_params->m_mos_capmodel())); - m_models.register_model(plib::pfmt("PMOS_DEFAULT _(CAPMOD={1})")(m_netlist_params->m_mos_capmodel())); + // FIXME: this is not optimal + m_parser.register_model(plib::pfmt("NMOS_DEFAULT _(CAPMOD={1})")( + m_netlist_params->m_mos_cap_model())); + m_parser.register_model(plib::pfmt("PMOS_DEFAULT _(CAPMOD={1})")( + m_netlist_params->m_mos_cap_model())); - /* create devices */ + // create devices - log().debug("Creating devices ...\n"); - for (auto & e : m_device_factory) - { - if ( !factory().is_class<devices::NETLIB_NAME(solver)>(e.second) - && !factory().is_class<devices::NETLIB_NAME(netlistparams)>(e.second)) + log().debug("Creating devices ...\n"); + for (auto &e : m_abstract.m_device_factory) { - auto dev = pool_owned_ptr<device_t>(e.second->Create(m_nlstate, e.first)); - m_nlstate.add_dev(dev->name(), std::move(dev)); + if (!m_parser.factory().is_class<devices::NETLIB_NAME(solver)>( + e.second) + && !m_parser.factory() + .is_class<devices::NETLIB_NAME(netlistparams)>( + e.second)) + { + auto dev = e.second->make_device(m_nlstate.pool(), m_nlstate, + e.first); + m_nlstate.register_device(dev->name(), std::move(dev)); + } } - } - log().debug("Looking for unknown parameters ...\n"); - for (auto &p : m_param_values) - { - auto f = m_params.find(p.first); - if (f == m_params.end()) + const bool use_deactivate = m_netlist_params->m_use_deactivate(); + + for (auto &d : m_nlstate.devices()) { - if (plib::endsWith(p.first, sHINT_NO_DEACTIVATE)) + auto p = m_abstract.m_hints.find(d.second->name() + + sHINT_NO_DEACTIVATE); + if (p != m_abstract.m_hints.end()) { - // FIXME: get device name, check for device - auto *dev = m_nlstate.find_device(plib::replace_all(p.first, sHINT_NO_DEACTIVATE, "")); - if (dev == nullptr) - log().warning(MW_DEVICE_NOT_FOUND_FOR_HINT(p.first)); + p->second = true; // mark as used + d.second->set_hint_deactivate(false); } else - log().warning(MW_UNKNOWN_PARAMETER(p.first)); + d.second->set_hint_deactivate(use_deactivate); } - } - bool use_deactivate = m_netlist_params->m_use_deactivate() ? true : false; + // resolve inputs + resolve_inputs(); - for (auto &d : m_nlstate.devices()) - { - if (use_deactivate) + log().verbose("looking for two terms connected to rail nets ..."); + for (auto &t : + m_nlstate.get_device_list<analog::NETLIB_NAME(two_terminal)>()) { - auto p = m_param_values.find(d.second->name() + sHINT_NO_DEACTIVATE); - if (p != m_param_values.end()) + if (t->N().net().is_rail_net() && t->P().net().is_rail_net()) { - //FIXME: check for errors ... - bool err(false); - auto v = plib::pstonum_ne<double, true>(p->second, err); - if (err || std::abs(v - std::floor(v)) > 1e-6 ) - log().fatal(MF_HND_VAL_NOT_SUPPORTED(p->second)); - d.second->set_hint_deactivate(v == 0.0); + log().info(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3( + t->name(), t->N().net().name(), t->P().net().name())); + // The following would remove internal devices in e.g. MOSFETs + // as well. +#if 0 + remove_terminal(t->setup_N().net(), t->setup_N()); + remove_terminal(t->setup_P().net(), t->setup_P()); + m_nlstate.remove_device(t); +#endif } } - else - d.second->set_hint_deactivate(false); - } - /* resolve inputs */ - resolve_inputs(); + int error_count = 0; - log().verbose("looking for two terms connected to rail nets ..."); - for (auto & t : m_nlstate.get_device_list<analog::NETLIB_NAME(twoterm)>()) - { - if (t->m_N.net().isRailNet() && t->m_P.net().isRailNet()) + log().verbose("looking for unused hints ..."); + for (auto &h : m_abstract.m_hints) { - // We are not interested in power terminals - This is intended behaviour - if (!plib::endsWith(t->name(), pstring(".") + sPowerDevRes)) - log().info(MI_REMOVE_DEVICE_1_CONNECTED_ONLY_TO_RAILS_2_3( - t->name(), t->m_N.net().name(), t->m_P.net().name())); - t->m_N.net().remove_terminal(t->m_N); - t->m_P.net().remove_terminal(t->m_P); - m_nlstate.remove_dev(t); + if (!h.second) + { + log().error(MF_UNUSED_HINT_1(h.first)); + error_count++; + } } - else + + log().verbose("initialize solver ...\n"); + + if (solver == nullptr) { - if (plib::endsWith(t->name(), pstring(".") + sPowerDevRes)) - log().info(MI_POWER_TERMINALS_1_CONNECTED_ANALOG_2_3( - t->name(), t->m_N.net().name(), t->m_P.net().name())); + for (auto &p : m_nlstate.nets()) + if (p->is_analog()) + { + log().error(MF_NO_SOLVER()); + error_count++; + } } - } - - log().verbose("initialize solver ...\n"); + else + solver->post_start(); - if (solver == nullptr) - { - for (auto &p : m_nlstate.nets()) - if (p->is_analog()) - log().fatal(MF_NO_SOLVER()); - } - else - solver->post_start(); + log().debug("Looking for unknown parameters ...\n"); + for (auto &p : m_abstract.m_param_values) + { + auto f = m_params.find(p.first); + if (f == m_params.end()) + { + log().error(ME_UNKNOWN_PARAMETER(p.first)); + error_count++; + } + } - for (auto &n : m_nlstate.nets()) - for (auto & term : n->core_terms()) + for (auto &n : m_nlstate.nets()) { - //core_device_t *dev = reinterpret_cast<core_device_t *>(term->m_delegate.object()); - core_device_t *dev = &term->device(); - dev->set_default_delegate(*term); + for (detail::core_terminal_t *term : n->core_terms_copy()) + if (term->delegate().isnull()) + { + log().error(MF_DELEGATE_NOT_SET_1(term->name())); + error_count++; + } + n->rebuild_list(); } -} + if (error_count > 0) + { + log().fatal(MF_ERRORS_FOUND(error_count)); + throw nl_exception(MF_ERRORS_FOUND(error_count)); + } + } -// ---------------------------------------------------------------------------------------- -// base sources -// ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + // base sources + // ------------------------------------------------------------------------- -bool source_t::parse(nlparse_t &setup, const pstring &name) -{ - if (m_type != SOURCE) - return false; - else + bool source_netlist_t::parse(nlparse_t &setup, const pstring &name) { auto strm(stream(name)); - if (strm) - return setup.parse_stream(std::move(strm), name); - else - return false; + return (!strm.empty()) ? setup.parse_stream(std::move(strm), name) + : false; } -} -plib::unique_ptr<std::istream> source_string_t::stream(const pstring &name) -{ - plib::unused_var(name); - auto ret(plib::make_unique<std::istringstream>(m_str)); - ret->imbue(std::locale::classic()); - return std::move(ret); -} + plib::istream_uptr + source_string_t::stream([[maybe_unused]] const pstring &name) + { + plib::istream_uptr ret( + std::make_unique<std::istringstream>(putf8string(m_str)), name); + ret->imbue(std::locale::classic()); + return ret; + } -plib::unique_ptr<std::istream> source_mem_t::stream(const pstring &name) -{ - plib::unused_var(name); - auto ret(plib::make_unique<std::istringstream>(m_str, std::ios_base::binary)); - ret->imbue(std::locale::classic()); - return std::move(ret); -} + plib::istream_uptr + source_mem_t::stream([[maybe_unused]] const pstring &name) + { + plib::istream_uptr ret( + std::make_unique<std::istringstream>(m_str, std::ios_base::binary), + name); + ret->imbue(std::locale::classic()); + return ret; + } -plib::unique_ptr<std::istream> source_file_t::stream(const pstring &name) -{ - plib::unused_var(name); - auto ret(plib::make_unique<std::ifstream>(plib::filesystem::u8path(m_filename))); - return std::move(ret); -} + plib::istream_uptr + source_file_t::stream([[maybe_unused]] const pstring &name) + { + auto f = std::make_unique<plib::ifstream>( + plib::filesystem::u8path(m_filename)); + if (f->is_open()) + { + return {std::move(f), m_filename}; + } -bool source_proc_t::parse(nlparse_t &setup, const pstring &name) -{ - if (name == m_setup_func_name) + return plib::istream_uptr(); + } + + plib::istream_uptr + source_pattern_t::stream([[maybe_unused]] const pstring &name) { - m_setup_func(setup); - return true; + pstring filename = plib::pfmt(m_pattern)( + m_force_lowercase ? plib::lcase(name) : name); + auto f = std::make_unique<plib::ifstream>( + plib::filesystem::u8path(filename)); + if (f->is_open()) + { + return {std::move(f), filename}; + } + + return plib::istream_uptr(); } - else + + bool source_proc_t::parse(nlparse_t &setup, const pstring &name) + { + if (name == m_setup_func_name) + { + m_setup_func(setup); + return true; + } + return false; -} + } -plib::unique_ptr<std::istream> source_proc_t::stream(const pstring &name) -{ - plib::unused_var(name); - plib::unique_ptr<std::istream> p(nullptr); - return p; -} + plib::istream_uptr + source_proc_t::stream([[maybe_unused]] const pstring &name) + { + return plib::istream_uptr(); + } } // namespace netlist - diff --git a/src/lib/netlist/nl_setup.h b/src/lib/netlist/nl_setup.h index 3650b3756a9..31e971026e9 100644 --- a/src/lib/netlist/nl_setup.h +++ b/src/lib/netlist/nl_setup.h @@ -1,233 +1,146 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nlsetup.h - * - */ + +/// +/// \file nl_setup.h +/// #ifndef NLSETUP_H_ #define NLSETUP_H_ -#include "plib/pparser.h" -#include "plib/pstream.h" -#include "plib/pstring.h" -#include "plib/putil.h" - #include "nl_config.h" -#include "nl_factory.h" #include "nltypes.h" +#include "plib/ppreprocessor.h" +#include "plib/psource.h" +#include "plib/pstream.h" +#include "plib/pstring.h" + +#include <initializer_list> #include <memory> #include <stack> #include <unordered_map> #include <vector> - //============================================================ -// MACROS / inline netlist definitions +// MACROS - netlist definitions //============================================================ -#define NET_STR(x) # x +#define NET_STR(x) #x -#define NET_MODEL(model) \ - setup.register_model(model); +#define NET_MODEL(model) setup.register_model(model); -#define ALIAS(alias, name) \ - setup.register_alias(# alias, # name); +#define ALIAS(alias, name) setup.register_alias(#alias, #name); #define DIPPINS(pin1, ...) \ - setup.register_dippins_arr( # pin1 ", " # __VA_ARGS__); + setup.register_dip_alias_arr(#pin1 ", " #__VA_ARGS__); -/* to be used to reference new library truthtable devices */ -#define NET_REGISTER_DEV(type, name) \ - setup.register_dev(# type, # name); +// to be used to reference new library truth table devices +#define NET_REGISTER_DEV(type, name) setup.register_dev(#type, #name); + +// name is first element so that __VA_ARGS__ always has one element +#define NET_REGISTER_DEVEXT(type, ...) \ + setup.register_dev(#type, {PSTRINGIFY_VA(__VA_ARGS__)}); #define NET_CONNECT(name, input, output) \ - setup.register_link(# name "." # input, # output); + setup.register_link(#name "." #input, #output); #define NET_C(term1, ...) \ - setup.register_link_arr( # term1 ", " # __VA_ARGS__); + setup.register_connection_arr(#term1 ", " #__VA_ARGS__); + +#define PARAM(name, val) setup.register_param(NET_STR(name), NET_STR(val)); -#define PARAM(name, val) \ - setup.register_param(# name, val); +#define DEFPARAM(name, val) \ + setup.register_default_param(NET_STR(name), NET_STR(val)); -#define HINT(name, val) \ - setup.register_param(# name ".HINT_" # val, 1); +#define HINT(name, val) setup.register_hint(#name, ".HINT_" #val); #define NETDEV_PARAMI(name, param, val) \ - setup.register_param(# name "." # param, val); + setup.register_param(#name "." #param, val); -#define NETLIST_NAME(name) netlist ## _ ## name +#define NETLIST_NAME(name) netlist##_##name #define NETLIST_EXTERNAL(name) \ - void NETLIST_NAME(name)(netlist::nlparse_t &setup); + void NETLIST_NAME(name)(netlist::nlparse_t & setup); #define NETLIST_START(name) \ -void NETLIST_NAME(name)(netlist::nlparse_t &setup) \ -{ -#define NETLIST_END() } + void NETLIST_NAME(name)([[maybe_unused]] netlist::nlparse_t & setup) #define LOCAL_SOURCE(name) \ - setup.register_source(plib::make_unique<netlist::source_proc_t>(# name, &NETLIST_NAME(name))); + setup.register_source_proc(#name, &NETLIST_NAME(name)); + +#define EXTERNAL_SOURCE(name) \ + setup.register_source_proc(#name, &NETLIST_NAME(name)); + +#define LOCAL_LIB_ENTRY_2(type, name) \ + type##_SOURCE(name) setup.register_lib_entry(#name, "", PSOURCELOC()); + +#define LOCAL_LIB_ENTRY_3(type, name, param_spec) \ + type##_SOURCE(name) \ + setup.register_lib_entry(#name, param_spec, PSOURCELOC()); + +#define LOCAL_LIB_ENTRY(...) PCALLVARARG(LOCAL_LIB_ENTRY_, LOCAL, __VA_ARGS__) -#define LOCAL_LIB_ENTRY(name) \ - LOCAL_SOURCE(name) \ - setup.register_lib_entry(# name, __FILE__); +#define EXTERNAL_LIB_ENTRY(...) \ + PCALLVARARG(LOCAL_LIB_ENTRY_, EXTERNAL, __VA_ARGS__) -#define INCLUDE(name) \ - setup.include(# name); +#define INCLUDE(name) setup.include(#name); #define SUBMODEL(model, name) \ - setup.namespace_push(# name); \ - NETLIST_NAME(model)(setup); \ - setup.namespace_pop(); + setup.namespace_push(#name); \ + setup.include(#model); \ + setup.namespace_pop(); #define OPTIMIZE_FRONTIER(attach, r_in, r_out) \ - setup.register_frontier(# attach, r_in, r_out); + setup.register_frontier(#attach, PSTRINGIFY_VA(r_in), PSTRINGIFY_VA(r_out)); // ----------------------------------------------------------------------------- -// truthtable defines +// truth table defines // ----------------------------------------------------------------------------- -#define TRUTHTABLE_START(cname, in, out, def_params) \ - { \ - netlist::tt_desc desc; \ - desc.name = #cname ; \ - desc.classname = #cname ; \ - desc.ni = in; \ - desc.no = out; \ - desc.def_param = def_params; \ - desc.family = ""; +#define TRUTH_TABLE(cname, in, out, params) \ + void NETLIST_NAME(cname##_impl)(netlist::nlparse_t & setup, \ + netlist::tt_desc & desc); \ + static void NETLIST_NAME(cname)(netlist::nlparse_t & setup) \ + { \ + netlist::tt_desc desc{#cname, in, out, "", {}}; \ + NETLIST_NAME(cname##_impl)(setup, desc); \ + setup.truth_table_create(desc, params, PSOURCELOC()); \ + } \ + static void NETLIST_NAME(cname##_impl)( \ + [[maybe_unused]] netlist::nlparse_t & setup, netlist::tt_desc & desc) -#define TT_HEAD(x) \ - desc.desc.emplace_back(x); +#define TT_HEAD(x) desc.desc.emplace_back(x); -#define TT_LINE(x) \ - desc.desc.emplace_back(x); +#define TT_LINE(x) desc.desc.emplace_back(x); -#define TT_FAMILY(x) \ - desc.family = x; +#define TT_FAMILY(x) desc.family = x; -#define TRUTHTABLE_END() \ - setup.tt_factory_create(desc, __FILE__); \ - } +#define TRUTHTABLE_ENTRY(name) \ + LOCAL_SOURCE(name) \ + INCLUDE(name) namespace netlist { - namespace detail { - class core_terminal_t; - class net_t; - } // namespace detail - - namespace devices { - class nld_base_proxy; - class nld_netlistparams; - } // namespace devices - - class core_device_t; - class param_t; - class setup_t; - class netlist_state_t; - class netlist_t; - class logic_family_desc_t; - class terminal_t; - // ----------------------------------------------------------------------------- - // truthtable desc + // truth table desc // ----------------------------------------------------------------------------- struct tt_desc { - tt_desc() : ni(0), no(0) { } - pstring name; - pstring classname; - unsigned long ni; - unsigned long no; - pstring def_param; + pstring name; + unsigned long ni; + unsigned long no; + pstring family; std::vector<pstring> desc; - pstring family; - }; - - // ----------------------------------------------------------------------------- - // param_ref_t - // ----------------------------------------------------------------------------- - - struct param_ref_t - { - param_ref_t(const pstring &name, core_device_t &device, param_t ¶m) - : m_name(name) - , m_device(device) - , m_param(param) - { } - pstring m_name; - core_device_t &m_device; - param_t &m_param; - }; - - // ---------------------------------------------------------------------------------------- - // A Generic netlist sources implementation - // ---------------------------------------------------------------------------------------- - - class source_t - { - public: - - friend class setup_t; - - enum type_t - { - SOURCE, - DATA - }; - - using list_t = std::vector<plib::unique_ptr<source_t>>; - - source_t(const type_t type = SOURCE) - : m_type(type) - {} - - COPYASSIGNMOVE(source_t, delete) - - virtual ~source_t() noexcept = default; - - virtual bool parse(nlparse_t &setup, const pstring &name); - - type_t type() const { return m_type; } - - protected: - virtual plib::unique_ptr<std::istream> stream(const pstring &name) = 0; - - private: - const type_t m_type; }; - // ---------------------------------------------------------------------------------------- - // Collection of models + // static compiled netlist. // ---------------------------------------------------------------------------------------- - class models_t - { - public: - void register_model(const pstring &model_in); - /* model / family related */ - - pstring value_str(const pstring &model, const pstring &entity); - - nl_double value(const pstring &model, const pstring &entity); - - pstring type(const pstring &model) { return value_str(model, "COREMODEL"); } - - private: - using model_map_t = std::unordered_map<pstring, pstring>; - - void model_parse(const pstring &model, model_map_t &map); - pstring model_string(model_map_t &map); - - std::unordered_map<pstring, pstring> m_models; - std::unordered_map<pstring, model_map_t> m_cache; - }; + using nlsetup_func = void (*)(nlparse_t &); // ---------------------------------------------------------------------------------------- // nlparse_t @@ -236,266 +149,143 @@ namespace netlist class nlparse_t { public: - using link_t = std::pair<pstring, pstring>; + nlparse_t(log_type &log, detail::abstract_t &abstract); - nlparse_t(setup_t &netlist, log_type &log); - - void register_model(const pstring &model_in) { m_models.register_model(model_in); } - void register_alias(const pstring &alias, const pstring &out); - void register_dippins_arr(const pstring &terms); - void register_dev(const pstring &classname, const pstring &name); - void register_link(const pstring &sin, const pstring &sout); - void register_link_arr(const pstring &terms); - void register_param(const pstring ¶m, const pstring &value); - void register_param(const pstring ¶m, const double value); - void register_lib_entry(const pstring &name, const pstring &sourcefile); - void register_frontier(const pstring &attach, const double r_IN, const double r_OUT); + void register_model(const pstring &model_in); - /* register a source */ - void register_source(plib::unique_ptr<source_t> &&src) + /// \brief Register an aliases + /// + /// Both alias and points_to are considered to be relative to the + /// current netlist naming level and changed to fully qualified names. + /// The alias type will be automatically determined. If it is a number, + /// it will be PACKAGE_PIN - in all other cases READABILITY. + /// This call is only used by the ALIAS macro. + /// \param alias the alias to be qualified + /// \param points_to the pin aliased + void register_alias(const pstring &alias, const pstring &points_to); + /// \brief Register an aliases + /// + /// Both alias and points_to are considered to be relative to the + /// current netlist naming level and changed to fully qualified names. + /// \param type the alias type see \ref alias_type + /// \param alias the alias to be qualified + /// \param points_to the pin aliased + void register_alias(detail::alias_type type, const pstring &alias, + const pstring &points_to); + /// \brief Register an aliases where alias and references are fully qualified names + /// \param type the alias type see \ref alias_type + /// \param alias the alias to be qualified + /// \param points_to the pin aliased + void register_fqn_alias(detail::alias_type type, const pstring &alias, + const pstring &points_to); + void register_dip_alias_arr(const pstring &terms); + + // last argument only needed by nltool + void register_dev(const pstring &classname, const pstring &name, + const std::vector<pstring> ¶ms_and_connections, + factory::element_t **factory_element = nullptr); + void register_dev(const pstring &classname, + std::initializer_list<const char *> more_parameters); + void register_dev(const pstring &classname, const pstring &name) { - m_sources.push_back(std::move(src)); + register_dev(classname, name, std::vector<pstring>()); } - void tt_factory_create(tt_desc &desc, const pstring &sourcefile); - - /* handle namespace */ - - void namespace_push(const pstring &aname); - void namespace_pop(); - - /* include other files */ - - void include(const pstring &netlist_name); - - pstring build_fqn(const pstring &obj_name) const; - void register_alias_nofqn(const pstring &alias, const pstring &out); + void + register_hint(const pstring &object_name, const pstring &hint_name); - /* also called from devices for latebinding connected terminals */ - void register_link_fqn(const pstring &sin, const pstring &sout); + void register_connection(const pstring &sin, const pstring &sout); + void register_connection_arr(const pstring &terms); + // also called from devices for late binding connected terminals + void register_connection_fqn(const pstring &sin, const pstring &sout); - /* used from netlist.cpp (mame) */ - bool device_exists(const pstring &name) const; + void register_param(const pstring ¶m, const pstring &value); - /* FIXME: used by source_t - need a different approach at some time */ - bool parse_stream(plib::unique_ptr<std::istream> &&istrm, const pstring &name); + // DEFPARAM support + void register_default_param(const pstring &name, const pstring &def); - void add_define(const pstring &def, const pstring &val) + template <typename T> + std::enable_if_t<plib::is_arithmetic<T>::value> + register_param(const pstring ¶m, T value) { - m_defines.insert({ def, plib::ppreprocessor::define_t(def, val)}); + register_param_fp(param, plib::narrow_cast<nl_fptype>(value)); } - void add_define(const pstring &defstr); - - factory::list_t &factory() { return m_factory; } - const factory::list_t &factory() const { return m_factory; } - - log_type &log() { return m_log; } - const log_type &log() const { return m_log; } - - /* FIXME: sources may need access to the netlist parent type - * since they may be created in a context in which they don't - * have access to their environment. - * Example is the MAME memregion source. - * We thus need a better approach to creating netlists in a context - * other than static procedures. - */ - setup_t &setup() { return m_setup; } - const setup_t &setup() const { return m_setup; } - - models_t &models() { return m_models; } - const models_t &models() const { return m_models; } - - protected: - models_t m_models; - std::stack<pstring> m_namespace_stack; - std::unordered_map<pstring, pstring> m_alias; - std::vector<link_t> m_links; - std::unordered_map<pstring, pstring> m_param_values; - - source_t::list_t m_sources; - - factory::list_t m_factory; + void register_lib_entry(const pstring &name, const pstring &def_params, + plib::source_location &&loc); - /* need to preserve order of device creation ... */ - std::vector<std::pair<pstring, factory::element_t *>> m_device_factory; + void register_frontier(const pstring &attach, const pstring &r_IN, + const pstring &r_OUT); + // register a source + template <typename S, typename... Args> + void register_source(Args &&...args) + { + m_sources.add_source<S>(std::forward<Args>(args)...); + } - private: - plib::ppreprocessor::defines_map_type m_defines; - - setup_t &m_setup; - log_type &m_log; - unsigned m_frontier_cnt; - }; - - // ---------------------------------------------------------------------------------------- - // setup_t - // ---------------------------------------------------------------------------------------- - - class setup_t : public nlparse_t - { - public: - - explicit setup_t(netlist_state_t &nlstate); - ~setup_t() noexcept; - - COPYASSIGNMOVE(setup_t, delete) - - netlist_state_t &nlstate() { return m_nlstate; } - const netlist_state_t &nlstate() const { return m_nlstate; } - - void register_param_t(const pstring &name, param_t ¶m); - - pstring get_initial_param_val(const pstring &name, const pstring &def) const; - - void register_term(detail::core_terminal_t &obj); - - void remove_connections(const pstring &attach); - - bool connect(detail::core_terminal_t &t1, detail::core_terminal_t &t2); - - param_t *find_param(const pstring ¶m_in, bool required = true) const; - - /* get family */ - const logic_family_desc_t *family_from_model(const pstring &model); - - void register_dynamic_log_devices(); - void resolve_inputs(); - - plib::unique_ptr<std::istream> get_data_stream(const pstring &name); - - factory::list_t &factory() { return m_factory; } - const factory::list_t &factory() const { return m_factory; } - - /* helper - also used by nltool */ - pstring resolve_alias(const pstring &name) const; - pstring de_alias(const pstring &alias) const; - - /* needed by nltool */ - std::vector<pstring> get_terminals_for_device_name(const pstring &devname) const; - - log_type &log(); - const log_type &log() const; - - /* needed by proxy */ - detail::core_terminal_t *find_terminal(const pstring &outname_in, const detail::terminal_type atype, bool required = true) const; - detail::core_terminal_t *find_terminal(const pstring &outname_in, bool required = true) const; - - /* core net handling */ - - void delete_empty_nets(); - - /* run preparation */ - - void prepare_to_run(); - - /* validation */ - - void enable_validation() { m_validation = true; } - bool is_validation() const { return m_validation; } - private: - - void merge_nets(detail::net_t &thisnet, detail::net_t &othernet); - - void connect_terminals(detail::core_terminal_t &in, detail::core_terminal_t &out); - void connect_input_output(detail::core_terminal_t &in, detail::core_terminal_t &out); - void connect_terminal_output(terminal_t &in, detail::core_terminal_t &out); - void connect_terminal_input(terminal_t &term, detail::core_terminal_t &inp); - bool connect_input_input(detail::core_terminal_t &t1, detail::core_terminal_t &t2); - - // helpers - pstring termtype_as_str(detail::core_terminal_t &in) const; + void register_source_proc(const pstring &name, nlsetup_func func); - devices::nld_base_proxy *get_d_a_proxy(detail::core_terminal_t &out); - devices::nld_base_proxy *get_a_d_proxy(detail::core_terminal_t &inp); + void truth_table_create(tt_desc &desc, const pstring &def_params, + plib::source_location &&loc); - std::unordered_map<pstring, detail::core_terminal_t *> m_terminals; + // include other files - netlist_state_t &m_nlstate; - devices::nld_netlistparams *m_netlist_params; - std::unordered_map<pstring, param_ref_t> m_params; + void include(const pstring &netlist_name); - unsigned m_proxy_cnt; - bool m_validation; - }; + // handle namespace - // ---------------------------------------------------------------------------------------- - // base sources - // ---------------------------------------------------------------------------------------- + void namespace_push(const pstring &aname); + void namespace_pop(); - class source_string_t : public source_t - { - public: + // FIXME: used by source_t - need a different approach at some time + bool parse_stream(plib::istream_uptr &&in_stream, const pstring &name); + bool parse_tokens(const plib::detail::token_store_t &tokens, + const pstring &name); - source_string_t(const pstring &source) - : source_t(), m_str(source) + template <typename S, typename... Args> + void add_include(Args &&...args) { + m_includes.add_source<S>(std::forward<Args>(args)...); } - protected: - plib::unique_ptr<std::istream> stream(const pstring &name) override; - - private: - pstring m_str; - }; - - class source_file_t : public source_t - { - public: - - source_file_t(const pstring &filename) - : source_t(), m_filename(filename) + void add_define(const pstring &def, const pstring &val) { + m_defines.insert({def, plib::ppreprocessor::define_t(def, val)}); } - protected: - plib::unique_ptr<std::istream> stream(const pstring &name) override; + void add_define(const pstring &define); - private: - pstring m_filename; - }; + // register a list of logs + void register_dynamic_log_devices(const std::vector<pstring> &log_list); - class source_mem_t : public source_t - { - public: - source_mem_t(const char *mem) - : source_t(), m_str(mem) - { - } + factory::list_t &factory() noexcept; + const factory::list_t &factory() const noexcept; - protected: - plib::unique_ptr<std::istream> stream(const pstring &name) override; + log_type &log() noexcept { return m_log; } + const log_type &log() const noexcept { return m_log; } - private: - pstring m_str; - }; + plib::istream_uptr get_data_stream(const pstring &name); - class source_proc_t : public source_t - { - public: - source_proc_t(const pstring &name, void (*setup_func)(nlparse_t &)) - : source_t(), - m_setup_func(setup_func), - m_setup_func_name(name) - { - } + private: + pstring namespace_prefix() const; + pstring build_fqn(const pstring &obj_name) const; + void register_param_fp(const pstring ¶m, nl_fptype value); + bool device_exists(const pstring &name) const; - bool parse(nlparse_t &setup, const pstring &name) override; + // FIXME: stale? - remove later + void remove_connections(const pstring &pin); - protected: - plib::unique_ptr<std::istream> stream(const pstring &name) override; + plib::ppreprocessor::defines_map_type m_defines; + plib::psource_collection_t m_includes; + std::stack<pstring> m_namespace_stack; + plib::psource_collection_t m_sources; + detail::abstract_t &m_abstract; - private: - void (*m_setup_func)(nlparse_t &); - pstring m_setup_func_name; + log_type &m_log; + unsigned m_frontier_cnt; }; - // ----------------------------------------------------------------------------- - // inline implementations - // ----------------------------------------------------------------------------- - } // namespace netlist - -#endif /* NLSETUP_H_ */ +#endif // NLSETUP_H_ diff --git a/src/lib/netlist/nltypes.h b/src/lib/netlist/nltypes.h index 0f4536cbfd5..e6a74db1c9d 100644 --- a/src/lib/netlist/nltypes.h +++ b/src/lib/netlist/nltypes.h @@ -1,147 +1,313 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*! - * - * \file nltypes.h - * - */ -/* \note never change the name to nl_types.h. This creates a conflict - * with nl_types.h file provided by libc++ (clang, macosx) - */ +/// +/// \file nltypes.h +/// + +/// \note never change the name to nl_types.h. This creates a conflict +/// with nl_types.h file provided by libc++ (clang, macosx) +/// #ifndef NLTYPES_H_ #define NLTYPES_H_ #include "nl_config.h" -#include "plib/pchrono.h" -#include "plib/pfmtlog.h" -#include "plib/pmempool.h" -#include "plib/pstate.h" -#include "plib/pstring.h" + #include "plib/ptime.h" -#include "plib/putil.h" +#include "plib/ptypes.h" -//#include <cstdint> -#include <unordered_map> +#include <memory> + +/// \brief Construct a netlist device name +/// +#define NETLIB_NAME(chip) nld_##chip + +namespace netlist +{ + // ----------------------------------------------------------------------------- + // forward definitions + // ----------------------------------------------------------------------------- + + class logic_output_t; + class tristate_output_t; + class logic_input_t; + class analog_net_t; + class logic_net_t; + class setup_t; + class nlparse_t; + class netlist_t; + class netlist_state_t; + class core_device_t; + class base_device_t; + class device_t; + class netlist_state_t; + class param_t; + class logic_family_desc_t; + class logic_family_std_proxy_t; + class terminal_t; + + template <typename CX> + struct sub_device_wrapper; + + class models_t; + + namespace analog + { + class NETLIB_NAME(two_terminal); + } // namespace analog + + namespace devices + { + class nld_solver; + class nld_mainclock; + class nld_base_proxy; + class nld_base_d_to_a_proxy; + class nld_base_a_to_d_proxy; + class nld_netlistparams; + + template <unsigned m_NI, unsigned m_NO> + class factory_truth_table_t; + } // namespace devices + + namespace solver + { + class matrix_solver_t; + } // namespace solver + + namespace detail + { + struct abstract_t; + class core_terminal_t; + class net_t; + class device_object_t; + } // namespace detail + + namespace factory + { + template <class C, typename... Args> + class device_element_t; + class library_element_t; + + class list_t; + class element_t; + struct properties; + } // namespace factory + +} // namespace netlist namespace netlist { - /*! @brief plib::constants struct specialized for nl_double - * - * This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t. - * The choice has little to no impact on performance. - */ - using constants = plib::constants<nl_double>; - - /*! @brief netlist_sig_t is the type used for logic signals. - * - * This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t. - * The choice has little to no impact on performance. - */ - using netlist_sig_t = std::uint32_t; - /* FIXME: belongs into nl_base.h to nlstate */ - /** - * @brief Interface definition for netlist callbacks into calling code - * - * A class inheriting from netlist_callbacks_t has to be passed to the netlist_t - * constructor. Netlist does processing during construction and thus needs - * the object passed completely constructed. - * - */ - class callbacks_t + /// \brief Constants and const calculations for the library + /// + template <typename T> + struct nlconst_base : public plib::constants<T> { - public: + using BC = plib::constants<T>; + + static constexpr T np_VT(T n = BC::one(), T temp = BC::T0()) noexcept + { + return n * temp * BC::k_b() / BC::Q_e(); + } + + static constexpr T np_Is() noexcept + { + return static_cast<T>(1e-15); + } // NOLINT - callbacks_t() = default; - /* what is done before this is passed as a unique_ptr to netlist - * we should not limit. - */ - virtual ~callbacks_t() = default; - COPYASSIGNMOVE(callbacks_t, default) + /// \brief constant startup gmin + /// + /// This should be used during object creation to initialize + /// conductivities with a reasonable value. + /// During reset, the object should than make use of exec().gmin() + /// to use the actual gmin() value. + static constexpr T cgmin() noexcept + { + return BC::magic(1e-9); + } // NOLINT - /* logging callback */ - virtual void vlog(const plib::plog_level &l, const pstring &ls) const = 0; + // FIXME: Some objects used 1e-15 for initial gmin. Needs to be + // aligned with cgmin + static constexpr T cgminalt() noexcept + { + return BC::magic(1e-15); + } // NOLINT + /// \brief Multiplier applied to VT in np diode models to determine + /// range for constant model + /// + static constexpr T diode_min_cutoff_mult() noexcept + { + return BC::magic(-5.0); + } // NOLINT + + /// \brief Startup voltage used by np diode models + /// + static constexpr T diode_start_voltage() noexcept + { + return BC::magic(0.7); + } // NOLINT }; - using log_type = plib::plog_base<callbacks_t, NL_DEBUG>; + /// \brief nlconst_base struct specialized for nl_fptype. + /// + struct nlconst : public nlconst_base<nl_fptype> + { + }; + /// \brief netlist_sig_t is the type used for logic signals. + /// + /// This may be any of bool, uint8_t, uint16_t, uin32_t and uint64_t. + /// The choice has little to no impact on performance. + /// + using netlist_sig_t = std::uint32_t; - //============================================================ - // Performance tracking - //============================================================ + /// \brief The memory pool for netlist objects + /// + /// \note This is not the right location yet. + /// + using device_arena = std::conditional_t< + config::use_mempool::value, + plib::mempool_arena<plib::aligned_arena<>, + config::mempool_align::value>, + plib::aligned_arena<>>; - template<bool enabled_> - using nperftime_t = plib::chrono::timer<plib::chrono::exact_ticks, enabled_>; + using host_arena = plib::aligned_arena<>; - template<bool enabled_> - using nperfcount_t = plib::chrono::counter<enabled_>; + using log_type = plib::plog_base<NL_DEBUG>; //============================================================ // Types needed by various includes //============================================================ - /*! The memory pool for netlist objects - * - * \note This is not the right location yet. - * - */ - -#if (USE_MEMPOOL) - using nlmempool = plib::mempool; -#else - using nlmempool = plib::aligned_arena; -#endif - - /*! Owned pointer type for pooled allocations. - * - */ - template <typename T> - using pool_owned_ptr = nlmempool::owned_pool_ptr<T>; - - inline nlmempool &pool() + namespace detail { - static nlmempool static_pool; - return static_pool; - } - namespace detail { + /// \brief Time step type. + /// + /// May be either FORWARD or RESTORE + /// + enum class time_step_type + { + FORWARD, //!< forward time + RESTORE //!< restore state before last forward + }; + + /// \brief Enum specifying the type of object + /// + enum class terminal_type + { + TERMINAL = 0, //!< object is an analog terminal + INPUT = 1, //!< object is an input + OUTPUT = 2, //!< object is an output + }; - /*! Enum specifying the type of object */ - enum terminal_type { - TERMINAL = 0, /*!< object is an analog terminal */ - INPUT = 1, /*!< object is an input */ - OUTPUT = 2, /*!< object is an output */ + /// + /// \brief The kind of alias + /// + /// The information should later be used to create a netlist from + /// an abstract net list representation. + /// + enum class alias_type + { + UNKNOWN, //!< Used as a placeholder during code changes + INTERNAL, //!< the alias references a internal pin + FUNCTIONAL, //!< Used for aliases e.g. in BJTs : ALIAS("B", + //!< somesub.p()) + PACKAGE_PIN, //!< the alias references a package pin, e.g. ALIAS(13, + //!< B.CLK) + READABILITY, //!< the alias is used to improved readability, e.g. + //!< ALIAS(hblank, IC3.3) }; } // namespace detail -#if (PHAS_INT128) - using netlist_time = ptime<INT128, NETLIST_INTERNAL_RES>; -#else - using netlist_time = plib::ptime<std::int64_t, NETLIST_INTERNAL_RES>; - static_assert(noexcept(netlist_time::from_nsec(1)) == true, "Not evaluated as constexpr"); -#endif + using netlist_time = plib::ptime<std::int64_t, config::INTERNAL_RES::value>; + using netlist_time_ext = plib::ptime< + std::conditional<config::prefer_int128::value + && plib::compile_info::has_int128::value, + INT128, std::int64_t>::type, + config::INTERNAL_RES::value>; + + static_assert(noexcept(netlist_time::from_nsec(1)), + "Not evaluated as constexpr"); //============================================================ // MACROS //============================================================ - template <typename T> inline constexpr const netlist_time NLTIME_FROM_NS(T &&t) noexcept { return netlist_time::from_nsec(t); } - template <typename T> inline constexpr const netlist_time NLTIME_FROM_US(T &&t) noexcept { return netlist_time::from_usec(t); } - template <typename T> inline constexpr const netlist_time NLTIME_FROM_MS(T &&t) noexcept { return netlist_time::from_msec(t); } + template <typename T> + constexpr netlist_time NLTIME_FROM_NS(T &&t) noexcept + { + return netlist_time::from_nsec(t); + } + template <typename T> + constexpr netlist_time NLTIME_FROM_US(T &&t) noexcept + { + return netlist_time::from_usec(t); + } + template <typename T> + constexpr netlist_time NLTIME_FROM_MS(T &&t) noexcept + { + return netlist_time::from_msec(t); + } -} // namespace netlist + struct desc_base + { + /// \brief: used to hold one static netlist_time value + /// + template <netlist_time::internal_type value0> + struct times_ns1 + { + static constexpr netlist_time + value([[maybe_unused]] std::size_t N = 0) + { + return NLTIME_FROM_NS(value0); + } + }; -namespace plib { + template <netlist_time::internal_type value0> + using time_ns = times_ns1<value0>; - template<> - inline void state_manager_t::save_item(const void *owner, netlist::netlist_time &nlt, const pstring &stname) - { - save_state_ptr(owner, stname, datatype_t(sizeof(netlist::netlist_time::internal_type), true, false), 1, nlt.get_internaltype_ptr()); - } -} // namespace plib + /// \brief: used to hold two static netlist_time values + /// + template <netlist_time::internal_type value0, + netlist_time::internal_type value1> + struct times_ns2 + { + static constexpr netlist_time value(std::size_t N) + { + return N == 0 ? NLTIME_FROM_NS(value0) : NLTIME_FROM_NS(value1); + } + }; + + /// \brief: used to hold three static netlist_time values + /// + template <netlist_time::internal_type value0, + netlist_time::internal_type value1, + netlist_time::internal_type value2> + struct times_ns3 + { + static constexpr netlist_time value(std::size_t N) + { + return N == 0 ? NLTIME_FROM_NS(value0) + : N == 1 ? NLTIME_FROM_NS(value1) + : NLTIME_FROM_NS(value2); + } + }; + + /// \brief: used to define a constant in device description struct + /// + /// See the 74125 implementation + /// + template <std::size_t V> + using desc_const = std::integral_constant<const std::size_t, V>; + + template <typename T, T V> + using desc_const_t = std::integral_constant<const T, V>; + }; + +} // namespace netlist -#endif /* NLTYPES_H_ */ +#endif // NLTYPES_H_ diff --git a/src/lib/netlist/plib/gmres.h b/src/lib/netlist/plib/gmres.h index 2c357e97624..6ce96ed2ae6 100644 --- a/src/lib/netlist/plib/gmres.h +++ b/src/lib/netlist/plib/gmres.h @@ -1,36 +1,50 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * gmres.h - * - */ #ifndef PLIB_GMRES_H_ #define PLIB_GMRES_H_ -#include "mat_cr.h" +// Names +// spell-checker: words Burkardt, Saad, Yousef, Givens +// + +/// +/// \file gmres.h +/// + #include "parray.h" #include "pconfig.h" +#include "pmatrix_cr.h" #include "vector_ops.h" #include <algorithm> -#include <cmath> - namespace plib { - template <typename FT, int SIZE> + template <int k> + struct do_k_helper + { + static constexpr bool value = true; + }; + + template <> + struct do_k_helper<-1> + { + static constexpr float value = 0.0; + }; + + template <typename ARENA, typename FT, int SIZE> struct mat_precondition_ILU { - using mat_type = plib::matrix_compressed_rows_t<FT, SIZE>; - - mat_precondition_ILU(std::size_t size, int ilu_scale = 4 - , std::size_t bw = plib::matrix_compressed_rows_t<FT, SIZE>::FILL_INFINITY) - : m_mat(static_cast<typename mat_type::index_type>(size)) - , m_LU(static_cast<typename mat_type::index_type>(size)) - , m_use_iLU_preconditioning(ilu_scale >= 0) - , m_ILU_scale(static_cast<std::size_t>(ilu_scale)) + using mat_type = plib::pmatrix_cr<ARENA, FT, SIZE>; + using matLU_type = plib::pLUmatrix_cr<mat_type>; + + mat_precondition_ILU(ARENA &arena, std::size_t size, std::size_t ilu_scale = 4 + , std::size_t bw = plib::pmatrix_cr<ARENA, FT, SIZE>::FILL_INFINITY) + : m_mat(arena, narrow_cast<typename mat_type::index_type>(size)) + , m_LU(arena, narrow_cast<typename mat_type::index_type>(size)) + , m_ILU_scale(narrow_cast<std::size_t>(ilu_scale)) , m_band_width(bw) { } @@ -39,16 +53,11 @@ namespace plib void build(M &fill) { m_mat.build_from_fill_mat(fill, 0); - if (m_use_iLU_preconditioning) - { - m_LU.gaussian_extend_fill_mat(fill); - m_LU.build_from_fill_mat(fill, m_ILU_scale, m_band_width); // ILU(2) - //m_LU.build_from_fill_mat(fill, 9999, 20); // Band matrix width 20 - } + m_LU.build(fill, m_ILU_scale); } - template<typename R, typename V> + template <typename R, typename V> void calc_rhs(R &rhs, const V &v) { m_mat.mult_vec(rhs, v); @@ -56,41 +65,30 @@ namespace plib void precondition() { - if (m_use_iLU_preconditioning) - { - if (m_ILU_scale < 1) - m_LU.raw_copy_from(m_mat); - else - m_LU.reduction_copy_from(m_mat); - m_LU.incomplete_LU_factorization(); - } + m_LU.incomplete_LU_factorization(m_mat); } - template<typename V> - void solve_LU_inplace(V &v) + template <typename V> + void solve_inplace(V &v) { - if (m_use_iLU_preconditioning) - { - m_LU.solveLUx(v); - } + m_LU.solveLU(v); } PALIGNAS_VECTOROPT() mat_type m_mat; PALIGNAS_VECTOROPT() - mat_type m_LU; - bool m_use_iLU_preconditioning; + matLU_type m_LU; std::size_t m_ILU_scale; std::size_t m_band_width; }; - template <typename FT, int SIZE> - struct mat_precondition_diag + template <typename ARENA, typename FT, int SIZE> + struct mat_precondition_diagonal { - mat_precondition_diag(std::size_t size) - : m_mat(size) - , m_diag(size) - , m_use_iLU_preconditioning(true) + mat_precondition_diagonal(ARENA &arena, std::size_t size, [[maybe_unused]] int dummy = 0) + : m_mat(arena, size) + , m_diagonal(size) + , nz_col(size) { } @@ -98,9 +96,21 @@ namespace plib void build(M &fill) { m_mat.build_from_fill_mat(fill, 0); + for (std::size_t i = 0; i< m_diagonal.size(); i++) + { + for (std::size_t j = 0; j< m_diagonal.size(); j++) + { + std::size_t k=m_mat.row_idx[j]; + while (m_mat.col_idx[k] < i && k < m_mat.row_idx[j+1]) + k++; + if (m_mat.col_idx[k] == i && k < m_mat.row_idx[j+1]) + nz_col[i].push_back(k); + } + nz_col[i].push_back(narrow_cast<std::size_t>(-1)); + } } - template<typename R, typename V> + template <typename R, typename V> void calc_rhs(R &rhs, const V &v) { m_mat.mult_vec(rhs, v); @@ -108,87 +118,148 @@ namespace plib void precondition() { - if (m_use_iLU_preconditioning) + for (std::size_t i = 0; i< m_diagonal.size(); i++) { - for (std::size_t i = 0; i< m_diag.size(); i++) + // ILUT: 265% + FT v(0.0); +#if 0 + // doesn't works, Mame performance drops significantly% + // 136% + for (std::size_t j = m_mat.row_idx[i]; j< m_mat.row_idx[i+1]; j++) + v += m_mat.A[j] * m_mat.A[j]; + m_diagonal[i] = reciprocal(std::sqrt(v)); +#elif 0 + // works halfway, i.e. Mame performance 50% + // 147% - lowest average solution time with 7.094 + for (std::size_t j = m_mat.row_idx[i]; j< m_mat.row_idx[i+1]; j++) + v += m_mat.A[j] * m_mat.A[j]; + m_diagonal[i] = m_mat.A[m_mat.diagonal[i]] / v; +#elif 0 + // works halfway, i.e. Mame performance 50% + // sum over column i + // 344% - lowest average solution time with 3.06 + std::size_t nzcolp = 0; + const auto &nz = nz_col[i]; + std::size_t j; + + while ((j = nz[nzcolp++])!=narrow_cast<std::size_t>(-1)) // NOLINT(bugprone-infinite-loop) { - m_diag[i] = 1.0 / m_mat.A[m_mat.diag[i]]; + v += m_mat.A[j] * m_mat.A[j]; } + m_diagonal[i] = m_mat.A[m_mat.diagonal[i]] / v; +#elif 0 + // works halfway, i.e. Mame performance 50% + // 151% + for (std::size_t j = m_mat.row_idx[i]; j< m_mat.row_idx[i+1]; j++) + v += plib::abs(m_mat.A[j]); + m_diagonal[i] = reciprocal(v); +#else + // 124% + for (std::size_t j = m_mat.row_idx[i]; j< m_mat.row_idx[i+1]; j++) + v = std::max(v, plib::abs(m_mat.A[j])); + m_diagonal[i] = reciprocal(v); +#endif + //m_diagonal[i] = reciprocal(m_mat.A[m_mat.diagonal[i]]); } } - template<typename V> - void solve_LU_inplace(V &v) + template <typename V> + void solve_inplace(V &v) { - if (m_use_iLU_preconditioning) - { - for (std::size_t i = 0; i< m_diag.size(); i++) - v[i] = v[i] * m_diag[i]; - } + for (std::size_t i = 0; i< m_diagonal.size(); i++) + v[i] = v[i] * m_diagonal[i]; } - plib::matrix_compressed_rows_t<FT, SIZE> m_mat; - plib::parray<FT, SIZE> m_diag; - bool m_use_iLU_preconditioning; + plib::pmatrix_cr<ARENA, FT, SIZE> m_mat; + plib::parray<FT, SIZE> m_diagonal; + plib::parray<std::vector<std::size_t>, SIZE > nz_col; }; - /* FIXME: hardcoding RESTART to 20 becomes an issue on very large - * systems. - */ - template <typename FT, int SIZE, int RESTART = 20> + template <typename ARENA, typename FT, int SIZE> + struct mat_precondition_none + { + mat_precondition_none(std::size_t size, [[maybe_unused]] int dummy = 0) + : m_mat(size) + { + } + + template <typename M> + void build(M &fill) + { + m_mat.build_from_fill_mat(fill, 0); + } + + template <typename R, typename V> + void calc_rhs(R &rhs, const V &v) + { + m_mat.mult_vec(rhs, v); + } + + void precondition() + { + } + + template <typename V> + void solve_inplace([[maybe_unused]] V &v) + { + } + + plib::pmatrix_cr<ARENA, FT, SIZE> m_mat; + }; + + // FIXME: hard coding RESTART to 20 becomes an issue on very large + // systems. + + template <typename FT, int SIZE, int RESTARTMAX = 16> struct gmres_t { public: using float_type = FT; - // FIXME: dirty hack to make this compile - static constexpr const std::size_t storage_N = plib::sizeabs<FT, SIZE>::ABS(); - gmres_t(std::size_t size) + //constexpr static int RESTART = RESTARTMAX; + constexpr static const int RESTART = (SIZE > 0) ? ((SIZE < RESTARTMAX) ? SIZE : RESTARTMAX) + : ((SIZE < 0) ? ((-SIZE < RESTARTMAX) ? -SIZE : RESTARTMAX) : RESTARTMAX); + + explicit gmres_t(std::size_t size) : residual(size) , Ax(size) + , m_ht(RESTART +1, RESTART) + , m_v(RESTART + 1, size) , m_size(size) , m_use_more_precise_stop_condition(false) { } - void givens_mult( const FT c, const FT s, FT & g0, FT & g1 ) - { - const FT g0_last(g0); - - g0 = c * g0 - s * g1; - g1 = s * g0_last + c * g1; - } - - std::size_t size() const { return (SIZE<=0) ? m_size : static_cast<std::size_t>(SIZE); } + std::size_t size() const { return (SIZE<=0) ? m_size : narrow_cast<std::size_t>(SIZE); } template <typename OPS, typename VT, typename VRHS> std::size_t solve(OPS &ops, VT &x, const VRHS & rhs, const std::size_t itr_max, float_type accuracy) { - /*------------------------------------------------------------------------- - * The code below was inspired by code published by John Burkardt under - * the LPGL here: - * - * http://people.sc.fsu.edu/~jburkardt/cpp_src/mgmres/mgmres.html - * - * The code below was completely written from scratch based on the pseudo code - * found here: - * - * http://de.wikipedia.org/wiki/GMRES-Verfahren - * - * The Algorithm itself is described in - * - * Yousef Saad, - * Iterative Methods for Sparse Linear Systems, - * Second Edition, - * SIAM, 20003, - * ISBN: 0898715342, - * LC: QA188.S17. - * - *------------------------------------------------------------------------*/ + // ------------------------------------------------------------------------- + // The code below was inspired by code published by John Burkardt under + // the LPGL here: + // + // http://people.sc.fsu.edu/~jburkardt/cpp_src/mgmres/mgmres.html + // + // The code below was completely written from scratch based on the pseudo code + // found here: + // + // http://de.wikipedia.org/wiki/GMRES-Verfahren + // + // The Algorithm itself is described in + // + // Yousef Saad, + // Iterative Methods for Sparse Linear Systems, + // Second Edition, + // SIAM, 20003, + // ISBN: 0898715342, + // LC: QA188.S17. + // + //------------------------------------------------------------------------ std::size_t itr_used = 0; - double rho_delta = 0.0; + float_type rho_delta(plib::constants<float_type>::zero()); const std::size_t n = size(); @@ -196,165 +267,174 @@ namespace plib if (m_use_more_precise_stop_condition) { - /* derive residual for a given delta x - * - * LU y = A dx - * - * ==> rho / accuracy = sqrt(y * y) - * - * This approach will approximate the iterative stop condition - * based |xnew - xold| pretty precisely. But it is slow, or expressed - * differently: The invest doesn't pay off. - */ - - vec_set_scalar(n, residual, accuracy); + // derive residual for a given delta x + // + // LU y = A dx + // + // ==> rho / accuracy = sqrt(y * y) + // + // This approach will approximate the iterative stop condition + // based `|xnew - xold|` pretty precisely. But it is slow, or expressed + // differently: The invest doesn't pay off. + // + + vec_set_scalar(residual, accuracy); ops.calc_rhs(Ax, residual); - ops.solve_LU_inplace(Ax); + ops.solve_inplace(Ax); - const float_type rho_to_accuracy = std::sqrt(vec_mult2<FT>(n, Ax)) / accuracy; + const float_type rho_to_accuracy = plib::sqrt(vec_mult2<FT>(Ax)) / accuracy; rho_delta = accuracy * rho_to_accuracy; } else - rho_delta = accuracy * std::sqrt(static_cast<FT>(n)); - - /* - * Using - * - * vec_set(n, x, rhs); - * ops.solve_LU_inplace(x); - * - * to get a starting point for x degrades convergence speed compared - * to using the last solution for x. - * - * LU x = b; solve for x; - * - */ + //rho_delta = accuracy * plib::sqrt(vec_mult2<FT>(n, rhs)) + // + 1e-4 * std::sqrt(n); + rho_delta = accuracy * plib::sqrt(narrow_cast<FT>(n)); + + // + // LU x = b; solve for x; + // + // Using + // + // vec_set(n, x, rhs); + // ops.solve_inplace(x); + // + // to get a starting point for x degrades convergence speed compared + // to using the last solution for x. while (itr_used < itr_max) { - std::size_t last_k = RESTART; float_type rho; ops.calc_rhs(Ax, x); - vec_sub(n, residual, rhs, Ax); + vec_sub(residual, rhs, Ax); - ops.solve_LU_inplace(residual); + ops.solve_inplace(residual); - rho = std::sqrt(vec_mult2<FT>(n, residual)); + rho = plib::sqrt(vec_mult2<FT>(residual)); if (rho < rho_delta) return itr_used + 1; - /* FIXME: The "+" is necessary to avoid link issues - * on some systems / compiler versions. Issue reported by - * AJR, no details known yet. - */ - vec_set_scalar(RESTART+1, m_g, +constants<FT>::zero()); + // FIXME: The "+" is necessary to avoid link issues + // on some systems / compiler versions. Issue reported by + // AJR, no details known yet. + + vec_set_scalar(m_g, +constants<FT>::zero()); m_g[0] = rho; - //for (std::size_t i = 0; i < mr + 1; i++) - // vec_set_scalar(mr, m_ht[i], NL_FCONST(0.0)); + vec_mult_scalar(m_v[0], residual, plib::reciprocal(rho)); - vec_mult_scalar(n, m_v[0], residual, constants<FT>::one() / rho); + if (do_k<RESTART-1>(ops, x, itr_used, rho_delta, true)) + // converged + break; + } + return itr_used; + } - for (std::size_t k = 0; k < RESTART; k++) - { - const std::size_t kp1 = k + 1; + private: - ops.calc_rhs(m_v[kp1], m_v[k]); - ops.solve_LU_inplace(m_v[kp1]); + static void givens_mult(FT c, FT s, FT & g0, FT & g1 ) + { + const FT g0_last(g0); + + g0 = c * g0 - s * g1; + g1 = s * g0_last + c * g1; + } - for (std::size_t j = 0; j <= k; j++) - { - m_ht[j][k] = vec_mult<FT>(n, m_v[kp1], m_v[j]); - vec_add_mult_scalar(n, m_v[kp1], m_v[j], -m_ht[j][k]); - } - m_ht[kp1][k] = std::sqrt(vec_mult2<FT>(n, m_v[kp1])); + template <int k, typename OPS, typename VT> + bool do_k(OPS &ops, VT &x, std::size_t &itr_used, FT rho_delta, [[maybe_unused]] bool dummy) + { + if (do_k<k-1, OPS>(ops, x, itr_used, rho_delta, do_k_helper<k-1>::value)) + return true; + + constexpr const std::size_t kp1 = k + 1; + //const std::size_t n = size(); - if (m_ht[kp1][k] != 0.0) - vec_scale(n, m_v[kp1], constants<FT>::one() / m_ht[kp1][k]); + ops.calc_rhs(m_v[kp1], m_v[k]); + ops.solve_inplace(m_v[kp1]); - for (std::size_t j = 0; j < k; j++) - givens_mult(m_c[j], m_s[j], m_ht[j][k], m_ht[j+1][k]); + for (std::size_t j = 0; j <= k; j++) + { + m_ht[j][k] = vec_mult<FT>(m_v[kp1], m_v[j]); + vec_add_mult_scalar(m_v[kp1], m_v[j], -m_ht[j][k]); + } + m_ht[kp1][k] = plib::sqrt(vec_mult2<FT>(m_v[kp1])); - const float_type mu = 1.0 / std::hypot(m_ht[k][k], m_ht[kp1][k]); + // FIXME: comparison to zero + if (m_ht[kp1][k] != plib::constants<FT>::zero()) + vec_scale(m_v[kp1], reciprocal(m_ht[kp1][k])); - m_c[k] = m_ht[k][k] * mu; - m_s[k] = -m_ht[kp1][k] * mu; - m_ht[k][k] = m_c[k] * m_ht[k][k] - m_s[k] * m_ht[kp1][k]; - m_ht[kp1][k] = 0.0; + for (std::size_t j = 0; j < k; j++) + givens_mult(m_c[j], m_s[j], m_ht[j][k], m_ht[j+1][k]); - givens_mult(m_c[k], m_s[k], m_g[k], m_g[kp1]); + const float_type mu = reciprocal(plib::hypot(m_ht[k][k], m_ht[kp1][k])); - rho = std::abs(m_g[kp1]); + m_c[k] = m_ht[k][k] * mu; + m_s[k] = -m_ht[kp1][k] * mu; + m_ht[k][k] = m_c[k] * m_ht[k][k] - m_s[k] * m_ht[kp1][k]; + m_ht[kp1][k] = plib::constants<FT>::zero(); - itr_used = itr_used + 1; + givens_mult(m_c[k], m_s[k], m_g[k], m_g[kp1]); - if (rho <= rho_delta) - { - last_k = k; - break; - } - } + const float_type rho = plib::abs(m_g[kp1]); - if (last_k >= RESTART) - /* didn't converge within accuracy */ - last_k = RESTART - 1; + // FIXME .. + itr_used = itr_used + 1; - /* Solve the system H * y = g */ - /* x += m_v[j] * m_y[j] */ - for (std::size_t i = last_k + 1; i-- > 0;) + if (rho <= rho_delta || k == RESTART-1) + { + // Solve the system H * y = g + // x += m_v[j] * m_y[j] + for (std::size_t i = k + 1; i-- > 0;) { - double tmp = m_g[i]; - for (std::size_t j = i + 1; j <= last_k; j++) + auto tmp = m_g[i]; + const auto ht_i_i = plib::reciprocal(m_ht[i][i]); + for (std::size_t j = i + 1; j <= k; j++) tmp -= m_ht[i][j] * m_y[j]; - m_y[i] = tmp / m_ht[i][i]; + m_y[i] = tmp * ht_i_i; + vec_add_mult_scalar(x, m_v[i], m_y[i]); } - for (std::size_t i = 0; i <= last_k; i++) - vec_add_mult_scalar(n, x, m_v[i], m_y[i]); - - if (rho <= rho_delta) - break; - + //for (std::size_t i = 0; i <= k; i++) + // vec_add_mult_scalar(n, x, m_v[i], m_y[i]); + return true; } - return itr_used; + return false; } - private: - - //typedef typename plib::mat_cr_t<FT, SIZE>::index_type mattype; + template <int k, typename OPS, typename VT> + bool do_k(OPS &ops, VT &x, std::size_t &itr_used, FT rho_delta, float dummy) + { + plib::unused_var(ops, x, itr_used, rho_delta, dummy); + return false; + } plib::parray<float_type, SIZE> residual; plib::parray<float_type, SIZE> Ax; - plib::parray<float_type, RESTART + 1> m_c; /* mr + 1 */ - plib::parray<float_type, RESTART + 1> m_g; /* mr + 1 */ - plib::parray<plib::parray<float_type, RESTART>, RESTART + 1> m_ht; /* (mr + 1), mr */ - plib::parray<float_type, RESTART + 1> m_s; /* mr + 1 */ - plib::parray<float_type, RESTART + 1> m_y; /* mr + 1 */ + plib::parray<float_type, RESTART + 1> m_c; // mr + 1 + plib::parray<float_type, RESTART + 1> m_g; // mr + 1 + plib::parray2D<float_type, RESTART + 1, RESTART> m_ht; // (mr + 1), mr + plib::parray<float_type, RESTART + 1> m_s; // mr + 1 + plib::parray<float_type, RESTART + 1> m_y; // mr + 1 - //plib::parray<float_type, SIZE> m_v[RESTART + 1]; /* mr + 1, n */ - plib::parray<plib::parray<float_type, storage_N>, RESTART + 1> m_v; /* mr + 1, n */ + plib::parray2D<float_type, RESTART + 1, SIZE> m_v; // mr + 1, n std::size_t m_size; bool m_use_more_precise_stop_condition; - - }; #if 0 - /* Example of a Chebyshev iteration solver. This one doesn't work yet, - * it needs to be extended for non-symmetric matrix operation and - * depends on spectral radius estimates - which we don't have. - * - * Left here as another example. - */ + // Example of a Chebyshev iteration solver. This one doesn't work yet, + // it needs to be extended for non-symmetric matrix operation and + // depends on spectral radius estimates - which we don't have. + // + // Left here as another example. template <typename FT, int SIZE> struct ch_t @@ -375,16 +455,11 @@ namespace plib { } - std::size_t size() const { return (SIZE<=0) ? m_size : static_cast<std::size_t>(SIZE); } + std::size_t size() const { return (SIZE<=0) ? m_size : narrow_cast<std::size_t>(SIZE); } template <typename OPS, typename VT, typename VRHS> std::size_t solve(OPS &ops, VT &x0, const VRHS & rhs, const std::size_t iter_max, float_type accuracy) { - /*------------------------------------------------------------------------- - * - * - *------------------------------------------------------------------------*/ - ops.precondition(); const FT lmax = 20.0; @@ -404,13 +479,13 @@ namespace plib ops.calc_rhs(Ax, x); vec_sub(size(), rhs, Ax, residual); - FT rho_delta = accuracy * std::sqrt(static_cast<FT>(size())); + FT rho_delta = accuracy * std::sqrt(narrow_cast<FT>(size())); rho_delta = 1e-9; for (int i = 0; i < iter_max; i++) { - ops.solve_LU_inplace(residual); + ops.solve_inplace(residual); if (i==0) { vec_set(size(), p, residual); @@ -419,7 +494,7 @@ namespace plib else { beta = alpha * ( c / 2.0)*( c / 2.0); - alpha = 1.0 / (d - beta); + alpha = reciprocal(d - beta); for (std::size_t k = 0; k < size(); k++) p[k] = residual[k] + beta * p[k]; } @@ -435,7 +510,7 @@ namespace plib } private: - //typedef typename plib::mat_cr_t<FT, SIZE>::index_type mattype; + //#typedef typename plib::mat_cr_t<FT, SIZE>::index_type mattype; plib::parray<float_type, SIZE> residual; plib::parray<float_type, SIZE> Ax; @@ -447,4 +522,4 @@ namespace plib } // namespace plib -#endif /* PLIB_GMRES_H_ */ +#endif // PLIB_GMRES_H_ diff --git a/src/lib/netlist/plib/mat_cr.h b/src/lib/netlist/plib/mat_cr.h deleted file mode 100644 index db791752cf1..00000000000 --- a/src/lib/netlist/plib/mat_cr.h +++ /dev/null @@ -1,529 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * mat_cr.h - * - * Compressed row format matrices - * - */ - -#ifndef MAT_CR_H_ -#define MAT_CR_H_ - -#include "palloc.h" -#include "parray.h" -#include "pconfig.h" -#include "pomp.h" -#include "pstate.h" -#include "ptypes.h" -#include "putil.h" - -#include <algorithm> -#include <array> -#include <cmath> -#include <type_traits> -#include <vector> - -namespace plib -{ - - // FIXME: causes a crash with GMRES handler - // template<typename T, int N, typename C = std::size_t> - - template<typename T, int N, typename C = uint16_t> - struct matrix_compressed_rows_t - { - using index_type = C; - using value_type = T; - - COPYASSIGNMOVE(matrix_compressed_rows_t, default) - - enum constants_e - { - FILL_INFINITY = 9999999 - }; - - parray<index_type, N> diag; // diagonal index pointer n - parray<index_type, (N == 0) ? 0 : (N < 0 ? N - 1 : N + 1)> row_idx; // row index pointer n + 1 - parray<index_type, N < 0 ? -N * N : N *N> col_idx; // column index array nz_num, initially (n * n) - parray<value_type, N < 0 ? -N * N : N *N> A; // Matrix elements nz_num, initially (n * n) - //parray<C, N < 0 ? -N * (N-1) / 2 : N * (N+1) / 2 > nzbd; // Support for gaussian elimination - parray<std::vector<index_type>, N > nzbd; // Support for gaussian elimination - // contains elimination rows below the diagonal - // FIXME: convert to pvector - std::vector<std::vector<index_type>> m_ge_par; - - index_type nz_num; - - explicit matrix_compressed_rows_t(const index_type n) - : diag(n) - , row_idx(n+1) - , col_idx(n*n) - , A(n*n) - //, nzbd(n * (n+1) / 2) - , nzbd(n) - , nz_num(0) - , m_size(n) - { - for (index_type i=0; i<n+1; i++) - row_idx[i] = 0; - } - - ~matrix_compressed_rows_t() = default; - - constexpr index_type size() const { return static_cast<index_type>((N>0) ? N : m_size); } - - void clear() - { - nz_num = 0; - for (index_type i=0; i < size() + 1; i++) - row_idx[i] = 0; - } - - void set_scalar(const T scalar) - { - for (index_type i=0, e=nz_num; i<e; i++) - A[i] = scalar; - } - - void set(C r, C c, T val) - { - C ri = row_idx[r]; - while (ri < row_idx[r+1] && col_idx[ri] < c) - ri++; - // we have the position now; - if (ri < row_idx[r+1] && col_idx[ri] == c) - A[ri] = val; - else - { - for (C i = nz_num; i>ri; i--) - { - A[i] = A[i-1]; - col_idx[i] = col_idx[i-1]; - } - A[ri] = val; - col_idx[ri] = c; - for (C i = r + 1; i < size() + 1; i++) - row_idx[i]++; - nz_num++; - if (c==r) - diag[r] = ri; - } - } - - template <typename M> - std::pair<std::size_t, std::size_t> gaussian_extend_fill_mat(M &fill) - { - std::size_t ops = 0; - std::size_t fill_max = 0; - - for (std::size_t k = 0; k < fill.size(); k++) - { - ops++; // 1/A(k,k) - for (std::size_t row = k + 1; row < fill.size(); row++) - { - if (fill[row][k] < FILL_INFINITY) - { - ops++; - for (std::size_t col = k + 1; col < fill[row].size(); col++) - //if (fill[k][col] < FILL_INFINITY) - { - auto f = std::min(fill[row][col], 1 + fill[row][k] + fill[k][col]); - if (f < FILL_INFINITY) - { - if (f > fill_max) - fill_max = f; - ops += 2; - } - fill[row][col] = f; - } - } - } - } - build_parallel_gaussian_execution_scheme(fill); - return { fill_max, ops }; - } - - template <typename M> - void build_from_fill_mat(const M &f, std::size_t max_fill = FILL_INFINITY - 1, - std::size_t band_width = FILL_INFINITY) - { - C nz = 0; - if (nz_num != 0) - throw pexception("build_from_mat only allowed on empty CR matrix"); - for (std::size_t k=0; k < size(); k++) - { - row_idx[k] = nz; - - for (std::size_t j=0; j < size(); j++) - if (f[k][j] <= max_fill && std::abs(static_cast<int>(k)-static_cast<int>(j)) <= static_cast<int>(band_width)) - { - col_idx[nz] = static_cast<C>(j); - if (j == k) - diag[k] = nz; - nz++; - } - } - - row_idx[size()] = nz; - nz_num = nz; - /* build nzbd */ - - for (std::size_t k=0; k < size(); k++) - { - for (std::size_t j=k + 1; j < size(); j++) - if (f[j][k] < FILL_INFINITY) - nzbd[k].push_back(static_cast<C>(j)); - nzbd[k].push_back(0); // end of sequence - } - } - - template <typename V> - void gaussian_elimination(V & RHS) - { - const std::size_t iN = size(); - - for (std::size_t i = 0; i < iN - 1; i++) - { - std::size_t nzbdp = 0; - std::size_t pi = diag[i]; - const value_type f = 1.0 / A[pi++]; - const std::size_t piie = row_idx[i+1]; - const auto &nz = nzbd[i]; - - while (auto j = nz[nzbdp++]) - { - // proceed to column i - - std::size_t pj = row_idx[j]; - - while (col_idx[pj] < i) - pj++; - - const value_type f1 = - A[pj++] * f; - - // subtract row i from j - // fill-in available assumed, i.e. matrix was prepared - - for (std::size_t pii = pi; pii<piie; pii++) - { - while (col_idx[pj] < col_idx[pii]) - pj++; - if (col_idx[pj] == col_idx[pii]) - A[pj++] += A[pii] * f1; - } - - RHS[j] += f1 * RHS[i]; - } - } - } - - template <typename V> - void gaussian_elimination_parallel(V & RHS) - { - // FIXME: move into solver creation ... - plib::omp::set_num_threads(4); - for (auto l = 0ul; l < m_ge_par.size(); l++) - plib::omp::for_static(0ul, m_ge_par[l].size(), [this, &RHS, &l] (unsigned ll) - { - auto &i = m_ge_par[l][ll]; - { - std::size_t nzbdp = 0; - std::size_t pi = diag[i]; - const value_type f = 1.0 / A[pi++]; - const std::size_t piie = row_idx[i+1]; - - while (auto j = nzbd[i][nzbdp++]) - { - // proceed to column i - - std::size_t pj = row_idx[j]; - - while (col_idx[pj] < i) - pj++; - - const value_type f1 = - A[pj++] * f; - - // subtract row i from j - // fill-in available assumed, i.e. matrix was prepared - for (std::size_t pii = pi; pii<piie; pii++) - { - while (col_idx[pj] < col_idx[pii]) - pj++; - if (col_idx[pj] == col_idx[pii]) - A[pj++] += A[pii] * f1; - } - RHS[j] += f1 * RHS[i]; - } - } - }); - } - - template <typename V1, typename V2> - void gaussian_back_substitution(V1 &V, const V2 &RHS) - { - const std::size_t iN = size(); - /* row n-1 */ - V[iN - 1] = RHS[iN - 1] / A[diag[iN - 1]]; - - for (std::size_t j = iN - 1; j-- > 0;) - { - value_type tmp = 0; - const auto jdiag = diag[j]; - const std::size_t e = row_idx[j+1]; - for (std::size_t pk = jdiag + 1; pk < e; pk++) - tmp += A[pk] * V[col_idx[pk]]; - V[j] = (RHS[j] - tmp) / A[jdiag]; - } - } - - template <typename V1> - void gaussian_back_substitution(V1 &V) - { - const std::size_t iN = size(); - /* row n-1 */ - V[iN - 1] = V[iN - 1] / A[diag[iN - 1]]; - - for (std::size_t j = iN - 1; j-- > 0;) - { - value_type tmp = 0; - const auto jdiag = diag[j]; - const std::size_t e = row_idx[j+1]; - for (std::size_t pk = jdiag + 1; pk < e; pk++) - tmp += A[pk] * V[col_idx[pk]]; - V[j] = (V[j] - tmp) / A[jdiag]; - } - } - - - template <typename VTV, typename VTR> - void mult_vec(VTR & res, const VTV & x) - { - /* - * res = A * x - */ - - std::size_t row = 0; - std::size_t k = 0; - const std::size_t oe = nz_num; - - while (k < oe) - { - T tmp = 0.0; - const std::size_t e = row_idx[row+1]; - for (; k < e; k++) - tmp += A[k] * x[col_idx[k]]; - res[row++] = tmp; - } - } - - /* throws error if P(source)>P(destination) */ - template <typename LUMAT> - void slim_copy_from(LUMAT & src) - { - for (std::size_t r=0; r<src.size(); r++) - { - C dp = row_idx[r]; - for (C sp = src.row_idx[r]; sp < src.row_idx[r+1]; sp++) - { - /* advance dp to source column and fill 0s if necessary */ - while (col_idx[dp] < src.col_idx[sp]) - A[dp++] = 0; - if (row_idx[r+1] <= dp || col_idx[dp] != src.col_idx[sp]) - throw plib::pexception("slim_copy_from error"); - A[dp++] = src.A[sp]; - } - /* fill remaining elements in row */ - while (dp < row_idx[r+1]) - A[dp++] = 0; - } - } - - /* only copies common elements */ - template <typename LUMAT> - void reduction_copy_from(LUMAT & src) - { - C sp = 0; - for (std::size_t r=0; r<src.size(); r++) - { - C dp = row_idx[r]; - while(sp < src.row_idx[r+1]) - { - /* advance dp to source column and fill 0s if necessary */ - if (col_idx[dp] < src.col_idx[sp]) - A[dp++] = 0; - else if (col_idx[dp] == src.col_idx[sp]) - A[dp++] = src.A[sp++]; - else - sp++; - } - /* fill remaining elements in row */ - while (dp < row_idx[r+1]) - A[dp++] = 0; - } - } - - /* checks at all - may crash */ - template <typename LUMAT> - void raw_copy_from(LUMAT & src) - { - for (std::size_t k = 0; k < nz_num; k++) - A[k] = src.A[k]; - } - - void incomplete_LU_factorization() - { - /* - * incomplete LU Factorization according to http://de.wikipedia.org/wiki/ILU-Zerlegung - * - * Result is stored in matrix LU - * - * For i = 1,...,N-1 - * For k = 0, ... , i - 1 - * If a[i,k] != 0 - * a[i,k] = a[i,k] / a[k,k] - * For j = k + 1, ... , N - 1 - * If a[i,j] != 0 - * a[i,j] = a[i,j] - a[i,k] * a[k,j] - * j=j+1 - * k=k+1 - * i=i+1 - * - */ - - for (std::size_t i = 1; i < size(); i++) // row i - { - const std::size_t p_i_end = row_idx[i + 1]; - // loop over all columns k left of diag in row i - for (std::size_t i_k = row_idx[i]; i_k < diag[i]; i_k++) - { - const std::size_t k = col_idx[i_k]; - const std::size_t p_k_end = row_idx[k + 1]; - const T LUp_i_k = A[i_k] = A[i_k] / A[diag[k]]; - - std::size_t k_j = diag[k] + 1; - std::size_t i_j = i_k + 1; - - while (i_j < p_i_end && k_j < p_k_end ) // pj = (i, j) - { - // we can assume that within a row ja increases continuously */ - const std::size_t c_i_j = col_idx[i_j]; // row i, column j - const std::size_t c_k_j = col_idx[k_j]; // row i, column j - if (c_k_j < c_i_j) - k_j++; - else if (c_k_j == c_i_j) - A[i_j++] -= LUp_i_k * A[k_j++]; - else - i_j++; - } - } - } - } - - template <typename R> - void solveLUx (R &r) - { - /* - * Solve a linear equation Ax = r - * where - * A = L*U - * - * L unit lower triangular - * U upper triangular - * - * ==> LUx = r - * - * ==> Ux = L⁻¹ r = w - * - * ==> r = Lw - * - * This can be solved for w using backwards elimination in L. - * - * Now Ux = w - * - * This can be solved for x using backwards elimination in U. - * - */ - for (std::size_t i = 1; i < size(); ++i ) - { - T tmp = 0.0; - const std::size_t j1 = row_idx[i]; - const std::size_t j2 = diag[i]; - - for (std::size_t j = j1; j < j2; ++j ) - tmp += A[j] * r[col_idx[j]]; - r[i] -= tmp; - } - // i now is equal to n; - for (std::size_t i = size(); i-- > 0; ) - { - T tmp = 0.0; - const std::size_t di = diag[i]; - const std::size_t j2 = row_idx[i+1]; - for (std::size_t j = di + 1; j < j2; j++ ) - tmp += A[j] * r[col_idx[j]]; - r[i] = (r[i] - tmp) / A[di]; - } - } - private: - template <typename M> - void build_parallel_gaussian_execution_scheme(const M &fill) - { - // calculate parallel scheme for gaussian elimination - std::vector<std::vector<index_type>> rt(size()); - for (index_type k = 0; k < size(); k++) - { - for (index_type j = k+1; j < size(); j++) - { - if (fill[j][k] < FILL_INFINITY) - { - rt[k].push_back(j); - } - } - } - - std::vector<index_type> levGE(size(), 0); - index_type cl = 0; - - for (index_type k = 0; k < size(); k++ ) - { - if (levGE[k] >= cl) - { - std::vector<index_type> t = rt[k]; - for (index_type j = k+1; j < size(); j++ ) - { - bool overlap = false; - // is there overlap - if (plib::container::contains(t, j)) - overlap = true; - for (auto &x : rt[j]) - if (plib::container::contains(t, x)) - { - overlap = true; - break; - } - if (overlap) - levGE[j] = cl + 1; - else - { - t.push_back(j); - for (auto &x : rt[j]) - t.push_back(x); - } - } - cl++; - } - } - - m_ge_par.clear(); - m_ge_par.resize(cl+1); - for (index_type k = 0; k < size(); k++) - m_ge_par[levGE[k]].push_back(k); - } - - index_type m_size; - }; - -} // namespace plib - -#endif /* MAT_CR_H_ */ diff --git a/src/lib/netlist/plib/palloc.h b/src/lib/netlist/plib/palloc.h index a9b03353b37..1eff726d45d 100644 --- a/src/lib/netlist/plib/palloc.h +++ b/src/lib/netlist/plib/palloc.h @@ -1,19 +1,21 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * palloc.h - * - */ #ifndef PALLOC_H_ #define PALLOC_H_ +/// +/// \file palloc.h +/// + #include "pconfig.h" -#include "pstring.h" +#include "pgsl.h" +#include "pgsl.h" +#include "pmath.h" // FIXME: only uses lcm ... move to ptypes. #include "ptypes.h" +#include <algorithm> #include <cstddef> // for std::max_align_t (usually long long) -//#include <cstdlib> #include <memory> #include <type_traits> #include <utility> @@ -29,36 +31,82 @@ namespace plib { // Standard arena_deleter //============================================================ - template <typename P, typename T> - struct arena_deleter + template <typename P, typename T, std::size_t ALIGN, bool X> + struct arena_deleter_base + { + }; + + struct deleter_info_t + { + std::size_t alignment; + std::size_t size; + }; + + template <typename P, typename T, std::size_t ALIGN> + struct arena_deleter_base<P, T, ALIGN, false> { - //using arena_storage_type = P *; - using arena_storage_type = typename std::conditional<P::is_stateless, P, P *>::type; - template <typename X, typename Y = void> - typename std::enable_if<!X::is_stateless, X&>::type getref(X *x) { return *x;} - template <typename X, typename Y = void *> - typename std::enable_if<std::remove_pointer<X>::type::is_stateless, X&>::type - getref(X &x, Y y = nullptr) + constexpr arena_deleter_base(P *a = nullptr) noexcept + : m_arena(a), m_info({ALIGN ? ALIGN : alignof(T), sizeof(T)} ) { } + + template<typename U, typename = + std::enable_if_t<std::is_convertible_v<U *, T *>>> + constexpr arena_deleter_base(const arena_deleter_base<P, U, ALIGN, false> &rhs) noexcept + : m_arena(rhs.m_arena), m_info(rhs.m_info) { } + + void operator()(T *p) noexcept { - unused_var(y); - return x; + // call destructor + p->~T(); + m_arena->deallocate(p, m_info.alignment, m_info.size); } - constexpr arena_deleter(arena_storage_type a = arena_storage_type()) noexcept - : m_a(a) { } + P *m_arena; + deleter_info_t m_info; + }; - template<typename PU, typename U, typename = typename - std::enable_if<std::is_convertible< U*, T*>::value>::type> - arena_deleter(const arena_deleter<PU, U> &rhs) noexcept : m_a(rhs.m_a) { } + template <typename P, typename T, std::size_t ALIGN> + struct arena_deleter_base<P, T, ALIGN, true> + { + constexpr arena_deleter_base(/*[[maybe_unused]]*/ P *a = nullptr) noexcept + : m_info({ALIGN ? ALIGN : alignof(T), sizeof(T)}) + { + plib::unused_var(a); // GCC 7.x does not like the maybe_unused + } - void operator()(T *p) //const + template<typename U, typename = + std::enable_if_t<std::is_convertible_v<U *, T *>>> + constexpr arena_deleter_base(const arena_deleter_base<P, U, ALIGN, true> &rhs) noexcept + : m_info(rhs.m_info) { - /* call destructor */ + } + + void operator()(T *p) noexcept + { + // call destructor p->~T(); - getref(m_a).deallocate(p); + P::deallocate(p, m_info.alignment, m_info.size); } - //private: - arena_storage_type m_a; + + deleter_info_t m_info; + }; + + + /// + /// \brief alignment aware deleter class + /// + /// The deleter class expects the object to have been allocated with + /// `alignof(T)` alignment if the ALIGN parameter is omitted. If ALIGN is + /// given, this is used. + /// + /// \tparam A Arena type + /// \tparam T Object type + /// \tparam ALIGN alignment + /// + template <typename A, typename T, std::size_t ALIGN = 0> + struct arena_deleter : public arena_deleter_base<A, T, ALIGN, A::has_static_deallocator> + { + using base_type = arena_deleter_base<A, T, ALIGN, A::has_static_deallocator>; + using base_type::base_type; }; //============================================================ @@ -80,27 +128,26 @@ namespace plib { template <typename, typename> friend class owned_ptr; - owned_ptr(pointer p, bool owned) noexcept + owned_ptr(pointer p, bool owned) : m_ptr(p), m_deleter(), m_is_owned(owned) { } - owned_ptr(pointer p, bool owned, D deleter) noexcept - : m_ptr(p), m_deleter(deleter), m_is_owned(owned) + owned_ptr(pointer p, bool owned, D deleter) + : m_ptr(p), m_deleter(std::move(deleter)), m_is_owned(owned) { } owned_ptr(const owned_ptr &r) = delete; owned_ptr & operator =(owned_ptr &r) = delete; - template<typename DC, typename DC_D> - owned_ptr & operator =(owned_ptr<DC, DC_D> &&r) + template <typename DC, typename DC_D> + owned_ptr & operator =(owned_ptr<DC, DC_D> &&r) noexcept { if (m_is_owned && (m_ptr != nullptr)) - //delete m_ptr; m_deleter(m_ptr); m_is_owned = r.m_is_owned; m_ptr = r.m_ptr; - m_deleter = r.m_deleter; + m_deleter = std::move(r.m_deleter); r.m_is_owned = false; r.m_ptr = nullptr; return *this; @@ -108,7 +155,7 @@ namespace plib { owned_ptr(owned_ptr &&r) noexcept : m_ptr(r.m_ptr) - , m_deleter(r.m_deleter) + , m_deleter(std::move(r.m_deleter)) , m_is_owned(r.m_is_owned) { r.m_is_owned = false; @@ -118,7 +165,6 @@ namespace plib { owned_ptr &operator=(owned_ptr &&r) noexcept { if (m_is_owned && (m_ptr != nullptr)) - //delete m_ptr; m_deleter(m_ptr); m_is_owned = r.m_is_owned; m_ptr = r.m_ptr; @@ -131,7 +177,7 @@ namespace plib { template<typename DC, typename DC_D> owned_ptr(owned_ptr<DC, DC_D> &&r) noexcept : m_ptr(static_cast<pointer >(r.get())) - , m_deleter(r.m_deleter) + , m_deleter(std::move(r.m_deleter)) , m_is_owned(r.is_owned()) { r.release(); @@ -148,9 +194,9 @@ namespace plib { m_ptr = nullptr; } - /** - * \brief Return @c true if the stored pointer is not null. - */ + /// + /// \brief Return \c true if the stored pointer is not null. + /// explicit operator bool() const noexcept { return m_ptr != nullptr; } pointer release() @@ -180,73 +226,100 @@ namespace plib { // Arena allocator for use with containers //============================================================ - template <class ARENA, class T, std::size_t ALIGN = alignof(T)> + template <class ARENA, class T, std::size_t ALIGN, bool HSA> class arena_allocator { public: using value_type = T; - static constexpr const std::size_t align_size = ALIGN; + using pointer = T *; + static constexpr const std::size_t align_size = ALIGN ? ALIGN : alignof(T); using arena_type = ARENA; - static_assert(align_size >= alignof(T) && (align_size % alignof(T)) == 0, + static_assert((align_size % alignof(T)) == 0, "ALIGN must be greater than alignof(T) and a multiple"); + template <typename U = int, typename = std::enable_if_t<HSA && sizeof(U)>> + //[[deprecated]] arena_allocator() noexcept : m_a(arena_type::instance()) { } ~arena_allocator() noexcept = default; - arena_allocator(const arena_allocator &rhs) noexcept = default; - arena_allocator& operator=(const arena_allocator&) noexcept = delete; + arena_allocator(const arena_allocator &) = default; + arena_allocator &operator=(const arena_allocator &) = default; + arena_allocator(arena_allocator &&) noexcept = default; + arena_allocator &operator=(arena_allocator &&) noexcept = default; - arena_allocator(arena_allocator&&) noexcept = default; - arena_allocator& operator=(arena_allocator&&) = delete; + template <typename U = int> + arena_allocator(/*[[maybe_unused]]*/ std::enable_if_t<HSA && sizeof(U), arena_type> & a) noexcept + : m_a(arena_type::instance()) + { + plib::unused_var(a); // GCC 7.x does not like the maybe_unused + } - arena_allocator(arena_type & a) noexcept : m_a(a) + template <typename U = int> + arena_allocator(/*[[maybe_unused]]*/ std::enable_if_t<!HSA && sizeof(U), arena_type> & a) noexcept + : m_a(a) { + plib::unused_var(a); // GCC 7.x does not like the maybe_unused } - template <class U> - arena_allocator(const arena_allocator<ARENA, U, ALIGN>& rhs) noexcept + template <class U, typename = std::enable_if_t<!std::is_same_v<T, U>>> + arena_allocator(const arena_allocator<ARENA, U, ALIGN, HSA>& rhs) noexcept : m_a(rhs.m_a) { } - template <class U> struct rebind + template <class U> + struct rebind { - using other = arena_allocator<ARENA, U, ALIGN>; + using other = arena_allocator<ARENA, U, ALIGN, HSA>; }; - T* allocate(std::size_t n) + pointer allocate(std::size_t n) + { + return reinterpret_cast<T *>(m_a.allocate(align_size, sizeof(T) * n)); //NOLINT + } + + void deallocate(pointer p, std::size_t n) noexcept + { + m_a.deallocate(p, align_size, sizeof(T) * n); + } + + template<typename U, typename... Args> + void construct(U* p, Args&&... args) { - return reinterpret_cast<T *>(m_a.allocate(ALIGN, sizeof(T) * n)); + // NOLINTNEXTLINE(cppcoreguidelines-owning-memory) + ::new (void_ptr_cast(p)) U(std::forward<Args>(args)...); } - void deallocate(T* p, std::size_t n) noexcept + template<typename U> + void destroy(U* p) { - unused_var(n); - m_a.deallocate(p); + p->~U(); } - template <class AR1, class T1, std::size_t A1, class AR2, class T2, std::size_t A2> - friend bool operator==(const arena_allocator<AR1, T1, A1>& lhs, - const arena_allocator<AR2, T2, A2>& rhs) noexcept; + template <class AR1, class T1, std::size_t A1, bool HSA1, class AR2, class T2, std::size_t A2, bool HSA2> + friend bool operator==(const arena_allocator<AR1, T1, A1, HSA1>& lhs, // NOLINT + const arena_allocator<AR2, T2, A2, HSA2>& rhs) noexcept; + + template <class AU1, class U1, std::size_t A1, bool HSA1> + friend class arena_allocator; - template <class AU, class U, std::size_t A> friend class arena_allocator; private: arena_type &m_a; }; - template <class AR1, class T1, std::size_t A1, class AR2, class T2, std::size_t A2> - inline bool operator==(const arena_allocator<AR1, T1, A1>& lhs, - const arena_allocator<AR2, T2, A2>& rhs) noexcept + template <class AR1, class T1, std::size_t A1, bool HSA1, class AR2, class T2, std::size_t A2, bool HSA2> + inline bool operator==(const arena_allocator<AR1, T1, A1, HSA1>& lhs, + const arena_allocator<AR2, T2, A2, HSA2>& rhs) noexcept { return A1 == A2 && rhs.m_a == lhs.m_a; } - template <class AR1, class T1, std::size_t A1, class AR2, class T2, std::size_t A2> - inline bool operator!=(const arena_allocator<AR1, T1, A1>& lhs, - const arena_allocator<AR2, T2, A2>& rhs) noexcept + template <class AR1, class T1, std::size_t A1, bool HSA1,class AR2, class T2, std::size_t A2, bool HSA2> + inline bool operator!=(const arena_allocator<AR1, T1, A1, HSA1>& lhs, + const arena_allocator<AR2, T2, A2, HSA2>& rhs) noexcept { return !(lhs == rhs); } @@ -255,140 +328,376 @@ namespace plib { // Memory allocation //============================================================ - struct aligned_arena + //template <typename P, std::size_t MINALIGN, bool HSD, bool HSA> + //struct arena_base; + + template <typename P, std::size_t MINALIGN, bool HSD, bool HSA> + struct arena_core { - static constexpr const bool is_stateless = true; - template <class T, std::size_t ALIGN = alignof(T)> - using allocator_type = arena_allocator<aligned_arena, T, ALIGN>; + static constexpr const bool has_static_deallocator = HSD; + static constexpr const bool has_static_allocator = HSA; + static constexpr const std::size_t min_align = MINALIGN; + using size_type = std::size_t; + + template <class T, size_type ALIGN = 0> + using allocator_type = arena_allocator<P, T, (ALIGN < MINALIGN) ? MINALIGN : ALIGN, HSA>; + + template <class T, size_type ALIGN = 0> + using deleter_type = arena_deleter<P, T, (ALIGN < MINALIGN) ? MINALIGN : ALIGN>; + + template <typename T, size_type ALIGN = 0> + using unique_ptr = std::unique_ptr<T, deleter_type<T, (ALIGN < MINALIGN) ? MINALIGN : ALIGN>>; - template <typename T> - using owned_pool_ptr = plib::owned_ptr<T, arena_deleter<aligned_arena, T>>; + template <typename T, size_type ALIGN = 0> + using owned_ptr = plib::owned_ptr<T, deleter_type<T, (ALIGN < MINALIGN) ? MINALIGN : ALIGN>>; - static inline aligned_arena &instance() + static P &instance() noexcept; + + template <class T, size_type ALIGN = 0> + allocator_type<T, ALIGN> get_allocator() { - static aligned_arena s_arena; - return s_arena; + return *static_cast<P *>(this); } - static inline void *allocate( size_t alignment, size_t size ) + protected: + size_t m_stat_cur_alloc = 0; + size_t m_stat_max_alloc = 0; + + }; + + template <typename P, std::size_t MINALIGN, bool HSD, bool HSA> + inline P & arena_core<P, MINALIGN, HSD, HSA>::instance() noexcept + { + static P s_arena; + return s_arena; + } + + template <typename P, std::size_t MINALIGN, bool HSD, bool HSA> + struct arena_base : public arena_core<P, MINALIGN, HSD, HSA> + { + using base_type = arena_core<P, MINALIGN, HSD, HSA>; + using size_type = typename base_type::size_type; + + ~arena_base() { - #if (USE_ALIGNED_ALLOCATION) - #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) - return _aligned_malloc(size, alignment); - #elif defined(__APPLE__) - void* p; - if (::posix_memalign(&p, alignment, size) != 0) { - p = nullptr; - } - return p; - #else - return aligned_alloc(alignment, size); - #endif - #else - unused_var(alignment); - return ::operator new(size); - #endif + //printf("%s %lu %lu %lu\n", typeid(*this).name(), MINALIGN, cur_alloc(), max_alloc()); } - static inline void deallocate( void *ptr ) + static size_type cur_alloc() noexcept { return base_type::instance().m_stat_cur_alloc; } + static size_type max_alloc() noexcept { return base_type::instance().m_stat_max_alloc; } + + static inline void inc_alloc_stat(size_type size) { - #if (USE_ALIGNED_ALLOCATION) + auto &i = base_type::instance(); + i.m_stat_cur_alloc += size; + if (i.m_stat_max_alloc <i.m_stat_cur_alloc) + i.m_stat_max_alloc = i.m_stat_cur_alloc; + } + static inline void dec_alloc_stat(size_type size) + { + base_type::instance().m_stat_cur_alloc -= size; + } + }; + + template <typename P, std::size_t MINALIGN> + struct arena_base<P, MINALIGN, false, false> : public arena_core<P, MINALIGN, false, false> + { + using size_type = typename arena_core<P, MINALIGN, false, false>::size_type; + + ~arena_base() + { + //printf("%s %lu %lu %lu\n", typeid(*this).name(), MINALIGN, cur_alloc(), max_alloc()); + } + + size_type cur_alloc() const noexcept { return this->m_stat_cur_alloc; } + size_type max_alloc() const noexcept { return this->m_stat_max_alloc; } + + inline void inc_alloc_stat(size_type size) + { + this->m_stat_cur_alloc += size; + if (this->m_stat_max_alloc < this->m_stat_cur_alloc) + this->m_stat_max_alloc = this->m_stat_cur_alloc; + } + inline void dec_alloc_stat(size_type size) + { + this->m_stat_cur_alloc -= size; + } + }; + + template <std::size_t MINALIGN> + struct aligned_arena : public arena_base<aligned_arena<MINALIGN>, MINALIGN, true, true> + { + using base_type = arena_base<aligned_arena<MINALIGN>, MINALIGN, true, true>; + + static inline gsl::owner<void *> allocate( size_t alignment, size_t size ) + { + base_type::inc_alloc_stat(size); +#if 0 + #if (PUSE_ALIGNED_ALLOCATION) + #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) + return _aligned_malloc(size, alignment); + #elif defined(__APPLE__) || defined(__ANDROID__) + void* p; + if (::posix_memalign(&p, alignment, size) != 0) { + p = nullptr; + } + return p; + #else + // see https://en.cppreference.com/w/c/memory/aligned_alloc + size = ((size + alignment - 1) / alignment) * alignment; + return static_cast<gsl::owner<void *>>(aligned_alloc(alignment, size)); + #endif + #else + unused_var(alignment); + return ::operator new(size); + #endif +#else + return ::operator new(size, std::align_val_t(alignment)); +#endif + } + + static inline void deallocate(gsl::owner<void *> ptr, [[maybe_unused]] size_t alignment, size_t size ) noexcept + { + //unused_var(size); + base_type::dec_alloc_stat(size); +#if 0 + #if (PUSE_ALIGNED_ALLOCATION) + #if defined(_WIN32) || defined(_WIN64) || defined(_MSC_VER) // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) - free(ptr); + _aligned_free(ptr); + #else + // NOLINTNEXTLINE(cppcoreguidelines-no-malloc) + ::free(ptr); + #endif #else ::operator delete(ptr); #endif +#else + ::operator delete(ptr, std::align_val_t(alignment)); +#endif } -#if 0 - template<typename T, typename... Args> - owned_pool_ptr<T> make_poolptr(Args&&... args) + bool operator ==([[maybe_unused]] const aligned_arena &rhs) const noexcept { - auto *mem = allocate(alignof(T), sizeof(T)); - return owned_pool_ptr<T>(new (mem) T(std::forward<Args>(args)...), true, arena_deleter<aligned_arena, T>(*this)); + return true; } -#endif - template<typename T, typename... Args> - owned_pool_ptr<T> make_poolptr(Args&&... args) + + }; + + struct std_arena : public arena_base<std_arena, 0, true, true> + { + static inline void *allocate(size_t alignment, size_t size ) { - auto *mem = allocate(alignof(T), sizeof(T)); + inc_alloc_stat(size); + return ::operator new(size, static_cast<std::align_val_t>(alignment)); + } + + static inline void deallocate( void *ptr, size_t alignment, size_t size ) noexcept + { + dec_alloc_stat(size); + ::operator delete(ptr, static_cast<std::align_val_t>(alignment)); + } + + bool operator ==([[maybe_unused]] const std_arena &rhs) const noexcept + { + return true; + } + }; + + namespace detail + { + /// + /// \brief Create new object T with an aligned memory + /// + /// The create object can be deallocate using \ref free or + /// using the arena_deleter type. This is the specialization for arenas + /// which have no state. + /// + /// \tparam T Object type + /// \tparam ALIGN Alignment of object to be created. If ALIGN equals 0, alignof(T) is used. + /// \tparam ARENA Arena type + /// \tparam Args Argument types + /// + /// \param args Arguments to be passed to constructor + /// + template<typename T, std::size_t ALIGN, typename ARENA, typename... Args> + static inline T * alloc(Args&&... args) + { + //using alloc_type = typename ARENA :: template allocator_type<T, alignof(T)>; + auto *mem = ARENA::allocate(ALIGN ? ALIGN : alignof(T), sizeof(T)); try { - auto *mema = new (mem) T(std::forward<Args>(args)...); - return owned_pool_ptr<T>(mema, true, arena_deleter<aligned_arena, T>(*this)); + // NOLINTNEXTLINE(cppcoreguidelines-owning-memory) + return new (mem) T(std::forward<Args>(args)...); } catch (...) { - deallocate(mem); + ARENA::deallocate(mem, ALIGN ? ALIGN : alignof(T), sizeof(T)); throw; } } - }; - - template <typename T, std::size_t ALIGN> - /*inline */ C14CONSTEXPR T *assume_aligned_ptr(T *p) noexcept - { - static_assert(ALIGN >= alignof(T), "Alignment must be greater or equal to alignof(T)"); - static_assert(is_pow2(ALIGN), "Alignment must be a power of 2"); - //auto t = reinterpret_cast<std::uintptr_t>(p); - //if (t & (ALIGN-1)) - // printf("alignment error!"); -#if (USE_ALIGNED_HINTS) - return reinterpret_cast<T *>(__builtin_assume_aligned(p, ALIGN)); -#else - return p; -#endif - } + template<std::size_t ALIGN, typename ARENA, typename T> + static inline void free(T *ptr) noexcept + { + ptr->~T(); + ARENA::deallocate(ptr, ALIGN ? ALIGN : alignof(T), sizeof(T)); + } - template <typename T, std::size_t ALIGN> - constexpr const T *assume_aligned_ptr(const T *p) noexcept - { - static_assert(ALIGN >= alignof(T), "Alignment must be greater or equal to alignof(T)"); - static_assert(is_pow2(ALIGN), "Alignment must be a power of 2"); -#if (USE_ALIGNED_HINTS) - return reinterpret_cast<const T *>(__builtin_assume_aligned(p, ALIGN)); -#else - return p; -#endif - } + /// + /// \brief Create new object T with an aligned memory + /// + /// The create object can be deallocate using \ref free or + /// using the arena_deleter type. This is the specialization for arenas + /// which do have state. + /// + /// \tparam T Object type + /// \tparam ALIGN Alignment of object to be created. If ALIGN equals 0, alignof(T) is used. + /// \tparam ARENA Arena type + /// \tparam Args Argument types + /// + /// \param arena Arena to provide memory + /// \param args Arguments to be passed to constructor + /// + template<typename T, std::size_t ALIGN, typename ARENA, typename... Args> + static inline T * alloc(ARENA &arena, Args&&... args) + { + auto *mem = arena.allocate(ALIGN ? ALIGN : alignof(T), sizeof(T)); + try + { + // NOLINTNEXTLINE(cppcoreguidelines-owning-memory) + return new (mem) T(std::forward<Args>(args)...); + } + catch (...) + { + arena.deallocate(mem, ALIGN ? ALIGN : alignof(T), sizeof(T)); + throw; + } + } - // FIXME: remove - template<typename T, typename... Args> - inline T *pnew(Args&&... args) + template<std::size_t ALIGN, typename ARENA, typename T> + static inline void free(ARENA &arena, T *ptr) noexcept + { + ptr->~T(); + arena.deallocate(ptr, ALIGN ? ALIGN : alignof(T), sizeof(T)); + } + } // namespace detail + + + /// + /// \brief Create new alignment and size aware std::unique_ptr + /// + /// `make_unique` creates a new shared pointer to the object it creates. + /// These version ensure that on deallocation the correct alignment and + /// size is used. Should the unique_ptr be down casted the deleter objects + /// used here track the size and alignment of the object created. + /// + /// std::standard_delete will use size and alignment of the base class. + /// + /// This function is deprecated since it hides the use of arenas. + /// + /// \tparam T Object type + /// \tparam ARENA Arena type + /// \tparam ALIGN Alignment of object to be created. If ALIGN equals 0, alignof(T) is used. + /// \tparam Args Argument types + /// + /// \param args Arguments to be passed to constructor + /// + template<typename T, typename ARENA, std::size_t ALIGN = 0, typename... Args> + //[[deprecated]] + std::enable_if_t<ARENA::has_static_allocator, typename ARENA::template unique_ptr<T, ALIGN>> + make_unique(Args&&... args) { - auto *p = aligned_arena::allocate(alignof(T), sizeof(T)); - return new(p) T(std::forward<Args>(args)...); + using up_type = typename ARENA::template unique_ptr<T, ALIGN>; + using deleter_type = typename ARENA::template deleter_type<T, ALIGN>; + auto *mem = detail::alloc<T, ALIGN, ARENA>(std::forward<Args>(args)...); + return up_type(mem, deleter_type()); } - template<typename T> - inline void pdelete(T *ptr) + /// + /// \brief Create new alignment and size aware std::unique_ptr + /// + /// `make_unique` creates a new shared pointer to the object it creates. + /// These version ensure that on deallocation the correct alignment and + /// size is used. Should the unique_ptr be down casted the deleter objects + /// used here track the size and alignment of the object created. + /// + /// std::standard_delete will use size and alignment of the base class. + /// + /// \tparam T Object type + /// \tparam ARENA Arena type + /// \tparam ALIGN Alignment of object to be created. If ALIGN equals 0, alignof(T) is used. + /// \tparam Args Argument types + /// + /// \param arena Arena to provide memory + /// \param args Arguments to be passed to constructor + /// + template<typename T, typename ARENA, std::size_t ALIGN = 0, typename... Args> + typename ARENA::template unique_ptr<T, ALIGN> + make_unique(ARENA &arena, Args&&... args) { - ptr->~T(); - aligned_arena::deallocate(ptr); + using up_type = typename ARENA::template unique_ptr<T, ALIGN>; + using deleter_type = typename ARENA::template deleter_type<T, ALIGN>; + auto *mem = detail::alloc<T, ALIGN>(arena, std::forward<Args>(args)...); + return up_type(mem, deleter_type(&arena)); } - - template <typename T> - using unique_ptr = std::unique_ptr<T, arena_deleter<aligned_arena, T>>; - - template<typename T, typename... Args> - plib::unique_ptr<T> make_unique(Args&&... args) + /// + /// \brief Create new alignment and size aware plib::owned_ptr + /// + /// `make_unique` creates a new shared pointer to the object it creates. + /// These version ensure that on deallocation the correct alignment and + /// size is used. Should the unique_ptr be down casted the deleter objects + /// used here track the size and alignment of the object created. + /// + /// std::standard_delete will use size and alignment of the base class. + /// + /// This function is deprecated since it hides the use of arenas. + /// + /// \tparam T Object type + /// \tparam ARENA Arena type + /// \tparam ALIGN Alignment of object to be created. If ALIGN equals 0, alignof(T) is used. + /// \tparam Args Argument types + /// + /// \param args Arguments to be passed to constructor + /// + template<typename T, typename ARENA, std::size_t ALIGN = 0, typename... Args> + //[[deprecated]] + std::enable_if_t<ARENA::has_static_allocator, typename ARENA::template owned_ptr<T, ALIGN>> + make_owned(Args&&... args) { - return plib::unique_ptr<T>(pnew<T>(std::forward<Args>(args)...)); + using op_type = typename ARENA::template owned_ptr<T, ALIGN>; + using deleter_type = typename ARENA::template deleter_type<T, ALIGN>; + auto *mem = detail::alloc<T, ALIGN, ARENA>(std::forward<Args>(args)...); + return op_type(mem, true, deleter_type()); } -#if 0 - template<typename T, typename... Args> - static owned_ptr<T> make_owned(Args&&... args) + /// + /// \brief Create new alignment and size aware plib::owned_ptr + /// + /// `make_unique` creates a new shared pointer to the object it creates. + /// These version ensure that on deallocation the correct alignment and + /// size is used. Should the unique_ptr be down casted the deleter objects + /// used here track the size and alignment of the object created. + /// + /// std::standard_delete will use size and alignment of the base class. + /// + /// \tparam T Object type + /// \tparam ARENA Arena type + /// \tparam ALIGN Alignment of object to be created. If ALIGN equals 0, alignof(T) is used. + /// \tparam Args Argument types + /// + /// \param arena Arena to provide memory + /// \param args Arguments to be passed to constructor + /// + template<typename T, typename ARENA, std::size_t ALIGN = 0, typename... Args> + typename ARENA::template owned_ptr<T> make_owned(ARENA &arena, Args&&... args) { - return owned_ptr<T>(pnew<T>(std::forward<Args>(args)...), true); + using op_type = typename ARENA::template owned_ptr<T, ALIGN>; + using deleter_type = typename ARENA::template deleter_type<T, ALIGN>; + auto *mem = detail::alloc<T, ALIGN>(arena, std::forward<Args>(args)...); + return op_type(mem, true, deleter_type(&arena)); } -#endif - - - template <class T, std::size_t ALIGN = alignof(T)> - using aligned_allocator = aligned_arena::allocator_type<T, ALIGN>; //============================================================ // traits to determine alignment size and stride size @@ -397,55 +706,103 @@ namespace plib { PDEFINE_HAS_MEMBER(has_align, align_size); - template <typename T, typename X = void> - struct align_traits + template <typename T, bool X> + struct align_traits_base { + static_assert(!has_align<T>::value, "no align"); static constexpr const std::size_t align_size = alignof(std::max_align_t); static constexpr const std::size_t value_size = sizeof(typename T::value_type); static constexpr const std::size_t stride_size = lcm(align_size, value_size) / value_size; }; template <typename T> - struct align_traits<T, typename std::enable_if<has_align<T>::value, void>::type> + struct align_traits_base<T, true> { + static_assert(has_align<T>::value, "no align"); static constexpr const std::size_t align_size = T::align_size; static constexpr const std::size_t value_size = sizeof(typename T::value_type); static constexpr const std::size_t stride_size = lcm(align_size, value_size) / value_size; }; - //============================================================ - // Aligned vector - //============================================================ - - // FIXME: needs a separate file - template <class T, std::size_t ALIGN = alignof(T)> - class aligned_vector : public std::vector<T, aligned_allocator<T, ALIGN>> + template <typename T> + struct align_traits : public align_traits_base<T, has_align<T>::value> + {}; + + /// + /// \brief Force BASEARENA to align memory allocations on page boundaries + /// + /// \tparam BASEARENA The base arena to use (optional, defaults to aligned_arena) + /// \tparam PG_SIZE The page size to use (optional, defaults to 1024) + /// + template <template<std::size_t> class BASEARENA = aligned_arena, std::size_t PG_SIZE = 1024> + using paged_arena = BASEARENA<PG_SIZE>; + + /// + /// \brief Helper class to create arena versions of standard library sequences + /// + /// \ref arena_vector on how to use this class + /// + /// \tparam A Arena typeThe base arena to use (optional, defaults to aligned_arena) + /// \tparam T Object type of objects in sequence + /// \tparam S Sequence, e.g. std::vector, std::list + /// \tparam ALIGN Alignment to use + /// + template <typename A, typename T, template <typename, typename> class S, std::size_t ALIGN = PALIGN_VECTOROPT> + class arena_sequence : public S<T, typename A::template allocator_type<T, ALIGN>> { public: - using base = std::vector<T, aligned_allocator<T, ALIGN>>; + using arena_allocator_type = typename A::template allocator_type<T, ALIGN>; + using arena_sequence_base = S<T, arena_allocator_type>; + using arena_sequence_base::arena_sequence_base; - using reference = typename base::reference; - using const_reference = typename base::const_reference; - using pointer = typename base::pointer; - using const_pointer = typename base::const_pointer; - using size_type = typename base::size_type; + using size_type = typename arena_sequence_base::size_type; - using base::base; - - C14CONSTEXPR reference operator[](size_type i) noexcept + arena_sequence(A &arena) + : arena_sequence_base(seq_alloc(arena)) { - return assume_aligned_ptr<T, ALIGN>(&(base::operator[](0)))[i]; } - constexpr const_reference operator[](size_type i) const noexcept + + arena_sequence(A &arena, size_type n) + : arena_sequence_base(n, seq_alloc(arena)) { - return assume_aligned_ptr<T, ALIGN>(&(base::operator[](0)))[i]; } - pointer data() noexcept { return assume_aligned_ptr<T, ALIGN>(base::data()); } - const_pointer data() const noexcept { return assume_aligned_ptr<T, ALIGN>(base::data()); } + private: + arena_allocator_type seq_alloc(A &arena) const { return arena.template get_allocator<T, ALIGN>(); } + }; + + /// + /// \brief Vector with arena allocations + /// + /// The Vector allocation will use the arena of type A of which an instance + /// has to be passed to the constructor. Should the minimum alignment exceed + /// the object size, min_align / sizeof(T) elements are reserved. + /// + /// \tparam A Arena type + /// \tparam T Object type of objects in sequence + /// \tparam ALIGN Alignment to use + /// + template <typename A, typename T, std::size_t ALIGN = PALIGN_VECTOROPT> + class arena_vector : public arena_sequence<A, T, std::vector, ALIGN> + { + public: + using arena_vector_base = arena_sequence<A, T, std::vector, ALIGN>; + using arena_vector_base::arena_vector_base; + + /// + /// \brief Constructor + /// + /// \param arena Arena instance to use + /// + arena_vector(A &arena) + : arena_vector_base(arena) + { + if (A::min_align / sizeof(T) > 0) + this->reserve(A::min_align / sizeof(T)); + } }; } // namespace plib -#endif /* PALLOC_H_ */ +#endif // PALLOC_H_ diff --git a/src/lib/netlist/plib/parray.h b/src/lib/netlist/plib/parray.h index 1be37b908cd..94bb424998c 100644 --- a/src/lib/netlist/plib/parray.h +++ b/src/lib/netlist/plib/parray.h @@ -1,126 +1,183 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * parray.h - * - */ #ifndef PARRAY_H_ #define PARRAY_H_ +/// +/// \file parray.h +/// + #include "palloc.h" #include "pconfig.h" #include "pexception.h" +#include "pfmtlog.h" #include <array> #include <memory> +#include <string> #include <type_traits> #include <utility> #include <vector> namespace plib { - template <typename FT, int SIZE> - struct sizeabs + template <typename FT, int SIZE, typename ARENA> + struct parray_traits { - static constexpr std::size_t ABS() { return (SIZE < 0) ? static_cast<std::size_t>(0 - SIZE) : static_cast<std::size_t>(SIZE); } + static constexpr std::size_t ABS() noexcept { return (SIZE < 0) ? narrow_cast<std::size_t>(0 - SIZE) : narrow_cast<std::size_t>(SIZE); } using container = typename std::array<FT, ABS()> ; }; - template <typename FT> - struct sizeabs<FT, 0> + template <typename FT, typename ARENA> + struct parray_traits<FT, 0, ARENA> { - static constexpr const std::size_t ABS = 0; - using container = typename std::vector<FT, aligned_allocator<FT, PALIGN_VECTOROPT>>; + static constexpr std::size_t ABS() noexcept { return 0; } + using allocator_type = typename ARENA::template allocator_type<FT, PALIGN_VECTOROPT>; + //using container = typename std::vector<FT, arena_allocator<mempool, FT, 64>>; + using container = typename std::vector<FT, allocator_type>; }; - /** - * \brief Array with preallocated or dynamic allocation - * - * Passing SIZE > 0 has the same functionality as a std::array. - * SIZE = 0 is pure dynamic allocation, the actual array size is passed to the - * constructor. - * SIZE < 0 reserves std::abs(SIZE) elements statically in place allocated. The - * actual size is passed in by the constructor. - * This array is purely intended for HPC application where depending on the - * architecture a preference dynamic/static has to be made. - * - * This struct is not intended to be a full replacement to std::array. - * It is a subset to enable switching between dynamic and static allocation. - * I consider > 10% performance difference to be a use case. - */ - - template <typename FT, int SIZE> + /// \brief Array with preallocated or dynamic allocation. + /// + /// Passing SIZE > 0 has the same functionality as a std::array. + /// SIZE = 0 is pure dynamic allocation, the actual array size is passed to the + /// constructor. + /// SIZE < 0 reserves abs(SIZE) elements statically in place allocated. The + /// actual size is passed in by the constructor. + /// This array is purely intended for HPC application where depending on the + /// architecture a preference dynamic/static has to be made. + /// + /// This struct is not intended to be a full replacement to std::array. + /// It is a subset to enable switching between dynamic and static allocation. + /// I consider > 10% performance difference to be a use case. + /// + + template <typename FT, int SIZE, typename ARENA = aligned_arena<>> struct parray { public: - static constexpr std::size_t SIZEABS() { return sizeabs<FT, SIZE>::ABS(); } + static constexpr std::size_t SIZEABS() noexcept { return parray_traits<FT, SIZE, ARENA>::ABS(); } - using base_type = typename sizeabs<FT, SIZE>::container; + using base_type = typename parray_traits<FT, SIZE, ARENA>::container; using size_type = typename base_type::size_type; - using reference = typename base_type::reference; - using const_reference = typename base_type::const_reference; - using value_type = typename base_type::value_type; + using value_type = FT; + using reference = FT &; + using const_reference = const FT &; + + using pointer = FT *; + using const_pointer = const FT *; template <int X = SIZE > - parray(size_type size, typename std::enable_if<X==0, int>::type = 0) + parray(size_type size, std::enable_if_t<(X==0), int> = 0) : m_a(size), m_size(size) { } -#if 1 - /* allow construction in fixed size arrays */ template <int X = SIZE > - parray(typename std::enable_if<(X > 0), int>::type = 0) - : m_size(X) + parray(size_type size, const FT &val, std::enable_if_t<(X==0), int> = 0) + : m_a(size, val), m_size(size) { } -#endif + template <int X = SIZE > - parray(size_type size, typename std::enable_if<X!=0, int>::type = 0) + parray(size_type size, std::enable_if_t<(X != 0), int> = 0) noexcept(false) : m_size(size) { - if (SIZE < 0 && size > SIZEABS()) - throw plib::pexception("parray: size error " + plib::to_string(size) + ">" + plib::to_string(SIZEABS())); - else if (SIZE > 0 && size != SIZEABS()) - throw plib::pexception("parray: size error"); + if ((SIZE < 0 && size > SIZEABS()) + || (SIZE > 0 && size != SIZEABS())) + throw pexception(pfmt("parray: size error: {1} > {2}")(size, SIZE)); } - inline size_type size() const noexcept { return SIZE <= 0 ? m_size : SIZEABS(); } - - constexpr size_type max_size() const noexcept { return base_type::max_size(); } + template <int X = SIZE > + parray(size_type size, const FT &val, std::enable_if_t<(X != 0), int> = 0) noexcept(false) + : m_size(size) + { + if ((SIZE < 0 && size > SIZEABS()) + || (SIZE > 0 && size != SIZEABS())) + throw pexception(pfmt("parray: size error: {1} > {2}")(size, SIZE)); + m_a.fill(val); + } - bool empty() const noexcept { return size() == 0; } -#if 0 - reference operator[](size_type i) /*noexcept*/ + // allow construction in fixed size arrays + parray() + : m_size(SIZEABS()) { - if (i >= m_size) throw plib::pexception("limits error " + to_string(i) + ">=" + to_string(m_size)); - return m_a[i]; } - const_reference operator[](size_type i) const /*noexcept*/ + + parray(const parray &rhs) : m_a(rhs.m_a), m_size(rhs.m_size) {} + parray(parray &&rhs) noexcept : m_a(std::move(rhs.m_a)), m_size(std::move(rhs.m_size)) {} + + parray &operator=(const parray &rhs) noexcept // NOLINT(bugprone-unhandled-self-assignment, cert-oop54-cpp) { - if (i >= m_size) throw plib::pexception("limits error " + to_string(i) + ">=" + to_string(m_size)); - return m_a[i]; + if (this == &rhs) + return *this; + + m_a = rhs.m_a; + m_size = rhs.m_size; + return *this; } -#else - C14CONSTEXPR reference operator[](size_type i) noexcept + + parray &operator=(parray &&rhs) noexcept { std::swap(m_a,rhs.m_a); std::swap(m_size, rhs.m_size); return *this; } + + ~parray() noexcept = default; + + constexpr base_type &as_base() noexcept { return m_a; } + + constexpr size_type size() const noexcept { return SIZE <= 0 ? m_size : SIZEABS(); } + + constexpr size_type max_size() const noexcept { return base_type::max_size(); } + + constexpr bool empty() const noexcept { return size() == 0; } + + constexpr reference operator[](size_type i) noexcept { - return assume_aligned_ptr<FT, PALIGN_VECTOROPT>(&m_a[0])[i]; + return m_a[i]; } constexpr const_reference operator[](size_type i) const noexcept { - return assume_aligned_ptr<FT, PALIGN_VECTOROPT>(&m_a[0])[i]; + return m_a[i]; } -#endif - FT * data() noexcept { return assume_aligned_ptr<FT, PALIGN_VECTOROPT>(m_a.data()); } - const FT * data() const noexcept { return assume_aligned_ptr<FT, PALIGN_VECTOROPT>(m_a.data()); } + + constexpr pointer data() noexcept { return m_a.data(); } + constexpr const_pointer data() const noexcept { return m_a.data(); } private: PALIGNAS_VECTOROPT() base_type m_a; size_type m_size; }; + + template <typename FT, int SIZE1, int SIZE2> + struct parray2D : public parray<parray<FT, SIZE2>, SIZE1> + { + public: + + using size_type = std::size_t; + using base_type = parray<parray<FT, SIZE2>, SIZE1>; + + parray2D(size_type size1, size_type size2) + : parray<parray<FT, SIZE2>, SIZE1>(size1) + { + if (SIZE2 <= 0) + { + for (size_type i=0; i < this->size(); i++) + (*this)[i] = parray<FT, SIZE2>(size2); + } + } + + parray2D(const parray2D &) = default; + parray2D &operator=(const parray2D &) = default; + parray2D(parray2D &&) noexcept(std::is_nothrow_move_constructible<base_type>::value) = default; + parray2D &operator=(parray2D &&) noexcept(std::is_nothrow_move_assignable<base_type>::value) = default; + + ~parray2D() noexcept = default; + + }; + } // namespace plib -#endif /* PARRAY_H_ */ + + +#endif // PARRAY_H_ diff --git a/src/lib/netlist/plib/pchrono.cpp b/src/lib/netlist/plib/pchrono.cpp deleted file mode 100644 index f89df7dba07..00000000000 --- a/src/lib/netlist/plib/pchrono.cpp +++ /dev/null @@ -1,51 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud - -#include "pchrono.h" - -namespace plib { -namespace chrono { -#if defined(__x86_64__) && !defined(_clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)) - -fast_ticks::type fast_ticks::per_second() -{ - static type persec = 0; - if (persec == 0) - { - type x = 0; - system_ticks::type t = system_ticks::start(); - system_ticks::type e; - x = -start(); - do { - e = system_ticks::stop(); - } while (e - t < system_ticks::per_second() / 100 ); - x += stop(); - persec = (type)(double)((double) x * (double) system_ticks::per_second() / double (e - t)); - } - return persec; -} - -#if PUSE_ACCURATE_STATS && PHAS_RDTSCP -exact_ticks::type exact_ticks::per_second() -{ - static type persec = 0; - if (persec == 0) - { - type x = 0; - system_ticks::type t = system_ticks::start(); - system_ticks::type e; - x = -start(); - do { - e = system_ticks::stop(); - } while (e - t < system_ticks::per_second() / 100 ); - x += stop(); - persec = (type)(double)((double) x * (double) system_ticks::per_second() / double (e - t)); - } - return persec; -} -#endif - -#endif - -} // namespace chrono -} // namespace plib diff --git a/src/lib/netlist/plib/pchrono.h b/src/lib/netlist/plib/pchrono.h index 711e8908dfd..1c2e4b13057 100644 --- a/src/lib/netlist/plib/pchrono.h +++ b/src/lib/netlist/plib/pchrono.h @@ -1,239 +1,278 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pchrono.h - * - */ #ifndef PCHRONO_H_ #define PCHRONO_H_ +/// +/// \file pchrono.h +/// + #include "pconfig.h" +#include "pgsl.h" #include "ptypes.h" #include <chrono> -//#include <cstdint> namespace plib { -namespace chrono { - template <typename T> - struct sys_ticks - { - using type = typename T::rep; - static inline type start() { return T::now().time_since_epoch().count(); } - static inline type stop() { return T::now().time_since_epoch().count(); } - static inline constexpr type per_second() { return T::period::den / T::period::num; } - }; - - using hires_ticks = sys_ticks<std::chrono::high_resolution_clock>; - using steady_ticks = sys_ticks<std::chrono::steady_clock>; - using system_ticks = sys_ticks<std::chrono::system_clock>; - - #if defined(__x86_64__) && !defined(_clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)) - - #if PHAS_RDTSCP - struct fast_ticks - { - typedef int64_t type; - static inline type start() - { - int64_t v; - __asm__ __volatile__ ( - "rdtscp;" - "shl $32, %%rdx;" - "or %%rdx, %%rax;" - : "=a"(v) /* outputs */ - : /* inputs */ - : "%rcx", "%rdx" /* clobbers */ - ); - return v; - } - static inline type stop() - { - return start(); - } - static type per_second(); - }; - - #else - struct fast_ticks - { - typedef int64_t type; - static inline type start() + namespace chrono { + template <typename T> + struct sys_ticks { - int64_t v; - __asm__ __volatile__ ( - "rdtsc;" - "shl $32, %%rdx;" - "or %%rdx, %%rax;" - : "=a"(v) /* outputs */ - : /* inputs */ - : "%rdx" /* clobbers */ - ); - return v; - } - static inline type stop() + using type = typename T::rep; + static constexpr type start() noexcept { return T::now().time_since_epoch().count(); } + static constexpr type stop() noexcept { return T::now().time_since_epoch().count(); } + static constexpr type per_second() noexcept { return T::period::den / T::period::num; } + }; + + using hires_ticks = sys_ticks<std::chrono::high_resolution_clock>; + using steady_ticks = sys_ticks<std::chrono::steady_clock>; + using system_ticks = sys_ticks<std::chrono::system_clock>; + + #if defined(__x86_64__) && !defined(_clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)) + + template <typename T, typename R> + struct base_ticks { - return start(); - } - static type per_second(); - }; - - #endif - - - /* Based on "How to Benchmark Code Execution Times on Intel?? IA-32 and IA-64 - * Instruction Set Architectures", Intel, 2010 - * - */ - #if PUSE_ACCURATE_STATS && PHAS_RDTSCP - /* - * kills performance completely, but is accurate - * cpuid serializes, but clobbers ebx and ecx - * - */ - - struct exact_ticks - { - typedef int64_t type; - - static inline type start() + using ret_type = R; + static ret_type per_second() noexcept + { + static ret_type per_second = 0; + if (per_second == 0) + { + ret_type x = 0; + system_ticks::type t = system_ticks::start(); + system_ticks::type e; + x = - T :: start(); + do { + e = system_ticks::stop(); + } while (e - t < system_ticks::per_second() / 100 ); + x += T :: stop(); + per_second = (ret_type)(double)((double) x * (double) system_ticks::per_second() / double (e - t)); + } + return per_second; + } + }; + + + #if PHAS_RDTSCP + struct fast_ticks : public base_ticks<fast_ticks, int64_t> { - int64_t v; - __asm__ __volatile__ ( - "cpuid;" - //"xor %%eax, %%eax\n\t" - "rdtsc;" - "shl $32, %%rdx;" - "or %%rdx, %%rax;" - : "=a"(v) /* outputs */ - : "a"(0x0) /* inputs */ - : "%ebx", "%ecx", "%rdx" /* clobbers*/ - ); - return v; - } - static inline type stop() + typedef int64_t type; + static inline type start() noexcept + { + int64_t v; + __asm__ __volatile__ ( + "rdtscp;" + "shl $32, %%rdx;" + "or %%rdx, %%rax;" + : "=a"(v) // outputs + : // inputs + : "%rcx", "%rdx" // clobbers + ); + return v; + } + static inline type stop() noexcept + { + return start(); + } + }; + + #else + struct fast_ticks : public base_ticks<fast_ticks, int64_t> { - int64_t v; - __asm__ __volatile__ ( - "rdtscp;" - "shl $32, %%rdx;" - "or %%rax, %%rdx;" - "mov %%rdx, %%r10;" - "xor %%eax, %%eax\n\t" - "cpuid;" - "mov %%r10, %%rax;" - : "=a" (v) - : - : "%ebx", "%ecx", "%rdx", "%r10" - ); - return v; - } - - static type per_second(); - }; - #else - using exact_ticks = fast_ticks; - #endif - - - #else - using fast_ticks = hires_ticks; - using exact_ticks = fast_ticks; - #endif - - template<bool enabled_> - struct counter - { - counter() : m_count(0) { } - using type = uint_least64_t; - type operator()() const { return m_count; } - void inc() { ++m_count; } - void reset() { m_count = 0; } - constexpr static bool enabled = enabled_; - private: - type m_count; - }; - - template<> - struct counter<false> - { - using type = uint_least64_t; - constexpr type operator()() const { return 0; } - void inc() const { } - void reset() const { } - constexpr static bool enabled = false; - }; - - - template< typename T, bool enabled_ = true> - struct timer - { - using type = typename T::type; - using ctype = uint_least64_t; - constexpr static bool enabled = enabled_; - - struct guard_t + typedef int64_t type; + static inline type start() noexcept + { + int64_t v; + __asm__ __volatile__ ( + "rdtsc;" + "shl $32, %%rdx;" + "or %%rdx, %%rax;" + : "=a"(v) // outputs + : // inputs + : "%rdx" // clobbers + ); + return v; + } + static inline type stop() noexcept + { + return start(); + } + }; + + #endif + + + // Based on "How to Benchmark Code Execution Times on Intel?? IA-32 and IA-64 + // Instruction Set Architectures", Intel, 2010 + + #if PUSE_ACCURATE_STATS && PHAS_RDTSCP + // + // kills performance completely, but is accurate + // `cpuid` serializes, but clobbers ebx and ecx + // + + struct exact_ticks : public base_ticks<exact_ticks, int64_t> { - guard_t() = delete; - guard_t(timer &m) noexcept : m_m(m) { m_m.m_time -= T::start(); } - ~guard_t() { m_m.m_time += T::stop(); ++m_m.m_count; } + typedef int64_t type; + + static inline type start() noexcept + { + int64_t v; + __asm__ __volatile__ ( + "cpuid;" + //"xor %%eax, %%eax\n\t" + "rdtsc;" + "shl $32, %%rdx;" + "or %%rdx, %%rax;" + : "=a"(v) // outputs + : "a"(0x0) // inputs + : "%ebx", "%ecx", "%rdx" // clobbers + ); + return v; + } + static inline type stop() noexcept + { + int64_t v; + __asm__ __volatile__ ( + "rdtscp;" + "shl $32, %%rdx;" + "or %%rax, %%rdx;" + "mov %%rdx, %%r10;" + "xor %%eax, %%eax\n\t" + "cpuid;" + "mov %%r10, %%rax;" + : "=a" (v) + : + : "%ebx", "%ecx", "%rdx", "%r10" + ); + return v; + } + }; + #else + using exact_ticks = fast_ticks; + #endif + - COPYASSIGNMOVE(guard_t, default) + #else + using fast_ticks = hires_ticks; + using exact_ticks = fast_ticks; + #endif + template<bool enabled_> + struct counter + { + constexpr counter() : m_count(0) { } + using type = uint_least64_t; + constexpr type operator()() const noexcept { return m_count; } + constexpr void inc() noexcept { ++m_count; } + constexpr void reset() noexcept { m_count = 0; } + constexpr static bool enabled = enabled_; private: - timer &m_m; + type m_count; }; - friend struct guard_t; + template<> + struct counter<false> + { + using type = uint_least64_t; + constexpr type operator()() const noexcept { return 0; } + constexpr void inc() const noexcept { } + constexpr void reset() const noexcept { } + constexpr static bool enabled = false; + }; + + + template <typename T, bool enabled_ = true> + struct timer + { + using type = typename T::type; + using ctype = uint_least64_t; + constexpr static const bool enabled = enabled_; + + struct guard_t + { + guard_t() = delete; + explicit constexpr guard_t(timer &m) noexcept : m_m(&m) { m_m->m_time -= T::start(); } + ~guard_t() noexcept { m_m->m_time += T::stop(); ++m_m->m_count; } - timer() : m_time(0), m_count(0) { } + constexpr guard_t(const guard_t &) = default; + constexpr guard_t &operator=(const guard_t &) = default; + constexpr guard_t(guard_t &&) noexcept = default; + constexpr guard_t &operator=(guard_t &&) noexcept = default; - type operator()() const { return m_time; } + private: + timer *m_m; + }; - void reset() { m_time = 0; m_count = 0; } - type average() const { return (m_count == 0) ? 0 : m_time / m_count; } - type total() const { return m_time; } - ctype count() const { return m_count; } + constexpr timer() : m_time(0), m_count(0) { } - double as_seconds() const { return static_cast<double>(total()) - / static_cast<double>(T::per_second()); } + constexpr type operator()() const { return m_time; } - guard_t guard() { return guard_t(*this); } - private: - type m_time; - ctype m_count; - }; + constexpr void reset() noexcept { m_time = 0; m_count = 0; } + constexpr type average() const noexcept { return (m_count == 0) ? 0 : m_time / m_count; } + constexpr type total() const noexcept { return m_time; } + constexpr ctype count() const noexcept { return m_count; } - template<typename T> - struct timer<T, false> - { - using type = typename T::type; - using ctype = uint_least64_t; + template <typename S> + constexpr S as_seconds() const noexcept { return narrow_cast<S>(total()) + / narrow_cast<S>(T::per_second()); } - struct guard_t + constexpr guard_t guard() noexcept { return guard_t(*this); } + + void stop() noexcept { m_time += T::stop(); } + void start() noexcept { m_time -= T::start(); } + + + private: + type m_time; + ctype m_count; + }; + + template<typename T> + struct timer<T, false> { - guard_t() = default; - COPYASSIGNMOVE(guard_t, default) - /* using default constructor will trigger warning on - * unused local variable. - */ - // NOLINTNEXTLINE(modernize-use-equals-default) - ~guard_t() { } + using type = typename T::type; + using ctype = uint_least64_t; + + struct guard_t + { + constexpr guard_t() = default; + + constexpr guard_t(const guard_t &) = default; + constexpr guard_t &operator=(const guard_t &) = default; + constexpr guard_t(guard_t &&) noexcept = default; + constexpr guard_t &operator=(guard_t &&) noexcept = default; + + // using default constructor will trigger warning on + // unused local variable. + + // NOLINTNEXTLINE(modernize-use-equals-default) + ~guard_t() noexcept { } + }; + + constexpr type operator()() const noexcept { return 0; } + void reset() const noexcept { } + constexpr type average() const noexcept { return 0; } + constexpr type total() const noexcept { return 0; } + constexpr ctype count() const noexcept { return 0; } + template <typename S> + constexpr S as_seconds() const noexcept { return narrow_cast<S>(0); } + constexpr static bool enabled = false; + guard_t guard() { return guard_t(); } }; - constexpr type operator()() const { return 0; } - void reset() const { } - constexpr type average() const { return 0; } - constexpr type total() const { return 0; } - constexpr ctype count() const { return 0; } - constexpr double as_seconds() const { return 0.0; } - constexpr static bool enabled = false; - guard_t guard() { return guard_t(); } - }; + } // namespace chrono + //============================================================ + // Performance tracking + //============================================================ + template <bool enabled_> + using pperftime_t = plib::chrono::timer<plib::chrono::exact_ticks, enabled_>; - } // namespace chrono + template <bool enabled_> + using pperfcount_t = plib::chrono::counter<enabled_>; } // namespace plib -#endif /* PCHRONO_H_ */ +#endif // PCHRONO_H_ diff --git a/src/lib/netlist/plib/pconfig.h b/src/lib/netlist/plib/pconfig.h index 4ce5aea4cdb..2d0ab0003d2 100644 --- a/src/lib/netlist/plib/pconfig.h +++ b/src/lib/netlist/plib/pconfig.h @@ -1,112 +1,131 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pconfig.h - * - */ #ifndef PCONFIG_H_ #define PCONFIG_H_ -/* - * Define this for more accurate measurements if you processor supports - * RDTSCP. - */ +/// +/// \file pconfig.h +/// + +/// \brief More accurate measurements the processor supports RDTSCP. +/// #ifndef PHAS_RDTSCP #define PHAS_RDTSCP (0) #endif -/* - * Define this to use accurate timing measurements. Only works - * if PHAS_RDTSCP == 1 - */ +/// \brief Use accurate timing measurements. +/// +/// Only works if \ref PHAS_RDTSCP == 1 +/// #ifndef PUSE_ACCURATE_STATS #define PUSE_ACCURATE_STATS (0) #endif -/* - * Set this to one if you want to use 128 bit int for ptime. - * This is about 5% slower on a kaby lake processor. - */ - -#ifndef PHAS_INT128 -#define PHAS_INT128 (0) +/// \brief Add support for the __float128 floating point type. +/// +#ifndef PUSE_FLOAT128 +#define PUSE_FLOAT128 (0) #endif -/* - * OpenMP adds about 10% to 20% performance for analog - * netlists like kidniki. - */ - -#ifndef USE_OPENMP -#define USE_OPENMP (0) +/// \brief Compile with support for OPENMP +/// +/// OpenMP adds about 10% to 20% performance for analog netlists. +/// +#ifndef PUSE_OPENMP +#define PUSE_OPENMP (1) #endif -/* - * Set this to one if you want to use aligned storage optimizations. - */ - -#ifndef USE_ALIGNED_OPTIMIZATIONS -#define USE_ALIGNED_OPTIMIZATIONS (0) +/// \brief Use aligned optimizations. +/// +/// Set this to one if you want to use aligned storage optimizations. +/// +#ifndef PUSE_ALIGNED_OPTIMIZATIONS +#if defined(__EMSCRIPTEN__) +#define PUSE_ALIGNED_OPTIMIZATIONS (0) +#else +#define PUSE_ALIGNED_OPTIMIZATIONS (1) +#endif #endif -#define USE_ALIGNED_ALLOCATION (USE_ALIGNED_OPTIMIZATIONS) -#define USE_ALIGNED_HINTS (USE_ALIGNED_OPTIMIZATIONS) -/* - * Standard alignment macros - */ +/// \brief Use aligned allocations. +/// +/// Set this to one if you want to use aligned storage optimizations. +/// +/// Defaults to \ref PUSE_ALIGNED_OPTIMIZATIONS. +/// +#define PUSE_ALIGNED_ALLOCATION (PUSE_ALIGNED_OPTIMIZATIONS) +/// \brief Use aligned hints. +/// +/// Some compilers support special functions to mark a pointer as being +/// aligned. Set this to one if you want to use these functions. +/// +/// Defaults to \ref PUSE_ALIGNED_OPTIMIZATIONS. +/// +#define PUSE_ALIGNED_HINTS (PUSE_ALIGNED_OPTIMIZATIONS) + +/// \brief Number of bytes for cache line alignment +/// #define PALIGN_CACHELINE (64) -#define PALIGN_VECTOROPT (64) +/// \brief Number of bytes for vector alignment +/// +#define PALIGN_VECTOROPT (32) + +#define PALIGN_MIN_SIZE (16) + +#if (PUSE_ALIGNED_OPTIMIZATIONS) #define PALIGNAS_CACHELINE() PALIGNAS(PALIGN_CACHELINE) #define PALIGNAS_VECTOROPT() PALIGNAS(PALIGN_VECTOROPT) +#else +#define PALIGNAS_CACHELINE() +#define PALIGNAS_VECTOROPT() +#endif -/* Breaks mame build on windows due to -Wattribute - * FIXME: no error on cross-compile - need further checks */ -#if defined(_WIN32) && defined(__GNUC__) +// FIXME: Breaks mame build on windows mingw due to `-Wattribute` +// also triggers `-Wattribute` on ARM +// This is fixed on mingw version 10 +// FIXME: no error on cross-compile - need further checks +#if defined(__GNUC__) && ((defined(_WIN32) && __GNUC__ < 10) || defined(__arm__) || defined(__ARMEL__)) #define PALIGNAS(x) #else #define PALIGNAS(x) alignas(x) #endif -/*============================================================ - * Check for CPP Version - * - * C++11: __cplusplus is 201103L. - * C++14: __cplusplus is 201402L. - * c++17/c++1z__cplusplus is 201703L. - * - * VS2015 returns 199711L here. This is the bug filed in - * 2012 which obviously never was picked up by MS: - * https://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l - * - * - *============================================================*/ - -#ifndef NVCCBUILD -#define NVCCBUILD (0) -#endif +// ============================================================ +// Check for CPP Version +// +// C++11: __cplusplus is 201103L. +// C++14: __cplusplus is 201402L. +// c++17/c++1z__cplusplus is 201703L. +// +// VS2015 returns 199711L here. This is the bug filed in +// 2012 which obviously never was picked up by MS: +// https://connect.microsoft.com/VisualStudio/feedback/details/763051/a-value-of-predefined-macro-cplusplus-is-still-199711l +// +// +//============================================================ -#if NVCCBUILD -#define C14CONSTEXPR -#else -#if __cplusplus == 201103L -#define C14CONSTEXPR +#if defined(_MSC_VER) + // Ok +#elif __cplusplus == 201103L + #error c++11 not supported - you need c++17 #elif __cplusplus == 201402L -#define C14CONSTEXPR constexpr + #error c++14 not supported - you need c++17 #elif __cplusplus == 201703L -#define C14CONSTEXPR constexpr -#elif defined(_MSC_VER) -#define C14CONSTEXPR + // Ok +#elif __cplusplus == 201709L + // Ok g++-9 -std=c++2a +#elif __cplusplus == 202002L + // Ok clang++-13 -std=c++2a #else -#error "C++ version not supported" -#endif + #error "C++ version not supported" #endif -#if (PHAS_INT128) -typedef __uint128_t UINT128; -typedef __int128_t INT128; + +#if (PUSE_FLOAT128) +typedef __float128 FLOAT128; #endif //============================================================ @@ -114,70 +133,43 @@ typedef __int128_t INT128; //============================================================ #if defined(OPENMP) -#define HAS_OPENMP ( OPENMP >= 200805 ) -#elif defined(_OPENMP) -#define HAS_OPENMP ( _OPENMP >= 200805 ) +#if ( OPENMP >= 200805 ) +#define PHAS_OPENMP (1) #else -#define HAS_OPENMP (0) +#define PHAS_OPENMP (0) #endif - -//============================================================ -// Pointer to Member Function -//============================================================ - -// This will be autodetected -//#define PPMF_TYPE 0 - -#define PPMF_TYPE_PMF 0 -#define PPMF_TYPE_GNUC_PMF_CONV 1 -#define PPMF_TYPE_INTERNAL 2 - -#if defined(__GNUC__) - /* does not work in versions over 4.7.x of 32bit MINGW */ - #if defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7))) - #define PHAS_PMF_INTERNAL 0 - #elif defined(__MINGW32__) && !defined(__x86_64) && defined(__i386__) - #define PHAS_PMF_INTERNAL 1 - #define MEMBER_ABI _thiscall - #elif defined(__clang__) && defined(__i386__) && defined(_WIN32) - #define PHAS_PMF_INTERNAL 0 - #elif defined(__arm__) || defined(__ARMEL__) || defined(__aarch64__) || defined(__MIPSEL__) || defined(__mips_isa_rev) || defined(__mips64) || defined(__EMSCRIPTEN__) - #define PHAS_PMF_INTERNAL 2 - #else - #define PHAS_PMF_INTERNAL 1 - #endif -#elif defined(_MSC_VER) && defined (_M_X64) - #define PHAS_PMF_INTERNAL 3 +#elif defined(_OPENMP) +#if ( _OPENMP >= 200805 ) +#define PHAS_OPENMP (1) #else - #define PHAS_PMF_INTERNAL 0 +#define PHAS_OPENMP (0) #endif - -#ifndef MEMBER_ABI - #define MEMBER_ABI -#endif - -#ifndef PPMF_TYPE - #if (PHAS_PMF_INTERNAL > 0) - #define PPMF_TYPE PPMF_TYPE_INTERNAL - #else - #define PPMF_TYPE PPMF_TYPE_PMF - #endif #else - #undef PHAS_PMF_INTERNAL - #define PHAS_PMF_INTERNAL 0 - #undef MEMBER_ABI - #define MEMBER_ABI +#define PHAS_OPENMP (0) #endif + //============================================================ // WARNINGS //============================================================ -#if (USE_OPENMP) -#if (!(HAS_OPENMP)) -#error To use openmp compile and link with "-fopenmp" +#if (PUSE_OPENMP) +#if (!(PHAS_OPENMP)) +//#error To use openmp compile and link with "-fopenmp" +#undef PUSE_OPENMP +#define PUSE_OPENMP (0) +#endif +#endif + +#if (PUSE_FLOAT128) +#if defined(__has_include) +#if !__has_include(<quadmath.h>) +//#pragma message "disabling PUSE_FLOAT128 due to missing quadmath.h" +#undef PUSE_FLOAT128 +#define PUSE_FLOAT128 (0) +#endif #endif #endif -#endif /* PCONFIG_H_ */ +#endif // PCONFIG_H_ diff --git a/src/lib/netlist/plib/pdynlib.cpp b/src/lib/netlist/plib/pdynlib.cpp index 828096d1b0c..cdc25dc71b4 100644 --- a/src/lib/netlist/plib/pdynlib.cpp +++ b/src/lib/netlist/plib/pdynlib.cpp @@ -1,130 +1,73 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * dynlib.c - * - */ #include "pdynlib.h" #ifdef _WIN32 #include "windows.h" -#include "palloc.h" - -namespace plib { -CHAR *astring_from_utf8(const char *utf8string) -{ - WCHAR *wstring; - int char_count; - CHAR *result; - - // convert MAME string (UTF-8) to UTF-16 - char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, nullptr, 0); - wstring = (WCHAR *)alloca(char_count * sizeof(*wstring)); - MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, wstring, char_count); - - // convert UTF-16 to "ANSI code page" string - char_count = WideCharToMultiByte(CP_ACP, 0, wstring, -1, nullptr, 0, nullptr, nullptr); - result = new CHAR[char_count]; - if (result != nullptr) - WideCharToMultiByte(CP_ACP, 0, wstring, -1, result, char_count, nullptr, nullptr); - - return result; -} - -WCHAR *wstring_from_utf8(const char *utf8string) -{ - int char_count; - WCHAR *result; - - // convert MAME string (UTF-8) to UTF-16 - char_count = MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, nullptr, 0); - result = new WCHAR[char_count]; - if (result != nullptr) - MultiByteToWideChar(CP_UTF8, 0, utf8string, -1, result, char_count); - - return result; -} -} - -#ifdef UNICODE -#define tstring_from_utf8 plib::wstring_from_utf8 -#else // !UNICODE -#define tstring_from_utf8 plib::astring_from_utf8 -#endif // UNICODE - #else #include <dlfcn.h> #endif -namespace plib { -dynlib::dynlib(const pstring &libname) -: m_isLoaded(false), m_lib(nullptr) +#include <type_traits> + +namespace plib +{ + using winapi_string = std::conditional<compile_info::unicode::value, + pwstring, pu8string>::type; + +dynamic_library::dynamic_library(const pstring &libname) +: m_lib(nullptr) { #ifdef _WIN32 //fprintf(stderr, "win: loading <%s>\n", libname.c_str()); - TCHAR *buffer = tstring_from_utf8(libname.c_str()); - if (libname != "") - m_lib = LoadLibrary(buffer); + if (!libname.empty()) + m_lib = LoadLibrary(winapi_string(putf8string(libname)).c_str()); else m_lib = GetModuleHandle(nullptr); - if (m_lib != nullptr) - m_isLoaded = true; - //else - // fprintf(stderr, "win: library <%s> not found!\n", libname.c_str()); - delete [] buffer; #elif defined(__EMSCRIPTEN__) //no-op #else //printf("loading <%s>\n", libname.c_str()); - if (libname != "") - m_lib = dlopen(libname.c_str(), RTLD_LAZY); + if (!libname.empty()) + m_lib = dlopen(putf8string(libname).c_str(), RTLD_LAZY); else m_lib = dlopen(nullptr, RTLD_LAZY); +#endif if (m_lib != nullptr) - m_isLoaded = true; + set_loaded(true); //else // printf("library <%s> not found: %s\n", libname.c_str(), dlerror()); -#endif } -dynlib::dynlib(const pstring &path, const pstring &libname) -: m_isLoaded(false), m_lib(nullptr) +dynamic_library::dynamic_library([[maybe_unused]] const pstring &path, const pstring &libname) +: m_lib(nullptr) { // FIXME: implement path search - plib::unused_var(path); // printf("win: loading <%s>\n", libname.c_str()); #ifdef _WIN32 - TCHAR *buffer = tstring_from_utf8(libname.c_str()); - if (libname != "") - m_lib = LoadLibrary(buffer); + if (!libname.empty()) + m_lib = LoadLibrary(winapi_string(putf8string(libname)).c_str()); else m_lib = GetModuleHandle(nullptr); - if (m_lib != nullptr) - m_isLoaded = true; - else - { - //printf("win: library <%s> not found!\n", libname.c_str()); - } - delete [] buffer; #elif defined(__EMSCRIPTEN__) //no-op #else //printf("loading <%s>\n", libname.c_str()); - if (libname != "") - m_lib = dlopen(libname.c_str(), RTLD_LAZY); + if (!libname.empty()) + m_lib = dlopen(putf8string(libname).c_str(), RTLD_LAZY); else m_lib = dlopen(nullptr, RTLD_LAZY); +#endif if (m_lib != nullptr) - m_isLoaded = true; + set_loaded(true); else { //printf("library <%s> not found!\n", libname.c_str()); } -#endif } -dynlib::~dynlib() +dynamic_library::~dynamic_library() { if (m_lib != nullptr) { @@ -136,17 +79,12 @@ dynlib::~dynlib() } } -bool dynlib::isLoaded() const -{ - return m_isLoaded; -} - -void *dynlib::getsym_p(const pstring &name) +void *dynamic_library::get_symbol_pointer(const pstring &name) const noexcept { #ifdef _WIN32 - return (void *) GetProcAddress((HMODULE) m_lib, name.c_str()); + return (void *) GetProcAddress((HMODULE) m_lib, putf8string(name).c_str()); #else - return dlsym(m_lib, name.c_str()); + return dlsym(m_lib, putf8string(name).c_str()); #endif } diff --git a/src/lib/netlist/plib/pdynlib.h b/src/lib/netlist/plib/pdynlib.h index 1454c053298..8d8e3377e3a 100644 --- a/src/lib/netlist/plib/pdynlib.h +++ b/src/lib/netlist/plib/pdynlib.h @@ -1,72 +1,131 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pdynlib.h - */ #ifndef PDYNLIB_H_ #define PDYNLIB_H_ +/// +/// \file pdynlib.h +/// +/// Dynamic loading of libraries +/// + #include "pstring.h" #include "ptypes.h" namespace plib { -// ---------------------------------------------------------------------------------------- -// pdynlib: dynamic loading of libraries ... -// ---------------------------------------------------------------------------------------- -class dynlib : public nocopyassignmove -{ -public: - explicit dynlib(const pstring &libname); - dynlib(const pstring &path, const pstring &libname); + class dynamic_library_base + { + public: - ~dynlib(); - COPYASSIGNMOVE(dynlib, delete) + explicit dynamic_library_base() : m_is_loaded(false) { } - bool isLoaded() const; + virtual ~dynamic_library_base() = default; - template <typename T> - T getsym(const pstring &name) - { - return reinterpret_cast<T>(getsym_p(name)); - } -private: - void *getsym_p(const pstring &name); + dynamic_library_base(const dynamic_library_base &) = delete; + dynamic_library_base &operator=(const dynamic_library_base &) = delete; - bool m_isLoaded; - void *m_lib; -}; + dynamic_library_base(dynamic_library_base &&) noexcept = default; + dynamic_library_base &operator=(dynamic_library_base &&) noexcept = default; -template <typename R, typename... Args> -class dynproc -{ -public: - using calltype = R(*) (Args... args); + template <typename R, typename... Args> + class function + { + public: + using calltype = R(*) (Args... args); - dynproc() : m_sym(nullptr) { } + function() : m_sym(nullptr) { } - dynproc(dynlib &dl, const pstring &name) - { - m_sym = dl.getsym<calltype>(name); - } + function(dynamic_library_base &dl, const pstring &name) noexcept + : m_sym(dl.get_symbol<calltype>(name)) + { + } - void load(dynlib &dl, const pstring &name) - { - m_sym = dl.getsym<calltype>(name); - } + void load(dynamic_library_base &dl, const pstring &name) noexcept + { + m_sym = dl.get_symbol<calltype>(name); + } + + R operator ()(Args&&... args) const + { + return m_sym(std::forward<Args>(args)...); + //return m_sym(args...); + } + + bool resolved() const noexcept { return m_sym != nullptr; } + private: + calltype m_sym; + }; + + bool isLoaded() const { return m_is_loaded; } - R operator ()(Args&&... args) const + template <typename T> + T get_symbol(const pstring &name) const noexcept + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return reinterpret_cast<T>(get_symbol_pointer(name)); + } + + protected: + void set_loaded(bool v) noexcept { m_is_loaded = v; } + virtual void *get_symbol_pointer(const pstring &name) const noexcept = 0; + private: + bool m_is_loaded; + }; + + class dynamic_library : public dynamic_library_base { - return m_sym(std::forward<Args>(args)...); - //return m_sym(args...); - } + public: + explicit dynamic_library(const pstring &libname); + dynamic_library(const pstring &path, const pstring &libname); + + ~dynamic_library() override; + + PCOPYASSIGN(dynamic_library, delete) + PMOVEASSIGN(dynamic_library, default) - bool resolved() { return m_sym != nullptr; } -private: - calltype m_sym; -}; + protected: + void *get_symbol_pointer(const pstring &name) const noexcept override; + + private: + void *m_lib; + }; + + class static_library : public dynamic_library_base + { + public: + struct symbol + { + const char *name; + void *addr; + }; + + + explicit static_library(const symbol *symbols) + : m_syms(symbols) + { + if (symbols != nullptr) + set_loaded(true); + } + + protected: + void *get_symbol_pointer(const pstring &name) const noexcept override + { + const symbol *p = m_syms; + while (p->name[0] != 0) + { + if (name == pstring(p->name)) + return p->addr; + p++; + } + return nullptr; + } + + private: + const symbol *m_syms; + }; } // namespace plib -#endif /* PSTRING_H_ */ +#endif // PDYNLIB_H_ diff --git a/src/lib/netlist/plib/penum.h b/src/lib/netlist/plib/penum.h new file mode 100644 index 00000000000..5a1db765ba0 --- /dev/null +++ b/src/lib/netlist/plib/penum.h @@ -0,0 +1,55 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PENUM_H_ +#define PENUM_H_ + +/// +/// \file penum.h +/// + +#include "pstring.h" + +namespace plib +{ + + /// + /// \brief strongly typed enumeration + /// + /// + struct penum_base + { + protected: + // Implementation in putil.cpp. + // Putting the code here leads to a performance decrease. + static int from_string_int(const pstring &str, const pstring &x); + static pstring nthstr(std::size_t n, const pstring &str); + }; + +} // namespace plib + +#define PENUM(ename, ...) \ + struct ename : public plib::penum_base { \ + enum E { __VA_ARGS__ }; \ + constexpr ename (const E &v) : m_v(v) { } \ + template <typename T> explicit constexpr ename(const T &val) : m_v(static_cast<E>(val)) { } \ + bool set_from_string (const pstring &s) { \ + int f = from_string_int(strings(), s); \ + if (f>=0) { m_v = static_cast<E>(f); return true; } \ + return false;\ + } \ + constexpr operator E() const noexcept {return m_v;} \ + constexpr bool operator==(const ename &rhs) const noexcept {return m_v == rhs.m_v;} \ + constexpr bool operator==(const E &rhs) const noexcept {return m_v == rhs;} \ + pstring name() const { \ + return nthstr(m_v, strings()); \ + } \ + template <typename S> void save_state(S &saver) { saver.save_item(m_v, "m_v"); } \ + private: E m_v; \ + static pstring strings() {\ + static const char * static_strings = # __VA_ARGS__; \ + return pstring(static_strings); \ + } \ + }; + +#endif // PENUM_H_ diff --git a/src/lib/netlist/plib/pexception.cpp b/src/lib/netlist/plib/pexception.cpp index 8d6907d66f2..b358f3ad6ba 100644 --- a/src/lib/netlist/plib/pexception.cpp +++ b/src/lib/netlist/plib/pexception.cpp @@ -1,17 +1,14 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * palloc.c - * - */ #include "pexception.h" #include "pfmtlog.h" #include <cfenv> +#include <cfloat> #include <iostream> -#if (defined(__x86_64__) || defined(__i386__)) && defined(__linux__) +#if (defined(__x86_64__) || defined(__i386__)) && defined(__GLIBC__) #define HAS_FEENABLE_EXCEPT (1) #else #define HAS_FEENABLE_EXCEPT (0) @@ -23,12 +20,35 @@ namespace plib { // terminate //============================================================ - void terminate(const pstring &msg) noexcept + [[noreturn]] void terminate(const char *msg) noexcept { - std::cerr << msg.c_str() << "\n"; + try + { + std::cerr << msg << "\n"; + } + catch (...) + { + // ignore + } std::terminate(); } + void passert_fail(const char *assertion, const char *file, int lineno, const char *msg) noexcept + { + try + { + std::cerr << file << ":" << lineno << ": "; + if (msg != nullptr) + std::cerr << msg << "\n"; + else + std::cerr << "Assertion '" << assertion << "' failed.\n"; + } + catch (...) + { + // ignore + } + std::terminate(); + } //============================================================ // Exceptions @@ -76,34 +96,48 @@ namespace plib { } - fpexception_e::fpexception_e(const pstring &text) - : pexception(pfmt("Out of memory: {}")(text)) + fp_exception_e::fp_exception_e(const pstring &text) + : pexception(pfmt("Exception error: {}")(text)) { } - bool fpsignalenabler::m_enable = false; + bool fp_signal_enabler::m_enable = false; // NOLINT + + //FIXME: mingw needs to be compiled with `-fnon-call-exceptions` - fpsignalenabler::fpsignalenabler(unsigned fpexceptions) + fp_signal_enabler::fp_signal_enabler(unsigned fp_exceptions) { #if HAS_FEENABLE_EXCEPT if (m_enable) { int b = 0; - if (fpexceptions & plib::FP_INEXACT) b = b | FE_INEXACT; - if (fpexceptions & plib::FP_DIVBYZERO) b = b | FE_DIVBYZERO; - if (fpexceptions & plib::FP_UNDERFLOW) b = b | FE_UNDERFLOW; - if (fpexceptions & plib::FP_OVERFLOW) b = b | FE_OVERFLOW; - if (fpexceptions & plib::FP_INVALID) b = b | FE_INVALID; - m_last_enabled = feenableexcept(b); + if (fp_exceptions & plib::FP_INEXACT) b = b | FE_INEXACT; + if (fp_exceptions & plib::FP_DIVBYZERO) b = b | FE_DIVBYZERO; + if (fp_exceptions & plib::FP_UNDERFLOW) b = b | FE_UNDERFLOW; + if (fp_exceptions & plib::FP_OVERFLOW) b = b | FE_OVERFLOW; + if (fp_exceptions & plib::FP_INVALID) b = b | FE_INVALID; + if ((b & m_last_enabled) != b) + m_last_enabled = feenableexcept(b); + } + #elif defined(_WIN32) && defined(_EM_INEXACT) + if (m_enable) + { + int b = _EM_DENORMAL | _EM_INEXACT | _EM_ZERODIVIDE | _EM_UNDERFLOW | _EM_OVERFLOW | _EM_INVALID; + if (fp_exceptions & plib::FP_INEXACT) b &= ~_EM_INEXACT; + if (fp_exceptions & plib::FP_DIVBYZERO) b &= ~_EM_ZERODIVIDE; + if (fp_exceptions & plib::FP_UNDERFLOW) b &= ~_EM_UNDERFLOW; + if (fp_exceptions & plib::FP_OVERFLOW) b &= ~_EM_OVERFLOW; + if (fp_exceptions & plib::FP_INVALID) b &= ~_EM_INVALID; + m_last_enabled = _controlfp(0, 0); + _controlfp(b, _MCW_EM ); } #else m_last_enabled = 0; #endif } - - fpsignalenabler::~fpsignalenabler() + fp_signal_enabler::~fp_signal_enabler() { #if HAS_FEENABLE_EXCEPT if (m_enable) @@ -111,15 +145,26 @@ namespace plib { fedisableexcept(FE_ALL_EXCEPT); // Enable all floating point exceptions but FE_INEXACT feenableexcept(m_last_enabled); // Enable all floating point exceptions but FE_INEXACT } + #elif defined(_WIN32) && defined(_EM_INEXACT) + if (m_enable) + { + _controlfp(m_last_enabled, _MCW_EM); + } #endif } - bool fpsignalenabler::supported() + bool fp_signal_enabler::supported() { + #if HAS_FEENABLE_EXCEPT + return true; + #elif defined(_WIN32) && defined(_EM_INEXACT) return true; + #else + return false; + #endif } - bool fpsignalenabler::global_enable(bool enable) + bool fp_signal_enabler::global_enable(bool enable) { bool old = m_enable; m_enable = enable; diff --git a/src/lib/netlist/plib/pexception.h b/src/lib/netlist/plib/pexception.h index 28a3ac1adf1..bf2a286e81e 100644 --- a/src/lib/netlist/plib/pexception.h +++ b/src/lib/netlist/plib/pexception.h @@ -1,29 +1,34 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * palloc.h - * - */ #ifndef PEXCEPTION_H_ #define PEXCEPTION_H_ +/// +/// \file: pexception.h +/// + #include "pstring.h" #include "ptypes.h" #include <exception> +#define passert_always(expr) \ + ((expr) ? static_cast<void>(0) : plib::passert_fail (#expr, __FILE__, __LINE__, nullptr)) + +#define passert_always_msg(expr, msg) \ + ((expr) ? static_cast<void>(0) : plib::passert_fail (#expr, __FILE__, __LINE__, msg)) + namespace plib { - //============================================================ - // terminate - //============================================================ + /// \brief Terminate the program. + /// + /// \note could be enhanced by setting a termination handler + /// + [[noreturn]] void terminate(const char *msg) noexcept; - /*! Terminate the program - * - * \note could be enhanced by setting a termination handler - */ - [[noreturn]] void terminate(const pstring &msg) noexcept; + [[noreturn]] void passert_fail(const char *assertion, + const char *file, int lineno, const char *msg) noexcept; //============================================================ // exception base @@ -34,11 +39,11 @@ namespace plib { public: explicit pexception(const pstring &text); - const pstring &text() { return m_text; } + const putf8string &text() const noexcept { return m_text; } const char* what() const noexcept override { return m_text.c_str(); } private: - pstring m_text; + putf8string m_text; }; class file_e : public plib::pexception @@ -77,14 +82,14 @@ namespace plib { explicit out_of_mem_e(const pstring &location); }; - /* FIXME: currently only a stub for later use. More use could be added by - * using “-fnon-call-exceptions" and sigaction to enable c++ exception supported. - */ + // FIXME: currently only a stub for later use. More use could be added by + // using `-fnon-call-exceptions` and sigaction to enable c++ exception supported. + // - class fpexception_e : public pexception + class fp_exception_e : public pexception { public: - explicit fpexception_e(const pstring &text); + explicit fp_exception_e(const pstring &text); }; static constexpr unsigned FP_INEXACT = 0x0001; @@ -94,31 +99,36 @@ namespace plib { static constexpr unsigned FP_INVALID = 0x00010; static constexpr unsigned FP_ALL = 0x0001f; - /* - * Catch SIGFPE on linux for debugging purposes. - */ - - class fpsignalenabler + /// \brief Catch SIGFPE on linux for debugging purposes. + /// + class fp_signal_enabler { public: - explicit fpsignalenabler(unsigned fpexceptions); + explicit fp_signal_enabler(unsigned fp_exceptions); - COPYASSIGNMOVE(fpsignalenabler, delete) + PCOPYASSIGNMOVE(fp_signal_enabler, delete) - ~fpsignalenabler(); + ~fp_signal_enabler(); - /* is the functionality supported ? */ + /// \brief is the functionality supported. + /// + /// \return current status + /// static bool supported(); - /* returns last global enable state */ + /// \brief get/set global enable status + /// + /// \param enable new status + /// \return returns last global enable state + /// static bool global_enable(bool enable); private: int m_last_enabled; - static bool m_enable; + static bool m_enable; // NOLINT }; } // namespace plib -#endif /* PEXCEPTION_H_ */ +#endif // PEXCEPTION_H_ diff --git a/src/lib/netlist/plib/pfmtlog.cpp b/src/lib/netlist/plib/pfmtlog.cpp index ef12e05fb1d..188c04f4cf7 100644 --- a/src/lib/netlist/plib/pfmtlog.cpp +++ b/src/lib/netlist/plib/pfmtlog.cpp @@ -1,16 +1,13 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_string.c - * - */ #include "pfmtlog.h" #include "palloc.h" +#include "pstonum.h" +#include "pstrutil.h" #include <algorithm> #include <array> -#include <cmath> #include <iomanip> #include <iostream> @@ -42,14 +39,15 @@ private: }; #endif -pfmt::rtype pfmt::setfmt(std::stringstream &strm, char32_t cfmt_spec) +pfmt::rtype pfmt::set_format(std::stringstream &strm, char32_t char_format) { pstring fmt; pstring search("{"); search += plib::to_string(m_arg); + rtype r; - r.sl = search.size(); + r.sl = search.length(); r.p = m_str.find(search + ':'); r.sl++; // ":" if (r.p == pstring::npos) // no further specifiers @@ -92,33 +90,40 @@ pfmt::rtype pfmt::setfmt(std::stringstream &strm, char32_t cfmt_spec) if (r.p != pstring::npos) { // a.b format here ... - if (fmt != "" && pstring("duxofge").find(static_cast<pstring::value_type>(cfmt_spec)) != pstring::npos) + char32_t pend(0); + int width(0); + if (!fmt.empty() && pstring("duxofge").find(static_cast<pstring::value_type>(char_format)) != pstring::npos) { - r.pend = static_cast<char32_t>(fmt.at(fmt.size() - 1)); - if (pstring("duxofge").find(static_cast<pstring::value_type>(r.pend)) == pstring::npos) - r.pend = cfmt_spec; + //pend = static_cast<char32_t>(fmt.at(fmt.size() - 1)); + pend = plib::right(fmt, 1).at(0); + if (pstring("duxofge").find(static_cast<pstring::value_type>(pend)) == pstring::npos) + pend = char_format; else - fmt = plib::left(fmt, fmt.size() - 1); + fmt = plib::left(fmt, fmt.length() - 1); } else // FIXME: Error - r.pend = cfmt_spec; + pend = char_format; auto pdot(fmt.find('.')); if (pdot==0) - strm << std::setprecision(pstonum<int>(fmt.substr(1))); + strm << std::setprecision(pstonum_ne_def<int>(fmt.substr(1), 6)); else if (pdot != pstring::npos) { - //strm << std::setprecision(pstonum<int>(fmt.substr(pdot + 1))) << std::setw(pstonum<int>(left(fmt,pdot))); - strm << std::setprecision(pstonum<int>(fmt.substr(pdot + 1))); - r.width = pstonum<pstring::size_type>(left(fmt,pdot)); + strm << std::setprecision(pstonum_ne_def<int>(fmt.substr(pdot + 1), 6)); + width = pstonum_ne_def<int>(left(fmt,pdot), 0); } - else if (fmt != "") - //strm << std::setw(pstonum<int>(fmt)); - r.width = pstonum<pstring::size_type>(fmt); + else if (!fmt.empty()) + width = pstonum_ne_def<int>(fmt, 0); + + auto aw(plib::abs(width)); + + strm << std::setw(aw); + if (width < 0) + strm << std::left; - switch (r.pend) + switch (pend) { case 'x': strm << std::hex; diff --git a/src/lib/netlist/plib/pfmtlog.h b/src/lib/netlist/plib/pfmtlog.h index 531b76fafe7..2e45498c637 100644 --- a/src/lib/netlist/plib/pfmtlog.h +++ b/src/lib/netlist/plib/pfmtlog.h @@ -1,372 +1,483 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pfmtlog.h - */ -#ifndef PFMT_H_ -#define PFMT_H_ +/// +/// \file pfmtlog.h +/// +#ifndef PFMTLOG_H_ +#define PFMTLOG_H_ + +#include "penum.h" +#include "pgsl.h" +#include "ppmf.h" #include "pstring.h" #include "ptypes.h" -#include "putil.h" #include <limits> #include <locale> #include <sstream> +#define PERRMSGV(name, argument_count, str) \ + struct name : public plib::perrmsg \ + { \ + template<typename... Args> explicit name(Args&&... args) \ + : plib::perrmsg(str, std::forward<Args>(args)...) \ + { static_assert((argument_count) == sizeof...(args), "Argument count mismatch"); } \ + }; + namespace plib { -P_ENUM(plog_level, - DEBUG, - VERBOSE, - INFO, - WARNING, - ERROR, - FATAL) - -template <typename T> -struct ptype_traits_base -{ - static const T cast(const T &x) { return x; } - static const bool is_signed = std::numeric_limits<T>::is_signed; - static char32_t fmt_spec() { return 'u'; } -}; - -template <> -struct ptype_traits_base<bool> -{ - static unsigned int cast(const bool &x) { return static_cast<unsigned int>(x); } - static const bool is_signed = std::numeric_limits<bool>::is_signed; - static char32_t fmt_spec() { return 'u'; } -}; - -template <typename T> -struct ptype_traits; - -template<> -struct ptype_traits<bool> : ptype_traits_base<bool> -{ -}; - -template<> -struct ptype_traits<char> : ptype_traits_base<char> -{ - static char32_t fmt_spec() { return is_signed ? 'd' : 'u'; } -}; - -template<> -struct ptype_traits<short> : ptype_traits_base<short> -{ - static char32_t fmt_spec() { return 'd'; } -}; - -template<> -struct ptype_traits<int> : ptype_traits_base<int> -{ - static char32_t fmt_spec() { return 'd'; } -}; - -template<> -struct ptype_traits<long> : ptype_traits_base<long> -{ - static char32_t fmt_spec() { return 'd'; } -}; - -template<> -struct ptype_traits<long long> : ptype_traits_base<long long> -{ - static char32_t fmt_spec() { return 'd'; } -}; - -template<> -struct ptype_traits<signed char> : ptype_traits_base<signed char> -{ - static char32_t fmt_spec() { return 'd'; } -}; - -template<> -struct ptype_traits<unsigned char> : ptype_traits_base<unsigned char> -{ - static char32_t fmt_spec() { return 'u'; } -}; - -template<> -struct ptype_traits<unsigned short> : ptype_traits_base<unsigned short> -{ - static char32_t fmt_spec() { return 'u'; } -}; - -template<> -struct ptype_traits<unsigned int> : ptype_traits_base<unsigned int> -{ - static char32_t fmt_spec() { return 'u'; } -}; - -template<> -struct ptype_traits<unsigned long> : ptype_traits_base<unsigned long> -{ - static char32_t fmt_spec() { return 'u'; } -}; - -template<> -struct ptype_traits<unsigned long long> : ptype_traits_base<unsigned long long> -{ - static char32_t fmt_spec() { return 'u'; } -}; - -template<> -struct ptype_traits<float> : ptype_traits_base<float> -{ - static char32_t fmt_spec() { return 'f'; } -}; - -template<> -struct ptype_traits<double> : ptype_traits_base<double> -{ - static char32_t fmt_spec() { return 'f'; } -}; - -template<> -struct ptype_traits<char *> : ptype_traits_base<char *> -{ - static const char *cast(const char *x) { return x; } - static char32_t fmt_spec() { return 's'; } -}; - -template<> -struct ptype_traits<std::string> : ptype_traits_base<char *> -{ - static const char *cast(const std::string &x) { return x.c_str(); } - static char32_t fmt_spec() { return 's'; } -}; - -class pfmt -{ -public: - explicit pfmt(const pstring &fmt) - : m_str(fmt), m_locale(std::locale::classic()), m_arg(0) - { - } - explicit pfmt(const std::locale &loc, const pstring &fmt) - : m_str(fmt), m_locale(loc), m_arg(0) - { - } - - COPYASSIGNMOVE(pfmt, default) - - ~pfmt() noexcept = default; - - operator pstring() const { return m_str; } + PENUM(plog_level, + DEBUG, + VERBOSE, + INFO, + WARNING, + ERROR, + FATAL) template <typename T> - typename std::enable_if<std::is_floating_point<T>::value, pfmt &>::type - f(const T &x) {return format_element('f', x); } + struct format_traits_base + { + static constexpr const bool is_signed = std::numeric_limits<T>::is_signed; + static char32_t fmt_spec() { return 'u'; } + static void streamify(std::ostream &s, const T &v) + { + s << v; + } + }; - template <typename T> - typename std::enable_if<std::is_floating_point<T>::value, pfmt &>::type - e(const T &x) {return format_element('e', x); } + #if (PUSE_FLOAT128) + template <> + struct format_traits_base<FLOAT128> + { + // FIXME: need native support at some time + static constexpr const bool is_signed = true; + static char32_t fmt_spec() { return 'f'; } + static void streamify(std::ostream &s, const FLOAT128 &v) + { + s << narrow_cast<long double>(v); + } + }; + #endif template <typename T> - typename std::enable_if<std::is_floating_point<T>::value, pfmt &>::type - g(const T &x) {return format_element('g', x); } - - pfmt &operator ()(const void *x) {return format_element('p', x); } - pfmt &operator ()(const pstring &x) {return format_element('s', x.c_str() ); } + struct format_traits; - template<typename T> - pfmt &operator ()(const T &x) + template<> + struct format_traits<compile_info::int128_type> { - return format_element(ptype_traits<T>::fmt_spec(), ptype_traits<T>::cast(x)); - } + // FIXME: need native support at some time + static constexpr const bool is_signed = true; + static char32_t fmt_spec() { return 'd'; } + template <typename T, typename = std::enable_if_t<plib::is_arithmetic<T>::value>> + static void streamify(std::ostream &s, const T &v) + { + s << narrow_cast<long long>(v); + } + }; - template<typename T> - pfmt &operator ()(const T *x) + template<> + struct format_traits<bool> : format_traits_base<bool> { - return format_element(ptype_traits<T *>::fmt_spec(), ptype_traits<T *>::cast(x)); - } + }; - pfmt &operator ()() + template<> + struct format_traits<char> : format_traits_base<char> { - return *this; - } + static char32_t fmt_spec() { return is_signed ? 'd' : 'u'; } + }; + template<> + struct format_traits<short> : format_traits_base<short> + { + static char32_t fmt_spec() { return 'd'; } + }; - template<typename X, typename Y, typename... Args> - pfmt &operator()(X&& x, Y && y, Args&&... args) + template<> + struct format_traits<int> : format_traits_base<int> { - return ((*this)(std::forward<X>(x)))(std::forward<Y>(y), std::forward<Args>(args)...); - } + static char32_t fmt_spec() { return 'd'; } + }; - template<typename T> - typename std::enable_if<std::is_integral<T>::value, pfmt &>::type - x(const T &x) + template<> + struct format_traits<long> : format_traits_base<long> { - return format_element('x', x); - } + static char32_t fmt_spec() { return 'd'; } + }; - template<typename T> - typename std::enable_if<std::is_integral<T>::value, pfmt &>::type - o(const T &x) + template<> + struct format_traits<long long> : format_traits_base<long long> { - return format_element('o', x); - } + static char32_t fmt_spec() { return 'd'; } + }; - friend std::ostream& operator<<(std::ostream &ostrm, const pfmt &fmt) + template<> + struct format_traits<signed char> : format_traits_base<signed char> { - ostrm << fmt.m_str; - return ostrm; - } + static char32_t fmt_spec() { return 'd'; } + }; -protected: + template<> + struct format_traits<unsigned char> : format_traits_base<unsigned char> + { + static char32_t fmt_spec() { return 'u'; } + }; - struct rtype + template<> + struct format_traits<unsigned short> : format_traits_base<unsigned short> { - rtype() : ret(0), p(0), sl(0), pend(0), width(0) {} - int ret; - pstring::size_type p; - pstring::size_type sl; - char32_t pend; - pstring::size_type width; + static char32_t fmt_spec() { return 'u'; } + }; + template<> + struct format_traits<unsigned int> : format_traits_base<unsigned int> + { + static char32_t fmt_spec() { return 'u'; } }; - rtype setfmt(std::stringstream &strm, char32_t cfmt_spec); - template <typename T> - pfmt &format_element(const char32_t cfmt_spec, T &&val) + template<> + struct format_traits<unsigned long> : format_traits_base<unsigned long> { - rtype ret; + static char32_t fmt_spec() { return 'u'; } + }; - m_arg++; + template<> + struct format_traits<unsigned long long> : format_traits_base<unsigned long long> + { + static char32_t fmt_spec() { return 'u'; } + }; - do { - std::stringstream strm; - strm.imbue(m_locale); - ret = setfmt(strm, cfmt_spec); - if (ret.ret>=0) - { - strm << std::forward<T>(val); - const pstring ps(strm.str()); - pstring pad(""); - if (ret.width > ps.length()) - pad = pstring(ret.width - ps.length(), ' '); + template<> + struct format_traits<float> : format_traits_base<float> + { + static char32_t fmt_spec() { return 'f'; } + }; - m_str = m_str.substr(0, ret.p) + pad + ps + m_str.substr(ret.p + ret.sl); - } - } while (ret.ret == 1); + template<> + struct format_traits<double> : format_traits_base<double> + { + static char32_t fmt_spec() { return 'f'; } + }; - return *this; - } + template<> + struct format_traits<long double> : format_traits_base<long double> + { + static char32_t fmt_spec() { return 'f'; } + }; + #if (PUSE_FLOAT128) + template<> + struct format_traits<FLOAT128> : format_traits_base<FLOAT128> + { + static char32_t fmt_spec() { return 'f'; } + }; + #endif -private: - pstring m_str; - std::locale m_locale; - unsigned m_arg; -}; + template<> + struct format_traits<char *> : format_traits_base<char *> + { + static char32_t fmt_spec() { return 's'; } + }; -template <class T, bool build_enabled = true> -class pfmt_writer_t -{ -public: - explicit pfmt_writer_t() : m_enabled(true) { } + template<> + struct format_traits<const char *> : format_traits_base<const char *> + { + static char32_t fmt_spec() { return 's'; } + }; - COPYASSIGNMOVE(pfmt_writer_t, delete) + template<> + struct format_traits<const char16_t *> : format_traits_base<const char16_t *> + { + static char32_t fmt_spec() { return 's'; } + static void streamify(std::ostream &s, const char16_t *v) + { + const putf16string su16(v); + s << putf8string(su16).c_str(); + } + }; - /* runtime enable */ - template<bool enabled, typename... Args> - void log(const pstring & fmt, Args&&... args) const + template<> + struct format_traits<const char32_t *> : format_traits_base<const char32_t *> { - if (build_enabled && enabled && m_enabled) + static char32_t fmt_spec() { return 's'; } + static void streamify(std::ostream &s, const char32_t *v) { - pfmt pf(fmt); - static_cast<T *>(this)->vdowrite(xlog(pf, std::forward<Args>(args)...)); + const putf32string su32(v); + s << putf8string(su32).c_str(); } - } + }; + + template<> + struct format_traits<std::string> : format_traits_base<std::string> + { + static char32_t fmt_spec() { return 's'; } + }; + + template<> + struct format_traits<putf8string> : format_traits_base<putf8string> + { + static char32_t fmt_spec() { return 's'; } + }; - template<typename... Args> - void operator ()(const pstring &fmt, Args&&... args) const + template<> + struct format_traits<putf16string> : format_traits_base<putf16string> { - if (build_enabled && m_enabled) + static char32_t fmt_spec() { return 's'; } + static void streamify(std::ostream &s, const putf16string &v) { - pfmt pf(fmt); - static_cast<const T *>(this)->vdowrite(xlog(pf, std::forward<Args>(args)...)); + s << putf8string(v).c_str(); } - } + }; + + template<> + struct format_traits<const void *> : format_traits_base<const void *> + { + static char32_t fmt_spec() { return 'p'; } + }; - void set_enabled(const bool v) + class pfmt { - m_enabled = v; - } + public: + explicit pfmt(const pstring &fmt) + : m_str(fmt), m_locale(std::locale::classic()), m_arg(0) + { + } + explicit pfmt(const std::locale &loc, const pstring &fmt) + : m_str(fmt), m_locale(loc), m_arg(0) + { + } - bool is_enabled() const { return m_enabled; } + PCOPYASSIGNMOVE(pfmt, default) -protected: - ~pfmt_writer_t() noexcept = default; + ~pfmt() noexcept = default; -private: - pfmt &xlog(pfmt &fmt) const { return fmt; } + operator pstring() const { return m_str; } - template<typename X, typename... Args> - pfmt &xlog(pfmt &fmt, X&& x, Args&&... args) const + template <typename T> + std::enable_if_t<plib::is_floating_point<T>::value, pfmt &> + f(const T &x) {return format_element('f', x); } + + template <typename T> + std::enable_if_t<plib::is_floating_point<T>::value, pfmt &> + e(const T &x) {return format_element('e', x); } + + template <typename T> + std::enable_if_t<plib::is_floating_point<T>::value, pfmt &> + g(const T &x) {return format_element('g', x); } + + pfmt &operator ()(const void *x) {return format_element('p', x); } + pfmt &operator ()(const pstring &x) {return format_element('s', x.c_str() ); } + + template<typename T> + pfmt &operator ()(const T &x) + { + return format_element(x); + } + + template<typename T> + pfmt &operator ()(const T *x) + { + return format_element(x); + } + + pfmt &operator ()() + { + return *this; + } + + template<typename X, typename Y, typename... Args> + pfmt &operator()(X&& x, Y && y, Args&&... args) + { + return ((*this)(std::forward<X>(x)))(std::forward<Y>(y), std::forward<Args>(args)...); + } + + template<typename T> + std::enable_if_t<plib::is_integral<T>::value, pfmt &> + x(const T &x) + { + return format_element('x', x); + } + + template<typename T> + std::enable_if_t<plib::is_integral<T>::value, pfmt &> + o(const T &x) + { + return format_element('o', x); + } + + friend std::ostream& operator<<(std::ostream &out_stream, const pfmt &fmt) + { + out_stream << putf8string(fmt.m_str); + return out_stream; + } + + protected: + + struct rtype + { + rtype() : ret(0), p(0), sl(0) {} + int ret; + pstring::size_type p; + pstring::size_type sl; + }; + rtype set_format(std::stringstream &strm, char32_t char_format); + + template <typename T> + pfmt &format_element(T &&v) + { + return format_element(format_traits<typename std::decay<T>::type>::fmt_spec(), std::forward<T>(v)); + } + + template <typename T> + pfmt &format_element(const char32_t char_format, T &&v) + { + rtype ret; + + m_arg++; + + do { + std::stringstream strm; + strm.imbue(m_locale); + ret = set_format(strm, char_format); + if (ret.ret>=0) + { + format_traits<typename std::decay<T>::type>::streamify(strm, std::forward<T>(v)); + const pstring ps(putf8string(strm.str())); + m_str = m_str.substr(0, ret.p) + ps + m_str.substr(ret.p + ret.sl); + } + } while (ret.ret == 1); + + return *this; + } + + + private: + + pstring m_str; + std::locale m_locale; + unsigned m_arg; + }; + + template <class T, bool build_enabled = true> + class pfmt_writer_t { - return xlog(fmt(std::forward<X>(x)), std::forward<Args>(args)...); - } + public: + explicit pfmt_writer_t() : m_enabled(true) { } + + PCOPYASSIGNMOVE(pfmt_writer_t, delete) + + // runtime enable + template<bool enabled, typename... Args> + void log(const pstring & fmt, Args&&... args) const noexcept + { + if (build_enabled && enabled && m_enabled) + { + pfmt pf(fmt); + plib::dynamic_downcast<T &>(*this).upstream_write(log_translate(pf, std::forward<Args>(args)...)); + } + } + + template<typename... Args> + void operator ()(const pstring &fmt, Args&&... args) const noexcept + { + if (build_enabled && m_enabled) + { + pfmt pf(fmt); + static_cast<const T &>(*this).upstream_write(log_translate(pf, std::forward<Args>(args)...)); + } + } + + void set_enabled(const bool v) + { + m_enabled = v; + } + + bool is_enabled() const { return m_enabled; } + + protected: + ~pfmt_writer_t() noexcept = default; - bool m_enabled; + private: + pfmt &log_translate(pfmt &fmt) const { return fmt; } -}; + template<typename X, typename... Args> + pfmt &log_translate(pfmt &fmt, X&& x, Args&&... args) const + { + return log_translate(fmt(std::forward<X>(x)), std::forward<Args>(args)...); + } -template <class T, plog_level::E L, bool build_enabled = true> -class plog_channel : public pfmt_writer_t<plog_channel<T, L, build_enabled>, build_enabled> -{ - friend class pfmt_writer_t<plog_channel<T, L, build_enabled>, build_enabled>; -public: - explicit plog_channel(T &b) : pfmt_writer_t<plog_channel, build_enabled>(), m_base(b) { } + bool m_enabled; - COPYASSIGNMOVE(plog_channel, delete) + }; - ~plog_channel() noexcept = default; + using plog_delegate = plib::pmfp<void (plog_level, const pstring &)>; -protected: - void vdowrite(const pstring &ls) const + template <plog_level::E L, bool build_enabled = true> + class plog_channel : public pfmt_writer_t<plog_channel<L, build_enabled>, build_enabled> { - m_base.vlog(L, ls); - } + friend class pfmt_writer_t<plog_channel<L, build_enabled>, build_enabled>; + public: + explicit plog_channel(plog_delegate logger) + : pfmt_writer_t<plog_channel, build_enabled>() + , m_logger(logger) { } + + PCOPYASSIGNMOVE(plog_channel, delete) -private: - T &m_base; -}; + ~plog_channel() noexcept = default; -template<class T, bool debug_enabled> -class plog_base -{ -public: + protected: + void upstream_write(const pstring &ls) const noexcept + { + m_logger(L, ls); + } + + private: + plog_delegate m_logger; + }; - explicit plog_base(T &proxy) - : debug(proxy), - info(proxy), - verbose(proxy), - warning(proxy), - error(proxy), - fatal(proxy) - {} + template<bool debug_enabled> + class plog_base + { + public: + + explicit plog_base(plog_delegate logger) + : debug(logger), + info(logger), + verbose(logger), + warning(logger), + error(logger), + fatal(logger) + {} + + PCOPYASSIGNMOVE(plog_base, delete) + virtual ~plog_base() noexcept = default; + + plog_channel<plog_level::DEBUG, debug_enabled> debug; + plog_channel<plog_level::INFO> info; + plog_channel<plog_level::VERBOSE> verbose; + plog_channel<plog_level::WARNING> warning; + plog_channel<plog_level::ERROR> error; + plog_channel<plog_level::FATAL> fatal; + }; - COPYASSIGNMOVE(plog_base, default) - virtual ~plog_base() noexcept = default; + struct perrmsg + { + template<std::size_t N, typename... Args> + explicit perrmsg(const char (&fmt)[N], Args&&... args) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + : m_msg(plib::pfmt(fmt)(std::forward<Args>(args)...)) + { } + operator pstring const & () const noexcept { return m_msg; } + const pstring & operator ()() const noexcept { return m_msg; } + private: + pstring m_msg; + }; - plog_channel<T, plog_level::DEBUG, debug_enabled> debug; - plog_channel<T, plog_level::INFO> info; - plog_channel<T, plog_level::VERBOSE> verbose; - plog_channel<T, plog_level::WARNING> warning; - plog_channel<T, plog_level::ERROR> error; - plog_channel<T, plog_level::FATAL> fatal; -}; } // namespace plib template<typename T> plib::pfmt& operator<<(plib::pfmt &p, T&& val) { return p(std::forward<T>(val)); } -#endif /* PSTRING_H_ */ +#endif // PFMT_LOG_H_ diff --git a/src/lib/netlist/plib/pfunction.cpp b/src/lib/netlist/plib/pfunction.cpp index efbdcee6b6b..ed906a40385 100644 --- a/src/lib/netlist/plib/pfunction.cpp +++ b/src/lib/netlist/plib/pfunction.cpp @@ -1,221 +1,487 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * palloc.c - * - */ #include "pfunction.h" #include "pexception.h" #include "pfmtlog.h" +#include "pmath.h" +#include "pstonum.h" +#include "pstrutil.h" #include "putil.h" -#include <cmath> +#include <array> +#include <map> #include <stack> +#include <type_traits> +#include <utility> namespace plib { -void pfunction::compile(const std::vector<pstring> &inputs, const pstring &expr) -{ - if (plib::startsWith(expr, "rpn:")) - compile_postfix(inputs, expr.substr(4)); - else - compile_infix(inputs, expr); -} - -void pfunction::compile_postfix(const std::vector<pstring> &inputs, const pstring &expr) -{ - std::vector<pstring> cmds(plib::psplit(expr, " ")); - compile_postfix(inputs, cmds, expr); -} - -void pfunction::compile_postfix(const std::vector<pstring> &inputs, - const std::vector<pstring> &cmds, const pstring &expr) -{ - m_precompiled.clear(); - int stk = 0; - - for (const pstring &cmd : cmds) + PERRMSGV(MF_FUNCTION_UNKNOWN_TOKEN, 2, "pfunction: unknown/misformatted token <{1}> in <{2}>") + PERRMSGV(MF_FUNCTION_STACK_UNDERFLOW, 2, "pfunction: stack underflow on token <{1}> in <{2}>") + PERRMSGV(MF_FUNCTION_STACK_OVERFLOW, 2, "pfunction: stack overflow on token <{1}> in <{2}>") + PERRMSGV(MF_FUNCTION_PARENTHESIS_INEQUALITY, 2, "pfunction: parenthesis inequality on token <{1}> in <{2}>") + PERRMSGV(MF_FUNCTION_STACK_UNEQUAL_ONE, 2, "pfunction: stack count {1} different to one on <{2}>") + PERRMSGV(MF_FUNCTION_STACK_UNDERFLOW_INFIX, 1, "pfunction: stack underflow during infix parsing of: <{1}>") + + static constexpr const std::size_t MAX_STACK = 32; + + struct pcmd_t + { + rpn_cmd cmd; + int adj; + int prio; + }; + + static const std::map<pstring, pcmd_t> &pcmds() + { + static const std::map<pstring, pcmd_t> lpcmds = + { + { "^", { POW, 1, 30 } }, + { "neg", { NEG, 0, 25 } }, + { "+", { ADD, 1, 10 } }, + { "-", { SUB, 1, 10 } }, + { "*", { MULT, 1, 20 } }, + { "/", { DIV, 1, 20 } }, + { "<", { LT, 1, 9 } }, + { ">", { GT, 1, 9 } }, + { "<=", { LE, 1, 9 } }, + { ">=", { GE, 1, 9 } }, + { "==", { EQ, 1, 8 } }, + { "!=", { NE, 1, 8 } }, + { "if", { IF, 2, 0 } }, + { "pow", { POW, 1, 0 } }, + { "log", { LOG, 0, 0 } }, + { "sin", { SIN, 0, 0 } }, + { "cos", { COS, 0, 0 } }, + { "max", { MAX, 1, 0 } }, + { "min", { MIN, 1, 0 } }, + { "trunc", { TRUNC, 0, 0 } }, + { "rand", { RAND, -1, 0 } }, + + { "(", { LP, 0, 1 } }, + { ")", { RP, 0, 1 } }, + }; + return lpcmds; + } + // FIXME: Exa parsing conflicts with e,E parsing + template<typename F> + static const std::map<pstring, F> &units_si() + { + static std::map<pstring, F> units_si_stat = + { + //{ "Y", narrow_cast<F>(1e24) }, // NOLINT: Yotta + //{ "Z", narrow_cast<F>(1e21) }, // NOLINT: Zetta + //{ "E", narrow_cast<F>(1e18) }, // NOLINT: Exa + { "P", narrow_cast<F>(1e15) }, // NOLINT: Peta + { "T", narrow_cast<F>(1e12) }, // NOLINT: Tera + { "G", narrow_cast<F>( 1e9) }, // NOLINT: Giga + { "M", narrow_cast<F>( 1e6) }, // NOLINT: Mega + { "k", narrow_cast<F>( 1e3) }, // NOLINT: Kilo + { "h", narrow_cast<F>( 1e2) }, // NOLINT: Hecto + //{ "da", narrow_cast<F>(1e1) }, // NOLINT: Deca + { "d", narrow_cast<F>(1e-1) }, // NOLINT: Deci + { "c", narrow_cast<F>(1e-2) }, // NOLINT: Centi + { "m", narrow_cast<F>(1e-3) }, // NOLINT: Milli + { "μ", narrow_cast<F>(1e-6) }, // NOLINT: Micro + { "n", narrow_cast<F>(1e-9) }, // NOLINT: Nano + { "p", narrow_cast<F>(1e-12) }, // NOLINT: Pico + { "f", narrow_cast<F>(1e-15) }, // NOLINT: Femto + { "a", narrow_cast<F>(1e-18) }, // NOLINT: Atto + { "z", narrow_cast<F>(1e-21) }, // NOLINT: Zepto + { "y", narrow_cast<F>(1e-24) }, // NOLINT: Yocto + }; + return units_si_stat; + } + + + template <typename NT> + void pfunction<NT>::compile(const pstring &expr, const inputs_container &inputs) noexcept(false) { - rpn_inst rc; - if (cmd == "+") - { rc.m_cmd = ADD; stk -= 1; } - else if (cmd == "-") - { rc.m_cmd = SUB; stk -= 1; } - else if (cmd == "*") - { rc.m_cmd = MULT; stk -= 1; } - else if (cmd == "/") - { rc.m_cmd = DIV; stk -= 1; } - else if (cmd == "pow") - { rc.m_cmd = POW; stk -= 1; } - else if (cmd == "sin") - { rc.m_cmd = SIN; stk -= 0; } - else if (cmd == "cos") - { rc.m_cmd = COS; stk -= 0; } - else if (cmd == "trunc") - { rc.m_cmd = TRUNC; stk -= 0; } - else if (cmd == "rand") - { rc.m_cmd = RAND; stk += 1; } + if (plib::startsWith(expr, "rpn:")) + compile_postfix(expr.substr(4), inputs); else + compile_infix(expr, inputs); + } + + template <typename NT> + void pfunction<NT>::compile_postfix(const pstring &expr, const inputs_container &inputs) noexcept(false) + { + std::vector<pstring> cmds(plib::psplit(expr, ' ')); + compile_postfix(inputs, cmds, expr); + } + + template <typename NT> + void pfunction<NT>::compile_postfix(const inputs_container &inputs, + const std::vector<pstring> &cmds, const pstring &expr) noexcept(false) + { + m_precompiled.clear(); + int stk = 0; + + for (const pstring &cmd : cmds) { - for (std::size_t i = 0; i < inputs.size(); i++) + rpn_inst rc; + auto p = pcmds().find(cmd); + if (p != pcmds().end()) + { + rc = rpn_inst(p->second.cmd); + stk -= p->second.adj; + } + else { - if (inputs[i] == cmd) + for (std::size_t i = 0; i < inputs.size(); i++) + { + if (inputs[i] == cmd) + { + rc = rpn_inst(PUSH_INPUT, i); + stk += 1; + break; + } + } + if (rc.cmd() != PUSH_INPUT) { - rc.m_cmd = PUSH_INPUT; - rc.m_param = static_cast<double>(i); + bool err(false); + auto rs(plib::right(cmd,1)); + auto r=units_si<NT>().find(rs); + if (r == units_si<NT>().end()) + rc = rpn_inst(plib::pstonum_ne<NT>(cmd, err)); + else + rc = rpn_inst(plib::pstonum_ne<NT>(plib::left(cmd, cmd.length()-1), err) * r->second); + if (err) + throw pexception(MF_FUNCTION_UNKNOWN_TOKEN(cmd, expr)); stk += 1; - break; } } - if (rc.m_cmd != PUSH_INPUT) - { - rc.m_cmd = PUSH_CONST; - bool err; - rc.m_param = plib::pstonum_ne<decltype(rc.m_param), true>(cmd, err); - if (err) - throw plib::pexception(plib::pfmt("pfunction: unknown/misformatted token <{1}> in <{2}>")(cmd)(expr)); - stk += 1; - } + if (stk < 1) + throw pexception(MF_FUNCTION_STACK_UNDERFLOW(cmd, expr)); + if (stk >= narrow_cast<int>(MAX_STACK)) + throw pexception(MF_FUNCTION_STACK_OVERFLOW(cmd, expr)); + if (rc.cmd() == LP || rc.cmd() == RP) + throw pexception(MF_FUNCTION_PARENTHESIS_INEQUALITY(cmd, expr)); + m_precompiled.push_back(rc); } - if (stk < 1) - throw plib::pexception(plib::pfmt("pfunction: stack underflow on token <{1}> in <{2}>")(cmd)(expr)); - m_precompiled.push_back(rc); + if (stk != 1) + throw pexception(MF_FUNCTION_STACK_UNEQUAL_ONE(stk, expr)); + compress(); + } + + static bool is_number(const pstring &n) + { + if (n.empty()) + return false; + const auto l = n.substr(0,1); + return (l >= "0" && l <= "9"); + } + + static bool is_id(const pstring &n) + { + if (n.empty()) + return false; + const auto l = n.substr(0,1); + return ((l >= "a" && l <= "z") || (l >= "A" && l <= "Z")); } - if (stk != 1) - throw plib::pexception(plib::pfmt("pfunction: stack count different to one on <{2}>")(expr)); -} - -static int get_prio(const pstring &v) -{ - if (v == "(" || v == ")") - return 1; - else if (plib::left(v, 1) >= "a" && plib::left(v, 1) <= "z") - return 0; - else if (v == "*" || v == "/") - return 20; - else if (v == "+" || v == "-") - return 10; - else if (v == "^") - return 30; - else + + static int get_prio(const pstring &v) + { + auto p = pcmds().find(v); + if (p != pcmds().end()) + return p->second.prio; + if (plib::left(v, 1) >= "a" && plib::left(v, 1) <= "z") + return 0; return -1; -} - -static pstring pop_check(std::stack<pstring> &stk, const pstring &expr) -{ - if (stk.size() == 0) - throw plib::pexception(plib::pfmt("pfunction: stack underflow during infix parsing of: <{1}>")(expr)); - pstring res = stk.top(); - stk.pop(); - return res; -} - -void pfunction::compile_infix(const std::vector<pstring> &inputs, const pstring &expr) -{ - // Shunting-yard infix parsing - std::vector<pstring> sep = {"(", ")", ",", "*", "/", "+", "-", "^"}; - std::vector<pstring> sexpr(plib::psplit(plib::replace_all(expr, pstring(" "), pstring("")), sep)); - std::stack<pstring> opstk; - std::vector<pstring> postfix; - - for (std::size_t i = 0; i < sexpr.size(); i++) + } + + static pstring pop_check(std::stack<pstring> &stk, const pstring &expr) noexcept(false) { - pstring &s = sexpr[i]; - if (s=="(") - opstk.push(s); - else if (s==")") + if (stk.empty()) + throw pexception(MF_FUNCTION_STACK_UNDERFLOW_INFIX(expr)); + pstring res = stk.top(); + stk.pop(); + return res; + } + + template <typename NT> + void pfunction<NT>::compile_infix(const pstring &expr, const inputs_container &inputs) + { + // Shunting-yard infix parsing + std::vector<pstring> sep = {"(", ")", ",", "*", "/", "+", "-", "^", "<=", ">=", "==", "!=", "<", ">"}; + std::vector<pstring> sexpr2(plib::psplit(plib::replace_all(expr, " ", ""), sep)); + std::stack<pstring> opstk; + std::vector<pstring> postfix; + std::vector<pstring> sexpr1; + std::vector<pstring> sexpr; + + // FIXME: We really need to switch to ptokenizer and fix negative number + // handling in ptokenizer. + + // Fix numbers exponential numbers + for (std::size_t i = 0; i < sexpr2.size(); ) { - pstring x = pop_check(opstk, expr); - while (x != "(") + if (i + 2 < sexpr2.size() && sexpr2[i].length() > 1) { - postfix.push_back(x); - x = pop_check(opstk, expr); + auto r(plib::right(sexpr2[i], 1)); + auto ne(sexpr2[i+1]); + if ((is_number(sexpr2[i])) + && (r == "e" || r == "E") + && (ne == "-" || ne == "+")) + { + sexpr1.push_back(sexpr2[i] + ne + sexpr2[i+2]); + i+=3; + } + else + sexpr1.push_back(sexpr2[i++]); } - if (opstk.size() > 0 && get_prio(opstk.top()) == 0) - postfix.push_back(pop_check(opstk, expr)); + else + sexpr1.push_back(sexpr2[i++]); } - else if (s==",") + // Fix numbers with unary minus/plus + for (std::size_t i = 0; i < sexpr1.size(); ) { - pstring x = pop_check(opstk, expr); - while (x != "(") + if (sexpr1[i]=="-" && (i+1 < sexpr1.size()) && is_number(sexpr1[i+1])) { - postfix.push_back(x); - x = pop_check(opstk, expr); + if (i==0 || !(is_number(sexpr1[i-1]) || sexpr1[i-1] == ")" || is_id(sexpr1[i-1]))) + { + sexpr.push_back("-" + sexpr1[i+1]); + i+=2; + } + else + sexpr.push_back(sexpr1[i++]); } - opstk.push(x); - } - else { - int p = get_prio(s); - if (p>0) + else if (sexpr1[i]=="-" && (i+1 < sexpr1.size()) && (is_id(sexpr1[i+1]) || sexpr1[i+1] == "(")) { - if (opstk.size() == 0) - opstk.push(s); + if (i==0 || !(is_number(sexpr1[i-1]) || sexpr1[i-1] == ")" || is_id(sexpr1[i-1]))) + { + sexpr.emplace_back("neg"); + sexpr.push_back(sexpr1[i+1]); + i+=2; + } else + sexpr.push_back(sexpr1[i++]); + } + else + sexpr.push_back(sexpr1[i++]); + } + + for (std::size_t i = 0; i < sexpr.size(); i++) + { + pstring &s = sexpr[i]; + if (s=="(") + opstk.push(s); + else if (s==")") + { + pstring x = pop_check(opstk, expr); + while (x != "(") { - if (get_prio(opstk.top()) >= get_prio(s)) - postfix.push_back(pop_check(opstk, expr)); - opstk.push(s); + postfix.push_back(x); + x = pop_check(opstk, expr); } + if (!opstk.empty() && get_prio(opstk.top()) == 0) + postfix.push_back(pop_check(opstk, expr)); } - else if (p == 0) // Function or variable + else if (s==",") { - if (sexpr[i+1] == "(") - opstk.push(s); + pstring x = pop_check(opstk, expr); + while (x != "(") + { + postfix.push_back(x); + x = pop_check(opstk, expr); + } + opstk.push(x); + } + else { + int prio = get_prio(s); + if (prio>0) + { + if (opstk.empty()) + opstk.push(s); + else + { + if (get_prio(opstk.top()) >= prio) + postfix.push_back(pop_check(opstk, expr)); + opstk.push(s); + } + } + else if (prio == 0) // Function or variable + { + if ((i+1<sexpr.size()) && sexpr[i+1] == "(") + opstk.push(s); + else + postfix.push_back(s); + } else postfix.push_back(s); } - else - postfix.push_back(s); } + while (!opstk.empty()) + { + postfix.push_back(opstk.top()); + opstk.pop(); + } + //for (auto &e : postfix) + // printf("\t%s\n", e.c_str()); + compile_postfix(inputs, postfix, expr); + } + + template <typename NT> + static inline std::enable_if_t<plib::is_floating_point<NT>::value, NT> + lfsr_random(std::uint16_t &lfsr) noexcept + { + std::uint16_t lsb = lfsr & 1; + lfsr >>= 1; + if (lsb) + lfsr ^= 0xB400U; // NOLINT: taps 15, 13, 12, 10 + return narrow_cast<NT>(lfsr) / narrow_cast<NT>(0xffffU); // NOLINT } - while (opstk.size() > 0) +#if 0 + // Currently unused since no integral type pfunction defined + template <typename NT> + static inline std::enable_if_t<plib::is_integral<NT>::value, NT> + lfsr_random(std::uint16_t &lfsr) noexcept + { + std::uint16_t lsb = lfsr & 1; + lfsr >>= 1; + if (lsb) + lfsr ^= 0xB400U; // NOLINT: taps 15, 13, 12, 10 + return narrow_cast<NT>(lfsr); + } +#endif + #define ST0 *(ptr+1) + #define ST1 *ptr + #define ST2 *(ptr-1) + + #define OP(OP, ADJ, EXPR) \ + case OP: \ + ptr-= (ADJ); \ + *(ptr-1) = (EXPR); \ + break; + + #define OP0(OP, EXPR) \ + case OP: \ + *(ptr++) = (EXPR); \ + break; + + template <typename NT> + NT pfunction<NT>::evaluate(const values_container &values) noexcept { - postfix.push_back(opstk.top()); - opstk.pop(); + std::array<value_type, MAX_STACK> stack; // NOLINT + value_type *ptr = stack.data(); + constexpr const auto zero = plib::constants<value_type>::zero(); + constexpr const auto one = plib::constants<value_type>::one(); + for (const auto &rc : m_precompiled) + { + switch (rc.cmd()) + { + OP(ADD, 1, ST2 + ST1) + OP(MULT, 1, ST2 * ST1) + OP(SUB, 1, ST2 - ST1) + OP(DIV, 1, ST2 / ST1) + OP(EQ, 1, ST2 == ST1 ? one : zero) + OP(NE, 1, ST2 != ST1 ? one : zero) + OP(GT, 1, ST2 > ST1 ? one : zero) + OP(LT, 1, ST2 < ST1 ? one : zero) + OP(LE, 1, ST2 <= ST1 ? one : zero) + OP(GE, 1, ST2 >= ST1 ? one : zero) + OP(IF, 2, (ST2 != zero) ? ST1 : ST0) + OP(NEG, 0, -ST2) + OP(POW, 1, plib::pow(ST2, ST1)) + OP(LOG, 0, plib::log(ST2)) + OP(SIN, 0, plib::sin(ST2)) + OP(COS, 0, plib::cos(ST2)) + OP(MAX, 1, std::max(ST2, ST1)) + OP(MIN, 1, std::min(ST2, ST1)) + OP(TRUNC, 0, plib::trunc(ST2)) + OP0(RAND, lfsr_random<value_type>(m_lfsr)) + OP0(PUSH_INPUT, values[rc.index()]) + OP0(PUSH_CONST, rc.value()) + // please compiler + case LP: + case RP: + break; + } + } + return *(ptr-1); } - compile_postfix(inputs, postfix, expr); -} +#undef ST0 +#undef ST1 +#undef ST2 +#undef OP +#undef OP0 -#define ST1 stack[ptr] -#define ST2 stack[ptr-1] +#define ST0 m_precompiled[ptr+0].value() +#define ST1 m_precompiled[ptr-1].value() +#define ST2 m_precompiled[ptr-2].value() #define OP(OP, ADJ, EXPR) \ -case OP: \ - ptr-= (ADJ); \ - stack[ptr-1] = (EXPR); \ - break; - -double pfunction::evaluate(const std::vector<double> &values) -{ - std::array<double, 20> stack = { 0 }; - unsigned ptr = 0; - stack[0] = 0.0; - for (auto &rc : m_precompiled) + case OP: \ + if (ADJ == 2) {\ + if (m_precompiled[ptr-3].cmd() == PUSH_CONST && m_precompiled[ptr-2].cmd() == PUSH_CONST && m_precompiled[ptr-1].cmd() == PUSH_CONST) \ + { ptr--; m_precompiled[ptr-2] = rpn_inst(EXPR); n -= 3; ptr++; std::copy(m_precompiled.begin()+(ptr+1), m_precompiled.end(), m_precompiled.begin()+(ptr-2)); ptr-=2;} \ + else { ptr++; } \ + } else if (ADJ == 1) {\ + if (m_precompiled[ptr-2].cmd() == PUSH_CONST && m_precompiled[ptr-1].cmd() == PUSH_CONST) \ + { m_precompiled[ptr-2] = rpn_inst(EXPR); n -= 2; std::copy(m_precompiled.begin()+(ptr+1), m_precompiled.end(), m_precompiled.begin()+(ptr-1)); ptr--;} \ + else { ptr++; } \ + } else if (ADJ == 0) {\ + if (m_precompiled[ptr-1].cmd() == PUSH_CONST) \ + { ptr++; m_precompiled[ptr-2] = rpn_inst(EXPR); n -= 1; ptr--; std::copy(m_precompiled.begin()+(ptr+1), m_precompiled.end(), m_precompiled.begin()+(ptr)); } \ + else { ptr++; } \ + } else ptr++; \ + break; + +#define OP0(OP, EXPR) \ + case OP: \ + ptr++; \ + break; + + template <typename NT> + void pfunction<NT>::compress() { - switch (rc.m_cmd) + constexpr const auto zero = plib::constants<value_type>::zero(); + constexpr const auto one = plib::constants<value_type>::one(); + unsigned ptr = 0; + auto n = m_precompiled.size(); + for (; ptr < n; ) { - OP(ADD, 1, ST2 + ST1) - OP(MULT, 1, ST2 * ST1) - OP(SUB, 1, ST2 - ST1) - OP(DIV, 1, ST2 / ST1) - OP(POW, 1, std::pow(ST2, ST1)) - OP(SIN, 0, std::sin(ST2)) - OP(COS, 0, std::cos(ST2)) - OP(TRUNC, 0, std::trunc(ST2)) - case RAND: - stack[ptr++] = lfsr_random(); - break; - case PUSH_INPUT: - stack[ptr++] = values[static_cast<unsigned>(rc.m_param)]; - break; - case PUSH_CONST: - stack[ptr++] = rc.m_param; - break; + switch (m_precompiled[ptr].cmd()) + { + OP(ADD, 1, ST2 + ST1) + OP(MULT, 1, ST2 * ST1) + OP(SUB, 1, ST2 - ST1) + OP(DIV, 1, ST2 / ST1) + OP(EQ, 1, ST2 == ST1 ? one : zero) + OP(NE, 1, ST2 != ST1 ? one : zero) + OP(GT, 1, ST2 > ST1 ? one : zero) + OP(LT, 1, ST2 < ST1 ? one : zero) + OP(LE, 1, ST2 <= ST1 ? one : zero) + OP(GE, 1, ST2 >= ST1 ? one : zero) + OP(IF, 2, (ST2 != zero) ? ST1 : ST0) + OP(NEG, 0, -ST2) + OP(POW, 1, plib::pow(ST2, ST1)) + OP(LOG, 0, plib::log(ST2)) + OP(SIN, 0, plib::sin(ST2)) + OP(COS, 0, plib::cos(ST2)) + OP(MAX, 1, std::max(ST2, ST1)) + OP(MIN, 1, std::min(ST2, ST1)) + OP(TRUNC, 0, plib::trunc(ST2)) + OP0(RAND, lfsr_random<value_type>(m_lfsr)) + OP0(PUSH_INPUT, values[rc.index()]) + OP0(PUSH_CONST, rc.value()) + // please compiler + case LP: + case RP: + break; + } } + //printf("func %lld %lld\n", m_precompiled.size(), n); + m_precompiled.resize(n); } - return stack[ptr-1]; -} + + template class pfunction<float>; + template class pfunction<double>; + template class pfunction<long double>; +#if (PUSE_FLOAT128) + template class pfunction<FLOAT128>; +#endif } // namespace plib diff --git a/src/lib/netlist/plib/pfunction.h b/src/lib/netlist/plib/pfunction.h index bc81ef0c5a6..836c6f9c126 100644 --- a/src/lib/netlist/plib/pfunction.h +++ b/src/lib/netlist/plib/pfunction.h @@ -1,14 +1,14 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pfunction.h - * - */ #ifndef PFUNCTION_H_ #define PFUNCTION_H_ -#include "pstate.h" +/// +/// \file pfunction.h +/// + +#include "pmath.h" #include "pstring.h" #include <vector> @@ -19,100 +19,163 @@ namespace plib { // function evaluation //============================================================ - /*! Class providing support for evaluating expressions - * - */ + enum rpn_cmd + { + ADD, + MULT, + SUB, + DIV, + EQ, + NE, + LT, + GT, + LE, + GE, + IF, + NEG, // unary minus + POW, + LOG, + SIN, + COS, + MIN, + MAX, + RAND, /// random number between 0 and 1 + TRUNC, + + PUSH_CONST, + PUSH_INPUT, + + LP, // Left parenthesis - for infix parsing + RP // right parenthesis - for infix parsing + }; + + /// \brief Class providing support for evaluating expressions + /// + /// \tparam NT Number type, should be float or double + /// + template <typename NT> class pfunction { - enum rpn_cmd - { - ADD, - MULT, - SUB, - DIV, - POW, - SIN, - COS, - RAND, /* random number between 0 and 1 */ - TRUNC, - PUSH_CONST, - PUSH_INPUT - }; struct rpn_inst { - rpn_inst() : m_cmd(ADD), m_param(0.0) { } + constexpr rpn_inst() : m_cmd(ADD) + { + m_param.val = plib::constants<NT>::zero(); + } + constexpr rpn_inst(rpn_cmd cmd, std::size_t index = 0) + : m_cmd(cmd) + { + m_param.index = index; + } + constexpr rpn_inst(NT v) : m_cmd(PUSH_CONST) + { + m_param.val = v; + } + constexpr const rpn_cmd &cmd() const noexcept + { + return m_cmd; + } + constexpr const NT &value() const noexcept + { + return m_param.val; // NOLINT + } + constexpr const std::size_t &index() const noexcept + { + return m_param.index; // NOLINT + } + private: rpn_cmd m_cmd; - double m_param; + union + { + NT val; + std::size_t index; + } m_param; }; public: - /*! Constructor with state saving support - * - * @param name Name of this object - * @param owner Owner of this object - * @param state_manager State manager to handle saving object state - * - */ - pfunction(const pstring &name, const void *owner, state_manager_t &state_manager) - : m_lfsr(0xACE1u) + + using value_type = NT; + + using inputs_container = std::vector<pstring>; + using values_container = std::vector<value_type>; + + /// \brief Constructor + /// + pfunction() + : m_lfsr(0xace1U) // NOLINT { - state_manager.save_item(owner, m_lfsr, name + ".lfsr"); } - /*! Constructor without state saving support - * - */ - pfunction() - : m_lfsr(0xACE1u) + /// \brief Constructor with compile + /// + pfunction(const pstring &expr, const inputs_container &inputs = inputs_container()) + : m_lfsr(0xace1U) // NOLINT { + compile(expr, inputs); } - /*! Compile an expression - * - * @param inputs Vector of input variables, e.g. {"A","B"} - * @param expr infix or postfix expression. default is infix, postrix - * to be prefixed with rpn, e.g. "rpn:A B + 1.3 /" - */ - void compile(const std::vector<pstring> &inputs, const pstring &expr); - - /*! Compile a rpn expression - * - * @param inputs Vector of input variables, e.g. {"A","B"} - * @param expr Reverse polish notation expression, e.g. "A B + 1.3 /" - */ - void compile_postfix(const std::vector<pstring> &inputs, const pstring &expr); - /*! Compile an infix expression - * - * @param inputs Vector of input variables, e.g. {"A","B"} - * @param expr Infix expression, e.g. "(A+B)/1.3" - */ - void compile_infix(const std::vector<pstring> &inputs, const pstring &expr); - /*! Evaluate the expression - * - * @param values for input variables, e.g. {1.1, 2.2} - * @return value of expression - */ - double evaluate(const std::vector<double> &values); + /// \brief Evaluate the expression + /// + /// \param values for input variables, e.g. {1.1, 2.2} + /// \return value of expression + /// + value_type operator()(const values_container &values = values_container()) noexcept + { + return evaluate(values); + } + + /// \brief Compile an expression + /// + /// \param expr infix or postfix expression. default is infix, postfix + /// to be prefixed with rpn, e.g. "rpn:A B + 1.3 /" + /// \param inputs Vector of input variables, e.g. {"A","B"} + /// + void compile(const pstring &expr, const inputs_container &inputs = inputs_container()) noexcept(false); + + /// \brief Compile a rpn expression + /// + /// \param expr Reverse polish notation expression, e.g. "A B + 1.3 /" + /// \param inputs Vector of input variables, e.g. {"A","B"} + /// + void compile_postfix(const pstring &expr, const inputs_container &inputs = inputs_container()) noexcept(false); + + /// \brief Compile an infix expression + /// + /// \param expr Infix expression, e.g. "(A+B)/1.3" + /// \param inputs Vector of input variables, e.g. {"A","B"} + /// + void compile_infix(const pstring &expr, const inputs_container &inputs = inputs_container()) noexcept(false); + + /// \brief Evaluate the expression + /// + /// \param values for input variables, e.g. {1.1, 2.2} + /// \return value of expression + /// + value_type evaluate(const values_container &values = values_container()) noexcept; + + template <typename ST> + void save_state(ST &st) + { + st.save_item(m_lfsr, "m_lfsr"); + } private: - void compile_postfix(const std::vector<pstring> &inputs, + void compress(); + void compile_postfix(const inputs_container &inputs, const std::vector<pstring> &cmds, const pstring &expr); - double lfsr_random() - { - std::uint16_t lsb = m_lfsr & 1; - m_lfsr >>= 1; - if (lsb) - m_lfsr ^= 0xB400u; // taps 15, 13, 12, 10 - return static_cast<double>(m_lfsr) / static_cast<double>(0xffffu); - } - std::vector<rpn_inst> m_precompiled; //!< precompiled expression std::uint16_t m_lfsr; //!< lfsr used for generating random numbers }; + extern template class pfunction<float>; + extern template class pfunction<double>; + extern template class pfunction<long double>; +#if (PUSE_FLOAT128) + extern template class pfunction<FLOAT128>; +#endif } // namespace plib -#endif /* PEXCEPTION_H_ */ +#endif // PEXCEPTION_H_ diff --git a/src/lib/netlist/plib/pgsl.h b/src/lib/netlist/plib/pgsl.h new file mode 100644 index 00000000000..b585e3ed9e3 --- /dev/null +++ b/src/lib/netlist/plib/pgsl.h @@ -0,0 +1,181 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PGSL_H_ +#define PGSL_H_ + +/// +/// \file pgsl.h +/// +/// This core guidelines gsl implementation currently provides only enough +/// functionality to syntactically support a very limited number of the +/// gsl specification. +/// +/// Going forward this approach may be extended. +/// + +#include "pconfig.h" +#include "pexception.h" +#include "ptypes.h" + +#include <exception> +#include <optional> +#include <type_traits> +#include <utility> + +#if defined(__has_builtin) // clang and gcc 10 + #if __has_builtin(__builtin_unreachable) + #define gsl_Expects(e) ((e) ? static_cast<void>(0) : __builtin_unreachable()) + #else + #define gsl_Expects(e) ((e) ? static_cast<void>(0) : static_cast<void>(0)) + #endif +#elif defined(__GNUC__) && !(defined( __CUDACC__ ) && defined( __CUDA_ARCH__ )) + //#define gsl_Expects(e) ((e) ? static_cast<void>(0) : __builtin_unreachable()) + #define gsl_Expects(e) (__builtin_expect(!!(e), 1) ? static_cast<void>(0) : __builtin_unreachable()) +#elif defined(_MSC_VER) + #define gsl_Expects(e) __assume(e) +#else + #define gsl_Expects(e) ((e) ? static_cast<void>(0) : static_cast<void>(0)) +#endif + +#if 1 +// FIXME: __builtin_unreachable contrary to google sources does not seem to be of +// any use and decreases performance slightly. Convert gsl_Expects to a noop +// and revisit in the future. +#undef gsl_Expects +#define gsl_Expects(e) do {} while (0) + +#if 0 +// Alternative and c++ style implementation. Suffers from the same drawbacks +// like __builtin_unreachable +static constexpr inline void gsl_Expects(const bool &e) +{ + if (!e) + __builtin_unreachable(); +} +#endif +#endif + +#define gsl_Ensures(e) gsl_Expects(e) + +namespace plib { + namespace pgsl { + + struct narrowing_error : public std::exception {}; + + template <typename T> + using owner = T; + + template <typename T> + using not_null = T; + + /// \brief perform a narrowing cast without checks + /// + template <typename T, typename O> + constexpr T narrow_cast(O && v) noexcept + { + static_assert(plib::is_arithmetic<T>::value && std::is_convertible<std::remove_reference_t<O>, T>::value, "narrow cast expects conversion between arithmetic types"); + return static_cast<T>(std::forward<O>(v)); + } + + /// \brief perform a narrowing cast terminating if loss of precision + /// + /// The c++ core guidelines require the narrow function to raise an error + /// This will make narrow noexcept(false). This has shown to have a + /// measurable impact on performance and thus we deviate from + /// the standard here. + /// + template <typename T, typename O> + inline T narrow(O && v) noexcept + { + static_assert(plib::is_arithmetic<T>::value && std::is_convertible<std::remove_reference_t<O>, T>::value, "narrow cast expects conversion between arithmetic types"); + + const auto val = static_cast<T>(std::forward<O>(v)); + if( v == static_cast<std::remove_reference_t<O>>(val)) + { + return val; + } + + plib::terminate("narrowing_error"); + // throw narrowing_error(); + } + + } // namespace pgsl + + /// \brief dynamic downcast from base type pointer to derived type pointer + /// + /// This is a `noexcept` dynamic_cast implementation. It will return the cast + /// wrapped into a std::optional type forcing the caller to + /// examine if the conversion was successful. + /// + /// \tparam D Derived type + /// \tparam B Base type + /// \param base pointer to type B + /// \returns return_success_t + /// + template <typename D, typename B> + std::enable_if_t<std::is_pointer_v<D> && std::is_pointer_v<std::remove_reference_t<B>>, + std::optional<D>> + dynamic_downcast(B base) noexcept + { + D ret = dynamic_cast<D>(base); + if (ret != nullptr) + return ret; + return std::nullopt; + } + + /// \brief dynamic downcast from base type reference to derived type pointer + /// + /// This is a `noexcept` dynamic_cast implementation. It will return the + /// pointer cast wrapped into a std::optional type forcing the caller to + /// examine if the conversion was successful. + /// + /// The return value is a pointer cast since there is no std::optional for + /// references. Such a construct is considered ill-formed according to + /// the std::optional specification (Section 5.2, p1). + /// + /// \tparam D Derived type + /// \tparam B Base type + /// \param base reference of type B + /// \returns return_success_t + /// + template <typename D, typename B> + std::enable_if_t<std::is_pointer_v<D> &&!std::is_pointer_v<std::remove_reference_t<B>> , + std::optional<D>> + dynamic_downcast(B &base) noexcept + { + D ret = dynamic_cast<D>(&base); + if (ret != nullptr) + return ret; + return std::nullopt; + } + + /// \brief downcast from base type to derived type + /// + /// The cpp core guidelines require a very careful use of static cast + /// for downcast operations. This template is used to identify these uses + /// and later for debug builds use dynamic_cast. + /// + template <typename D, typename B> + constexpr D downcast(B && b) noexcept + { + static_assert((std::is_pointer<D>::value && std::is_pointer<B>::value) + || (std::is_reference<D>::value && std::is_reference<B>::value), "downcast only supports pointers or reference for derived"); + return static_cast<D>(std::forward<B>(b)); + } + + using pgsl::narrow_cast; + + /// \brief cast to void * + /// + /// The purpose of void_ptr_cast is to help identify casts to void in the code. + /// + template <typename T> + constexpr void * void_ptr_cast(T *ptr) noexcept { return static_cast<void *>(ptr); } + +} // namespace plib + +//FIXME: This is the place to use more complete implementations +namespace gsl = plib::pgsl; + +#endif // PGSL_H_ diff --git a/src/lib/netlist/plib/plists.h b/src/lib/netlist/plib/plists.h index 525a65a97f2..2e389f34b54 100644 --- a/src/lib/netlist/plib/plists.h +++ b/src/lib/netlist/plib/plists.h @@ -1,281 +1,323 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * plists.h - * - */ - -#pragma once #ifndef PLISTS_H_ #define PLISTS_H_ -#include "pstring.h" +/// +/// \file plists.h +/// + +#include "ptypes.h" +#include <algorithm> #include <array> #include <type_traits> -#include <vector> +#include <utility> namespace plib { -/* ---------------------------------------------------------------------------------------- - * uninitialised_array_t: - * fixed size array allowing to override constructor and initialize - * members by placement new. - * - * Use with care. This template is provided to improve locality of storage - * in high frequency applications. It should not be used for anything else. - * ---------------------------------------------------------------------------------------- */ - -template <class C, std::size_t N> -class uninitialised_array_t -{ -public: - - using iterator = C *; - using const_iterator = const C *; - - //uninitialised_array_t() noexcept = default; - uninitialised_array_t() noexcept - : m_initialized(0) - { - } - COPYASSIGNMOVE(uninitialised_array_t, delete) - ~uninitialised_array_t() noexcept + /// \brief Array holding uninitialized elements + /// + /// Use with care. This template is provided to improve locality of storage + /// in high frequency applications. It should not be used for anything else. + /// + template <class C, std::size_t N> + class uninitialised_array { - if (m_initialized>=N) - for (std::size_t i=0; i<N; i++) - (*this)[i].~C(); - } + public: - size_t size() const { return N; } + using value_type = C; + using pointer = value_type *; + using const_pointer = const value_type *; + using reference = value_type &; + using const_reference = const value_type &; + using iterator = value_type *; + using const_iterator = const value_type *; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using reverse_iterator = std::reverse_iterator<iterator>; + using const_reverse_iterator = std::reverse_iterator<const_iterator>; - C& operator[](const std::size_t &index) noexcept - { - return *reinterpret_cast<C *>(&m_buf[index]); - } + constexpr uninitialised_array() noexcept = default; - const C& operator[](const std::size_t &index) const noexcept - { - return *reinterpret_cast<const C *>(&m_buf[index]); - } + constexpr uninitialised_array(const uninitialised_array &) = default; + constexpr uninitialised_array &operator=(const uninitialised_array &) = default; + constexpr uninitialised_array(uninitialised_array &&) noexcept = default; + constexpr uninitialised_array &operator=(uninitialised_array &&) noexcept = default; - template<typename... Args> - void emplace(const std::size_t index, Args&&... args) - { - m_initialized++; - // allocate on buffer - new (&m_buf[index]) C(std::forward<Args>(args)...); - } + ~uninitialised_array() noexcept = default; - iterator begin() const noexcept { return reinterpret_cast<iterator>(&m_buf[0]); } - iterator end() const noexcept { return reinterpret_cast<iterator>(&m_buf[N]); } + constexpr size_t size() const noexcept { return N; } - iterator begin() noexcept { return reinterpret_cast<iterator>(&m_buf[0]); } - iterator end() noexcept { return reinterpret_cast<iterator>(&m_buf[N]); } + constexpr bool empty() const noexcept { return size() == 0; } - const_iterator cbegin() const noexcept { return reinterpret_cast<const_iterator>(&m_buf[0]); } - const_iterator cend() const noexcept { return reinterpret_cast<const_iterator>(&m_buf[N]); } + constexpr reference operator[](size_type index) noexcept + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return reinterpret_cast<reference>(m_buf[index]); + } -protected: + constexpr const_reference operator[](size_type index) const noexcept + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return reinterpret_cast<const_reference>(m_buf[index]); + } -private: + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator begin() const noexcept { return reinterpret_cast<iterator>(&m_buf[0]); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator end() const noexcept { return reinterpret_cast<iterator>(&m_buf[0] + N); } - /* ensure proper alignment */ - PALIGNAS_VECTOROPT() - std::array<typename std::aligned_storage<sizeof(C), alignof(C)>::type, N> m_buf; - unsigned m_initialized; -}; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator begin() noexcept { return reinterpret_cast<iterator>(&m_buf[0]); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator end() noexcept { return reinterpret_cast<iterator>(&m_buf[0] + N); } -// ---------------------------------------------------------------------------------------- -// plinkedlist_t: a simple linked list -// the list allows insertions / deletions if used properly -// ---------------------------------------------------------------------------------------- + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr const_iterator cbegin() const noexcept { return reinterpret_cast<const_iterator>(&m_buf[0]); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr const_iterator cend() const noexcept { return reinterpret_cast<const_iterator>(&m_buf[0] + N); } -#if 0 -template <class LC> -class linkedlist_t -{ -public: + private: + std::array<typename std::aligned_storage<sizeof(C), alignof(C)>::type, N> m_buf; + }; - struct element_t + /// \brief fixed allocation vector + /// + /// Currently only emplace_back and clear are supported. + /// + /// Use with care. This template is provided to improve locality of storage + /// in high frequency applications. It should not be used for anything else. + /// + template <class C, std::size_t N> + class static_vector { public: - friend class linkedlist_t<LC>; - - constexpr element_t() : m_next(nullptr) {} - constexpr element_t(const element_t &rhs) = delete; - constexpr element_t(element_t &&rhs) = delete; + using value_type = C; + using pointer = value_type *; + using const_pointer = const value_type *; + using reference = value_type &; + using const_reference = const value_type &; + using iterator = value_type *; + using const_iterator = const value_type *; + using size_type = std::size_t; + using difference_type = std::ptrdiff_t; + using reverse_iterator = std::reverse_iterator<iterator>; + using const_reverse_iterator = std::reverse_iterator<const_iterator>; + + constexpr static_vector() noexcept + : m_pos(0) + { + } - constexpr LC *next() const noexcept { return m_next; } + constexpr static_vector(const static_vector &) = default; + constexpr static_vector &operator=(const static_vector &) = default; + constexpr static_vector(static_vector &&) noexcept = default; + constexpr static_vector &operator=(static_vector &&) noexcept = default; - protected: - ~element_t() = default; - private: - LC * m_next; - }; + ~static_vector() noexcept + { + clear(); + } - struct iter_t final : public std::iterator<std::forward_iterator_tag, LC> - { - private: - LC* p; - public: - explicit constexpr iter_t(LC* x) noexcept : p(x) { } - explicit constexpr iter_t(const iter_t &rhs) noexcept : p(rhs.p) { } - iter_t(iter_t &&rhs) noexcept { std::swap(*this, rhs); } - iter_t& operator=(const iter_t &rhs) { iter_t t(rhs); std::swap(*this, t); return *this; } - iter_t& operator=(iter_t &&rhs) { std::swap(*this, rhs); return *this; } - iter_t& operator++() noexcept {p = p->next();return *this;} - iter_t operator++(int) noexcept {iter_t tmp(*this); operator++(); return tmp;} - constexpr bool operator==(const iter_t& rhs) const noexcept {return p == rhs.p;} - constexpr bool operator!=(const iter_t& rhs) const noexcept {return p != rhs.p;} - /* constexpr */ LC& operator*() noexcept {return *p;} - /* constexpr */ LC* operator->() noexcept {return p;} - - constexpr LC& operator*() const noexcept {return *p;} - constexpr LC* operator->() const noexcept {return p;} - }; + constexpr size_t size() const noexcept { return m_pos; } - constexpr linkedlist_t() : m_head(nullptr) {} + constexpr bool empty() const noexcept { return size() == 0; } - constexpr iter_t begin() const noexcept { return iter_t(m_head); } - constexpr iter_t end() const noexcept { return iter_t(nullptr); } + constexpr void clear() + { + for (size_type i=0; i<m_pos; ++i) + (*this)[i].~C(); + m_pos = 0; + } - void push_front(LC *elem) noexcept - { - elem->m_next = m_head; - m_head = elem; - } + template<typename... Args> + constexpr void emplace_back(Args&&... args) + { + // placement new on buffer + new (&m_buf[m_pos]) C(std::forward<Args>(args)...); + m_pos++; + } - void push_back(LC *elem) noexcept - { - LC **p = &m_head; - while (*p != nullptr) + constexpr reference operator[](size_type index) noexcept { - p = &((*p)->m_next); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return reinterpret_cast<reference>(m_buf[index]); } - *p = elem; - elem->m_next = nullptr; - } - void remove(const LC *elem) noexcept - { - auto p = &m_head; - while(*p != elem) + constexpr const_reference operator[](size_type index) const noexcept { - //nl_assert(*p != nullptr); - p = &((*p)->m_next); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return reinterpret_cast<const_reference>(m_buf[index]); } - (*p) = elem->m_next; - } - LC *front() const noexcept { return m_head; } - void clear() noexcept { m_head = nullptr; } - constexpr bool empty() const noexcept { return (m_head == nullptr); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator begin() const noexcept { return reinterpret_cast<iterator>(&m_buf[0]); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator end() const noexcept { return reinterpret_cast<iterator>(&m_buf[0] + m_pos); } -private: - LC *m_head; -}; -#else -template <class LC> -class linkedlist_t -{ -public: + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator begin() noexcept { return reinterpret_cast<iterator>(&m_buf[0]); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr iterator end() noexcept { return reinterpret_cast<iterator>(&m_buf[0] + m_pos); } + + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr const_iterator cbegin() const noexcept { return reinterpret_cast<const_iterator>(&m_buf[0]); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + constexpr const_iterator cend() const noexcept { return reinterpret_cast<const_iterator>(&m_buf[0] + m_pos); } + + private: + std::array<typename std::aligned_storage<sizeof(C), alignof(C)>::type, N> m_buf; + size_type m_pos; + }; - struct element_t + /// \brief a simple linked list. + /// + /// The list allows insertions and deletions whilst being processed. + /// + template <class LC, int TAG> + class linked_list_t { public: + using ttag = std::integral_constant<int, TAG>; - friend class linkedlist_t<LC>; + struct element_t + { + public: + using tag = std::integral_constant<int, TAG>; - constexpr element_t() : m_next(nullptr), m_prev(nullptr) {} - ~element_t() noexcept = default; + friend class linked_list_t<LC, TAG>; - COPYASSIGNMOVE(element_t, delete) + constexpr element_t() noexcept : m_next(nullptr), m_prev(nullptr) {} + ~element_t() noexcept = default; - constexpr LC *next() const noexcept { return m_next; } - constexpr LC *prev() const noexcept { return m_prev; } - private: - LC * m_next; - LC * m_prev; - }; + constexpr element_t(const element_t &) noexcept = default; + constexpr element_t &operator=(const element_t &) noexcept = default; + constexpr element_t(element_t &&) noexcept = default; + constexpr element_t &operator=(element_t &&) noexcept = default; - struct iter_t final : public std::iterator<std::forward_iterator_tag, LC> - { - private: - LC* p; - public: - explicit constexpr iter_t(LC* x) noexcept : p(x) { } - constexpr iter_t(iter_t &rhs) noexcept : p(rhs.p) { } - iter_t(iter_t &&rhs) noexcept { std::swap(*this, rhs); } - iter_t& operator=(const iter_t &rhs) noexcept { iter_t t(rhs); std::swap(*this, t); return *this; } - iter_t& operator=(iter_t &&rhs) noexcept { std::swap(*this, rhs); return *this; } - iter_t& operator++() noexcept {p = p->next();return *this;} - // NOLINTNEXTLINE(cert-dcl21-cpp) - iter_t operator++(int) & noexcept {const iter_t tmp(*this); operator++(); return tmp;} - - ~iter_t() = default; - - constexpr bool operator==(const iter_t& rhs) const noexcept {return p == rhs.p;} - constexpr bool operator!=(const iter_t& rhs) const noexcept {return p != rhs.p;} - /* constexpr */ LC& operator*() noexcept {return *p;} - /* constexpr */ LC* operator->() noexcept {return p;} - - constexpr LC& operator*() const noexcept {return *p;} - constexpr LC* operator->() const noexcept {return p;} - }; + private: + element_t * m_next; + element_t * m_prev; + }; - constexpr linkedlist_t() : m_head(nullptr) {} + struct iter_t final + { + private: + element_t * p; + public: + using tag = std::integral_constant<int, TAG>; + using iterator_category = std::forward_iterator_tag; + using value_type = LC; + using pointer = value_type *; + using reference = value_type &; + using difference_type = std::ptrdiff_t; + + explicit constexpr iter_t(element_t * x) noexcept : p(x) { } + + constexpr iter_t(const iter_t &rhs) noexcept = default; + constexpr iter_t(iter_t &&rhs) noexcept = default; + constexpr iter_t& operator=(const iter_t &rhs) noexcept = default; + constexpr iter_t& operator=(iter_t &&rhs) noexcept = default; + + ~iter_t() noexcept = default; + + iter_t& operator++() noexcept { p = p->m_next; return *this; } + // NOLINTNEXTLINE(cert-dcl21-cpp) + iter_t operator++(int) & noexcept { const iter_t tmp(*this); operator++(); return tmp; } + + constexpr bool operator==(const iter_t& rhs) const noexcept { return p == rhs.p; } + constexpr bool operator!=(const iter_t& rhs) const noexcept { return p != rhs.p; } +#if 0 + constexpr LC& operator*() noexcept { return *static_cast<LC *>(p); } + constexpr LC* operator->() noexcept { return static_cast<LC *>(p); } - constexpr iter_t begin() const noexcept { return iter_t(m_head); } - constexpr iter_t end() const noexcept { return iter_t(nullptr); } + constexpr LC& operator*() const noexcept { return *static_cast<LC *>(p); } + constexpr LC* operator->() const noexcept { return static_cast<LC *>(p); } +#else + constexpr LC* operator*() noexcept { return static_cast<LC *>(p); } + constexpr LC* operator->() noexcept { return static_cast<LC *>(p); } - void push_front(LC *elem) noexcept - { - if (m_head) - m_head->m_prev = elem; - elem->m_next = m_head; - elem->m_prev = nullptr; - m_head = elem; - } - - void push_back(LC *elem) noexcept - { - LC ** p(&m_head); - LC * prev(nullptr); - while (*p != nullptr) + constexpr LC* operator*() const noexcept { return static_cast<LC *>(p); } + constexpr LC* operator->() const noexcept { return static_cast<LC *>(p); } +#endif + }; + + constexpr linked_list_t() noexcept : m_head(nullptr) {} + + constexpr iter_t begin() const noexcept { return iter_t(m_head); } + constexpr iter_t end() const noexcept { return iter_t(nullptr); } + + constexpr void push_front(element_t *elem) noexcept { - prev = *p; - p = &((*p)->m_next); + elem->m_next = m_head; + elem->m_prev = nullptr; + if (m_head) + m_head->m_prev = elem; + m_head = elem; } - *p = elem; - elem->m_prev = prev; - elem->m_next = nullptr; - } - void remove(const LC *elem) noexcept - { - if (elem->m_prev) - elem->m_prev->m_next = elem->m_next; - else - m_head = elem->m_next; - if (elem->m_next) - elem->m_next->m_prev = elem->m_prev; - else + constexpr void push_back(element_t *elem) noexcept { - /* update tail */ + element_t ** p(&m_head); + element_t * prev(nullptr); + while (*p != nullptr) + { + prev = *p; + p = &((*p)->m_next); + } + *p = elem; + elem->m_prev = prev; + elem->m_next = nullptr; } - } - LC *front() const noexcept { return m_head; } - void clear() noexcept { m_head = nullptr; } - constexpr bool empty() const noexcept { return (m_head == nullptr); } + constexpr void remove(const element_t *elem) noexcept + { + if (elem->m_prev) + elem->m_prev->m_next = elem->m_next; + else + m_head = elem->m_next; + if (elem->m_next) + elem->m_next->m_prev = elem->m_prev; + else + { + // update tail + } + } + + constexpr LC *front() const noexcept { return m_head; } + constexpr bool empty() const noexcept { return (m_head == nullptr); } + constexpr std::size_t size() const noexcept + { + std::size_t ret = 0; + element_t *p = m_head; + while (p != nullptr) + { + ret++; + p = p->m_next; + } + return ret; + } + + constexpr void clear() noexcept + { + element_t *p(m_head); + while (p != nullptr) + { + element_t *n(p->m_next); + p->m_next = nullptr; + p->m_prev = nullptr; + p = n; + } + m_head = nullptr; + } + + private: + element_t *m_head; + }; -private: - LC *m_head; -}; -#endif } // namespace plib -#endif /* PLISTS_H_ */ +#endif // PLISTS_H_ diff --git a/src/lib/netlist/plib/pmain.cpp b/src/lib/netlist/plib/pmain.cpp index 1ecf0a4d032..ef1f47077e5 100644 --- a/src/lib/netlist/plib/pmain.cpp +++ b/src/lib/netlist/plib/pmain.cpp @@ -1,80 +1,47 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pmain.cpp - * - */ #include "pmain.h" -#ifdef _WIN32 -#include <windows.h> -#include <string.h> -#include <tchar.h> -#endif - namespace plib { - #ifdef _WIN32 - static pstring toutf8(const wchar_t *w) - { - auto wlen = wcslen(w); - int dst_char_count = WideCharToMultiByte(CP_UTF8, 0, w, wlen, nullptr, 0, nullptr, nullptr); - char *buf = new char[dst_char_count + 1]; - WideCharToMultiByte(CP_UTF8, 0, w, wlen, buf, dst_char_count, nullptr, nullptr); - buf[dst_char_count] = 0; - auto ret = pstring(buf); - delete [] buf; - return ret; - } - #endif - -/*************************************************************************** - Application -***************************************************************************/ - app::app() - : options() - , pout(&std::cout) - , perr(&std::cerr) + : std_out(&std::cout) + , std_err(&std::cerr) { } - int app::main_utfX(int argc, char **argv) + int app::main_utfX(const std::vector<putf8string> &argv) { - auto r = this->parse(argc, argv); - int ret = 0; + auto r = this->parse(argv); - if (r != argc) + if (r != argv.size()) { - this->perr("Error parsing {}\n", argv[r]); - //FIXME: usage_short - this->perr(this->usage()); - ret = 1; + this->std_err("Error parsing {}\n", argv[r]); + this->std_err(this->usage_short()); + return 1; } - else - ret = this->execute(); - return ret; + return this->execute(); } -#ifdef _WIN32 - int app::main_utfX(int argc, wchar_t *argv[]) + int app::main_utfX(int argc, char *argv[]) { - std::vector<pstring> argv_vectors(argc); - std::vector<char *> utf8_argv(argc); + std::vector<putf8string> arg; + for (std::size_t i = 0; i < narrow_cast<std::size_t>(argc); i++) + arg.emplace_back(putf8string(argv[i])); - // convert arguments to UTF-8 - for (int i = 0; i < argc; i++) - { - argv_vectors[i] = toutf8(argv[i]); - utf8_argv[i] = const_cast<char *>(argv_vectors[i].c_str()); - } + return main_utfX(arg); + } + + int app::main_utfX(int argc, wchar_t *argv[]) + { + std::vector<putf8string> arg; + for (std::size_t i = 0; i < narrow_cast<std::size_t>(argc); i++) + arg.emplace_back(putf8string(pwstring(argv[i]))); - // run utf8_main - return main_utfX(argc, utf8_argv.data()); + return main_utfX(arg); } -#endif } // namespace plib diff --git a/src/lib/netlist/plib/pmain.h b/src/lib/netlist/plib/pmain.h index cfa73844f57..3213719d0d2 100644 --- a/src/lib/netlist/plib/pmain.h +++ b/src/lib/netlist/plib/pmain.h @@ -1,15 +1,13 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * poptions.h - * - */ - -#pragma once #ifndef PMAIN_H_ #define PMAIN_H_ +/// +/// \file poptions.h +/// + #include "palloc.h" #include "poptions.h" #include "pstream.h" @@ -17,49 +15,52 @@ #include "putil.h" #include <memory> +#include <vector> #ifdef _WIN32 #include <cwchar> -#define PMAIN(appclass) \ -extern "C" int wmain(int argc, wchar_t *argv[]) { return plib::app::mainrun<appclass, wchar_t>(argc, argv); } +#define PMAIN(app_class) \ +extern "C" int wmain(int argc, wchar_t *argv[]) { return plib::app::run_main<app_class, wchar_t>(argc, argv); } #else -#define PMAIN(appclass) \ -int main(int argc, char **argv) { return plib::app::mainrun<appclass, char>(argc, argv); } +#define PMAIN(app_class) \ +int main(int argc, char **argv) { return plib::app::run_main<app_class, char>(argc, argv); } #endif namespace plib { -/*************************************************************************** - Application -***************************************************************************/ + /// \brief Application class. + /// class app : public options { public: app(); - COPYASSIGNMOVE(app, delete) + PCOPYASSIGNMOVE(app, delete) virtual ~app() = default; virtual pstring usage() = 0; + + // short version of usage, defaults to usage + virtual pstring usage_short() { return usage(); } + virtual int execute() = 0; - plib::putf8_fmt_writer pout; - plib::putf8_fmt_writer perr; + plib::putf8_fmt_writer std_out; + plib::putf8_fmt_writer std_err; template <class C, typename T> - static int mainrun(int argc, T **argv) + static int run_main(int argc, T **argv) { - auto a = plib::make_unique<C>(); - return a->main_utfX(argc, argv); + C application; + return application.main_utfX(argc, argv); } private: - int main_utfX(int argc, char **argv); -#ifdef _WIN32 + int main_utfX(const std::vector<putf8string> &argv); + int main_utfX(int argc, char *argv[]); int main_utfX(int argc, wchar_t *argv[]); -#endif }; @@ -67,4 +68,4 @@ namespace plib { -#endif /* PMAIN_H_ */ +#endif // PMAIN_H_ diff --git a/src/lib/netlist/plib/pmath.h b/src/lib/netlist/plib/pmath.h new file mode 100644 index 00000000000..96f815bcca7 --- /dev/null +++ b/src/lib/netlist/plib/pmath.h @@ -0,0 +1,422 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PMATH_H_ +#define PMATH_H_ + +/// +/// \file pmath.h +/// + +#include "pconfig.h" +#include "pgsl.h" +#include "ptypes.h" + +#include <algorithm> +#include <cmath> +#include <type_traits> + +// `quadmath.h` included by `ptypes.h` + +namespace plib +{ + + /// \brief Holds constants used repeatedly. + /// + /// \tparam T floating point type + /// + /// Using the structure members we can avoid magic numbers in the code. + /// In addition, this is a typesafe approach. + /// + template <typename T> + struct constants + { + static constexpr T zero() noexcept { return static_cast<T>(0); } // NOLINT + static constexpr T half() noexcept { return static_cast<T>(0.5); } // NOLINT + static constexpr T one() noexcept { return static_cast<T>(1); } // NOLINT + static constexpr T two() noexcept { return static_cast<T>(2); } // NOLINT + static constexpr T three() noexcept { return static_cast<T>(3); } // NOLINT + static constexpr T four() noexcept { return static_cast<T>(4); } // NOLINT + static constexpr T hundred()noexcept { return static_cast<T>(100); } // NOLINT + + static constexpr T one_thirds() noexcept { return fraction(one(), three()); } + static constexpr T two_thirds() noexcept { return fraction(two(), three()); } + + static constexpr T ln2() noexcept { return static_cast<T>(0.6931471805599453094172321214581766L); } // NOLINT + static constexpr T sqrt2() noexcept { return static_cast<T>(1.4142135623730950488016887242096982L); } // NOLINT + static constexpr T sqrt3() noexcept { return static_cast<T>(1.7320508075688772935274463415058723L); } // NOLINT + static constexpr T sqrt3_2() noexcept { return static_cast<T>(0.8660254037844386467637231707529362L); } // NOLINT + static constexpr T pi() noexcept { return static_cast<T>(3.1415926535897932384626433832795029L); } // NOLINT + + /// \brief Electric constant of vacuum + /// + static constexpr T eps_0() noexcept { return static_cast<T>(8.854187817e-12); } // NOLINT + + // \brief Relative permittivity of Silicon dioxide + /// + static constexpr T eps_SiO2() noexcept { return static_cast<T>(3.9); } // NOLINT + + /// \brief Relative permittivity of Silicon + /// + static constexpr T eps_Si() noexcept { return static_cast<T>(11.7); } // NOLINT + + /// \brief Boltzmann constant + /// + static constexpr T k_b() noexcept { return static_cast<T>(1.38064852e-23); } // NOLINT + + /// \brief room temperature (gives VT = 0.02585 at T=300) + /// + static constexpr T T0() noexcept { return static_cast<T>(300); } // NOLINT + + /// \brief Elementary charge + /// + static constexpr T Q_e() noexcept { return static_cast<T>(1.6021765314e-19); } // NOLINT + + /// \brief Intrinsic carrier concentration in 1/m^3 of Silicon + /// + static constexpr T NiSi() noexcept { return static_cast<T>(1.45e16); } // NOLINT + + /// \brief clearly identify magic numbers in code + /// + /// Magic numbers should be avoided. The magic member at least clearly + /// identifies them and makes it easier to convert them to named constants + /// later. + /// + template <typename V> + static constexpr T magic(V &&v) noexcept { return static_cast<T>(v); } + + template <typename V> + static constexpr T fraction(V &&v1, V &&v2) noexcept { return static_cast<T>(v1 / v2); } + }; + + /// \brief typesafe reciprocal function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return reciprocal of argument + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + reciprocal(T v) noexcept + { + return constants<T>::one() / v; + } + + /// \brief abs function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return absolute value of argument + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + abs(T v) noexcept + { + return std::abs(v); + } + + /// \brief sqrt function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return absolute value of argument + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + sqrt(T v) noexcept + { + return std::sqrt(v); + } + + /// \brief hypot function + /// + /// \tparam T type of the arguments + /// \param v1 first argument + /// \param v2 second argument + /// \return sqrt(v1*v1+v2*v2) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + hypot(T v1, T v2) noexcept + { + return std::hypot(v1, v2); + } + + /// \brief exp function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return exp(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + exp(T v) noexcept + { + return std::exp(v); + } + + /// \brief log function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return log(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + log(T v) noexcept + { + return std::log(v); + } + + /// \brief tanh function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return tanh(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + tanh(T v) noexcept + { + return std::tanh(v); + } + + /// \brief floor function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return floor(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + floor(T v) noexcept + { + return std::floor(v); + } + + /// \brief log1p function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return log(1 + v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + log1p(T v) noexcept + { + return std::log1p(v); + } + + /// \brief sin function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return sin(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + sin(T v) noexcept + { + return std::sin(v); + } + + /// \brief cos function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return cos(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + cos(T v) noexcept + { + return std::cos(v); + } + + /// \brief trunc function + /// + /// \tparam T type of the argument + /// \param v argument + /// \return trunc(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + trunc(T v) noexcept + { + return std::trunc(v); + } + + /// \brief signum function + /// + /// \tparam T type of the argument + /// \param v argument + /// \param r optional argument, if given will return r and -r instead of 1 and -1 + /// \return signum(v) + /// + template <typename T> + static constexpr std::enable_if_t<std::is_floating_point<T>::value, T> + signum(T v, T r = static_cast<T>(1)) + { + constexpr const T z(static_cast<T>(0)); + return (v > z) ? r : ((v < z) ? -r : v); + } + + /// \brief pow function + /// + /// \tparam T1 type of the first argument + /// \tparam T2 type of the second argument + /// \param v argument + /// \param p power + /// \return v^p + /// + /// FIXME: limited implementation + /// + template <typename T1, typename T2> + static inline auto pow(T1 v, T2 p) noexcept -> decltype(std::pow(v, p)) + { + return std::pow(v, p); + } + +#if (PUSE_FLOAT128) + static constexpr FLOAT128 reciprocal(FLOAT128 v) noexcept + { + return constants<FLOAT128>::one() / v; + } + + static FLOAT128 abs(FLOAT128 v) noexcept { return fabsq(v); } + + static FLOAT128 sqrt(FLOAT128 v) noexcept { return sqrtq(v); } + + static FLOAT128 hypot(FLOAT128 v1, FLOAT128 v2) noexcept + { + return hypotq(v1, v2); + } + + static FLOAT128 exp(FLOAT128 v) noexcept { return expq(v); } + + static FLOAT128 log(FLOAT128 v) noexcept { return logq(v); } + + static FLOAT128 tanh(FLOAT128 v) noexcept { return tanhq(v); } + + static FLOAT128 floor(FLOAT128 v) noexcept { return floorq(v); } + + static FLOAT128 log1p(FLOAT128 v) noexcept { return log1pq(v); } + + static FLOAT128 sin(FLOAT128 v) noexcept { return sinq(v); } + + static FLOAT128 cos(FLOAT128 v) noexcept { return cosq(v); } + + static FLOAT128 trunc(FLOAT128 v) noexcept { return truncq(v); } + + template <typename T> + static FLOAT128 pow(FLOAT128 v, T p) noexcept + { + return powq(v, static_cast<FLOAT128>(p)); + } + + static FLOAT128 pow(FLOAT128 v, int p) noexcept + { + if (p == 2) + return v * v; + else + return powq(v, static_cast<FLOAT128>(p)); + } + +#endif + + /// \brief is argument a power of two? + /// + /// \tparam T type of the argument + /// \param v argument to be checked + /// \return true if argument is a power of two + /// + template <typename T> + constexpr bool is_pow2(T v) noexcept + { + static_assert(is_integral<T>::value, "is_pow2 needs integer arguments"); + return !(v & (v - 1)); + } + + /// \brief return absolute value of signed argument + /// + /// \tparam T type of the argument + /// \param v argument + /// \return absolute value of argument + /// + template <typename T> + constexpr std::enable_if_t< + plib::is_integral<T>::value && plib::is_signed<T>::value, T> + abs(T v) noexcept + { + return v < 0 ? -v : v; + } + + /// \brief return absolute value of unsigned argument + /// + /// \tparam T type of the argument + /// \param v argument + /// \return argument since it has no sign + /// + template <typename T> + constexpr std::enable_if_t< + plib::is_integral<T>::value && plib::is_unsigned<T>::value, T> + abs(T v) noexcept + { + return v; + } + + /// \brief return greatest common denominator + /// + /// Function returns the greatest common denominator of m and n. For known + /// arguments, this function also works at compile time. + /// + /// \tparam M type of the first argument + /// \tparam N type of the second argument + /// \param m first argument + /// \param n first argument + /// \return greatest common denominator of m and n + /// + template <typename M, typename N> + constexpr typename std::common_type<M, N>::type + gcd(M m, N n) noexcept // NOLINT(misc-no-recursion) + { + static_assert(plib::is_integral<M>::value, "gcd: M must be an integer"); + static_assert(plib::is_integral<N>::value, "gcd: N must be an integer"); + + return m == 0 ? plib::abs(n) : n == 0 ? plib::abs(m) : gcd(n, m % n); + } + + /// \brief return least common multiple + /// + /// Function returns the least common multiple of m and n. For known + /// arguments, this function also works at compile time. + /// + /// \tparam M type of the first argument + /// \tparam N type of the second argument + /// \param m first argument + /// \param n first argument + /// \return least common multiple of m and n + /// + template <typename M, typename N> + constexpr typename std::common_type<M, N>::type lcm(M m, N n) noexcept + { + static_assert(plib::is_integral<M>::value, "lcm: M must be an integer"); + static_assert(plib::is_integral<N>::value, "lcm: N must be an integer"); + + return (m != 0 && n != 0) ? (plib::abs(m) / gcd(m, n)) * plib::abs(n) + : 0; + } + + template <class T> + constexpr const T &clamp(const T &v, const T &low, const T &high) + { + gsl_Expects(high >= low); + return (v < low) ? low : (high < v) ? high : v; + } + + static_assert(noexcept(constants<double>::one()), + "Not evaluated as constexpr"); + +} // namespace plib + +#endif // PMATH_H_ diff --git a/src/lib/netlist/plib/pmatrix2d.h b/src/lib/netlist/plib/pmatrix2d.h index 7d6072fc358..4c167e9baf8 100644 --- a/src/lib/netlist/plib/pmatrix2d.h +++ b/src/lib/netlist/plib/pmatrix2d.h @@ -1,85 +1,248 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pmatrix2d.h - * - * NxM regular matrix - * - */ #ifndef PMATRIX2D_H_ #define PMATRIX2D_H_ +/// +/// \file pmatrix2d.h +/// + #include "palloc.h" #include <algorithm> -#include <cmath> -//#include <cstdlib> #include <type_traits> #include <vector> namespace plib { - - template<typename T, typename A = aligned_allocator<T>> + template<typename A, typename T> class pmatrix2d { public: + using size_type = std::size_t; + using arena_type = A; + using allocator_type = typename A::template allocator_type<T, PALIGN_VECTOROPT>; + + static constexpr const size_type align_size = align_traits<allocator_type>::align_size; + static constexpr const size_type stride_size = align_traits<allocator_type>::stride_size; + using value_type = T; - using allocator_type = A; + using reference = T &; + using const_reference = const T &; + + using pointer = T *; + using const_pointer = const T *; - static constexpr const std::size_t align_size = align_traits<A>::align_size; - static constexpr const std::size_t stride_size = align_traits<A>::stride_size; - pmatrix2d() - : m_N(0), m_M(0), m_stride(8), m_v() + pmatrix2d(A &arena) noexcept + : m_N(0), m_M(0), m_stride(8), m_v(nullptr), m_a(arena) { } - pmatrix2d(std::size_t N, std::size_t M) - : m_N(N), m_M(M), m_v() + pmatrix2d(A &arena, size_type N, size_type M) + : m_N(N), m_M(M), m_v(), m_a(arena) { + gsl_Expects(N>0); + gsl_Expects(M>0); m_stride = ((M + stride_size-1) / stride_size) * stride_size; - m_v.resize(N * m_stride); + m_v = m_a.allocate(N * m_stride); + for (std::size_t i = 0; i < N * m_stride; i++) + ::new(&m_v[i]) T(); } - void resize(std::size_t N, std::size_t M) + pmatrix2d(const pmatrix2d &) = delete; + pmatrix2d &operator=(const pmatrix2d &) = delete; + pmatrix2d(pmatrix2d &&) = delete; + pmatrix2d &operator=(pmatrix2d &&) = delete; + + ~pmatrix2d() { + if (m_v != nullptr) + { + for (std::size_t i = 0; i < m_N * m_stride; i++) + (&m_v[i])->~T(); + m_a.deallocate(m_v, m_N * m_stride); + } + } + + void resize(size_type N, size_type M) + { + gsl_Expects(N>0); + gsl_Expects(M>0); + if (m_v != nullptr) + { + for (std::size_t i = 0; i < N * m_stride; i++) + (&m_v[i])->~T(); + m_a.deallocate(m_v, N * m_stride); + } m_N = N; m_M = M; m_stride = ((M + stride_size-1) / stride_size) * stride_size; - m_v.resize(N * m_stride); + m_v = m_a.allocate(N * m_stride); + for (std::size_t i = 0; i < N * m_stride; i++) + ::new(&m_v[i]) T(); } - C14CONSTEXPR T * operator[] (std::size_t row) noexcept + constexpr pointer operator[] (size_type row) noexcept { - return assume_aligned_ptr<T, align_size>(&m_v[m_stride * row]); + return &m_v[m_stride * row]; } - constexpr const T * operator[] (std::size_t row) const noexcept + constexpr const_pointer operator[] (size_type row) const noexcept { - return assume_aligned_ptr<T, align_size>(&m_v[m_stride * row]); + return &m_v[m_stride * row]; } - T & operator()(std::size_t r, std::size_t c) noexcept + reference operator()(size_type r, size_type c) noexcept { return (*this)[r][c]; } - const T & operator()(std::size_t r, std::size_t c) const noexcept + const_reference operator()(size_type r, size_type c) const noexcept { return (*this)[r][c]; } + // for compatibility with vrl variant + void set(size_type r, size_type c, const value_type &v) noexcept + { + (*this)[r][c] = v; + } + + pointer data() noexcept + { + return m_v; + } + + const_pointer data() const noexcept + { + return m_v; + } + + size_type didx(size_type r, size_type c) const noexcept + { + return m_stride * r + c; + } private: - std::size_t m_N; - std::size_t m_M; - std::size_t m_stride; + size_type m_N; + size_type m_M; + size_type m_stride; + + T * __restrict m_v; + + allocator_type m_a; + }; + + // variable row length matrix + template<typename A, typename T> + class pmatrix2d_vrl + { + public: + using size_type = std::size_t; + using value_type = T; + using arena_type = A; + + using allocator_type = typename A::template allocator_type<T, PALIGN_VECTOROPT>; + + static constexpr const size_type align_size = align_traits<allocator_type>::align_size; + static constexpr const size_type stride_size = align_traits<allocator_type>::stride_size; + + pmatrix2d_vrl(A &arena) noexcept + : m_N(0), m_M(0), m_row(arena), m_v(arena) + { + } + + pmatrix2d_vrl(A &arena, size_type N, size_type M) + : m_N(N), m_M(M), m_row(arena), m_v(arena) + { + m_row.resize(N + 1, 0); + m_v.resize(N); //FIXME + } + + pmatrix2d_vrl(const pmatrix2d_vrl &) = default; + pmatrix2d_vrl &operator=(const pmatrix2d_vrl &) = default; + pmatrix2d_vrl(pmatrix2d_vrl &&) noexcept = default; + pmatrix2d_vrl &operator=(pmatrix2d_vrl &&) noexcept(!compile_info::clang_noexcept_issue::value) = default; + + ~pmatrix2d_vrl() = default; - std::vector<T, A> m_v; + void resize(size_type N, size_type M) + { + m_N = N; + m_M = M; + m_row.resize(N + 1); + for (std::size_t i = 0; i < m_N; i++) + m_row[i] = 0; + m_v.resize(N); //FIXME + } + + constexpr T * operator[] (size_type row) noexcept + { + return &(m_v[m_row[row]]); + } + + constexpr const T * operator[] (size_type row) const noexcept + { + return &(m_v[m_row[row]]); + } + + //FIXME: no check! + T & operator()(size_type r, size_type c) noexcept + { + return (*this)[r][c]; + } + + void set(size_type r, size_type c, const T &v) noexcept + { + if (c + m_row[r] >= m_row[r + 1]) + { + m_v.insert(m_v.begin() + narrow_cast<std::ptrdiff_t>(m_row[r+1]), v); + for (size_type i = r + 1; i <= m_N; i++) + m_row[i] = m_row[i] + 1; + } + else + (*this)[r][c] = v; + } + + //FIXME: no check! + const T & operator()(size_type r, size_type c) const noexcept + { + return (*this)[r][c]; + } + + T * data() noexcept + { + return m_v.data(); + } + + const T * data() const noexcept + { + return m_v.data(); + } + + //FIXME: no check! + constexpr size_type didx(size_type r, size_type c) const noexcept + { + return m_row[r] + c; + } + + constexpr size_type col_count(size_type row) const noexcept + { + return m_row[row + 1] - m_row[row]; + } + + size_type tx() const { return m_v.size(); } + private: + + size_type m_N; + size_type m_M; + plib::arena_vector<A, size_type, PALIGN_VECTOROPT> m_row; + plib::arena_vector<A, T, PALIGN_VECTOROPT> m_v; }; + } // namespace plib -#endif /* MAT_CR_H_ */ +#endif // PMATRIX2D_H_ diff --git a/src/lib/netlist/plib/pmatrix_cr.h b/src/lib/netlist/plib/pmatrix_cr.h new file mode 100644 index 00000000000..74175e07101 --- /dev/null +++ b/src/lib/netlist/plib/pmatrix_cr.h @@ -0,0 +1,648 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PMATRIX_CR_H_ +#define PMATRIX_CR_H_ + +/// +/// \file pmatrix_cr.h +/// +/// Compressed row format matrices +/// + +#include "palloc.h" +#include "parray.h" +#include "pconfig.h" +#include "pexception.h" +#include "pfmtlog.h" +#include "pmatrix2d.h" +#include "pomp.h" +#include "ptypes.h" +#include "putil.h" // <- container::contains + +#include <algorithm> +#include <array> +#include <type_traits> +#include <vector> + +namespace plib +{ + + template<typename ARENA, typename T, int N, typename C = uint16_t> + struct pmatrix_cr + { + using index_type = C; + using value_type = T; + + static constexpr const int NSQ = (N < 0 ? -N * N : N * N); + static constexpr const int Np1 = (N == 0) ? 0 : (N < 0 ? N - 1 : N + 1); + + pmatrix_cr(const pmatrix_cr &) = default; + pmatrix_cr &operator=(const pmatrix_cr &) = default; + pmatrix_cr(pmatrix_cr &&) noexcept(std::is_nothrow_move_constructible<parray<value_type, NSQ>>::value) = default; + pmatrix_cr &operator=(pmatrix_cr &&) noexcept(std::is_nothrow_move_assignable<parray<value_type, NSQ>>::value && std::is_nothrow_move_assignable<pmatrix2d_vrl<ARENA, index_type>>::value) = default; + + enum constants_e + { + FILL_INFINITY = 9999999 + }; + + // FIXME: these should be private + // NOLINTNEXTLINE + parray<index_type, N> diagonal; // diagonal index pointer n + // NOLINTNEXTLINE + parray<index_type, Np1> row_idx; // row index pointer n + 1 + // NOLINTNEXTLINE + parray<index_type, NSQ> col_idx; // column index array nz_num, initially (n * n) + // NOLINTNEXTLINE + parray<value_type, NSQ> A; // Matrix elements nz_num, initially (n * n) + // NOLINTNEXTLINE + std::size_t nz_num; + + explicit pmatrix_cr(ARENA &arena, std::size_t n) + : diagonal(n) + , row_idx(n+1) + , col_idx(n*n) + , A(n*n) + , nz_num(0) + //, nzbd(n * (n+1) / 2) + , m_nzbd(arena, n, n) + , m_size(n) + { + for (std::size_t i=0; i<n+1; i++) + { + row_idx[i] = 0; + } + } + + ~pmatrix_cr() = default; + + constexpr std::size_t size() const noexcept { return (N>0) ? narrow_cast<std::size_t>(N) : m_size; } + + constexpr void clear() noexcept + { + nz_num = 0; + for (std::size_t i=0; i < size() + 1; i++) + row_idx[i] = 0; + } + + constexpr void set_scalar(T scalar) noexcept + { + for (std::size_t i=0, e=nz_num; i<e; i++) + A[i] = scalar; + } + + constexpr void set_row_scalar(C r, T val) noexcept + { + C ri = row_idx[r]; + while (ri < row_idx[r+1]) + A[ri++] = val; + } + + constexpr void set(C r, C c, T val) noexcept + { + C ri = row_idx[r]; + while (ri < row_idx[r+1] && col_idx[ri] < c) + ri++; + // we have the position now; + if (ri < row_idx[r+1] && col_idx[ri] == c) + A[ri] = val; + else + { + for (C i = nz_num; i>ri; i--) + { + A[i] = A[i-1]; + col_idx[i] = col_idx[i-1]; + } + A[ri] = val; + col_idx[ri] = c; + for (C i = r + 1; i < size() + 1; i++) + row_idx[i]++; + nz_num++; + if (c==r) + diagonal[r] = ri; + } + } + + template <typename M> + void build_from_fill_mat(const M &f, std::size_t max_fill = FILL_INFINITY - 1, + std::size_t band_width = FILL_INFINITY) noexcept(false) + { + C nz = 0; + if (nz_num != 0) + throw pexception("build_from_mat only allowed on empty CR matrix"); + for (std::size_t k=0; k < size(); k++) + { + row_idx[k] = nz; + + for (std::size_t j=0; j < size(); j++) + if (f[k][j] <= max_fill && plib::abs(narrow_cast<int>(k)-narrow_cast<int>(j)) <= narrow_cast<int>(band_width)) + { + col_idx[nz] = narrow_cast<C>(j); + if (j == k) + diagonal[k] = nz; + nz++; + } + } + + row_idx[size()] = nz; + nz_num = nz; + + // build nzbd + + for (std::size_t k=0; k < size(); k++) + { + for (std::size_t j=k + 1; j < size(); j++) + if (f[j][k] < FILL_INFINITY) + m_nzbd.set(k, m_nzbd.col_count(k), narrow_cast<C>(j)); + m_nzbd.set(k, m_nzbd.col_count(k), 0); // end of sequence + } + + } + + template <typename VTV, typename VTR> + void mult_vec(VTR & res, const VTV & x) const noexcept + { + + // res = A * x + // this is a bit faster than the version above + std::size_t row = 0; + std::size_t k = 0; + const std::size_t oe = nz_num; + while (k < oe) + { + T tmp = plib::constants<T>::zero(); + const std::size_t e = row_idx[row+1]; + for (; k < e; k++) + tmp += A[k] * x[col_idx[k]]; + res[row++] = tmp; + } + } + + // throws error if P(source)>P(destination) + template <typename LUMAT> + void slim_copy_from(LUMAT & src) noexcept(false) + { + for (std::size_t r=0; r<src.size(); r++) + { + C dp = row_idx[r]; + for (C sp = src.row_idx[r]; sp < src.row_idx[r+1]; sp++) + { + // advance dp to source column and fill 0s if necessary + while (col_idx[dp] < src.col_idx[sp]) + A[dp++] = 0; + if (row_idx[r+1] <= dp || col_idx[dp] != src.col_idx[sp]) + throw pexception("slim_copy_from error"); + A[dp++] = src.A[sp]; + } + // fill remaining elements in row + while (dp < row_idx[r+1]) + A[dp++] = 0; + } + } + + // only copies common elements + template <typename LUMAT> + void reduction_copy_from(LUMAT & src) noexcept + { + C sp(0); + for (std::size_t r=0; r<src.size(); r++) + { + C dp(row_idx[r]); + while(sp < src.row_idx[r+1]) + { + // advance dp to source column and fill 0s if necessary + if (col_idx[dp] < src.col_idx[sp]) + A[dp++] = 0; + else if (col_idx[dp] == src.col_idx[sp]) + A[dp++] = src.A[sp++]; + else + sp++; + } + // fill remaining elements in row + while (dp < row_idx[r+1]) + A[dp++] = 0; + } + } + + // no checks at all - may crash + template <typename LUMAT> + void raw_copy_from(LUMAT & src) noexcept + { + for (std::size_t k = 0; k < nz_num; k++) + A[k] = src.A[k]; + } + + constexpr index_type * nzbd(std::size_t row) noexcept { return m_nzbd[row]; } + constexpr std::size_t nzbd_count(std::size_t row) noexcept { return m_nzbd.col_count(row) - 1; } + protected: + // FIXME: this should be private + // NOLINTNEXTLINE + //parray<std::vector<index_type>, N > m_nzbd; // Support for gaussian elimination + pmatrix2d_vrl<ARENA, index_type> m_nzbd; // Support for gaussian elimination + private: + //parray<C, N < 0 ? -N * (N-1) / 2 : N * (N+1) / 2 > nzbd; // Support for gaussian elimination + std::size_t m_size; + }; + + template<typename B> + struct pGEmatrix_cr : public B + { + using base_type = B; + using index_type = typename base_type::index_type; + + pGEmatrix_cr(const pGEmatrix_cr &) = default; + pGEmatrix_cr &operator=(const pGEmatrix_cr &) = default; + pGEmatrix_cr(pGEmatrix_cr &&) noexcept(std::is_nothrow_move_constructible<base_type>::value) = default; + pGEmatrix_cr &operator=(pGEmatrix_cr &&) noexcept(std::is_nothrow_move_assignable<base_type>::value) = default; + + template<typename ARENA> + explicit pGEmatrix_cr(ARENA &arena, std::size_t n) + : B(arena, n) + { + } + + ~pGEmatrix_cr() = default; + + template <typename M> + std::pair<std::size_t, std::size_t> gaussian_extend_fill_mat(M &fill) noexcept + { + std::size_t ops = 0; + std::size_t fill_max = 0; + + for (std::size_t k = 0; k < fill.size(); k++) + { + ops++; // 1/A(k,k) + for (std::size_t row = k + 1; row < fill.size(); row++) + { + if (fill[row][k] < base_type::FILL_INFINITY) + { + ops++; + for (std::size_t col = k + 1; col < fill[row].size(); col++) + //if (fill[k][col] < FILL_INFINITY) + { + auto f = std::min(fill[row][col], 1 + fill[row][k] + fill[k][col]); + if (f < base_type::FILL_INFINITY) + { + if (f > fill_max) + fill_max = f; + ops += 2; + } + fill[row][col] = f; + } + } + } + } + build_parallel_gaussian_execution_scheme(fill); + return { fill_max, ops }; + } + + template <typename V> + void gaussian_elimination(V & RHS) noexcept + { + const std::size_t iN = base_type::size(); + + for (std::size_t i = 0; i < iN - 1; i++) + { + std::size_t nzbdp = 0; + std::size_t pi = base_type::diagonal[i]; + auto f = reciprocal(base_type::A[pi++]); + const std::size_t piie = base_type::row_idx[i+1]; + + const auto *nz = base_type::m_nzbd[i]; + while (auto j = nz[nzbdp++]) // NOLINT(bugprone-infinite-loop) + { + // proceed to column i + + std::size_t pj = base_type::row_idx[j]; + std::size_t pje = base_type::row_idx[j+1]; + + while (base_type::col_idx[pj] < i) + pj++; + + const typename base_type::value_type f1 = - base_type::A[pj++] * f; + + // subtract row i from j + // fill-in available assumed, i.e. matrix was prepared + + for (std::size_t pii = pi; pii<piie && pj < pje; pii++) + { + while (base_type::col_idx[pj] < base_type::col_idx[pii]) + pj++; + if (base_type::col_idx[pj] == base_type::col_idx[pii]) + base_type::A[pj++] += base_type::A[pii] * f1; + } + + RHS[j] += f1 * RHS[i]; + } + } + } + + int get_parallel_level(std::size_t k) const noexcept + { + for (std::size_t i = 0; i < m_ge_par.size(); i++) + if (plib::container::contains( m_ge_par[i], k)) + return narrow_cast<int>(i); + return -1; + } + + template <typename V> + void gaussian_elimination_parallel(V & RHS) noexcept + { + //printf("omp: %ld %d %d\n", m_ge_par.size(), nz_num, (int)m_ge_par[m_ge_par.size()-2].size()); + for (auto l = 0UL; l < m_ge_par.size(); l++) + plib::omp::for_static(base_type::nz_num, 0UL, m_ge_par[l].size(), [this, &RHS, &l] (unsigned ll) + { + auto &i = m_ge_par[l][ll]; + { + std::size_t nzbdp = 0; + std::size_t pi = base_type::diagonal[i]; + const auto f = reciprocal(base_type::A[pi++]); + const std::size_t piie = base_type::row_idx[i+1]; + const auto &nz = base_type::nzbd[i]; + + while (auto j = nz[nzbdp++]) + { + // proceed to column i + + std::size_t pj = base_type::row_idx[j]; + + while (base_type::col_idx[pj] < i) + pj++; + + auto f1 = - base_type::A[pj++] * f; + + // subtract row i from j + // fill-in available assumed, i.e. matrix was prepared + for (std::size_t pii = pi; pii<piie; pii++) + { + while (base_type::col_idx[pj] < base_type::col_idx[pii]) + pj++; + if (base_type::col_idx[pj] == base_type::col_idx[pii]) + base_type::A[pj++] += base_type::A[pii] * f1; + } + RHS[j] += f1 * RHS[i]; + } + } + }); + } + + template <typename V1, typename V2> + void gaussian_back_substitution(V1 &V, const V2 &RHS) noexcept + { + const std::size_t iN = base_type::size(); + // row n-1 + V[iN - 1] = RHS[iN - 1] / base_type::A[base_type::diagonal[iN - 1]]; + + for (std::size_t j = iN - 1; j-- > 0;) + { + typename base_type::value_type tmp = 0; + const auto diagonal_j = base_type::diagonal[j]; + const std::size_t e = base_type::row_idx[j+1]; + for (std::size_t pk = diagonal_j + 1; pk < e; pk++) + tmp += base_type::A[pk] * V[base_type::col_idx[pk]]; + V[j] = (RHS[j] - tmp) / base_type::A[diagonal_j]; + } + } + + template <typename V1> + void gaussian_back_substitution(V1 &V) noexcept + { + const std::size_t iN = base_type::size(); + // row n-1 + V[iN - 1] = V[iN - 1] / base_type::A[base_type::diagonal[iN - 1]]; + + for (std::size_t j = iN - 1; j-- > 0;) + { + typename base_type::value_type tmp = 0; + const auto diagonal_j = base_type::diagonal[j]; + const std::size_t e = base_type::row_idx[j+1]; + for (std::size_t pk = diagonal_j + 1; pk < e; pk++) + tmp += base_type::A[pk] * V[base_type::col_idx[pk]]; + V[j] = (V[j] - tmp) / base_type::A[diagonal_j]; + } + } + + private: + template <typename M> + void build_parallel_gaussian_execution_scheme(const M &fill) noexcept + { + // calculate parallel scheme for gaussian elimination + std::vector<std::vector<std::size_t>> rt(base_type::size()); + for (std::size_t k = 0; k < base_type::size(); k++) + { + for (std::size_t j = k+1; j < base_type::size(); j++) + { + if (fill[j][k] < base_type::FILL_INFINITY) + { + rt[k].push_back(j); + } + } + } + + std::vector<std::size_t> levGE(base_type::size(), 0); + std::size_t cl = 0; + + for (std::size_t k = 0; k < base_type::size(); k++ ) + { + if (levGE[k] >= cl) + { + std::vector<std::size_t> t = rt[k]; + for (std::size_t j = k+1; j < base_type::size(); j++ ) + { + bool overlap = false; + // is there overlap + if (plib::container::contains(t, j)) + overlap = true; + for (auto &x : rt[j]) + if (plib::container::contains(t, x)) + { + overlap = true; + break; + } + if (overlap) + levGE[j] = cl + 1; + else + { + t.push_back(j); + for (auto &x : rt[j]) + t.push_back(x); + } + } + cl++; + } + } + + m_ge_par.clear(); + m_ge_par.resize(cl+1); + for (std::size_t k = 0; k < base_type::size(); k++) + m_ge_par[levGE[k]].push_back(k); + //for (std::size_t k = 0; k < m_ge_par.size(); k++) + // printf("%d %d\n", (int) k, (int) m_ge_par[k].size()); + } + std::vector<std::vector<std::size_t>> m_ge_par; // parallel execution support for Gauss + }; + + template<typename B> + struct pLUmatrix_cr : public B + { + using base_type = B; + using index_type = typename base_type::index_type; + + pLUmatrix_cr(const pLUmatrix_cr &) = default; + pLUmatrix_cr &operator=(const pLUmatrix_cr &) = default; + pLUmatrix_cr(pLUmatrix_cr &&) noexcept(std::is_nothrow_move_constructible<base_type>::value) = default; + pLUmatrix_cr &operator=(pLUmatrix_cr &&) noexcept(std::is_nothrow_move_assignable<base_type>::value) = default; + + template<typename ARENA> + explicit pLUmatrix_cr(ARENA &arena, std::size_t n) + : B(arena, n) + , ilu_rows(n+1) + , m_ILUp(0) + { + } + + ~pLUmatrix_cr() = default; + + template <typename M> + void build(M &fill, std::size_t ilup) noexcept(false) + { + std::size_t p(0); + // build ilu_rows + for (decltype(fill.size()) i=1; i < fill.size(); i++) + { + bool found(false); + for (decltype(fill.size()) k = 0; k < i; k++) + { + // if (fill[i][k] < base::FILL_INFINITY) + if (fill[i][k] <= ilup) + { + // assume A[k][k]!=0 + for (decltype(fill.size()) j=k+1; j < fill.size(); j++) + { + auto f = std::min(fill[i][j], 1 + fill[i][k] + fill[k][j]); + if (f <= ilup) + fill[i][j] = f; + } + found = true; + } + } + if (found) + ilu_rows[p++] = narrow_cast<index_type>(i); + } + ilu_rows[p] = 0; // end of array + this->build_from_fill_mat(fill, ilup); //, m_band_width); // ILU(2) + m_ILUp = ilup; + } + + /// \brief incomplete LU Factorization. + /// + /// We are following http://de.wikipedia.org/wiki/ILU-Zerlegung here. + /// + /// The result is stored in matrix LU + /// + /// For i = 1,...,N-1 + /// For k = 0, ... , i - 1 + /// If a[i,k] != 0 + /// a[i,k] = a[i,k] / a[k,k] + /// For j = k + 1, ... , N - 1 + /// If a[i,j] != 0 + /// a[i,j] = a[i,j] - a[i,k] * a[k,j] + /// j=j+1 + /// k=k+1 + /// i=i+1 + /// + void incomplete_LU_factorization(const base_type &mat) noexcept + { + if (m_ILUp < 1) + this->raw_copy_from(mat); + else + this->reduction_copy_from(mat); + + std::size_t p(0); + while (auto i = ilu_rows[p++]) // NOLINT(bugprone-infinite-loop) + { + const auto p_i_end = base_type::row_idx[i + 1]; + // loop over all columns k left of diagonal in row i + //if (row_idx[i] < diagonal[i]) + // printf("occ %d\n", (int)i); + for (auto i_k = base_type::row_idx[i]; i_k < base_type::diagonal[i]; i_k++) + { + const index_type k(base_type::col_idx[i_k]); + const index_type p_k_end(base_type::row_idx[k + 1]); + const typename base_type::value_type LUp_i_k = base_type::A[i_k] = base_type::A[i_k] / base_type::A[base_type::diagonal[k]]; + + std::size_t k_j(base_type::diagonal[k] + 1); + std::size_t i_j(i_k + 1); + + while (i_j < p_i_end && k_j < p_k_end ) // pj = (i, j) + { + // we can assume that within a row ja increases continuously + const index_type c_i_j(base_type::col_idx[i_j]); // row i, column j + const index_type c_k_j(base_type::col_idx[k_j]); // row k, column j + + if (c_k_j == c_i_j) + base_type::A[i_j] -= LUp_i_k * base_type::A[k_j]; + k_j += (c_k_j <= c_i_j ? 1 : 0); + i_j += (c_k_j >= c_i_j ? 1 : 0); + + } + } + } + } + + + /// \brief Solve a linear equation + /// + /// Solve a linear equation Ax = r + /// + /// where + /// A = L*U + /// + /// L unit lower triangular + /// U upper triangular + /// + /// ==> LUx = r + /// + /// ==> Ux = L⁻¹ r = w + /// + /// ==> r = Lw + /// + /// This can be solved for w using backwards elimination in L. + /// + /// Now Ux = w + /// + /// This can be solved for x using backwards elimination in U. + /// + template <typename R> + void solveLU (R &r) noexcept + { + for (std::size_t i = 1; i < base_type::size(); ++i ) + { + typename base_type::value_type tmp(0); + const index_type j1(base_type::row_idx[i]); + const index_type j2(base_type::diagonal[i]); + + for (auto j = j1; j < j2; ++j ) + tmp += base_type::A[j] * r[base_type::col_idx[j]]; + r[i] -= tmp; + } + // i now is equal to n; + for (std::size_t i = base_type::size(); i-- > 0; ) + { + typename base_type::value_type tmp(0); + const index_type di(base_type::diagonal[i]); + const index_type j2(base_type::row_idx[i+1]); + for (std::size_t j = di + 1; j < j2; j++ ) + tmp += base_type::A[j] * r[base_type::col_idx[j]]; + r[i] = (r[i] - tmp) / base_type::A[di]; + } + } + private: + parray<index_type, base_type::Np1> ilu_rows; + std::size_t m_ILUp; + }; + +} // namespace plib + +#endif // PMATRIX_CR_H_ diff --git a/src/lib/netlist/plib/pmempool.h b/src/lib/netlist/plib/pmempool.h index 769d2f653b5..29712601237 100644 --- a/src/lib/netlist/plib/pmempool.h +++ b/src/lib/netlist/plib/pmempool.h @@ -1,21 +1,21 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pmempool.h - * - */ #ifndef PMEMPOOL_H_ #define PMEMPOOL_H_ +/// +/// \file pmempool.h +/// + #include "palloc.h" -#include "pstream.h" -#include "pstring.h" +#include "pconfig.h" +#include "pstream.h" // perrlogger +//#include "pstring.h" #include "ptypes.h" -#include "putil.h" +//#include "putil.h" #include <algorithm> -//#include <cstddef> #include <memory> #include <unordered_map> #include <utility> @@ -27,30 +27,39 @@ namespace plib { // Memory pool //============================================================ - class mempool + template <typename BASEARENA, std::size_t MINALIGN = PALIGN_MIN_SIZE> + class mempool_arena : public arena_base<mempool_arena<BASEARENA, MINALIGN>, MINALIGN, false, false> { + public: + + using size_type = typename BASEARENA::size_type; + using base_type = arena_base<mempool_arena<BASEARENA, MINALIGN>, MINALIGN, false, false>; + + template <class T> + using base_allocator_type = typename BASEARENA::template allocator_type<T>; + using block_align = std::integral_constant<size_t, 1024>; + + mempool_arena(size_t min_alloc = (1<<21)); + + PCOPYASSIGNMOVE(mempool_arena, delete) + + ~mempool_arena(); + + void *allocate(size_t align, size_t size); + + void deallocate(void *ptr, std::size_t alignment, size_t size) noexcept; + + bool operator ==(const mempool_arena &rhs) const noexcept { return this == &rhs; } + private: struct block { - block(mempool *mp, std::size_t min_bytes) - : m_num_alloc(0) - , m_cur(0) - , m_data(nullptr) - , m_mempool(mp) - { - min_bytes = std::max(mp->m_min_alloc, min_bytes); - m_free = min_bytes; - std::size_t alloc_bytes = (min_bytes + mp->m_min_align); // - 1); // & ~(mp->m_min_align - 1); - //m_data_allocated = ::operator new(alloc_bytes); - m_data_allocated = new char[alloc_bytes]; - void *r = m_data_allocated; - std::align(mp->m_min_align, min_bytes, r, alloc_bytes); - m_data = reinterpret_cast<char *>(r); - } + block(mempool_arena &mp, size_type min_bytes); ~block() { //::operator delete(m_data_allocated); - delete [] m_data_allocated; + //delete [] m_data_allocated; + m_mempool.base_arena().deallocate(m_data_allocated, mempool_arena::block_align(), m_bytes_allocated); } block(const block &) = delete; @@ -58,151 +67,157 @@ namespace plib { block &operator =(const block &) = delete; block &operator =(block &&) = delete; - std::size_t m_num_alloc; - std::size_t m_free; - std::size_t m_cur; - char *m_data; - char *m_data_allocated; - mempool *m_mempool; + size_type m_num_alloc; + size_type m_free; + size_type m_cur; + size_type m_bytes_allocated; + std::uint8_t *m_data; + std::uint8_t *m_data_allocated; + mempool_arena &m_mempool; }; struct info { - info(block *b, std::size_t p) : m_block(b), m_pos(p) { } + info(block *b, size_type p, size_type orig_size) : m_block(b), m_pos(p), m_orig_size(orig_size) { } + info(const info &) = default; + info &operator=(const info &) = default; + info(info &&) noexcept = default; + info &operator=(info &&) noexcept = default; ~info() = default; - COPYASSIGNMOVE(info, default) block * m_block; - std::size_t m_pos; + size_type m_pos; + size_type m_orig_size; }; - - block * new_block(std::size_t min_bytes) + block * new_block(size_type min_bytes) { - auto *b = plib::pnew<block>(this, min_bytes); + auto *b = detail::alloc<block, 0>(base_arena(), *this, min_bytes); m_blocks.push_back(b); return b; } - - static std::unordered_map<void *, info> &sinfo() + size_t m_min_alloc; + static BASEARENA &base_arena() { - static std::unordered_map<void *, info> spinfo; - return spinfo; + static BASEARENA s_arena; + return s_arena; } - size_t m_min_alloc; - size_t m_min_align; + using info_type = std::pair<void * const, info>; - std::vector<block *> m_blocks; + using info_allocator_type = typename BASEARENA::template allocator_type<info_type>; + std::unordered_map<void *, info, std::hash<void *>, std::equal_to<>, + info_allocator_type> m_info; - public: - static constexpr const bool is_stateless = false; - template <class T, std::size_t ALIGN = alignof(T)> - using allocator_type = arena_allocator<mempool, T, ALIGN>; + plib::arena_vector<BASEARENA, block *> m_blocks; - mempool(size_t min_alloc = (1<<21), size_t min_align = 16) - : m_min_alloc(min_alloc), m_min_align(min_align) - { - } + }; - COPYASSIGNMOVE(mempool, delete) + template <typename BASEARENA, std::size_t MINALIGN> + mempool_arena<BASEARENA, MINALIGN>::mempool_arena(size_t min_alloc) + : m_min_alloc(min_alloc) + //, m_blocks(base_allocator_type<block *>(base_arena())) + , m_blocks(base_arena()) + { + } - ~mempool() + template <typename BASEARENA, std::size_t MINALIGN> + mempool_arena<BASEARENA, MINALIGN>::~mempool_arena() + { + for (auto & b : m_blocks) { - - for (auto & b : m_blocks) + if (b->m_num_alloc != 0) { - if (b->m_num_alloc != 0) - { - plib::perrlogger("Found {} info blocks\n", sinfo().size()); - plib::perrlogger("Found block with {} dangling allocations\n", b->m_num_alloc); - } - plib::pdelete(b); - //::operator delete(b->m_data); + plib::perrlogger("Found {} info blocks\n", m_info.size()); + plib::perrlogger("Found block with {} dangling allocations\n", b->m_num_alloc); } + detail::free<0>(base_arena(), b); } + if (!m_info.empty()) + plib::perrlogger("Still found {} info blocks after mempool deleted\n", m_info.size()); + } - void *allocate(size_t align, size_t size) - { - block *b = nullptr; + template <typename BASEARENA, std::size_t MINALIGN> + void * mempool_arena<BASEARENA, MINALIGN>::allocate(size_t align, size_t size) + { + block *b = nullptr; - if (align < m_min_align) - align = m_min_align; + if (align < MINALIGN) + align = MINALIGN; - size_t rs = size + align; - for (auto &bs : m_blocks) - { - if (bs->m_free > rs) - { - b = bs; - break; - } - } - if (b == nullptr) - { - b = new_block(rs); - } - b->m_free -= rs; - b->m_num_alloc++; - void *ret = reinterpret_cast<void *>(b->m_data + b->m_cur); - auto capacity(rs); - ret = std::align(align, size, ret, capacity); - sinfo().insert({ ret, info(b, b->m_cur)}); - rs -= (capacity - size); - b->m_cur += rs; - - return ret; - } + size_t rs = size + align; - static void deallocate(void *ptr) + for (auto &bs : m_blocks) { - - auto it = sinfo().find(ptr); - if (it == sinfo().end()) - plib::terminate("mempool::free - pointer not found\n"); - block *b = it->second.m_block; - if (b->m_num_alloc == 0) - plib::terminate("mempool::free - double free was called\n"); - else + if (bs->m_free > rs) { - b->m_num_alloc--; - //printf("Freeing in block %p %lu\n", b, b->m_num_alloc); - if (b->m_num_alloc == 0) - { - mempool *mp = b->m_mempool; - auto itb = std::find(mp->m_blocks.begin(), mp->m_blocks.end(), b); - if (itb == mp->m_blocks.end()) - plib::terminate("mempool::free - block not found\n"); - - mp->m_blocks.erase(itb); - plib::pdelete(b); - } - sinfo().erase(it); + b = bs; + break; } } - - template <typename T> - using owned_pool_ptr = plib::owned_ptr<T, arena_deleter<mempool, T>>; - - template<typename T, typename... Args> - owned_pool_ptr<T> make_poolptr(Args&&... args) + if (b == nullptr) { - auto *mem = this->allocate(alignof(T), sizeof(T)); - try - { - auto *mema = new (mem) T(std::forward<Args>(args)...); - return owned_pool_ptr<T>(mema, true, arena_deleter<mempool, T>(this)); - } - catch (...) - { - this->deallocate(mem); - throw; - } + b = new_block(rs); } + b->m_free -= rs; + b->m_num_alloc++; + void *ret = reinterpret_cast<void *>(b->m_data + b->m_cur); // NOLINT(cppcoreguidelines-pro-type-reinterpret + auto capacity(rs); + ret = std::align(align, size, ret, capacity); + m_info.insert({ ret, info(b, b->m_cur, size)}); + rs -= (capacity - size); + b->m_cur += rs; + this->inc_alloc_stat(size); + + return ret; + } + + template <typename BASEARENA, std::size_t MINALIGN> + void mempool_arena<BASEARENA, MINALIGN>::deallocate(void *ptr, [[maybe_unused]] std::size_t alignment, size_t size) noexcept + { + auto it = m_info.find(ptr); + if (it == m_info.end()) + plib::terminate("mempool::free - pointer not found"); + block *b = it->second.m_block; + if (b->m_num_alloc == 0) + plib::terminate("mempool::free - double free was called"); + if (it->second.m_orig_size != size) + plib::perrlogger("Size mismatch original {} vs {}\n", it->second.m_orig_size, size); + + mempool_arena &mp = b->m_mempool; + b->m_num_alloc--; + mp.dec_alloc_stat(size); + if (b->m_num_alloc == 0) + { + auto itb = std::find(mp.m_blocks.begin(), mp.m_blocks.end(), b); + if (itb == mp.m_blocks.end()) + plib::terminate("mempool::free - block not found"); - }; + mp.m_blocks.erase(itb); + detail::free<0>(mp.base_arena(), b); + } + m_info.erase(it); + } + + template <typename BASEARENA, std::size_t MINALIGN> + mempool_arena<BASEARENA, MINALIGN>::block::block(mempool_arena &mp, size_type min_bytes) + : m_num_alloc(0) + , m_cur(0) + , m_data(nullptr) + , m_mempool(mp) + { + min_bytes = std::max(mp.m_min_alloc, min_bytes); + m_free = min_bytes; + m_bytes_allocated = (min_bytes + mempool_arena::block_align()); // - 1); // & ~(mp.m_min_align - 1); + // NOLINTNEXTLINE(cppcoreguidelines-owning-memory) + //m_data_allocated = new std::uint8_t[alloc_bytes]; + m_data_allocated = static_cast<std::uint8_t *>(mp.base_arena().allocate(mempool_arena::block_align(), m_bytes_allocated)); + void *r = m_data_allocated; + std::align(mempool_arena::block_align(), min_bytes, r, m_bytes_allocated); + m_data = reinterpret_cast<std::uint8_t *>(r); // NOLINT(cppcoreguidelines-pro-type-reinterpret + } } // namespace plib -#endif /* PMEMPOOL_H_ */ +#endif // PMEMPOOL_H_ diff --git a/src/lib/netlist/plib/pmulti_threading.h b/src/lib/netlist/plib/pmulti_threading.h new file mode 100644 index 00000000000..f7b89079bc0 --- /dev/null +++ b/src/lib/netlist/plib/pmulti_threading.h @@ -0,0 +1,89 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PMULTI_THREADING_H_ +#define PMULTI_THREADING_H_ + +/// +/// \file pmulti_threading.h +/// + +#include "pconfig.h" + +#include <algorithm> +#include <atomic> +#include <condition_variable> +#include <mutex> +#include <type_traits> +#include <utility> + +namespace plib { + + template<bool enabled_ = true> + struct pspin_mutex + { + public: + inline pspin_mutex() noexcept = default; + inline void lock() noexcept{ while (m_lock.test_and_set(std::memory_order_acquire)) { } } + inline void unlock() noexcept { m_lock.clear(std::memory_order_release); } + private: + PALIGNAS_CACHELINE() + std::atomic_flag m_lock = ATOMIC_FLAG_INIT; + }; + + template<> + struct pspin_mutex<false> + { + public: + inline pspin_mutex() noexcept = default; + static inline void lock() noexcept { } + static inline void unlock() noexcept { } + }; + + class psemaphore + { + public: + + psemaphore(long count = 0) noexcept: m_count(count) { } + + psemaphore(const psemaphore& other) = delete; + psemaphore& operator=(const psemaphore& other) = delete; + psemaphore(psemaphore&& other) = delete; + psemaphore& operator=(psemaphore&& other) = delete; + ~psemaphore() = default; + + void release(long update = 1) + { + std::lock_guard<std::mutex> lock(m_mutex); + m_count += update; + m_cv.notify_one(); + } + + void acquire() + { + std::unique_lock<std::mutex> lock(m_mutex); + while (m_count == 0) + m_cv.wait(lock); + --m_count; + } + + bool try_acquire() + { + std::lock_guard<std::mutex> lock(m_mutex); + if (m_count) + { + --m_count; + return true; + } + return false; + } + private: + std::mutex m_mutex; + std::condition_variable m_cv; + long m_count; + }; + + +} // namespace plib + +#endif // PMULTI_THREADING_H_ diff --git a/src/lib/netlist/plib/pomp.h b/src/lib/netlist/plib/pomp.h index ecd9eacc41b..b77d3e5ee56 100644 --- a/src/lib/netlist/plib/pomp.h +++ b/src/lib/netlist/plib/pomp.h @@ -1,73 +1,76 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pomp.h - * - * Wrap all OPENMP stuff here in a hopefully c++ compliant way. - */ #ifndef POMP_H_ #define POMP_H_ +/// +/// \file pomp.h +/// +/// Wrap all OPENMP stuff here in a hopefully c++ compliant way. +/// + #include "pconfig.h" #include "ptypes.h" #include <cstdint> -#if HAS_OPENMP +#if PHAS_OPENMP #include "omp.h" #endif -namespace plib { -namespace omp { +namespace plib::omp { template <typename I, class T> -void for_static(const I start, const I end, const T &what) +void for_static(std::size_t numops, const I start, const I end, const T &what) noexcept(noexcept(what)) { -#if HAS_OPENMP && USE_OPENMP - #pragma omp parallel -#endif + if (numops>1000) { -#if HAS_OPENMP && USE_OPENMP - #pragma omp for //schedule(static) -#endif + #if PHAS_OPENMP && PUSE_OPENMP + #pragma omp parallel for schedule(static) + #endif for (I i = start; i < end; i++) what(i); } + else + for (I i = start; i < end; i++) + what(i); } template <typename I, class T> -void for_static_np(const I start, const I end, const T &what) +void for_static(const I start, const I end, const T &what) noexcept(noexcept(what)) +{ +#if PHAS_OPENMP && PUSE_OPENMP + #pragma omp parallel for schedule(static) +#endif + for (I i = start; i < end; i++) + what(i); +} + +template <typename I, class T> +void for_static_np(const I start, const I end, const T &what) noexcept(noexcept(what)) { for (I i = start; i < end; i++) what(i); } -inline void set_num_threads(const std::size_t threads) +inline void set_num_threads([[maybe_unused]] const std::size_t threads) noexcept { -#if HAS_OPENMP && USE_OPENMP +#if PHAS_OPENMP && PUSE_OPENMP omp_set_num_threads(threads); -#else - plib::unused_var(threads); #endif } -inline std::size_t get_max_threads() +inline std::size_t get_max_threads() noexcept { -#if HAS_OPENMP && USE_OPENMP +#if PHAS_OPENMP && PUSE_OPENMP return omp_get_max_threads(); #else return 1; #endif } +} // namespace plib::omp -// ---------------------------------------------------------------------------------------- -// pdynlib: dynamic loading of libraries ... -// ---------------------------------------------------------------------------------------- - -} // namespace omp -} // namespace plib - -#endif /* PSTRING_H_ */ +#endif // PSTRING_H_ diff --git a/src/lib/netlist/plib/poptions.cpp b/src/lib/netlist/plib/poptions.cpp index fa9a343815e..1ddda613e85 100644 --- a/src/lib/netlist/plib/poptions.cpp +++ b/src/lib/netlist/plib/poptions.cpp @@ -1,18 +1,12 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * poptions.cpp - * - */ #include "poptions.h" #include "pexception.h" +#include "pstrutil.h" #include "ptypes.h" namespace plib { -/*************************************************************************** - Options -***************************************************************************/ option_base::option_base(options &parent, const pstring &help) : m_help(help) @@ -32,9 +26,8 @@ namespace plib { return 0; } - int option_bool::parse(const pstring &argument) + int option_bool::parse([[maybe_unused]] const pstring &argument) { - unused_var(argument); m_val = true; return 0; } @@ -64,17 +57,17 @@ namespace plib { void options::register_option(option_base *opt) { - m_opts.push_back(opt); + m_options.push_back(opt); } void options::check_consistency() { - for (auto &opt : m_opts) + for (auto &opt : m_options) { auto *o = dynamic_cast<option *>(opt); if (o != nullptr) { - if (o->short_opt() == "" && o->long_opt() == "") + if (o->short_opt().empty() && o->long_opt().empty()) { auto *ov = dynamic_cast<option_args *>(o); if (ov != nullptr) @@ -83,10 +76,8 @@ namespace plib { { throw pexception("other args can only be specified once!"); } - else - { - m_other_args = ov; - } + + m_other_args = ov; } else throw pexception("found option with neither short or long tag!" ); @@ -95,13 +86,13 @@ namespace plib { } } - int options::parse(int argc, char **argv) + std::size_t options::parse(const std::vector<putf8string> &argv) { check_consistency(); - m_app = pstring(argv[0]); + m_app = argv[0]; bool seen_other_args = false; - for (int i=1; i<argc; ) + for (std::size_t i=1; i < argv.size(); ) { pstring arg(argv[i]); option *opt = nullptr; @@ -110,8 +101,8 @@ namespace plib { if (!seen_other_args && plib::startsWith(arg, "--")) { - auto v = psplit(arg.substr(2),"="); - if (v.size() && v[0] != pstring("")) + auto v = psplit(arg.substr(2),'='); + if (!v.empty() && !v[0].empty()) { opt = getopt_long(v[0]); has_equal_arg = (v.size() > 1); @@ -159,7 +150,7 @@ namespace plib { else { i++; - if (i >= argc) + if (i >= argv.size()) return i - 1; if (opt->do_parse(pstring(argv[i])) != 0) return i - 1; @@ -173,28 +164,30 @@ namespace plib { } i++; } - return argc; + return argv.size(); } pstring options::split_paragraphs(const pstring &text, unsigned width, unsigned indent, - unsigned firstline_indent) + unsigned firstline_indent, const pstring &line_end) { - auto paragraphs = psplit(text,"\n"); + auto paragraphs = psplit(text,'\n'); pstring ret(""); for (auto &p : paragraphs) { pstring line = plib::rpad(pstring(""), pstring(" "), firstline_indent); - for (auto &s : psplit(p, " ")) + for (auto &s : psplit(p, ' ')) { if (line.length() + s.length() > width) { - ret += line + "\n"; + ret += line + line_end; line = plib::rpad(pstring(""), pstring(" "), indent); } line += s + " "; } - ret += line + "\n"; + ret += line; + if (p != paragraphs.back()) + ret += line_end; } return ret; } @@ -204,23 +197,23 @@ namespace plib { { pstring ret; - ret = split_paragraphs(description, width, 0, 0) + "\n"; + ret = split_paragraphs(description, width, 0, 0) + "\n\n"; ret += "Usage:\t" + usage + "\n\nOptions:\n\n"; - for (auto & optbase : m_opts ) + for (const auto & optbase : m_options ) { // Skip anonymous inputs which are collected in option_args if (dynamic_cast<option_args *>(optbase) != nullptr) continue; - if (auto opt = dynamic_cast<option *>(optbase)) + if (auto * const opt = dynamic_cast<option *>(optbase)) { pstring line = ""; - if (opt->short_opt() != "") + if (!opt->short_opt().empty()) line += " -" + opt->short_opt(); - if (opt->long_opt() != "") + if (!opt->long_opt().empty()) { - if (line != "") + if (!line.empty()) line += ", "; else line = " "; @@ -229,9 +222,9 @@ namespace plib { { line += "="; auto *ol = dynamic_cast<option_str_limit_base *>(opt); - if (ol) + if (ol != nullptr) { - for (auto &v : ol->limit()) + for (const auto &v : ol->limit()) { line += v + "|"; } @@ -246,28 +239,30 @@ namespace plib { { //ret += "TestGroup abc\n def gef\nxyz\n\n" ; ret += line + "\n"; - ret += split_paragraphs(opt->help(), width, indent, indent); + ret += split_paragraphs(opt->help(), width, indent, indent) + "\n"; } else - ret += split_paragraphs(line + opt->help(), width, indent, 0); + ret += split_paragraphs(line + opt->help(), width, indent, 0) + "\n"; } - else if (auto grp = dynamic_cast<option_group *>(optbase)) + else if (auto *grp = dynamic_cast<option_group *>(optbase)) { ret += "\n" + grp->group() + ":\n"; - if (grp->help() != "") ret += split_paragraphs(grp->help(), width, 4, 4) + "\n"; + if (!grp->help().empty()) + ret += split_paragraphs(grp->help(), width, 4, 4) + "\n\n"; } } // FIXME: other help ... pstring ex(""); - for (auto & optbase : m_opts ) + for (const auto & optbase : m_options ) { - if (auto example = dynamic_cast<option_example *>(optbase)) + if (auto *example = dynamic_cast<option_example *>(optbase)) { - ex += "> " + example->example()+"\n\n"; - ex += split_paragraphs(example->help(), width, 4, 4) + "\n"; + // help2man doesn't like \\ line continuation in output + ex += split_paragraphs(example->example(), width, 8, 0, "\n") + "\n\n"; + ex += split_paragraphs(example->help(), width, 4, 4) + "\n\n"; } } - if (ex.length() > 0) + if (!ex.empty()) { ret += "\n\nExamples:\n\n" + ex; } @@ -276,20 +271,20 @@ namespace plib { option *options::getopt_short(const pstring &arg) const { - for (auto & optbase : m_opts) + for (const auto & optbase : m_options) { - auto opt = dynamic_cast<option *>(optbase); - if (opt && arg != "" && opt->short_opt() == arg) + auto *opt = dynamic_cast<option *>(optbase); + if (opt != nullptr && !arg.empty() && opt->short_opt() == arg) return opt; } return nullptr; } option *options::getopt_long(const pstring &arg) const { - for (auto & optbase : m_opts) + for (const auto & optbase : m_options) { - auto opt = dynamic_cast<option *>(optbase); - if (opt && arg !="" && opt->long_opt() == arg) + auto *opt = dynamic_cast<option *>(optbase); + if (opt != nullptr && !arg.empty() && opt->long_opt() == arg) return opt; } return nullptr; diff --git a/src/lib/netlist/plib/poptions.h b/src/lib/netlist/plib/poptions.h index aa2608c2c91..a758c446ff9 100644 --- a/src/lib/netlist/plib/poptions.h +++ b/src/lib/netlist/plib/poptions.h @@ -1,264 +1,274 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * poptions.h - * - */ - -#pragma once #ifndef POPTIONS_H_ #define POPTIONS_H_ -#include "plists.h" +/// +/// \file poptions.h +/// + +#include "pfmtlog.h" +#include "pstonum.h" #include "pstring.h" #include "putil.h" namespace plib { -/*************************************************************************** - Options -***************************************************************************/ -class options; + /// \brief options base class + /// + class options; -class option_base -{ -public: - option_base(options &parent, const pstring &help); - virtual ~option_base() = default; + class option_base + { + public: + option_base(options &parent, const pstring &help); + virtual ~option_base() = default; - COPYASSIGNMOVE(option_base, delete) + PCOPYASSIGNMOVE(option_base, delete) - pstring help() const { return m_help; } -private: - pstring m_help; -}; + virtual pstring help() const { return m_help; } + private: + pstring m_help; + }; -class option_group : public option_base -{ -public: - option_group(options &parent, const pstring &group, const pstring &help) - : option_base(parent, help), m_group(group) { } + class option_group : public option_base + { + public: + option_group(options &parent, const pstring &group, const pstring &help) + : option_base(parent, help), m_group(group) { } - pstring group() const { return m_group; } -private: - pstring m_group; -}; + pstring group() const { return m_group; } + private: + pstring m_group; + }; -class option_example : public option_base -{ -public: - option_example(options &parent, const pstring &group, const pstring &help) - : option_base(parent, help), m_example(group) { } + class option_example : public option_base + { + public: + option_example(options &parent, const pstring &group, const pstring &help) + : option_base(parent, help), m_example(group) { } - pstring example() const { return m_example; } -private: - pstring m_example; -}; + pstring example() const { return m_example; } + private: + pstring m_example; + }; -class option : public option_base -{ -public: - option(options &parent, const pstring &ashort, const pstring &along, const pstring &help, bool has_argument); + class option : public option_base + { + public: + option(options &parent, const pstring &short_opt, const pstring &long_opt, const pstring &help, bool has_argument); - /* no_argument options will be called with "" argument */ + // no_argument options will be called with "" argument - pstring short_opt() { return m_short; } - pstring long_opt() { return m_long; } - bool has_argument() { return m_has_argument ; } - bool was_specified() { return m_specified; } + pstring short_opt() const { return m_short; } + pstring long_opt() const { return m_long; } + bool has_argument() const { return m_has_argument ; } + bool was_specified() const { return m_specified; } - int do_parse(const pstring &argument) - { - m_specified = true; - return parse(argument); - } + int do_parse(const pstring &argument) + { + m_specified = true; + return parse(argument); + } -protected: - virtual int parse(const pstring &argument) = 0; + protected: + virtual int parse(const pstring &argument) = 0; -private: - pstring m_short; - pstring m_long; - bool m_has_argument; - bool m_specified; -}; + private: + pstring m_short; + pstring m_long; + bool m_has_argument; + bool m_specified; + }; -class option_str : public option -{ -public: - option_str(options &parent, const pstring &ashort, const pstring &along, const pstring &defval, const pstring &help) - : option(parent, ashort, along, help, true), m_val(defval) - {} + class option_str : public option + { + public: + option_str(options &parent, const pstring &short_opt, const pstring &long_opt, const pstring &default_value, const pstring &help) + : option(parent, short_opt, long_opt, help, true), m_val(default_value) + {} - pstring operator ()() const { return m_val; } + pstring operator ()() const { return m_val; } -protected: - int parse(const pstring &argument) override; + protected: + int parse(const pstring &argument) override; -private: - pstring m_val; -}; + private: + pstring m_val; + }; -class option_str_limit_base : public option -{ -public: - option_str_limit_base(options &parent, const pstring &ashort, const pstring &along, std::vector<pstring> &&limit, const pstring &help) - : option(parent, ashort, along, help, true) - , m_limit(limit) + class option_str_limit_base : public option { - } - const std::vector<pstring> &limit() const { return m_limit; } + public: + option_str_limit_base(options &parent, const pstring &short_opt, const pstring &long_opt, std::vector<pstring> &&limit, const pstring &help) + : option(parent, short_opt, long_opt, help, true) + , m_limit(limit) + { + } + const std::vector<pstring> &limit() const { return m_limit; } -protected: + protected: -private: - std::vector<pstring> m_limit; -}; + private: + std::vector<pstring> m_limit; + }; -template <typename T> -class option_str_limit : public option_str_limit_base -{ -public: - option_str_limit(options &parent, const pstring &ashort, const pstring &along, const T &defval, std::vector<pstring> &&limit, const pstring &help) - : option_str_limit_base(parent, ashort, along, std::move(limit), help), m_val(defval) + template <typename T> + class option_str_limit : public option_str_limit_base { - } - - T operator ()() const { return m_val; } + public: + option_str_limit(options &parent, const pstring &short_opt, const pstring &long_opt, const T &default_value, std::vector<pstring> &&limit, const pstring &help) + : option_str_limit_base(parent, short_opt, long_opt, std::move(limit), help), m_val(default_value) + { + } - pstring as_string() const { return limit()[m_val]; } + T operator ()() const { return m_val; } -protected: - int parse(const pstring &argument) override - { - auto raw = plib::container::indexof(limit(), argument); + pstring as_string() const { return limit()[m_val]; } - if (raw != plib::container::npos) + protected: + int parse(const pstring &argument) override { - m_val = static_cast<T>(raw); - return 0; - } - else + auto raw = plib::container::index_of(limit(), argument); + + if (raw != plib::container::npos) + { + m_val = narrow_cast<T>(raw); + return 0; + } + return 1; - } + } -private: - T m_val; -}; + private: + T m_val; + }; -class option_bool : public option -{ -public: - option_bool(options &parent, const pstring &ashort, const pstring &along, const pstring &help) - : option(parent, ashort, along, help, false), m_val(false) - {} + class option_bool : public option + { + public: + option_bool(options &parent, const pstring &short_opt, const pstring &long_opt, const pstring &help) + : option(parent, short_opt, long_opt, help, false), m_val(false) + {} - bool operator ()() const { return m_val; } + bool operator ()() const { return m_val; } -protected: - int parse(const pstring &argument) override; + protected: + int parse(const pstring &argument) override; -private: - bool m_val; -}; + private: + bool m_val; + }; -template <typename T> -class option_num : public option -{ -public: - option_num(options &parent, const pstring &ashort, const pstring &along, T defval, - const pstring &help, - T minval = std::numeric_limits<T>::min(), - T maxval = std::numeric_limits<T>::max() ) - : option(parent, ashort, along, help, true) - , m_val(defval) - , m_min(minval) - , m_max(maxval) - {} - - T operator ()() const { return m_val; } - -protected: - int parse(const pstring &argument) override + template <typename T> + class option_num : public option { - bool err; - m_val = pstonum_ne<T, true>(argument, err); - return (err ? 1 : (m_val < m_min || m_val > m_max)); - } + public: + option_num(options &parent, const pstring &short_opt, const pstring &long_opt, T default_value, + const pstring &help, + T min_val = std::numeric_limits<T>::lowest(), + T max_val = std::numeric_limits<T>::max() ) + : option(parent, short_opt, long_opt, help, true) + , m_val(default_value) + , m_min(min_val) + , m_max(max_val) + , m_def(default_value) + {} + + T operator ()() const { return m_val; } + + pstring help() const override + { + auto hs(option::help()); + return plib::pfmt(hs)(m_def, m_min, m_max); + } -private: - T m_val; - T m_min; - T m_max; -}; + protected: + int parse(const pstring &argument) override + { + bool err(false); + m_val = pstonum_ne<T>(argument, err); + return (err ? 1 : (m_val < m_min || m_val > m_max)); + } -class option_vec : public option -{ -public: - option_vec(options &parent, const pstring &ashort, const pstring &along, const pstring &help) - : option(parent, ashort, along, help, true) - {} + private: + T m_val; + T m_min; + T m_max; + T m_def; + }; - const std::vector<pstring> &operator ()() const { return m_val; } + class option_vec : public option + { + public: + option_vec(options &parent, const pstring &short_opt, const pstring &long_opt, const pstring &help) + : option(parent, short_opt, long_opt, help, true) + {} -protected: - int parse(const pstring &argument) override; + const std::vector<pstring> &operator ()() const { return m_val; } -private: - std::vector<pstring> m_val; -}; + protected: + int parse(const pstring &argument) override; -class option_args : public option_vec -{ -public: - option_args(options &parent, const pstring &help) - : option_vec(parent, "", "", help) - {} -}; + private: + std::vector<pstring> m_val; + }; -class options : public nocopyassignmove -{ -public: + class option_args : public option_vec + { + public: + option_args(options &parent, const pstring &help) + : option_vec(parent, "", "", help) + {} + }; - options(); - explicit options(option **o); + class options + { + public: - void register_option(option_base *opt); - int parse(int argc, char **argv); + options(); + explicit options(option **o); - pstring help(const pstring &description, const pstring &usage, - unsigned width = 72, unsigned indent = 20) const; + ~options() = default; - pstring app() const { return m_app; } + PCOPYASSIGNMOVE(options, delete) -private: - static pstring split_paragraphs(const pstring &text, unsigned width, unsigned indent, - unsigned firstline_indent); + void register_option(option_base *opt); + std::size_t parse(const std::vector<putf8string> &argv); - void check_consistency(); + pstring help(const pstring &description, const pstring &usage, + unsigned width = 72, unsigned indent = 20) const; - template <typename T> - T *getopt_type() const - { - for (auto & optbase : m_opts ) + pstring app() const { return m_app; } + + private: + static pstring split_paragraphs(const pstring &text, unsigned width, unsigned indent, + unsigned first_line_indent, const pstring &line_end = "\n"); + + void check_consistency() noexcept(false); + + template <typename T> + T *getopt_type() const { - if (auto opt = dynamic_cast<T *>(optbase)) - return opt; - } + for (const auto & base_class : m_options ) + { + if (auto opt = dynamic_cast<T *>(base_class)) + return opt; + } return nullptr; } - option *getopt_short(const pstring &arg) const; - option *getopt_long(const pstring &arg) const; + option *getopt_short(const pstring &arg) const; + option *getopt_long(const pstring &arg) const; - std::vector<option_base *> m_opts; - pstring m_app; - option_args * m_other_args; + std::vector<option_base *> m_options; + pstring m_app; + option_args * m_other_args; }; } // namespace plib -#endif /* POPTIONS_H_ */ +#endif // POPTIONS_H_ diff --git a/src/lib/netlist/plib/pparser.cpp b/src/lib/netlist/plib/pparser.cpp deleted file mode 100644 index 2b365f22811..00000000000 --- a/src/lib/netlist/plib/pparser.cpp +++ /dev/null @@ -1,531 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * pparser.c - * - */ - -#include "pparser.h" -#include "palloc.h" -#include "putil.h" - -//#include <cstdarg> - -namespace plib { -// ---------------------------------------------------------------------------------------- -// A simple tokenizer -// ---------------------------------------------------------------------------------------- - -pstring ptokenizer::currentline_str() -{ - return m_cur_line; -} - - -void ptokenizer::skipeol() -{ - pstring::value_type c = getc(); - while (c) - { - if (c == 10) - { - c = getc(); - if (c != 13) - ungetc(c); - return; - } - c = getc(); - } -} - - -pstring::value_type ptokenizer::getc() -{ - if (m_unget != 0) - { - pstring::value_type c = m_unget; - m_unget = 0; - return c; - } - if (m_px == m_cur_line.end()) - { - m_lineno++; - if (m_strm.readline(m_cur_line)) - m_px = m_cur_line.begin(); - else - return 0; - return '\n'; - } - pstring::value_type c = *(m_px++); - return c; -} - -void ptokenizer::ungetc(pstring::value_type c) -{ - m_unget = c; -} - -void ptokenizer::require_token(const token_id_t &token_num) -{ - require_token(get_token(), token_num); -} - -void ptokenizer::require_token(const token_t &tok, const token_id_t &token_num) -{ - if (!tok.is(token_num)) - { - pstring val(""); - for (auto &i : m_tokens) - if (i.second.id() == token_num.id()) - val = i.first; - error(pfmt("Expected token <{1}> got <{2}>")(val)(tok.str()) ); - } -} - -pstring ptokenizer::get_string() -{ - token_t tok = get_token(); - if (!tok.is_type(STRING)) - { - error(pfmt("Expected a string, got <{1}>")(tok.str()) ); - } - return tok.str(); -} - -pstring ptokenizer::get_identifier() -{ - token_t tok = get_token(); - if (!tok.is_type(IDENTIFIER)) - { - error(pfmt("Expected an identifier, got <{1}>")(tok.str()) ); - } - return tok.str(); -} - -pstring ptokenizer::get_identifier_or_number() -{ - token_t tok = get_token(); - if (!(tok.is_type(IDENTIFIER) || tok.is_type(NUMBER))) - { - error(pfmt("Expected an identifier or number, got <{1}>")(tok.str()) ); - } - return tok.str(); -} - -// FIXME: combine into template -double ptokenizer::get_number_double() -{ - token_t tok = get_token(); - if (!tok.is_type(NUMBER)) - { - error(pfmt("Expected a number, got <{1}>")(tok.str()) ); - } - bool err; - auto ret = plib::pstonum_ne<double, true>(tok.str(), err); - if (err) - error(pfmt("Expected a number, got <{1}>")(tok.str()) ); - return ret; -} - -long ptokenizer::get_number_long() -{ - token_t tok = get_token(); - if (!tok.is_type(NUMBER)) - { - error(pfmt("Expected a long int, got <{1}>")(tok.str()) ); - } - bool err; - auto ret = plib::pstonum_ne<long, true>(tok.str(), err); - if (err) - error(pfmt("Expected a long int, got <{1}>")(tok.str()) ); - return ret; -} - -ptokenizer::token_t ptokenizer::get_token() -{ - while (true) - { - token_t ret = get_token_internal(); - if (ret.is_type(ENDOFFILE)) - return ret; - - if (ret.is(m_tok_comment_start)) - { - do { - ret = get_token_internal(); - } while (ret.is_not(m_tok_comment_end)); - } - else if (ret.is(m_tok_line_comment)) - { - skipeol(); - } - else if (ret.str() == "#") - { - skipeol(); - } - else - { - return ret; - } - } -} - -ptokenizer::token_t ptokenizer::get_token_internal() -{ - /* skip ws */ - pstring::value_type c = getc(); - while (m_whitespace.find(c) != pstring::npos) - { - c = getc(); - if (eof()) - { - return token_t(ENDOFFILE); - } - } - if (m_number_chars_start.find(c) != pstring::npos) - { - /* read number while we receive number or identifier chars - * treat it as an identifier when there are identifier chars in it - * - */ - token_type ret = NUMBER; - pstring tokstr = ""; - while (true) { - if (m_identifier_chars.find(c) != pstring::npos && m_number_chars.find(c) == pstring::npos) - ret = IDENTIFIER; - else if (m_number_chars.find(c) == pstring::npos) - break; - tokstr += c; - c = getc(); - } - ungetc(c); - return token_t(ret, tokstr); - } - else if (m_identifier_chars.find(c) != pstring::npos) - { - /* read identifier till non identifier char */ - pstring tokstr = ""; - while (m_identifier_chars.find(c) != pstring::npos) - { - tokstr += c; - c = getc(); - } - ungetc(c); - auto id = m_tokens.find(tokstr); - if (id != m_tokens.end()) - return token_t(id->second, tokstr); - else - return token_t(IDENTIFIER, tokstr); - } - else if (c == m_string) - { - pstring tokstr = ""; - c = getc(); - while (c != m_string) - { - tokstr += c; - c = getc(); - } - return token_t(STRING, tokstr); - } - else - { - /* read identifier till first identifier char or ws */ - pstring tokstr = ""; - while ((m_identifier_chars.find(c) == pstring::npos) && (m_whitespace.find(c) == pstring::npos)) - { - tokstr += c; - /* expensive, check for single char tokens */ - if (tokstr.length() == 1) - { - auto id = m_tokens.find(tokstr); - if (id != m_tokens.end()) - return token_t(id->second, tokstr); - } - c = getc(); - } - ungetc(c); - auto id = m_tokens.find(tokstr); - if (id != m_tokens.end()) - return token_t(id->second, tokstr); - else - return token_t(UNKNOWN, tokstr); - } -} - -void ptokenizer::error(const pstring &errs) -{ - verror(errs, currentline_no(), currentline_str()); - //throw error; -} - -// ---------------------------------------------------------------------------------------- -// A simple preprocessor -// ---------------------------------------------------------------------------------------- - -ppreprocessor::ppreprocessor(defines_map_type *defines) -: std::istream(new st(this)) -, m_ifflag(0) -, m_level(0) -, m_lineno(0) -, m_pos(0) -, m_state(PROCESS) -, m_comment(false) -{ - m_expr_sep.emplace_back("!"); - m_expr_sep.emplace_back("("); - m_expr_sep.emplace_back(")"); - m_expr_sep.emplace_back("+"); - m_expr_sep.emplace_back("-"); - m_expr_sep.emplace_back("*"); - m_expr_sep.emplace_back("/"); - m_expr_sep.emplace_back("&&"); - m_expr_sep.emplace_back("||"); - m_expr_sep.emplace_back("=="); - m_expr_sep.emplace_back(","); - m_expr_sep.emplace_back(" "); - m_expr_sep.emplace_back("\t"); - - if (defines != nullptr) - m_defines = *defines; - m_defines.insert({"__PLIB_PREPROCESSOR__", define_t("__PLIB_PREPROCESSOR__", "1")}); -} - -void ppreprocessor::error(const pstring &err) -{ - throw pexception("PREPRO ERROR: " + err); -} - -#define CHECKTOK2(p_op, p_prio) \ - else if (tok == # p_op) \ - { \ - if (prio < (p_prio)) \ - return val; \ - start++; \ - const auto v2 = expr(sexpr, start, (p_prio)); \ - val = (val p_op v2); \ - } \ - -// Operator precedence see https://en.cppreference.com/w/cpp/language/operator_precedence - -int ppreprocessor::expr(const std::vector<pstring> &sexpr, std::size_t &start, int prio) -{ - int val = 0; - pstring tok=sexpr[start]; - if (tok == "(") - { - start++; - val = expr(sexpr, start, /*prio*/ 255); - if (sexpr[start] != ")") - error("parsing error!"); - start++; - } - while (start < sexpr.size()) - { - tok=sexpr[start]; - if (tok == ")") - { - // FIXME: catch error - return val; - } - else if (tok == "!") - { - if (prio < 3) - return val; - start++; - val = !expr(sexpr, start, 3); - } - CHECKTOK2(*, 5) - CHECKTOK2(/, 5) - CHECKTOK2(+, 6) - CHECKTOK2(-, 6) - CHECKTOK2(==, 10) - CHECKTOK2(&&, 14) - CHECKTOK2(||, 15) - else - { - // FIXME: error handling - val = plib::pstonum<decltype(val)>(tok); - start++; - } - } - return val; -} - -ppreprocessor::define_t *ppreprocessor::get_define(const pstring &name) -{ - auto idx = m_defines.find(name); - return (idx != m_defines.end()) ? &idx->second : nullptr; -} - -pstring ppreprocessor::replace_macros(const pstring &line) -{ - std::vector<pstring> elems(psplit(line, m_expr_sep)); - pstring ret(""); - for (auto & elem : elems) - { - define_t *def = get_define(elem); - ret += (def != nullptr) ? def->m_replace : elem; - } - return ret; -} - -static pstring catremainder(const std::vector<pstring> &elems, std::size_t start, const pstring &sep) -{ - pstring ret(""); - for (std::size_t i = start; i < elems.size(); i++) - { - ret += elems[i]; - ret += sep; - } - return ret; -} - -pstring ppreprocessor::process_comments(pstring line) -{ - bool in_string = false; - - std::size_t e = line.size(); - pstring ret = ""; - for (std::size_t i=0; i < e; ) - { - pstring c = plib::left(line, 1); - line = line.substr(1); - if (!m_comment) - { - if (c=="\"") - { - in_string = !in_string; - ret += c; - } - else if (in_string && c=="\\") - { - i++; - ret += (c + plib::left(line, 1)); - line = line.substr(1); - } - else if (!in_string && c=="/" && plib::left(line,1) == "*") - m_comment = true; - else if (!in_string && c=="/" && plib::left(line,1) == "/") - break; - else - ret += c; - } - else - if (c=="*" && plib::left(line,1) == "/") - { - i++; - line = line.substr(1); - m_comment = false; - } - i++; - } - return ret; -} - -pstring ppreprocessor::process_line(pstring line) -{ - bool line_cont = plib::right(line, 1) == "\\"; - if (line_cont) - line = plib::left(line, line.size() - 1); - - if (m_state == LINE_CONTINUATION) - m_line += line; - else - m_line = line; - - if (line_cont) - { - m_state = LINE_CONTINUATION; - return ""; - } - else - m_state = PROCESS; - - line = process_comments(m_line); - - pstring lt = plib::trim(plib::replace_all(line, pstring("\t"), pstring(" "))); - pstring ret; - // FIXME ... revise and extend macro handling - if (plib::startsWith(lt, "#")) - { - std::vector<pstring> lti(psplit(lt, " ", true)); - if (lti[0] == "#if") - { - m_level++; - std::size_t start = 0; - lt = replace_macros(lt); - std::vector<pstring> t(psplit(replace_all(lt.substr(3), pstring(" "), pstring("")), m_expr_sep)); - auto val = static_cast<int>(expr(t, start, 255)); - if (val == 0) - m_ifflag |= (1 << m_level); - } - else if (lti[0] == "#ifdef") - { - m_level++; - if (get_define(lti[1]) == nullptr) - m_ifflag |= (1 << m_level); - } - else if (lti[0] == "#ifndef") - { - m_level++; - if (get_define(lti[1]) != nullptr) - m_ifflag |= (1 << m_level); - } - else if (lti[0] == "#else") - { - m_ifflag ^= (1 << m_level); - } - else if (lti[0] == "#endif") - { - m_ifflag &= ~(1 << m_level); - m_level--; - } - else if (lti[0] == "#include") - { - // ignore - } - else if (lti[0] == "#pragma") - { - if (m_ifflag == 0 && lti.size() > 3 && lti[1] == "NETLIST") - { - if (lti[2] == "warning") - error("NETLIST: " + catremainder(lti, 3, " ")); - } - } - else if (lti[0] == "#define") - { - if (m_ifflag == 0) - { - if (lti.size() < 2) - error("PREPRO: define needs at least one argument: " + line); - else if (lti.size() == 2) - m_defines.insert({lti[1], define_t(lti[1], "")}); - else - { - pstring arg(""); - for (std::size_t i=2; i<lti.size() - 1; i++) - arg += lti[i] + " "; - arg += lti[lti.size()-1]; - m_defines.insert({lti[1], define_t(lti[1], arg)}); - } - } - } - else - { - if (m_ifflag == 0) - error(pfmt("unknown directive on line {1}: {2}")(m_lineno)(replace_macros(line))); - } - } - else - { - lt = replace_macros(lt); - if (m_ifflag == 0) - ret += lt; - } - return ret; -} - - - -} // namespace plib diff --git a/src/lib/netlist/plib/pparser.h b/src/lib/netlist/plib/pparser.h deleted file mode 100644 index 123786602e0..00000000000 --- a/src/lib/netlist/plib/pparser.h +++ /dev/null @@ -1,279 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * pparser.h - * - */ - -#ifndef PPARSER_H_ -#define PPARSER_H_ - -#include "plists.h" -#include "pstream.h" -#include "pstring.h" - -//#include <cstdint> -#include <unordered_map> - - -namespace plib { -class ptokenizer -{ -public: - template <typename T> - ptokenizer(T &&strm) // NOLINT(misc-forwarding-reference-overload, bugprone-forwarding-reference-overload) - : m_strm(std::forward<T>(strm)) - , m_lineno(0) - , m_cur_line("") - , m_px(m_cur_line.begin()) - , m_unget(0) - , m_string('"') - { - } - - COPYASSIGNMOVE(ptokenizer, delete) - - virtual ~ptokenizer() = default; - - enum token_type - { - IDENTIFIER, - NUMBER, - TOKEN, - STRING, - COMMENT, - UNKNOWN, - ENDOFFILE - }; - - struct token_id_t - { - public: - - static constexpr std::size_t npos = static_cast<std::size_t>(-1); - - token_id_t() : m_id(npos) {} - explicit token_id_t(const std::size_t id) : m_id(id) {} - std::size_t id() const { return m_id; } - private: - std::size_t m_id; - }; - - struct token_t - { - explicit token_t(token_type type) - : m_type(type), m_id(), m_token("") - { - } - token_t(token_type type, const pstring &str) - : m_type(type), m_id(), m_token(str) - { - } - token_t(const token_id_t &id, const pstring &str) - : m_type(TOKEN), m_id(id), m_token(str) - { - } - - bool is(const token_id_t &tok_id) const { return m_id.id() == tok_id.id(); } - bool is_not(const token_id_t &tok_id) const { return !is(tok_id); } - - bool is_type(const token_type type) const { return m_type == type; } - - pstring str() const { return m_token; } - - private: - token_type m_type; - token_id_t m_id; - pstring m_token; - }; - - - int currentline_no() { return m_lineno; } - pstring currentline_str(); - - /* tokenizer stuff follows ... */ - - token_t get_token(); - pstring get_string(); - pstring get_identifier(); - pstring get_identifier_or_number(); - double get_number_double(); - long get_number_long(); - - void require_token(const token_id_t &token_num); - void require_token(const token_t &tok, const token_id_t &token_num); - - token_id_t register_token(const pstring &token) - { - token_id_t ret(m_tokens.size()); - m_tokens.emplace(token, ret); - return ret; - } - - ptokenizer & identifier_chars(pstring s) { m_identifier_chars = std::move(s); return *this; } - ptokenizer & number_chars(pstring st, pstring rem) { m_number_chars_start = std::move(st); m_number_chars = std::move(rem); return *this; } - ptokenizer & string_char(pstring::value_type c) { m_string = c; return *this; } - ptokenizer & whitespace(pstring s) { m_whitespace = std::move(s); return *this; } - ptokenizer & comment(const pstring &start, const pstring &end, const pstring &line) - { - m_tok_comment_start = register_token(start); - m_tok_comment_end = register_token(end); - m_tok_line_comment = register_token(line); - return *this; - } - - token_t get_token_internal(); - void error(const pstring &errs); - - putf8_reader &stream() { return m_strm; } -protected: - virtual void verror(const pstring &msg, int line_num, const pstring &line) = 0; - -private: - void skipeol(); - - pstring::value_type getc(); - void ungetc(pstring::value_type c); - - bool eof() { return m_strm.eof(); } - - putf8_reader m_strm; - - int m_lineno; - pstring m_cur_line; - pstring::const_iterator m_px; - pstring::value_type m_unget; - - /* tokenizer stuff follows ... */ - - pstring m_identifier_chars; - pstring m_number_chars; - pstring m_number_chars_start; - std::unordered_map<pstring, token_id_t> m_tokens; - pstring m_whitespace; - pstring::value_type m_string; - - token_id_t m_tok_comment_start; - token_id_t m_tok_comment_end; - token_id_t m_tok_line_comment; -}; - - -class ppreprocessor : public std::istream -{ -public: - - struct define_t - { - define_t(const pstring &name, const pstring &replace) - : m_name(name), m_replace(replace) - {} - pstring m_name; - pstring m_replace; - }; - - using defines_map_type = std::unordered_map<pstring, define_t>; - - explicit ppreprocessor(defines_map_type *defines = nullptr); - ~ppreprocessor() override - { - delete rdbuf(); - } - - template <typename T> - ppreprocessor & process(T &&istrm) - { - putf8_reader reader(std::forward<T>(istrm)); - pstring line; - while (reader.readline(line)) - { - m_lineno++; - line = process_line(line); - m_buf += decltype(m_buf)(line.c_str()) + static_cast<char>(10); - } - return *this; - } - - COPYASSIGN(ppreprocessor, delete) - ppreprocessor &operator=(ppreprocessor &&src) = delete; - - - ppreprocessor(ppreprocessor &&s) noexcept - : std::istream(new st(this)) - , m_defines(std::move(s.m_defines)) - , m_expr_sep(std::move(s.m_expr_sep)) - , m_ifflag(s.m_ifflag) - , m_level(s.m_level) - , m_lineno(s.m_lineno) - , m_buf(std::move(s.m_buf)) - , m_pos(s.m_pos) - , m_state(s.m_state) - , m_comment(s.m_comment) - { - } - -protected: - - class st : public std::streambuf - { - public: - st(ppreprocessor *strm) : m_strm(strm) { setg(nullptr, nullptr, nullptr); } - st(st &&rhs) noexcept : m_strm(rhs.m_strm) {} - int_type underflow() override - { - //printf("here\n"); - if (this->gptr() == this->egptr()) - { - /* clang reports sign error - weird */ - std::size_t bytes = pstring_mem_t_size(m_strm->m_buf) - static_cast<std::size_t>(m_strm->m_pos); - - if (bytes > m_buf.size()) - bytes = m_buf.size(); - std::copy(m_strm->m_buf.c_str() + m_strm->m_pos, m_strm->m_buf.c_str() + m_strm->m_pos + bytes, m_buf.data()); - //printf("%ld\n", (long int)bytes); - this->setg(m_buf.data(), m_buf.data(), m_buf.data() + bytes); - - m_strm->m_pos += static_cast</*pos_type*/long>(bytes); - } - return this->gptr() == this->egptr() - ? std::char_traits<char>::eof() - : std::char_traits<char>::to_int_type(*this->gptr()); - } - private: - ppreprocessor *m_strm; - std::array<char_type, 1024> m_buf; - }; - //friend class st; - - int expr(const std::vector<pstring> &sexpr, std::size_t &start, int prio); - define_t *get_define(const pstring &name); - pstring replace_macros(const pstring &line); - virtual void error(const pstring &err); - -private: - - enum state_e - { - PROCESS, - LINE_CONTINUATION - }; - - pstring process_line(pstring line); - pstring process_comments(pstring line); - - defines_map_type m_defines; - std::vector<pstring> m_expr_sep; - - std::uint_least64_t m_ifflag; // 31 if levels - int m_level; - int m_lineno; - pstring_t<pu8_traits> m_buf; - std::istream::pos_type m_pos; - state_e m_state; - pstring m_line; - bool m_comment; -}; - -} // namespace plib - -#endif /* PPARSER_H_ */ diff --git a/src/lib/netlist/plib/ppmf.cpp b/src/lib/netlist/plib/ppmf.cpp new file mode 100644 index 00000000000..85088b25638 --- /dev/null +++ b/src/lib/netlist/plib/ppmf.cpp @@ -0,0 +1,109 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#include "ppmf.h" + +#if PPMF_USE_MAME_DELEGATES +#include "../../util/delegate.cpp" +#else + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic push +#pragma GCC diagnostic ignored "-Wpmf-conversions" +#pragma GCC diagnostic ignored "-Wpedantic" +#endif + +namespace plib { + + void mfp_raw<ppmf_type::INTERNAL_ITANIUM>::convert_to_generic(generic_function &func, mfp_generic_class *&object) const + { + // apply the "this" delta to the object first + // NOLINTNEXTLINE(clang-analyzer-core.UndefinedBinaryOperatorResult,cppcoreguidelines-pro-type-reinterpret-cast) + auto *o_p_delta = reinterpret_cast<mfp_generic_class *>(reinterpret_cast<std::uint8_t *>(object) + m_this_delta); + + // if the low bit of the vtable index is clear, then it is just a raw function pointer + if ((m_function & 1) == 0) + { + // NOLINTNEXTLINE(performance-no-int-to-ptr,cppcoreguidelines-pro-type-reinterpret-cast) + func = reinterpret_cast<generic_function>(m_function); + } + else + { + // otherwise, it is the byte index into the vtable where the actual function lives + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + std::uint8_t *vtable_base = *reinterpret_cast<std::uint8_t **>(o_p_delta); + if (compile_info::abi_vtable_function_descriptors::value) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + func = reinterpret_cast<generic_function>(uintptr_t(vtable_base + m_function - 1)); + else + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + func = *reinterpret_cast<generic_function *>(vtable_base + m_function - 1); + } + object = o_p_delta; + } + + void mfp_raw<ppmf_type::INTERNAL_ARM>::convert_to_generic(generic_function &func, mfp_generic_class *&object) const + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + object = reinterpret_cast<mfp_generic_class *>(reinterpret_cast<std::uint8_t *>(object) + (m_this_delta >> 1)); + if ((m_this_delta & 1) == 0) + { + // NOLINTNEXTLINE(performance-no-int-to-ptr,cppcoreguidelines-pro-type-reinterpret-cast) + func = reinterpret_cast<generic_function>(m_function); + } + else + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + std::uint8_t *vtable_base = *reinterpret_cast<std::uint8_t **>(object) + m_function; + if (compile_info::abi_vtable_function_descriptors::value) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + func = reinterpret_cast<generic_function>(uintptr_t(vtable_base)); + else + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + func = *reinterpret_cast<generic_function *>(vtable_base); + } + } + + struct unknown_base_equiv_novtdisp { mfp_raw<ppmf_type::INTERNAL_MSC>::generic_function fptr; int thisdisp, vptrdisp; }; + + void mfp_raw<ppmf_type::INTERNAL_MSC>::convert_to_generic(generic_function &func, mfp_generic_class *&object) const + { + //printf("%lx, %lx, %lx, %lx %lx\n", m_function, m_this_delta, m_vptr_offs, m_vt_index, m_size); + + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *byteptr = reinterpret_cast<std::uint8_t *>(object); + + // test for pointer to member function cast across virtual inheritance relationship + //if ((sizeof(unknown_base_equiv) == m_size) && m_vt_index) + if ((sizeof(unknown_base_equiv) == m_size) || (sizeof(unknown_base_equiv_novtdisp) == m_size)) + { + // add index from "this" pointer to location of vptr. This actually is an index, + // it needs to be multiplied by sizeof(void *) + byteptr += (m_vptr_index * static_cast<ptrdiff_t>(sizeof(void *))); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + std::uint8_t const *const vptr = *reinterpret_cast<std::uint8_t const *const *>(byteptr); + // and add offset to virtual base from vtable + if (sizeof(unknown_base_equiv) == m_size) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + byteptr += *reinterpret_cast<int const *>(vptr + m_vt_index); + } + + // add "this" pointer displacement if present in the pointer to member function + if (sizeof(single_base_equiv) < m_size) + byteptr += m_this_delta; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + object = reinterpret_cast<mfp_generic_class *>(byteptr); + + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast,performance-no-int-to-ptr) + auto const *funcx = reinterpret_cast<std::uint8_t const *>(m_function); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast,performance-no-int-to-ptr) + func = reinterpret_cast<generic_function>(std::uintptr_t(funcx)); + } + +} // namespace plib + +#if defined(__GNUC__) && !defined(__clang__) +#pragma GCC diagnostic pop +#endif + +#endif diff --git a/src/lib/netlist/plib/ppmf.h b/src/lib/netlist/plib/ppmf.h index 9ee759befa4..56f40bde922 100644 --- a/src/lib/netlist/plib/ppmf.h +++ b/src/lib/netlist/plib/ppmf.h @@ -1,280 +1,587 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * ppmf.h - * - */ #ifndef PPMF_H_ #define PPMF_H_ +/// +/// \file ppmf.h +/// +/// +/// PMF_TYPE_PMF +/// Use standard pointer to member function syntax C++11 +/// +/// PMF_TYPE_GNUC_PMF_CONV +/// Use gnu extension and convert the pmf to a function pointer. +/// This is not standard compliant and needs +/// -Wno-pmf-conversions to compile. +/// +/// PMF_TYPE_INTERNAL_* +/// Use the same approach as MAME for deriving the function pointer. +/// This is compiler-dependent as well +/// +/// Benchmarks for `./nltool -c run -t 10 -n pong src/mame/machine/nl_pong.cpp` +/// +/// PMF_TYPE_INTERNAL: 215% 215% 564% 580% +/// PMF_TYPE_GNUC_PMF: 163% 196% 516% 490% +/// PMF_TYPE_GNUC_PMF_CONV: 215% 215% 560% 575% +/// +/// + +/// \brief Enable experimental code on Visual Studio builds and VS clang llvm builds +/// +/// This enables experimental code which uses optimized builds the +/// ppmf_type::INTERNAL_MSC path also for complex (struct/union) return types. +/// This currently depends on whether the code can adequately determine on +/// x64 builds if the return type is returned through registers or passed as a +/// second argument as a pointer to the member function. +/// +/// The experimental code uses a temporary storage for the return value. This a +/// copy overhead for causes for large sized return types a copy overhead. +/// It would be easier if we would be able to obtain the RDX register on entry +/// to the call. On MSVC this seems not to be possible since on x64 inline +/// assembly is not supported. Even with clang-cl inline assembly this was not +/// successful when optimized code was compiled. Therefore we have to live with +/// the limitations. +/// +/// This code path is disabled by default currently. +/// +#if !defined(PPMF_EXPERIMENTAL) +#define PPMF_EXPERIMENTAL 0 +#endif + +/// brief Enable using MAME delegates as a replacement for ppmf. +/// +/// This define enables the use of MAME delegates (src/lib/util/delegate.h +/// as a replacement to ppmf. Enable this setting if you want to use the nltool +/// test suite (nltool -c tests) to produce comparisons to ppmf. +/// +#if !defined(PPMF_USE_MAME_DELEGATES) +#define PPMF_USE_MAME_DELEGATES 0 +#endif + +#if PPMF_USE_MAME_DELEGATES + +#include "../../util/delegate.h" + +namespace plib { + template<typename Signature> + class pmfp : public delegate<Signature> + { + public: + using basetype = delegate<Signature>; + using basetype::basetype; + using basetype::object; + explicit operator bool() const { return !this->isnull(); } + }; +} +#else + #include "pconfig.h" +#include "ptypes.h" +#include <algorithm> +#include <cstddef> // ptrdiff_t #include <cstdint> // uintptr_t +#include <type_traits> #include <utility> -/* - * - * NL_PMF_TYPE_GNUC_PMF - * Use standard pointer to member function syntax C++11 - * - * NL_PMF_TYPE_GNUC_PMF_CONV - * Use gnu extension and convert the pmf to a function pointer. - * This is not standard compliant and needs - * -Wno-pmf-conversions to compile. - * - * NL_PMF_TYPE_INTERNAL - * Use the same approach as MAME for deriving the function pointer. - * This is compiler-dependent as well - * - * Benchmarks for ./nltool -c run -f src/mame/machine/nl_pong.cpp -t 10 -n pong_fast - * - * NL_PMF_TYPE_INTERNAL: 215% 215% - * NL_PMF_TYPE_GNUC_PMF: 163% 196% - * NL_PMF_TYPE_GNUC_PMF_CONV: 215% 215% - * NL_PMF_TYPE_VIRTUAL: 213% 209% - * - * The whole exercise was done to avoid virtual calls. In prior versions of - * netlist, the INTERNAL and GNUC_PMF_CONV approach provided significant improvement. - * Since than, "hot" was removed from functions declared as virtual. - * This may explain that the recent benchmarks show no difference at all. - * - */ - -#if (PPMF_TYPE == PPMF_TYPE_GNUC_PMF_CONV) -#pragma GCC diagnostic ignored "-Wpmf-conversions" -#endif +//============================================================ +// Macro magic +//============================================================ -#if defined(__GNUC__) && (__GNUC__ > 6) -#pragma GCC diagnostic ignored "-Wnoexcept-type" +//#define PPMF_FORCE_TYPE 1 + +#ifndef PPMF_FORCE_TYPE +#define PPMF_FORCE_TYPE -1 #endif namespace plib { -/* - * The following class was derived from the MAME delegate.h code. - * It derives a pointer to a member function. - */ -#if (PHAS_PMF_INTERNAL > 0) - class mfp + enum class ppmf_type + { + PMF, + GNUC_PMF_CONV, + INTERNAL_ITANIUM, + INTERNAL_ARM, + INTERNAL_MSC + }; + + + struct ppmf_internal_selector + { + using ci = compile_info; + constexpr static ppmf_type value = + (PPMF_FORCE_TYPE >= 0) ? static_cast<ppmf_type>(PPMF_FORCE_TYPE) : + (ci::type() == ci_compiler::CLANG && !ci::m64() + && ci::os() == ci_os::WINDOWS) ? ppmf_type::PMF : + (ci::mingw() && !ci::m64() && ci::version::full() >= typed_version<4,7>::full()) ? ppmf_type::PMF : + (ci::mingw() && !ci::m64()) ? ppmf_type::PMF : // Dropped support for mingw32 < 407 ppmf_type::INTERNAL_ITANIUM : + (ci::env() == ci_env::MSVC && ci::m64()) ? ppmf_type::INTERNAL_MSC : + ((ci::type() == ci_compiler::CLANG || ci::type() == ci_compiler::GCC) + && (ci::arch() == ci_arch::MIPS + || ci::arch() == ci_arch::ARM + || ci::os() == ci_os::EMSCRIPTEN)) ? ppmf_type::INTERNAL_ARM : + (ci::type() == ci_compiler::CLANG || ci::type() == ci_compiler::GCC) ? ppmf_type::INTERNAL_ITANIUM : + ppmf_type::PMF + ; + }; + + static_assert(!(compile_info::type() == ci_compiler::CLANG && ppmf_internal_selector::value == (ppmf_type::GNUC_PMF_CONV)), "clang does not support ppmf_type::GNUC_PMF_CONV"); + static_assert(!(compile_info::env() == ci_env::NVCC && ppmf_internal_selector::value == (ppmf_type::GNUC_PMF_CONV)), "nvcc does not support ppmf_type::GNUC_PMF_CONV"); + + template<typename R, typename... Targs> + struct mfp_traits + { + template<typename C> using specific_member_function = R (C::*)(Targs...); + template<typename C> using const_specific_member_function = R (C::*)(Targs...) const; + template<typename C> using member_static_ref = R (*)(C &, Targs...); + template<typename C> using member_static_ptr = R (*)(C *, Targs...); + }; + + class mfp_generic_class; + + + /// + /// \brief Used to derive a pointer to a member function. + /// + /// The following class was derived from the MAME delegate.h code. + /// + template <ppmf_type PMFINTERNAL> + class mfp_raw; + + template <> + class mfp_raw<ppmf_type::INTERNAL_ITANIUM> { public: // construct from any member function pointer -#ifdef _MSC_VER - class __single_inheritance si_generic_class; - class generic_class { }; -#else - class generic_class; -#endif using generic_function = void (*)(); template<typename MemberFunctionType> - mfp(MemberFunctionType mftp) // NOLINT(cppcoreguidelines-pro-type-member-init) + mfp_raw(MemberFunctionType mftp); - : m_function(0), m_this_delta(0), m_size(sizeof(mfp)) - { - *reinterpret_cast<MemberFunctionType *>(this) = mftp; - } + // extract the generic function and adjust the object pointer + void convert_to_generic(generic_function &func, mfp_generic_class *&object) const; + + /// \brief Byte offset into the vtable + /// + /// On x86-64, the vtable contains pointers to code, and function pointers + /// are pointers to code. To obtain a function pointer for a virtual + /// member function, you fetch a pointer to code from the vtable. + /// + /// On traditional PPC64, the vtable contains pointers to function + /// descriptors, and function pointers are pointers to function descriptors. + /// To obtain a function pointer for a virtual member function, you + /// fetch a pointer to a function descriptor from the vtable. + /// + /// On IA64, the vtable contains function descriptors, and function + /// pointers are pointers to function descriptors. To obtain a + /// function pointer for a virtual member function, you calculate + /// the address of the function descriptor in the vtable. + /// + /// Simply adding the byte offset to the vtable pointer creates a + /// function pointer on IA64 because the vtable contains function + /// descriptors; on most other targets, the vtable contains function + /// pointers, so you need to fetch the function pointer after + /// calculating its address in the vtable. + /// + uintptr_t m_function; // first item can be one of two things: + // if even, it's a function pointer + // if odd, it's the byte offset into the vtable + ptrdiff_t m_this_delta; // delta to apply to the 'this' pointer + }; - template<typename MemberFunctionType, typename FunctionType, typename ObjectType> - static void get_mfp(MemberFunctionType mftp, FunctionType &func, ObjectType *&object) - { - mfp mfpo(mftp); - //return mfpo.update_after_bind<FunctionType>(object); - generic_function rfunc(nullptr); - auto robject = reinterpret_cast<generic_class *>(object); - mfpo.convert_to_generic(rfunc, robject); - func = reinterpret_cast<FunctionType>(rfunc); - object = reinterpret_cast<ObjectType *>(robject); - } + template <> + class mfp_raw<ppmf_type::INTERNAL_ARM> + { + public: + // construct from any member function pointer + using generic_function = void (*)(); + + template<typename MemberFunctionType> + mfp_raw(MemberFunctionType mftp); + + // extract the generic function and adjust the object pointer + void convert_to_generic(generic_function &func, mfp_generic_class *&object) const; + + // actual state + uintptr_t m_function; // first item can be a function pointer or a byte offset into the vtable + ptrdiff_t m_this_delta; // delta to apply to the 'this' pointer after right shifting by one bit + // if even, m_function is a fuction pointer + // if odd, m_function is the byte offset into the vtable + }; + + template <> + class mfp_raw<ppmf_type::INTERNAL_MSC> + { + public: + // construct from any member function pointer + using generic_function = void (*)(); + struct unknown_base_equiv { generic_function fptr; int thisdisp, vptrdisp, vtdisp; }; + struct single_base_equiv { generic_function fptr; }; + + template<typename MemberFunctionType> + mfp_raw(MemberFunctionType mftp); - private: // extract the generic function and adjust the object pointer - void convert_to_generic(generic_function &func, generic_class *&object) const + void convert_to_generic(generic_function &func, mfp_generic_class *&object) const; + + // actual state + uintptr_t m_function; // pointer to the function + int m_this_delta; // delta to apply to the 'this' pointer + + int m_vptr_index; // index into the vptr table. + int m_vt_index; // offset to be applied after vptr table lookup. + unsigned m_size; + }; + + template <typename R> + using pmf_is_register_return_type = std::integral_constant<bool, + std::is_void_v<R> || + std::is_scalar_v<R> || + std::is_reference_v<R> || + std::is_same_v<std::remove_cv_t<R>, compile_info::int128_type> || + std::is_same_v<std::remove_cv_t<R>, compile_info::uint128_type> >; + + template<ppmf_type PMFINTERNAL, typename R, typename... Targs> + struct mfp_helper + { + protected: + static_assert(PMFINTERNAL >= ppmf_type::INTERNAL_ITANIUM && PMFINTERNAL <= ppmf_type::INTERNAL_MSC, "Invalid PMF type"); + + using traits = mfp_traits<R, Targs...>; + using generic_member_function = typename traits::template specific_member_function<mfp_generic_class>; + using generic_member_abi_function = typename traits::template member_static_ptr<mfp_generic_class>; + + using raw_type = mfp_raw<PMFINTERNAL>; + using generic_function_storage = typename raw_type::generic_function; + + mfp_helper(); + + template<typename O, typename F> + void bind(O *object, F *mftp); + + R call(Targs&&... args) const noexcept(true) { - if (PHAS_PMF_INTERNAL == 1) +#if defined(_MSC_VER) && (PPMF_EXPERIMENTAL) + if constexpr (pmf_is_register_return_type<R>::value) { - // apply the "this" delta to the object first - // NOLINTNEXTLINE(clang-analyzer-core.UndefinedBinaryOperatorResult) - auto o_p_delta = reinterpret_cast<generic_class *>(reinterpret_cast<std::uint8_t *>(object) + m_this_delta); - - // if the low bit of the vtable index is clear, then it is just a raw function pointer - if (!(m_function & 1)) - func = reinterpret_cast<generic_function>(m_function); - else - { - // otherwise, it is the byte index into the vtable where the actual function lives - std::uint8_t *vtable_base = *reinterpret_cast<std::uint8_t **>(o_p_delta); - func = *reinterpret_cast<generic_function *>(vtable_base + m_function - 1); - } - object = o_p_delta; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + const auto* func = reinterpret_cast<const generic_member_abi_function*>(&m_resolved); + return (*func)(m_obj, std::forward<Targs>(args)...); } - else if (PHAS_PMF_INTERNAL == 2) + else { - if ((m_this_delta & 1) == 0) { - object = reinterpret_cast<generic_class *>(reinterpret_cast<std::uint8_t *>(object) + m_this_delta); - func = reinterpret_cast<generic_function>(m_function); - } - else - { - object = reinterpret_cast<generic_class *>(reinterpret_cast<std::uint8_t *>(object)); - - // otherwise, it is the byte index into the vtable where the actual function lives - std::uint8_t *vtable_base = *reinterpret_cast<std::uint8_t **>(object); - func = *reinterpret_cast<generic_function *>(vtable_base + m_function + m_this_delta - 1); - } + using generic_member_abi_function_alt = void (*)(mfp_generic_class *,void *, Targs...); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + const auto* func = reinterpret_cast<const generic_member_abi_function_alt*>(&m_resolved); + std::uint8_t temp[sizeof(typename std::conditional<std::is_void_v<R>, void *, R>::type)]; + (*func)(m_obj, &temp[0], std::forward<Targs>(args)...); + return *reinterpret_cast<R *>(&temp); } - else if (PHAS_PMF_INTERNAL == 3) - { - const int SINGLE_MEMFUNCPTR_SIZE = sizeof(void (generic_class::*)()); +#else + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + const auto* func = reinterpret_cast<const generic_member_abi_function*>(&m_resolved); + return (*func)(m_obj, std::forward<Targs>(args)...); +#endif + } - func = reinterpret_cast<generic_function>(m_function); - if (m_size == SINGLE_MEMFUNCPTR_SIZE + sizeof(int)) - object = reinterpret_cast<generic_class *>(reinterpret_cast<std::uint8_t *>(object) + m_this_delta); - } + generic_function_storage m_resolved; + mfp_generic_class *m_obj; + }; + + template<typename R, typename... Targs> + struct mfp_helper<ppmf_type::PMF, R, Targs...> + { + protected: + using traits = mfp_traits<R, Targs...>; + using generic_member_function = typename traits::template specific_member_function<mfp_generic_class>; + + template <class C> + using member_abi_function = typename traits::template specific_member_function<C>; + mfp_helper(); + + template<typename O, typename F> + void bind(O *object, F *mftp); + + R call(Targs&&... args) const noexcept(true) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto* func = reinterpret_cast<const generic_member_function *>(&m_resolved); + return (*m_stub)(func, m_obj, std::forward<Targs>(args)...); } - // actual state - uintptr_t m_function; // first item can be one of two things: - // if even, it's a pointer to the function - // if odd, it's the byte offset into the vtable - int m_this_delta; // delta to apply to the 'this' pointer - - int m_dummy1; // only used for visual studio x64 - int m_dummy2; - int m_size; + generic_member_function m_resolved; + mfp_generic_class *m_obj; + R (*m_stub)(const generic_member_function *funci, mfp_generic_class *obji, Targs&&... args); + + private: + template<typename O> + static R stub(const generic_member_function* funci, mfp_generic_class* obji, Targs&&... args) noexcept(true); }; -#endif -#if (PPMF_TYPE == PPMF_TYPE_PMF) template<typename R, typename... Targs> - class pmfp_base + struct mfp_helper<ppmf_type::GNUC_PMF_CONV, R, Targs...> { + protected: + using traits = mfp_traits<R, Targs...>; + + template <class C> + using member_abi_function = typename traits::template member_static_ptr<C>; + + mfp_helper(); + + template<typename O, typename F> + void bind(O *object, F *mftp); + + R call(Targs&&... args) const noexcept(true) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto* func = reinterpret_cast<const member_abi_function<mfp_generic_class> *>(&m_resolved); + return (*func)(m_obj, std::forward<Targs>(args)...); + } + + member_abi_function<mfp_generic_class> m_resolved; + mfp_generic_class *m_obj; + }; + + template <ppmf_type PMFINTERNAL, typename R, typename... Targs> + using pmfp_helper_select = std::conditional< + pmf_is_register_return_type<R>::value + || PMFINTERNAL != ppmf_type::INTERNAL_MSC || (PPMF_EXPERIMENTAL), + mfp_helper<PMFINTERNAL, R, Targs...>, mfp_helper<ppmf_type::PMF, R, Targs...>>; + + template<ppmf_type PMFINTERNAL, typename SIGNATURE> class pmfp_base; + + template<ppmf_type PMFINTERNAL, typename R, typename... Targs> + class pmfp_base<PMFINTERNAL, R (Targs...)> : public pmfp_helper_select<PMFINTERNAL, R, Targs...>::type + { + static_assert((compile_info::env::value != ci_env::NVCC) || (PMFINTERNAL != ppmf_type::GNUC_PMF_CONV), "GNUC_PMF_CONV not supported by nvcc"); public: - class generic_class; -#if defined (__INTEL_COMPILER) && defined (_M_X64) // needed for "Intel(R) C++ Intel(R) 64 Compiler XE for applications running on Intel(R) 64, Version 14.0.2.176 Build 20140130" at least - using generic_function = int [((sizeof(void *) + 4 * sizeof(int)) + (sizeof(int) - 1)) / sizeof(int)]; -#elif defined(_MSC_VER) // all other cases - for MSVC maximum size is one pointer, plus 3 ints; all other implementations seem to be smaller - using generic_function = int[((sizeof(void *) + 3 * sizeof(int)) + (sizeof(int) - 1)) / sizeof(int)]; -#else - using generic_function = R (generic_class::*)(Targs...); -#endif + using helper = typename pmfp_helper_select<PMFINTERNAL, R, Targs...>::type; + + using traits = mfp_traits<R, Targs...>; + pmfp_base() + : helper() { - int *p = reinterpret_cast<int *>(&m_func); - int *e = p + sizeof(generic_function) / sizeof(int); - for (; p < e; p++) - *p = 0; } - template<typename MemberFunctionType, typename O> - void set_base(MemberFunctionType mftp, O *object) + template<typename O, typename P> + pmfp_base(typename traits::template specific_member_function<O> mftp, P *object) + : helper() { - using function_ptr = R (O::*)(Targs...); - function_ptr t = mftp; - *reinterpret_cast<function_ptr *>(&m_func) = t; + this->bind(static_cast<O*>(object), &mftp); } + + template<typename O, typename P> + pmfp_base(typename traits::template const_specific_member_function<O> mftp, P *object) + : helper() + { + this->bind(static_cast<O*>(object), &mftp); + } + + mfp_generic_class *object() const noexcept { return this->m_obj; } + template<typename O> - inline R call(O *obj, Targs... args) + void set(typename traits::template specific_member_function<O> mftp, O *object) { - using function_ptr = R (O::*)(Targs...); - function_ptr t = *reinterpret_cast<function_ptr *>(&m_func); - return (obj->*t)(std::forward<Targs>(args)...); + this->bind(object, &mftp); } - bool is_set() { -#if defined(_MSC_VER) || (defined (__INTEL_COMPILER) && defined (_M_X64)) - int *p = reinterpret_cast<int *>(&m_func); - int *e = p + sizeof(generic_function) / sizeof(int); - for (; p < e; p++) - if (*p != 0) - return true; - - return false; -#else - return m_func != nullptr; -#endif + + R operator()(Targs... args) const noexcept(true) + { + return this->call(std::forward<Targs>(args)...); } + + bool isnull() const noexcept { return this->m_resolved == nullptr; } + explicit operator bool() const noexcept { return !isnull(); } + bool has_object() const noexcept { return this->m_obj != nullptr; } + bool operator==(const pmfp_base &rhs) const { return this->m_resolved == rhs.m_resolved; } + bool operator!=(const pmfp_base &rhs) const { return !(*this == rhs); } + private: - generic_function m_func; -#if 0 && defined(_MSC_VER) - int dummy[4]; -#endif }; -#elif ((PPMF_TYPE == PPMF_TYPE_GNUC_PMF_CONV) || (PPMF_TYPE == PPMF_TYPE_INTERNAL)) - template<typename R, typename... Targs> - class pmfp_base + template<typename Signature> + using pmfp = pmfp_base<ppmf_internal_selector::value, Signature>; + + /// + /// \brief Class to support delegate late binding + /// + /// When constructing delegates in constructors AND the referenced function + /// is virtual, the vtable may not yet be fully constructed. In these cases + /// the following class allows to construct the delegate later. + /// + /// ``` + /// plib::late_pmfp<plib::pmfp<void, pstring>> a(&nld_7493::printer); + /// // Store the a object somewhere + /// + /// // After full construction ... + /// + /// auto delegate_obj = a(this); + /// delegate_obj(pstring("Hello World!")); + /// ``` + template<typename T> + class late_pmfp { public: - using generic_function = void (*)(); - pmfp_base() : m_func(nullptr) {} + using return_type = T; + using traits = typename return_type::traits; + using generic_member_function = typename traits::template specific_member_function<mfp_generic_class>; + using static_creator = return_type (*)(const generic_member_function *, mfp_generic_class *); - template<typename MemberFunctionType, typename O> - void set_base(MemberFunctionType mftp, O *object) - { - #if (PPMF_TYPE == PPMF_TYPE_INTERNAL) - using function_ptr = MEMBER_ABI R (*)(O *obj, Targs... args); - function_ptr func(nullptr); - plib::mfp::get_mfp(mftp, func, object); - m_func = reinterpret_cast<generic_function>(func); - #elif (PPMF_TYPE == PPMF_TYPE_GNUC_PMF_CONV) - R (O::* pFunc)(Targs...) = mftp; - m_func = reinterpret_cast<generic_function>((object->*pFunc)); - #endif - } template<typename O> - R call(O *obj, Targs... args) const + late_pmfp(typename traits::template specific_member_function<O> mftp); + + template<typename O> + return_type operator()(O *object) const { - using function_ptr = MEMBER_ABI R (*)(O *obj, Targs... args); - return (reinterpret_cast<function_ptr>(m_func))(obj, std::forward<Targs>(args)...); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return m_creator(&m_raw, reinterpret_cast<mfp_generic_class *>(object)); } - bool is_set() noexcept { return m_func != nullptr; } - generic_function get_function() const noexcept { return m_func; } + private: - generic_function m_func; + + template <typename O> + static return_type creator(const generic_member_function *raw, mfp_generic_class *obj); + + generic_member_function m_raw; + static_creator m_creator; }; -#endif - template<typename R, typename... Targs> - class pmfp : public pmfp_base<R, Targs...> + template<typename MemberFunctionType> + mfp_raw<ppmf_type::INTERNAL_ITANIUM>::mfp_raw(MemberFunctionType mftp) + : m_function(0), m_this_delta(0) { - public: - class generic_class; + static_assert(sizeof(*this) >= sizeof(MemberFunctionType), "size mismatch"); + *reinterpret_cast<MemberFunctionType *>(this) = mftp; // NOLINT + // NOLINTNEXTLINE(clang-analyzer-optin.cplusplus.UninitializedObject) + } + + template<typename MemberFunctionType> + mfp_raw<ppmf_type::INTERNAL_ARM>::mfp_raw(MemberFunctionType mftp) + : m_function(0), m_this_delta(0) + { + static_assert(sizeof(*this) >= sizeof(MemberFunctionType), "size mismatch"); + *reinterpret_cast<MemberFunctionType *>(this) = mftp; // NOLINT + } - template <class C> - using MemberFunctionType = R (C::*)(Targs...); + template<typename MemberFunctionType> + mfp_raw<ppmf_type::INTERNAL_MSC>::mfp_raw(MemberFunctionType mftp) + : m_function(0), m_this_delta(0), m_vptr_index(0), m_vt_index(0), m_size(0) + { + static_assert(sizeof(*this) >= sizeof(MemberFunctionType), "size mismatch"); + *reinterpret_cast<MemberFunctionType *>(this) = mftp; // NOLINT + m_size = sizeof(mftp); //NOLINT + } + + template<ppmf_type PMFINTERNAL, typename R, typename... Targs> + mfp_helper<PMFINTERNAL, R, Targs...>::mfp_helper() + : m_obj(nullptr) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *s = reinterpret_cast<std::uint8_t *>(&m_resolved); + std::fill(s, s + sizeof(m_resolved), 0); + } + + template<ppmf_type PMFINTERNAL, typename R, typename... Targs> + template<typename O, typename F> + void mfp_helper<PMFINTERNAL, R, Targs...>::bind(O *object, F *mftp) + { + typename traits::template specific_member_function<O> pFunc; + static_assert(sizeof(pFunc) >= sizeof(F), "size error"); + //# NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + //# *reinterpret_cast<F *>(&pFunc) = *mftp; + reinterpret_copy(*mftp, pFunc); + raw_type mfpo(pFunc); + generic_function_storage rfunc(nullptr); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *robject = reinterpret_cast<mfp_generic_class *>(object); + mfpo.convert_to_generic(rfunc, robject); + reinterpret_copy(rfunc, this->m_resolved); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + m_obj = reinterpret_cast<mfp_generic_class *>(robject); + } - pmfp() : pmfp_base<R, Targs...>(), m_obj(nullptr) {} + template<typename R, typename... Targs> + mfp_helper<ppmf_type::PMF, R, Targs...>::mfp_helper() + : m_obj(nullptr) + , m_stub(nullptr) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *s = reinterpret_cast<std::uint8_t *>(&m_resolved); + std::fill(s, s + sizeof(m_resolved), 0); + } - template<typename O> - pmfp(MemberFunctionType<O> mftp, O *object) - : pmfp_base<R, Targs...>() - { - this->set_base(mftp, object); - m_obj = reinterpret_cast<generic_class *>(object); - } + template<typename R, typename... Targs> + template<typename O, typename F> + void mfp_helper<ppmf_type::PMF, R, Targs...>::bind(O *object, F *mftp) + { + reinterpret_copy(*mftp, this->m_resolved); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + m_obj = reinterpret_cast<mfp_generic_class *>(object); + m_stub = &stub<O>; + } - template<typename O> - void set(MemberFunctionType<O> mftp, O *object) - { - this->set_base(mftp, object); - m_obj = reinterpret_cast<generic_class *>(object); - } + template<typename R, typename... Targs> + template<typename O> + R mfp_helper<ppmf_type::PMF, R, Targs...>::stub(const generic_member_function* funci, mfp_generic_class* obji, Targs&&... args) noexcept(true) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto* obj = reinterpret_cast<O*>(obji); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto* func = reinterpret_cast<const member_abi_function<O> *>(funci); + return (obj->*(*func))(std::forward<Targs>(args)...); + } - inline R operator()(Targs ... args) - { - return this->call(m_obj, std::forward<Targs>(args)...); - } + template<typename R, typename... Targs> + mfp_helper<ppmf_type::GNUC_PMF_CONV, R, Targs...>::mfp_helper() + : m_obj(nullptr) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *s = reinterpret_cast<std::uint8_t *>(&m_resolved); + std::fill(s, s + sizeof(m_resolved), 0); + } - generic_class *object() const noexcept { return m_obj; } - bool has_object() const noexcept { return m_obj != nullptr; } - private: - generic_class *m_obj; - }; + template<typename R, typename... Targs> + template<typename O, typename F> + void mfp_helper<ppmf_type::GNUC_PMF_CONV, R, Targs...>::bind(O *object, F *mftp) + { + // nvcc still tries to compile the code below - even when shielded with a `if constexpr` +#if !defined(__NVCC__) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + member_abi_function<O> t = reinterpret_cast<member_abi_function<O>>(object->*(*mftp)); + reinterpret_copy(t, this->m_resolved); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + m_obj = reinterpret_cast<mfp_generic_class *>(object); +#endif + } + template<typename T> + template<typename O> + late_pmfp<T>::late_pmfp(typename traits::template specific_member_function<O> mftp) + : m_creator(creator<O>) + { + static_assert(sizeof(m_raw) >= sizeof(typename traits::template specific_member_function<O>), "size issue"); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + *reinterpret_cast<typename traits::template specific_member_function<O> *>(&m_raw) = mftp; + } + + template<typename T> + template<typename O> + typename late_pmfp<T>::return_type late_pmfp<T>::creator(const typename late_pmfp<T>::generic_member_function *raw, mfp_generic_class *obj) + { + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto p = reinterpret_cast<const typename late_pmfp<T>::traits::template specific_member_function<O> *>(raw); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *o = reinterpret_cast<O *>(obj); + return return_type(*p, o); + } } // namespace plib -#endif /* PPMF_H_ */ +#endif +#endif // PPMF_H_ diff --git a/src/lib/netlist/plib/ppreprocessor.cpp b/src/lib/netlist/plib/ppreprocessor.cpp new file mode 100644 index 00000000000..0c3858862f6 --- /dev/null +++ b/src/lib/netlist/plib/ppreprocessor.cpp @@ -0,0 +1,766 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#include "ppreprocessor.h" +#include "palloc.h" +#include "pstonum.h" +#include "pstrutil.h" +#include "putil.h" + +namespace plib { + + // ---------------------------------------------------------------------------------------- + // A simple preprocessor + // ---------------------------------------------------------------------------------------- + + ppreprocessor::ppreprocessor(psource_collection_t &sources, defines_map_type *defines) + : m_sources(sources) + , m_if_flag(0) + , m_if_seen(0) + , m_elif(0) + , m_if_level(0) + , m_state(PROCESS) + , m_comment(false) + { + m_expr_sep.emplace_back("!"); + m_expr_sep.emplace_back("("); + m_expr_sep.emplace_back(")"); + m_expr_sep.emplace_back("+"); + m_expr_sep.emplace_back("-"); + m_expr_sep.emplace_back("*"); + m_expr_sep.emplace_back("/"); + m_expr_sep.emplace_back("&&"); + m_expr_sep.emplace_back("||"); + m_expr_sep.emplace_back("=="); + m_expr_sep.emplace_back(","); + m_expr_sep.emplace_back(";"); + m_expr_sep.emplace_back("."); + m_expr_sep.emplace_back("##"); + m_expr_sep.emplace_back("#"); + m_expr_sep.emplace_back(" "); + m_expr_sep.emplace_back("\t"); + m_expr_sep.emplace_back("\""); + + if (defines != nullptr) + m_defines = *defines; + m_defines.insert({"__PLIB_PREPROCESSOR__", define_t("__PLIB_PREPROCESSOR__", "1")}); + auto idx = m_defines.find("__PREPROCESSOR_DEBUG__"); + m_debug_out = idx != m_defines.end(); + + } + + void ppreprocessor::error(const pstring &err) + { + pstring s(""); + pstring trail (" from "); + pstring trail_first("In file included from "); + pstring e = plib::pfmt("{1}:{2}:0: error: {3}\n") + (m_stack.back().m_name, m_stack.back().m_lineno, err); + m_stack.pop_back(); + while (!m_stack.empty()) + { + if (m_stack.size() == 1) + trail = trail_first; + s = plib::pfmt("{1}{2}:{3}:0\n{4}")(trail, m_stack.back().m_name, m_stack.back().m_lineno, s); + m_stack.pop_back(); + } + throw pexception("\n" + s + e + " " + m_line + "\n"); + } + + template <typename PP, typename L = ppreprocessor::string_list> + struct simple_iter + { + simple_iter(PP *parent, const L &tokens) + : m_tokens(tokens), m_parent(parent), m_pos(0) + {} + + /// \brief skip white space in token list + /// + void skip_ws() + { + while (m_pos < m_tokens.size() && (m_tokens[m_pos] == " " || m_tokens[m_pos] == "\t")) + m_pos++; + } + + /// \brief return next token skipping white space + /// + /// \return next token + /// + const pstring &next() + { + skip_ws(); + if (m_pos >= m_tokens.size()) + error("unexpected end of line"); + return m_tokens[m_pos++]; + } + + /// \brief return next token including white space + /// + /// \return next token + /// + const pstring &next_ws() + { + if (m_pos >= m_tokens.size()) + error("unexpected end of line"); + return m_tokens[m_pos++]; + } + + const pstring &peek_ws() + { + if (m_pos >= m_tokens.size()) + error("unexpected end of line"); + return m_tokens[m_pos]; + } + + const pstring &last() + { + if (m_pos == 0) + error("no last token at beginning of line"); + if (m_pos > m_tokens.size()) + error("unexpected end of line"); + return m_tokens[m_pos-1]; + } + + bool eod() + { + return (m_pos >= m_tokens.size()); + } + + void error(const pstring &err) + { + m_parent->error(err); + } + private: + const L m_tokens; + PP *m_parent; + std::size_t m_pos; + }; + + #define CHECKTOK2(p_op, p_prio) \ + else if (tok == # p_op) \ + { \ + if (!has_val) \ + { sexpr.error("parsing error!"); return 1;} \ + if (prio < (p_prio)) \ + return val; \ + sexpr.next(); \ + const auto v2 = prepro_expr(sexpr, (p_prio)); \ + val = (val p_op v2); \ + } + + // Operator precedence see https://en.cppreference.com/w/cpp/language/operator_precedence + + template <typename PP> + static int prepro_expr(simple_iter<PP> &sexpr, int prio) + { + int val(0); + bool has_val(false); + + pstring tok=sexpr.peek_ws(); + if (tok == "(") + { + sexpr.next(); + val = prepro_expr(sexpr, 255); + if (sexpr.next() != ")") + sexpr.error("expected ')'"); + has_val = true; + } + while (!sexpr.eod()) + { + tok = sexpr.peek_ws(); + if (tok == ")") + { + if (!has_val) + sexpr.error("Found ')' but have no value computed"); + else + return val; + } + else if (tok == "!") + { + if (prio < 3) + { + if (!has_val) + sexpr.error("parsing error!"); + else + return val; + } + sexpr.next(); + val = !prepro_expr(sexpr, 3); + has_val = true; + } + CHECKTOK2(*, 5) + CHECKTOK2(/, 5) // NOLINT(clang-analyzer-core.DivideZero) + CHECKTOK2(+, 6) + CHECKTOK2(-, 6) + CHECKTOK2(==, 10) + CHECKTOK2(&&, 14) + CHECKTOK2(||, 15) + else + { + try + { + val = plib::pstonum<decltype(val)>(tok); + } + catch (pexception &e) + { + sexpr.error(e.text()); + } + has_val = true; + sexpr.next(); + } + } + if (!has_val) + sexpr.error("No value computed. Empty expression ?"); + return val; + } + + ppreprocessor::define_t *ppreprocessor::get_define(const pstring &name) + { + auto idx = m_defines.find(name); + return (idx != m_defines.end()) ? &idx->second : nullptr; + } + + ppreprocessor::string_list ppreprocessor::tokenize(const pstring &str, + const string_list &sep, bool remove_ws, bool concat) + { + const pstring STR = "\""; + string_list tmp_ret; + string_list tmp(psplit(str, sep)); + std::size_t pi(0); + + while (pi < tmp.size()) + { + if (tmp[pi] == STR) + { + pstring s(STR); + pi++; + while (pi < tmp.size() && tmp[pi] != STR) + { + s += tmp[pi]; + pi++; + } + s += STR; + tmp_ret.push_back(s); + } + else + { + pstring tok=tmp[pi]; + if (tok.length() >= 2 && pi < tmp.size() - 2 ) + { + auto sc=tok.substr(0,1); + auto ec=tok.substr(tok.length()-1, 1); + if ((sc == "." || (sc>="0" && sc<="9")) && (ec=="e" || ec=="E")) + { + // looks like an incomplete float due splitting by - or + + tok = tok + tmp[pi+1] + tmp[pi+2]; + pi += 2; + } + } + if (!remove_ws || (tok != " " && tok != "\t")) + tmp_ret.push_back(tok); + } + pi++; + } + + if (!concat) + return tmp_ret; + + // FIXME: error if concat at beginning or end + string_list ret; + pi = 0; + while (pi<tmp_ret.size()) + { + if (tmp_ret[pi] == "##") + { + while (ret.back() == " " || ret.back() == "\t") + ret.pop_back(); + pstring cc = ret.back(); + ret.pop_back(); + pi++; + while (pi < tmp_ret.size() && (tmp_ret[pi] == " " || tmp_ret[pi] == "\t")) + pi++; + if (pi == tmp_ret.size()) + error("## found at end of sequence"); + ret.push_back(cc + tmp_ret[pi]); + } + else + ret.push_back(tmp_ret[pi]); + pi++; + } + return ret; + } + + bool ppreprocessor::is_valid_token(const pstring &str) + { + if (str.empty()) + return false; + pstring::value_type c(str.at(0)); + return ((c>='a' && c<='z') || (c>='A' && c<='Z') || c == '_'); + } + + pstring ppreprocessor::replace_macros(const pstring &line) + { + //std::vector<pstring> elems(psplit(line, m_expr_sep)); + bool repeat(false); + pstring tmpret(line); + do + { + repeat = false; + simple_iter<ppreprocessor> elems(this, tokenize(tmpret, m_expr_sep, false, true)); + tmpret = ""; + while (!elems.eod()) + { + auto token(elems.next_ws()); + define_t *def = get_define(token); + if (def == nullptr) + tmpret += token; + else if (!def->m_has_params) + { + tmpret += def->m_replace; + repeat = true; + } + else + { + token = elems.next(); + if (token != "(") + error("expected '(' in macro expansion of " + def->m_name); + string_list rep; + token = elems.next(); + while (token != ")") + { + pstring par(""); + int parenthesis_count(1); + while (true) + { + if (parenthesis_count==1 && token == ",") + { + token = elems.next(); + break; + } + if (token == "(") + parenthesis_count++; + if (token == ")") + if (--parenthesis_count == 0) + break; + par += token; + token = elems.next(); + } + rep.push_back(par); + } + repeat = true; + if (def->m_params.size() != rep.size()) + error(pfmt("Expected {1} parameters, got {2}")(def->m_params.size(), rep.size())); + simple_iter<ppreprocessor> r(this, tokenize(def->m_replace, m_expr_sep, false, false)); + bool stringify_next = false; + while (!r.eod()) + { + token = r.next(); + if (token == "#") + stringify_next = true; + else if (token != " " && token != "\t") + { + for (std::size_t i=0; i<def->m_params.size(); i++) + if (def->m_params[i] == token) + { + if (stringify_next) + { + stringify_next = false; + token = "\"" + rep[i] + "\""; + } + else + token = rep[i]; + break; + } + if (stringify_next) + error("'#' is not followed by a macro parameter"); + tmpret += token; + tmpret += " "; // make sure this is not concatenated with next token + } + else + tmpret += token; + } + } + } + } while (repeat); + + return tmpret; + } + + static pstring cat_remainder(const std::vector<pstring> &elems, std::size_t start, const pstring &sep) + { + pstring ret(""); + for (std::size_t i = start; i < elems.size(); i++) + { + ret += elems[i]; + ret += sep; + } + return ret; + } + +#if 0 + pstring ppreprocessor::process_comments(pstring line) + { + bool in_string = false; + + std::size_t e = line.size(); + pstring ret = ""; + for (std::size_t i=0; i < e; ) + { + pstring c = plib::left(line, 1); + line = line.substr(1); + if (!m_comment) + { + if (c=="\"") + { + in_string = !in_string; + ret += c; + } + else if (in_string && c=="\\") + { + i++; + ret += (c + plib::left(line, 1)); + line = line.substr(1); + } + else if (!in_string && c=="/" && plib::left(line,1) == "*") + m_comment = true; + else if (!in_string && c=="/" && plib::left(line,1) == "/") + break; + else + ret += c; + } + else + if (c=="*" && plib::left(line,1) == "/") + { + i++; + line = line.substr(1); + m_comment = false; + } + i++; + } + return ret; + } +#else + pstring ppreprocessor::process_comments(const pstring &line) + { + bool in_string = false; + + pstring ret = ""; + for (auto c = line.begin(); c != line.end(); ) + { + if (!m_comment) + { + if (*c == '"') + { + in_string = !in_string; + ret += *c; + } + else if (in_string && *c == '\\') + { + ret += *c; + ++c; + if (c == line.end()) + break; + ret += *c; + } + else if (!in_string && *c == '/') + { + ++c; + if (c == line.end()) + break; + if (*c == '*') + m_comment = true; + else if (*c == '/') + break; + else + ret += *c; + } + else + ret += *c; + } + else + if (*c == '*') + { + c++; + if (c == line.end()) + break; + if (*c == '/') + m_comment = false; + } + c++; + } + return ret; + } +#endif + + std::pair<pstring,bool> ppreprocessor::process_line(const pstring &line_in) + { + bool line_cont = plib::right(line_in, 1) == "\\"; + + pstring line = line_cont ? plib::left(line_in, line_in.length() - 1) : line_in; + + if (m_state == LINE_CONTINUATION) + m_line += line; + else + m_line = line; + + if (line_cont) + { + m_state = LINE_CONTINUATION; + return {"", false}; + } + + m_state = PROCESS; + + line = process_comments(m_line); + + pstring lt = plib::trim(plib::replace_all(line, '\t', ' ')); + if (plib::startsWith(lt, "#")) + { + string_list lti(psplit(lt, ' ', true)); + if (lti[0] == "#if") + { + m_if_level++; + m_if_seen |= (1 << m_if_level); + if (m_if_flag == 0) + { + lt = replace_macros(lt); + simple_iter<ppreprocessor> t(this, tokenize(lt.substr(3), m_expr_sep, true, true)); + auto val = narrow_cast<int>(prepro_expr(t, 255)); + t.skip_ws(); + if (!t.eod()) + error("found unprocessed content at end of line"); + if (val == 0) + m_if_flag |= (1 << m_if_level); + else + m_elif |= (1 << m_if_level); + } + } + else if (lti[0] == "#ifdef") + { + m_if_level++; + m_if_seen |= (1 << m_if_level); + if (get_define(lti[1]) == nullptr) + m_if_flag |= (1 << m_if_level); + else + m_elif |= (1 << m_if_level); + } + else if (lti[0] == "#ifndef") + { + m_if_level++; + m_if_seen |= (1 << m_if_level); + if (get_define(lti[1]) != nullptr) + m_if_flag |= (1 << m_if_level); + else + m_elif |= (1 << m_if_level); + } + else if (lti[0] == "#else") // basically #elif (1) + { + if (!(m_if_seen & (1 << m_if_level))) + error("#else without #if"); + + if (m_elif & (1 << m_if_level)) // elif disabled + m_if_flag |= (1 << m_if_level); + else + m_if_flag &= ~(1 << m_if_level); + m_elif |= (1 << m_if_level); + } + else if (lti[0] == "#elif") + { + if (!(m_if_seen & (1 << m_if_level))) + error("#elif without #if"); + + //if ((m_if_flag & (1 << m_if_level)) == 0) + // m_if_flag ^= (1 << m_if_level); + if (m_elif & (1 << m_if_level)) // elif disabled + m_if_flag |= (1 << m_if_level); + else + m_if_flag &= ~(1 << m_if_level); + if (m_if_flag == 0) + { + //m_if_flag ^= (1 << m_if_level); + lt = replace_macros(lt); + simple_iter<ppreprocessor> t(this, tokenize(lt.substr(5), m_expr_sep, true, true)); + auto val = narrow_cast<int>(prepro_expr(t, 255)); + t.skip_ws(); + if (!t.eod()) + error("found unprocessed content at end of line"); + if (val == 0) + m_if_flag |= (1 << m_if_level); + else + m_elif |= (1 << m_if_level); + } + } + else if (lti[0] == "#endif") + { + if (!(m_if_seen & (1 << m_if_level))) + error("#else without #if"); + m_if_seen &= ~(1 << m_if_level); + m_elif &= ~(1 << m_if_level); + m_if_flag &= ~(1 << m_if_level); + m_if_level--; + } + else if (lti[0] == "#include") + { + if (m_if_flag == 0) + { + pstring arg(""); + for (std::size_t i=1; i<lti.size(); i++) + arg += (lti[i] + " "); + + arg = plib::trim(arg); + + if (startsWith(arg, "\"") && endsWith(arg, "\"")) + { + arg = arg.substr(1, arg.length() - 2); + // first try local context + auto l(plib::util::build_path({m_stack.back().m_local_path, arg})); + auto lstrm(m_sources.get_stream(l)); + if (!lstrm.empty()) + { + m_stack.emplace_back(input_context(lstrm.release_stream(), plib::util::path(l), l)); + } + else + { + auto strm(m_sources.get_stream(arg)); + if (!strm.empty()) + { + m_stack.emplace_back(input_context(strm.release_stream(), plib::util::path(arg), arg)); + } + else + error("include not found:" + arg); + } + } + else + error("include misspelled:" + arg); + pstring line_marker = pfmt("# {1} \"{2}\" 1\n")(m_stack.back().m_lineno, m_stack.back().m_name); + push_out(line_marker); + } + } + else if (lti[0] == "#pragma") + { + if (m_if_flag == 0 && lti.size() > 3 && lti[1] == "NETLIST") + { + if (lti[2] == "warning") + error("NETLIST: " + cat_remainder(lti, 3, " ")); + } + } + else if (lti[0] == "#define") + { + if (m_if_flag == 0) + { + if (lti.size() < 2) + error("define needs at least one argument"); + simple_iter<ppreprocessor> args(this, tokenize(lt.substr(8), m_expr_sep, false, false)); + pstring n = args.next(); + if (!is_valid_token(n)) + error("define expected identifier"); + auto *previous_define = get_define(n); + if (lti.size() == 2) + { + if (previous_define != nullptr && !previous_define->m_replace.empty()) + error("redefinition of " + n); + m_defines.insert({n, define_t(n, "")}); + } + else if (args.next_ws() == "(") + { + define_t def(n); + def.m_has_params = true; + auto token(args.next()); + while (true) + { + if (token == ")") + break; + def.m_params.push_back(token); + token = args.next(); + if (token != "," && token != ")") + error(pfmt("expected , or ), found <{1}>")(token)); + if (token == ",") + token = args.next(); + } + pstring r; + while (!args.eod()) + r += args.next_ws(); + def.m_replace = r; + if (previous_define != nullptr && previous_define->m_replace != r) + error("redefinition of " + n); + m_defines.insert({n, def}); + } + else + { + pstring r; + while (!args.eod()) + r += args.next_ws(); + if (previous_define != nullptr && previous_define->m_replace != r) + error("redefinition of " + n); + m_defines.insert({n, define_t(n, r)}); + } + } + } + else if (lti[0] == "#undef") + { + if (m_if_flag == 0) + { + if (lti.size() < 2) + error("undef needs at least one argument"); + simple_iter<ppreprocessor> args(this, tokenize(lt.substr(7), m_expr_sep, false, false)); + pstring n = args.next(); + if (!is_valid_token(n)) + error("undef expected identifier"); + m_defines.erase(n); + } + } + else + { + if (m_if_flag == 0) + error("unknown directive"); + } + return { "", false }; + } + + if (m_if_flag == 0) + return { replace_macros(lt), true }; + + return { "", false }; + } + + void ppreprocessor::push_out(const pstring &s) + { + m_outbuf += s; + if (m_debug_out) + std::cerr << putf8string(s); + } + + void ppreprocessor::process_stack() + { + while (!m_stack.empty()) + { + putf8string line; + pstring line_marker = pfmt("# {1} \"{2}\"\n")(m_stack.back().m_lineno, m_stack.back().m_name); + push_out(line_marker); + bool last_skipped=false; + while (m_stack.back().m_reader.read_line(line)) + { + m_stack.back().m_lineno++; + auto r(process_line(pstring(line))); + if (r.second) + { + if (last_skipped) + push_out(pfmt("# {1} \"{2}\"\n")(m_stack.back().m_lineno, m_stack.back().m_name)); + push_out(r.first + "\n"); + last_skipped = false; + } + else + last_skipped = true; + } + m_stack.pop_back(); + if (!m_stack.empty()) + { + line_marker = pfmt("# {1} \"{2}\" 2\n")(m_stack.back().m_lineno, m_stack.back().m_name); + push_out(line_marker); + } + } + } + + + +} // namespace plib diff --git a/src/lib/netlist/plib/ppreprocessor.h b/src/lib/netlist/plib/ppreprocessor.h new file mode 100644 index 00000000000..1e21e72a5b0 --- /dev/null +++ b/src/lib/netlist/plib/ppreprocessor.h @@ -0,0 +1,127 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PPREPROCESSOR_H_ +#define PPREPROCESSOR_H_ + +/// +/// \file ppreprocessor.h +/// + +#include "pstream.h" +#include "pstring.h" + +#include "psource.h" +#include "putil.h" + +#include <istream> +#include <unordered_map> +#include <vector> + +namespace plib { + + class ppreprocessor + { + public: + + using string_list = std::vector<pstring>; + + struct define_t + { + define_t(const pstring &name, const pstring &replace) + : m_name(name), m_replace(replace), m_has_params(false) + {} + explicit define_t(const pstring &name) + : m_name(name), m_replace(""), m_has_params(false) + {} + pstring m_name; + pstring m_replace; + bool m_has_params; + string_list m_params; + }; + + using defines_map_type = std::unordered_map<pstring, define_t>; + + explicit ppreprocessor(psource_collection_t &sources, defines_map_type *defines = nullptr); + + PCOPYASSIGNMOVE(ppreprocessor, delete) + + ~ppreprocessor() = default; + + /// \brief process stream + /// + /// \param filename a filename or identifier identifying the stream. + /// + /// FIXME: this is sub-optimal. Refactor input_context into `pinput`_context + /// and pass this to `ppreprocessor`. + /// + template <typename T> + pstring process(T &&istrm, const pstring &filename) + { + m_outbuf.clear(); + m_stack.emplace_back(input_context(istrm.release_stream(),plib::util::path(filename), filename)); + process_stack(); + return m_outbuf; + } + + [[noreturn]] void error(const pstring &err) noexcept(false); + + define_t *get_define(const pstring &name); + pstring replace_macros(const pstring &line); + + private: + + enum state_e + { + PROCESS, + LINE_CONTINUATION + }; + + void push_out(const pstring &s); + + void process_stack(); + + string_list tokenize(const pstring &str, const string_list &sep, bool remove_ws, bool concat); + static bool is_valid_token(const pstring &str); + + std::pair<pstring,bool> process_line(const pstring &line_in); + pstring process_comments(const pstring &line); + + defines_map_type m_defines; + psource_collection_t &m_sources; + string_list m_expr_sep; + + std::uint_least64_t m_if_flag; // 63 if levels + std::uint_least64_t m_if_seen; // 63 if levels + std::uint_least64_t m_elif; // 63 if levels - for #elif + int m_if_level; + + struct input_context + { + template <typename T> + input_context(T &&istrm, const pstring &local_path, const pstring &name) + : m_reader(std::forward<T>(istrm)) + , m_lineno(0) + , m_local_path(local_path) + , m_name(name) + {} + + putf8_reader m_reader; + int m_lineno; + pstring m_local_path; + pstring m_name; + }; + + // vector used as stack because we need to loop through stack + std::vector<input_context> m_stack; + pstring m_outbuf; + state_e m_state; + pstring m_line; + bool m_comment; + bool m_debug_out; + + }; + +} // namespace plib + +#endif // PPREPROCESSOR_H_ diff --git a/src/lib/netlist/plib/prandom.h b/src/lib/netlist/plib/prandom.h new file mode 100644 index 00000000000..3772343826a --- /dev/null +++ b/src/lib/netlist/plib/prandom.h @@ -0,0 +1,233 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PRANDOM_H_ +#define PRANDOM_H_ + +/// +/// \file pmath.h +/// + +#include "pconfig.h" +#include "pgsl.h" +#include "pmath.h" +#include "ptypes.h" + +//#include <algorithm> +//#include <cmath> +//#include <type_traits> +#include <array> + +namespace plib +{ + + /// \brief Mersenne Twister implementation which is state saveable + /// + /// This is a Mersenne Twister implementation which is state saveable. + /// It has been written following this wikipedia entry: + /// + /// https://en.wikipedia.org/wiki/Mersenne_Twister + /// + /// The implementation has basic support for the interface described here + /// + /// https://en.cppreference.com/w/cpp/numeric/random/mersenne_twister_engine + /// + /// so that it can be used with the C++11 random environment + /// + template<typename T, + std::size_t w, std::size_t N, std::size_t m, std::size_t r, + T a, + std::size_t u, T d, + std::size_t s, T b, + std::size_t t, T c, + std::size_t l, T f> + class mersenne_twister_t + { + public: + + mersenne_twister_t() + : m_p(N) + { + seed(5489); + } + + static constexpr T min() noexcept { return T(0); } + static constexpr T max() noexcept { return ~T(0) >> (sizeof(T)*8 - w); } + + template <typename ST> + void save_state(ST &st) + { + st.save_item(m_p, "index"); + st.save_item(m_mt, "mt"); + } + + void seed(T val) noexcept + { + const T lowest_w(~T(0) >> (sizeof(T)*8 - w)); + m_p = N; + m_mt[0] = val; + for (std::size_t i=1; i< N; i++) + m_mt[i] = (f * (m_mt[i-1] ^ (m_mt[i-1] >> (w-2))) + i) & lowest_w; + } + + T operator()() noexcept + { + const T lowest_w(~T(0) >> (sizeof(T)*8 - w)); + if (m_p >= N) + twist(); + + T y = m_mt[m_p++]; + y = y ^ ((y >> u) & d); + y = y ^ ((y << s) & b); + y = y ^ ((y << t) & c); + y = y ^ (y >> l); + + return y & lowest_w; + } + + void discard(std::size_t v) noexcept + { + if (v > N - m_p) + { + v -= N - m_p; + twist(); + } + while (v > N) + { + v -= N; + twist(); + } + m_p += v; + } + + private: + void twist() noexcept + { + const T lowest_w(~T(0) >> (sizeof(T)*8 - w)); + const T lower_mask((T(1) << r) - 1); // That is, the binary number of r 1's + const T upper_mask((~lower_mask) & lowest_w); + + for (std::size_t i=0; i<N; i++) + { + const T x((m_mt[i] & upper_mask) + (m_mt[(i+1) % N] & lower_mask)); + const T xA((x >> 1) ^ ((x & 1) ? a : 0)); + m_mt[i] = m_mt[(i + m) % N] ^ xA; + } + m_p = 0; + } + + std::size_t m_p; + std::array<T, N> m_mt; + }; + + template <typename FT, typename T> + FT normalize_uniform(T &p, FT m = constants<FT>::one(), FT b = constants<FT>::zero()) noexcept + { + constexpr const FT mmin(narrow_cast<FT>(T::min())); + constexpr const FT mmax(narrow_cast<FT>(T::max())); + // -> 0 to a + return (narrow_cast<FT>(p())- mmin) / (mmax - mmin) * m - b; + } + + template<typename FT> + class uniform_distribution_t + { + public: + uniform_distribution_t(FT dev) + : m_stddev(dev) { } + + template <typename P> + FT operator()(P &p) noexcept + { + // get -1 to 1 + return normalize_uniform(p, constants<FT>::two(), constants<FT>::one()) + * constants<FT>::sqrt3() * m_stddev; + } + + template <typename ST> + void save_state([[maybe_unused]] ST &st) + { + // no state to save + } + + private: + FT m_stddev; + }; + + template<typename FT> + class normal_distribution_t + { + public: + normal_distribution_t(FT dev) + : m_p(m_buf.size()), m_stddev(dev) { } + + // Donald Knuth, Algorithm P (Polar method) + + template <typename P> + FT operator()(P &p) noexcept + { + if (m_p >= m_buf.size()) + fill(p); + return m_buf[m_p++]; + } + + template <typename ST> + void save_state(ST &st) + { + st.save_item(m_p, "m_p"); + st.save_item(m_buf, "m_buf"); + } + + private: + + template <typename P> + void fill(P &p) noexcept + { + for (std::size_t i = 0; i < m_buf.size(); i += 2) + { + FT s; + FT v1; + FT v2; + do + { + v1 = normalize_uniform(p, constants<FT>::two(), constants<FT>::one()); // [-1..1] + v2 = normalize_uniform(p, constants<FT>::two(), constants<FT>::one()); // [-1..1] + s = v1 * v1 + v2 * v2; + } while (s >= constants<FT>::one()); + if (s == constants<FT>::zero()) + { + m_buf[i] = s; + m_buf[i+1] = s; + } + else + { + // last value without error for log(s)/s + // double: 1.000000e-305 + // float: 9.999999e-37 + // FIXME: with 128 bit randoms log(s)/w will fail 1/(2^128) ~ 2.9e-39 + const FT m(m_stddev * plib::sqrt(-constants<FT>::two() * plib::log(s)/s)); + m_buf[i] = /*mean+*/ m * v1; + m_buf[i+1] = /*mean+*/ m * v2; + } + } + m_p = 0; + } + + std::array<FT, 256> m_buf; + std::size_t m_p; + FT m_stddev; + }; + + using mt19937_64 = mersenne_twister_t< + uint_fast64_t, + 64, 312, 156, 31, + 0xb5026f5aa96619e9ULL, + 29, 0x5555555555555555ULL, + 17, 0x71d67fffeda60000ULL, + 37, 0xfff7eee000000000ULL, + 43, + 6364136223846793005ULL>; + +} // namespace plib + +#endif // PRANDOM_H_ diff --git a/src/lib/netlist/plib/psource.h b/src/lib/netlist/plib/psource.h new file mode 100644 index 00000000000..80a313ec415 --- /dev/null +++ b/src/lib/netlist/plib/psource.h @@ -0,0 +1,173 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PSOURCE_H_ +#define PSOURCE_H_ + +/// +/// \file putil.h +/// + +#include "palloc.h" +#include "pexception.h" +#include "pstream.h" +#include "pstring.h" + +#include <algorithm> +#include <initializer_list> +#include <sstream> +#include <vector> + + +#define PSOURCELOC() plib::source_location(__FILE__, __LINE__) + +namespace plib +{ + + /// \brief Source code locations. + /// + /// The c++20 draft for source locations is based on const char * strings. + /// It is thus only suitable for c++ source code and not for programmatic + /// parsing of files. This class is a replacement for dynamic use cases. + /// + struct source_location + { + source_location() noexcept + : m_file("unknown"), m_func(m_file), m_line(0), m_col(0) + { } + + source_location(pstring file, unsigned line) noexcept + : m_file(std::move(file)), m_func("unknown"), m_line(line), m_col(0) + { } + + source_location(pstring file, pstring func, unsigned line) noexcept + : m_file(std::move(file)), m_func(std::move(func)), m_line(line), m_col(0) + { } + + PCOPYASSIGNMOVE(source_location, default) + + ~source_location() = default; + + unsigned line() const noexcept { return m_line; } + unsigned column() const noexcept { return m_col; } + pstring file_name() const noexcept { return m_file; } + pstring function_name() const noexcept { return m_func; } + + source_location &operator ++() noexcept + { + ++m_line; + return *this; + } + + private: + pstring m_file; + pstring m_func; + unsigned m_line; + unsigned m_col; + }; + + /// \brief Base source class. + /// + /// Pure virtual class all other source implementations are based on. + /// Sources provide an abstraction to read input from a variety of + /// sources, e.g. files, memory, remote locations. + /// + class psource_t + { + public: + + psource_t() noexcept = default; + + PCOPYASSIGNMOVE(psource_t, delete) + + virtual ~psource_t() noexcept = default; + + virtual istream_uptr stream(const pstring &name) = 0; + private: + }; + + /// \brief Generic string source. + /// + /// Will return the given string when name matches. + /// Is used in preprocessor code to eliminate inclusion of certain files. + /// + class psource_str_t : public psource_t + { + public: + psource_str_t(pstring name, pstring str) + : m_name(std::move(name)), m_str(std::move(str)) + {} + + PCOPYASSIGNMOVE(psource_str_t, delete) + ~psource_str_t() noexcept override = default; + + istream_uptr stream(const pstring &name) override + { + if (name == m_name) + return {std::make_unique<std::stringstream>(putf8string(m_str)), name }; + + return istream_uptr(); + } + private: + pstring m_name; + pstring m_str; + }; + + /// \brief Generic sources collection. + /// + class psource_collection_t + { + public: + using source_ptr = std::unique_ptr<psource_t>; + using list_t = std::vector<source_ptr>; + + psource_collection_t() noexcept = default; + + PCOPYASSIGNMOVE(psource_collection_t, delete) + virtual ~psource_collection_t() noexcept = default; + + template <typename S, typename... Args> + void add_source(Args&&... args) + { + static_assert(std::is_base_of<psource_t, S>::value, "S must inherit from plib::psource_t"); + + auto src = std::make_unique<S>(std::forward<Args>(args)...); + m_collection.push_back(std::move(src)); + } + + template <typename S = psource_t> + istream_uptr get_stream(pstring name) + { + for (auto &s : m_collection) + { + if (auto source = plib::dynamic_downcast<S *>(s.get())) + { + auto strm = (*source)->stream(name); + if (!strm.empty()) + return strm; + } + } + return istream_uptr(); + } + + template <typename S, typename F> + bool for_all(F lambda) + { + for (auto &s : m_collection) + { + if (auto source = plib::dynamic_downcast<S *>(s.get())) + { + if (lambda(*source)) + return true; + } + } + return false; + } + + private: + list_t m_collection; + }; + +} // namespace plib + +#endif // PSOURCE_H_ diff --git a/src/lib/netlist/plib/pstate.cpp b/src/lib/netlist/plib/pstate.cpp deleted file mode 100644 index 3bd93ed4f8e..00000000000 --- a/src/lib/netlist/plib/pstate.cpp +++ /dev/null @@ -1,57 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * pstate.c - * - */ - -#include "pstate.h" -#include "palloc.h" - -namespace plib { - -void state_manager_t::save_state_ptr(const void *owner, const pstring &stname, const datatype_t &dt, const std::size_t count, void *ptr) -{ - auto p = plib::make_unique<entry_t>(stname, dt, owner, count, ptr); - m_save.push_back(std::move(p)); -} - -void state_manager_t::remove_save_items(const void *owner) -{ - auto i = m_save.end(); - while (i != m_save.begin()) - { - i--; - if (i->get()->m_owner == owner) - i = m_save.erase(i); - } - i = m_custom.end(); - while (i > m_custom.begin()) - { - i--; - if (i->get()->m_owner == owner) - i = m_custom.erase(i); - } -} - -void state_manager_t::pre_save() -{ - for (auto & s : m_custom) - s->m_callback->on_pre_save(*this); -} - -void state_manager_t::post_load() -{ - for (auto & s : m_custom) - s->m_callback->on_post_load(*this); -} - -template<> void state_manager_t::save_item(const void *owner, callback_t &state, const pstring &stname) -{ - callback_t *state_p = &state; - auto p = plib::make_unique<entry_t>(stname, owner, state_p); - m_custom.push_back(std::move(p)); - state.register_state(*this, stname); -} - -} // namespace plib diff --git a/src/lib/netlist/plib/pstate.h b/src/lib/netlist/plib/pstate.h index ac75ca6b69e..72473590b9b 100644 --- a/src/lib/netlist/plib/pstate.h +++ b/src/lib/netlist/plib/pstate.h @@ -1,14 +1,13 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pstate.h - * - */ #ifndef PSTATE_H_ #define PSTATE_H_ -#include "palloc.h" +/// +/// \file pstate.h +/// + #include "pstring.h" #include "ptypes.h" @@ -28,16 +27,22 @@ public: struct datatype_t { datatype_t(std::size_t bsize, bool bintegral, bool bfloat) - : size(bsize), is_integral(bintegral), is_float(bfloat), is_custom(false) + : m_size(bsize), m_is_integral(bintegral), m_is_float(bfloat), m_is_custom(false) {} explicit datatype_t(bool bcustom) - : size(0), is_integral(false), is_float(false), is_custom(bcustom) + : m_size(0), m_is_integral(false), m_is_float(false), m_is_custom(bcustom) {} - const std::size_t size; - const bool is_integral; - const bool is_float; - const bool is_custom; + std::size_t size() const noexcept { return m_size; } + bool is_integral() const noexcept { return m_is_integral; } + bool is_float() const noexcept { return m_is_float; } + bool is_custom() const noexcept { return m_is_custom; } + + private: + std::size_t m_size; + bool m_is_integral; + bool m_is_float; + bool m_is_custom; }; template<typename T> @@ -45,10 +50,10 @@ public: { return datatype_t(sizeof(T), plib::is_integral<T>::value || std::is_enum<T>::value, - std::is_floating_point<T>::value); + plib::is_floating_point<T>::value); } - class callback_t + struct callback_t { public: using list_t = std::vector<callback_t *>; @@ -58,85 +63,165 @@ public: virtual void on_post_load(state_manager_t &manager) = 0; protected: callback_t() = default; - ~callback_t() = default; - COPYASSIGNMOVE(callback_t, default) + virtual ~callback_t() = default; + PCOPYASSIGNMOVE(callback_t, default) }; struct entry_t { - using list_t = std::vector<plib::unique_ptr<entry_t>>; + using list_t = std::vector<entry_t>; - entry_t(const pstring &stname, const datatype_t &dt, const void *owner, + entry_t(const pstring &item_name, const datatype_t &dt, const void *owner, const std::size_t count, void *ptr) - : m_name(stname), m_dt(dt), m_owner(owner), m_callback(nullptr), m_count(count), m_ptr(ptr) { } + : m_name(item_name), m_dt(dt), m_owner(owner), m_callback(nullptr), m_count(count), m_ptr(ptr) { } - entry_t(const pstring &stname, const void *owner, callback_t *callback) - : m_name(stname), m_dt(datatype_t(true)), m_owner(owner), m_callback(callback), m_count(0), m_ptr(nullptr) { } + entry_t(const pstring &item_name, const void *owner, callback_t *callback) + : m_name(item_name), m_dt(datatype_t(true)), m_owner(owner), m_callback(callback), m_count(0), m_ptr(nullptr) { } + pstring name() const noexcept { return m_name; } + datatype_t dt() const noexcept { return m_dt; } + const void * owner() const noexcept { return m_owner; } + callback_t * callback() const noexcept { return m_callback; } + std::size_t count() const noexcept { return m_count; } + void * ptr() const noexcept { return m_ptr; } + + private: pstring m_name; - const datatype_t m_dt; + datatype_t m_dt; const void * m_owner; callback_t * m_callback; - const std::size_t m_count; + std::size_t m_count; void * m_ptr; }; state_manager_t() = default; + struct saver_t + { + saver_t(state_manager_t &sm, const void *owner, const pstring &member_name) + : m_sm(sm) + , m_owner(owner) + , m_member_name(member_name) + { } + + template <typename XS> + void save_item(XS &some_state, const pstring &item_name) + { + m_sm.save_item(m_owner, some_state, m_member_name + "." + item_name); + } + + state_manager_t &m_sm; + const void * m_owner; + const pstring m_member_name; + }; + template<typename C> - void save_item(const void *owner, C &state, const pstring &stname) + void save_item(const void *owner, C &state, const pstring &item_name) { - save_state_ptr( owner, stname, dtype<C>(), 1, &state); + save_item_dispatch(owner, state, item_name); } template<typename C, std::size_t N> - void save_item(const void *owner, C (&state)[N], const pstring &stname) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + void save_item(const void *owner, C (&state)[N], const pstring &item_name) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) { - save_state_ptr(owner, stname, dtype<C>(), N, &(state[0])); + save_state_ptr(owner, item_name, dtype<C>(), N, &(state[0])); } template<typename C> - void save_item(const void *owner, C *state, const pstring &stname, const std::size_t count) + void save_item(const void *owner, C *state, const pstring &item_name, const std::size_t count) { - save_state_ptr(owner, stname, dtype<C>(), count, state); + save_state_ptr(owner, item_name, dtype<C>(), count, state); } - template<typename C> - void save_item(const void *owner, std::vector<C> &v, const pstring &stname) + template<typename C, typename A> + void save_item(const void *owner, std::vector<C, A> &v, const pstring &item_name) { - save_state_ptr(owner, stname, dtype<C>(), v.size(), v.data()); + save_state_ptr(owner, item_name, dtype<C>(), v.size(), v.data()); } template<typename C, std::size_t N> - void save_item(const void *owner, std::array<C, N> &a, const pstring &stname) + void save_item(const void *owner, std::array<C, N> &a, const pstring &item_name) + { + save_state_ptr(owner, item_name, dtype<C>(), N, a.data()); + } + + void save_state_ptr(const void *owner, const pstring &item_name, const datatype_t &dt, const std::size_t count, void *ptr) + { + m_save.emplace_back(item_name, dt, owner, count, ptr); + } + + void pre_save() + { + for (auto & s : m_custom) + s.callback()->on_pre_save(*this); + } + + void post_load() { - save_state_ptr(owner, stname, dtype<C>(), N, a.data()); + for (auto & s : m_custom) + s.callback()->on_post_load(*this); } - void pre_save(); - void post_load(); - void remove_save_items(const void *owner); + void remove_save_items(const void *owner) + { + auto i = m_save.end(); + while (i != m_save.begin()) + { + i--; + if (i->owner() == owner) + i = m_save.erase(i); + } + i = m_custom.end(); + while (i > m_custom.begin()) + { + i--; + if (i->owner() == owner) + i = m_custom.erase(i); + } + } - const std::vector<const entry_t *> save_list() const + std::vector<const entry_t *> save_list() const { std::vector<const entry_t *> ret; - for (auto &i : m_save) - ret.push_back(i.get()); + for (const auto &i : m_save) + ret.push_back(&i); return ret; } - void save_state_ptr(const void *owner, const pstring &stname, const datatype_t &dt, const std::size_t count, void *ptr); - protected: private: + + template<typename C> + std::enable_if_t<plib::is_integral<C>::value || std::is_enum<C>::value + || plib::is_floating_point<C>::value> + save_item_dispatch(const void *owner, C &state, const pstring &item_name) + { + save_state_ptr( owner, item_name, dtype<C>(), 1, &state); + } + + template<typename C> + std::enable_if_t<!(plib::is_integral<C>::value || std::is_enum<C>::value + || plib::is_floating_point<C>::value)> + save_item_dispatch(const void *owner, C &state, const pstring &item_name) + { + saver_t sav(*this, owner, item_name); + state.save_state(sav); + } + entry_t::list_t m_save; entry_t::list_t m_custom; }; -template<> void state_manager_t::save_item(const void *owner, callback_t &state, const pstring &stname); +template<> +inline void state_manager_t::save_item(const void *owner, callback_t &state, const pstring &item_name) +{ + m_custom.emplace_back(item_name, owner, &state); + state.register_state(*this, item_name); +} + } // namespace plib -#endif /* PSTATE_H_ */ +#endif // PSTATE_H_ diff --git a/src/lib/netlist/plib/pstonum.h b/src/lib/netlist/plib/pstonum.h new file mode 100644 index 00000000000..18c67ca2b86 --- /dev/null +++ b/src/lib/netlist/plib/pstonum.h @@ -0,0 +1,145 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PSTONUM_H_ +#define PSTONUM_H_ + +/// +/// \file pstonum.h +/// + +#include "pconfig.h" +#include "pexception.h" +#include "pgsl.h" +#include "pmath.h" // for pstonum +#include "pstring.h" + +#include <algorithm> +#include <initializer_list> +#include <iostream> +#include <locale> +#include <sstream> + +namespace plib +{ + // ---------------------------------------------------------------------------------------- + // number conversions + // ---------------------------------------------------------------------------------------- + + template <typename T, typename S> + T pstonum_locale(const std::locale &loc, const S &arg, bool *err) + { + std::stringstream ss; + ss.imbue(loc); + ss << putf8string(arg); + auto len(ss.tellp()); + T x(constants<T>::zero()); + if (ss >> x) + { + auto pos(ss.tellg()); + if (pos == decltype(pos)(-1)) + pos = len; + *err = (pos != len); + } + else + *err = true; + return x; + } + + template <typename T, typename E = void> + struct pstonum_helper; + + template<typename T> + struct pstonum_helper<T, std::enable_if_t<plib::is_integral<T>::value && plib::is_signed<T>::value>> + { + template <typename S> + long long operator()(std::locale loc, const S &arg, bool *err) + { + //return std::stoll(arg, idx); + return pstonum_locale<long long>(loc, arg, err); + } + }; + + template<typename T> + struct pstonum_helper<T, std::enable_if_t<plib::is_integral<T>::value && !plib::is_signed<T>::value>> + { + template <typename S> + unsigned long long operator()(std::locale loc, const S &arg, bool *err) + { + //return std::stoll(arg, idx); + return pstonum_locale<unsigned long long>(loc, arg, err); + } + }; + + template<typename T> + struct pstonum_helper<T, std::enable_if_t<std::is_floating_point<T>::value>> + { + template <typename S> + long double operator()(std::locale loc, const S &arg, bool *err) + { + return pstonum_locale<long double>(loc, arg, err); + } + }; + +#if PUSE_FLOAT128 + template<> + struct pstonum_helper<FLOAT128> + { + // FIXME: use `strtoflt128` from `quadmath.h` + template <typename S> + FLOAT128 operator()(std::locale loc, const S &arg, bool *err) + { + return narrow_cast<FLOAT128>(pstonum_locale<long double>(loc, arg, err)); + } + }; +#endif + + template<typename T, typename S> + T pstonum(const S &arg, const std::locale &loc = std::locale::classic()) noexcept(false) + { + bool err(false); + auto ret = pstonum_helper<T>()(loc, arg, &err); + if (err) + throw pexception(pstring("Error converting string to number: ") + pstring(arg)); + + using ret_type = decltype(ret); + if (ret >= narrow_cast<ret_type>(plib::numeric_limits<T>::lowest()) + && ret <= narrow_cast<ret_type>(plib::numeric_limits<T>::max())) + { + return narrow_cast<T>(ret); + } + + throw pexception(pstring("Out of range: ") + pstring(arg)); + } + + template<typename R, typename T> + R pstonum_ne(const T &str, bool &err, std::locale loc = std::locale::classic()) noexcept + { + try + { + err = false; + return pstonum<R>(str, loc); + } + catch (...) + { + err = true; + return R(0); + } + } + + template<typename R, typename T> + R pstonum_ne_def(const T &str, R def, std::locale loc = std::locale::classic()) noexcept + { + try + { + return pstonum<R>(str, loc); + } + catch (...) + { + return def; + } + } + +} // namespace plib + +#endif // PUTIL_H_ diff --git a/src/lib/netlist/plib/pstream.cpp b/src/lib/netlist/plib/pstream.cpp deleted file mode 100644 index 1e805825af3..00000000000 --- a/src/lib/netlist/plib/pstream.cpp +++ /dev/null @@ -1,55 +0,0 @@ -// license:GPL-2.0+ -// copyright-holders:Couriersud -/* - * pstream.c - * - */ - -#include "pstream.h" -#include "palloc.h" - -#include <algorithm> -#include <cstdio> -//#include <cstdlib> - -// VS2015 prefers _dup -#ifdef _WIN32 -#include <io.h> -#else -#include <unistd.h> -#endif - -namespace plib { - - -bool putf8_reader::readline(pstring &line) -{ - putf8string::code_t c = 0; - m_linebuf = ""; - if (!this->readcode(c)) - { - line = ""; - return false; - } - while (true) - { - if (c == 10) - break; - else if (c != 13) /* ignore CR */ - m_linebuf += putf8string(1, c); - if (!this->readcode(c)) - break; - } - line = m_linebuf.c_str(); - return true; -} - - -void putf8_fmt_writer::vdowrite(const pstring &ls) const -{ - write(ls); -} - - - -} // namespace plib diff --git a/src/lib/netlist/plib/pstream.h b/src/lib/netlist/plib/pstream.h index ca21bca795a..72a2f242106 100644 --- a/src/lib/netlist/plib/pstream.h +++ b/src/lib/netlist/plib/pstream.h @@ -1,108 +1,208 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pstream.h - */ + #ifndef PSTREAM_H_ #define PSTREAM_H_ +/// +/// \file pstream.h +/// -#include "palloc.h" #include "pconfig.h" -#include "pexception.h" #include "pfmtlog.h" +#include "pgsl.h" #include "pstring.h" #include <array> -#include <type_traits> -#include <vector> -#include <ios> #include <fstream> +#include <ios> #include <iostream> +#include <memory> #include <sstream> +#include <type_traits> +#include <vector> namespace plib { -// ----------------------------------------------------------------------------- -// putf8reader_t: reader on top of istream -// ----------------------------------------------------------------------------- + /// \brief wrapper around istream read + /// + template <typename S, typename T> + static S & istream_read(S &is, T * data, size_t len) + { + using ct = typename S::char_type; + static_assert((sizeof(T) % sizeof(ct)) == 0, "istream_read sizeof issue"); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return is.read(reinterpret_cast<ct *>(data), gsl::narrow<std::streamsize>(len * sizeof(T))); + } -/* this digests linux & dos/windows text files */ + /// \brief wrapper around ostream write + /// + template <typename S, typename T> + static S & ostream_write(S &os, const T * data, size_t len) + { + using ct = typename S::char_type; + static_assert((sizeof(T) % sizeof(ct)) == 0, "ostream_write sizeof issue"); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + return os.write(reinterpret_cast<const ct *>(data), gsl::narrow<std::streamsize>(len * sizeof(T))); + } + /// \brief a named istream pointer container + /// + /// This moveable object allows to pass istream unique pointers with + /// information about the origin (filename). This is useful in error + /// reporting where the source of the stream has to be logged. + /// + struct istream_uptr + { + explicit istream_uptr() = default; -template <typename T> -struct constructor_helper -{ - plib::unique_ptr<std::istream> operator()(T &&s) { return std::move(plib::make_unique<T>(std::move(s))); } -}; + istream_uptr(std::unique_ptr<std::istream> &&strm, const pstring &filename) + : m_strm(std::move(strm)) + , m_filename(filename) + { + } + istream_uptr(const istream_uptr &) = delete; + istream_uptr &operator=(const istream_uptr &) = delete; + istream_uptr(istream_uptr &&rhs) noexcept + : m_strm(std::move(rhs.m_strm)) + , m_filename(std::move(rhs.m_filename)) + { + } + istream_uptr &operator=(istream_uptr &&) = delete; + + ~istream_uptr() = default; + std::istream * operator ->() noexcept { return m_strm.get(); } + std::istream & operator *() noexcept { return *m_strm; } + pstring filename() { return m_filename; } + + bool empty() { return m_strm == nullptr; } + + // FIXME: workaround input context should accept stream_ptr + + std::unique_ptr<std::istream> release_stream() { return std::move(m_strm); } + private: + std::unique_ptr<std::istream> m_strm; + pstring m_filename; + }; + +/// +/// \brief digests linux & dos/windows text files +/// // NOLINTNEXTLINE(cppcoreguidelines-special-member-functions) class putf8_reader { public: - COPYASSIGN(putf8_reader, delete) - putf8_reader &operator=(putf8_reader &&src) = delete; + PCOPYASSIGN(putf8_reader, delete) virtual ~putf8_reader() = default; - template <typename T> - friend struct constructor_helper; + putf8_reader(putf8_reader &&rhs) noexcept + : m_strm(std::move(rhs.m_strm)) + { + } - template <typename T> - putf8_reader(T &&strm) // NOLINT(cppcoreguidelines-special-member-functions, misc-forwarding-reference-overload, bugprone-forwarding-reference-overload) - : m_strm(std::move(constructor_helper<T>()(std::move(strm)))) // NOLINT(bugprone-move-forwarding-reference) - {} + putf8_reader(std::unique_ptr<std::istream> &&rhs) noexcept + : m_strm(std::move(rhs)) + { + // no bad surprises + m_strm->imbue(std::locale::classic()); + } bool eof() const { return m_strm->eof(); } - bool readline(pstring &line); - bool readbyte1(std::istream::char_type &b) + /// \brief Read a line of UTF8 characters from the stream. + /// + /// The line will not contain a trailing linefeed + /// + /// \param line pstring reference to the result + /// \returns Returns false if at end of file + /// + bool read_line(putf8string &line) + { + putf8string::code_t c = 0; + line = ""; + if (!this->read_code(c)) + { + return false; + } + while (true) + { + if (c == 10) + break; + if (c != 13) // ignore CR + line += putf8string(1, c); + if (!this->read_code(c)) + break; + } + return true; + } + + /// \brief Read a line of UTF8 characters from the stream including trailing linefeed. + /// + /// The line will contain the trailing linefeed + /// + /// \param line pstring reference to the result + /// \returns Returns false if at end of file + /// + bool read_line_lf(putf8string &line) + { + putf8string::code_t c = 0; + line = ""; + if (!this->read_code(c)) + { + return false; + } + while (true) + { + if (c != 13) // ignore CR + line += putf8string(1, c); + if (c == 10) + break; + if (!this->read_code(c)) + break; + } + return true; + } + + bool readbyte(std::istream::char_type &b) { if (m_strm->eof()) return false; m_strm->read(&b, 1); - return true; + return (!m_strm->eof()); } - bool readcode(putf8string::traits_type::code_t &c) + + bool read_code(putf8string::traits_type::code_t &c) { std::array<std::istream::char_type, 4> b{0}; if (m_strm->eof()) return false; m_strm->read(&b[0], 1); + if (m_strm->eof()) + return false; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) const std::size_t l = putf8string::traits_type::codelen(reinterpret_cast<putf8string::traits_type::mem_t *>(&b)); for (std::size_t i = 1; i < l; i++) { + m_strm->read(&b[i], 1); if (m_strm->eof()) return false; - m_strm->read(&b[i], 1); } + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) c = putf8string::traits_type::code(reinterpret_cast<putf8string::traits_type::mem_t *>(&b)); return true; } std::istream &stream() { return *m_strm; } private: - plib::unique_ptr<std::istream> m_strm; - putf8string m_linebuf; -}; - -template <> -struct constructor_helper<putf8_reader> -{ - plib::unique_ptr<std::istream> operator()(putf8_reader &&s) { return std::move(s.m_strm); } -}; - -template <> -struct constructor_helper<plib::unique_ptr<std::istream>> -{ - plib::unique_ptr<std::istream> operator()(plib::unique_ptr<std::istream> &&s) { return std::move(s); } + std::unique_ptr<std::istream> m_strm; }; - -// ----------------------------------------------------------------------------- -// putf8writer_t: writer on top of ostream -// ----------------------------------------------------------------------------- +/// +/// \brief writer on top of ostream +/// class putf8_writer { @@ -111,12 +211,12 @@ public: putf8_writer(putf8_writer &&src) noexcept : m_strm(src.m_strm) {} - COPYASSIGN(putf8_writer, delete) + PCOPYASSIGN(putf8_writer, delete) putf8_writer &operator=(putf8_writer &&src) = delete; virtual ~putf8_writer() = default; - void writeline(const pstring &line) const + void write_line(const pstring &line) const { write(line); write(10); @@ -126,15 +226,17 @@ public: { // NOLINTNEXTLINE(performance-unnecessary-copy-initialization) const putf8string conv_utf8(text); - m_strm->write(conv_utf8.c_str(), static_cast<std::streamsize>(plib::strlen(conv_utf8.c_str()))); + //m_strm->write(conv_utf8.c_str(), static_cast<std::streamsize>(plib::strlen(conv_utf8.c_str() ))); + ostream_write(*m_strm, conv_utf8.c_str(), conv_utf8.size()); } void write(const pstring::value_type c) const { - pstring t = pstring("") + c; + pstring t(1,c); write(t); } + void flush() { m_strm->flush(); } private: std::ostream *m_strm; }; @@ -144,24 +246,27 @@ class putf8_fmt_writer : public pfmt_writer_t<putf8_fmt_writer>, public putf8_wr public: explicit putf8_fmt_writer(std::ostream *strm) - : pfmt_writer_t() - , putf8_writer(strm) + : putf8_writer(strm) { } - COPYASSIGNMOVE(putf8_fmt_writer, delete) + PCOPYASSIGNMOVE(putf8_fmt_writer, delete) ~putf8_fmt_writer() override = default; //protected: - void vdowrite(const pstring &ls) const; + void upstream_write(const pstring &s) const + { + write(s); + } + private: }; -// ----------------------------------------------------------------------------- -// pbinary_writer_t: writer on top of ostream -// ----------------------------------------------------------------------------- +/// +/// \brief writer on top of ostream +/// class pbinary_writer { @@ -169,7 +274,7 @@ public: explicit pbinary_writer(std::ostream &strm) : m_strm(strm) {} pbinary_writer(pbinary_writer &&src) noexcept : m_strm(src.m_strm) {} - COPYASSIGN(pbinary_writer, delete) + PCOPYASSIGN(pbinary_writer, delete) pbinary_writer &operator=(pbinary_writer &&src) = delete; virtual ~pbinary_writer() = default; @@ -177,23 +282,24 @@ public: template <typename T> void write(const T &val) { - m_strm.write(reinterpret_cast<const std::ostream::char_type *>(&val), sizeof(T)); + ostream_write(m_strm, &val, 1); } void write(const pstring &s) { - const auto sm = reinterpret_cast<const std::ostream::char_type *>(s.c_str()); - const std::streamsize sl(static_cast<std::streamsize>(pstring_mem_t_size(s))); + const auto *sm = s.c_str(); + //const auto sl(std::char_traits<pstring::mem_t>::length(sm)); + const auto sl(s.size()); write(sl); - m_strm.write(sm, sl); + ostream_write(m_strm, sm, sl); } template <typename T> void write(const std::vector<T> &val) { - const std::streamsize sz(static_cast<std::streamsize>(val.size())); + const typename std::vector<T>::size_type sz(val.size()); write(sz); - m_strm.write(reinterpret_cast<const std::ostream::char_type *>(val.data()), sz * static_cast<std::streamsize>(sizeof(T))); + ostream_write(m_strm, val.data(), sz); } private: @@ -206,7 +312,7 @@ public: explicit pbinary_reader(std::istream &strm) : m_strm(strm) {} pbinary_reader(pbinary_reader &&src) noexcept : m_strm(src.m_strm) { } - COPYASSIGN(pbinary_reader, delete) + PCOPYASSIGN(pbinary_reader, delete) pbinary_reader &operator=(pbinary_reader &&src) = delete; virtual ~pbinary_reader() = default; @@ -214,14 +320,14 @@ public: template <typename T> void read(T &val) { - m_strm.read(reinterpret_cast<std::istream::char_type *>(&val), sizeof(T)); + istream_read(m_strm, &val, 1); } void read( pstring &s) { std::size_t sz = 0; read(sz); - std::vector<plib::string_info<pstring>::mem_t> buf(sz+1); + std::vector<plib::string_info<putf8string>::mem_t> buf(sz+1); m_strm.read(buf.data(), static_cast<std::streamsize>(sz)); buf[sz] = 0; s = pstring(buf.data()); @@ -233,14 +339,14 @@ public: std::size_t sz = 0; read(sz); val.resize(sz); - m_strm.read(reinterpret_cast<std::istream::char_type *>(val.data()), static_cast<std::streamsize>(sizeof(T) * sz)); + istream_read(m_strm, val.data(), sz); } private: std::istream &m_strm; }; -inline void copystream(std::ostream &dest, std::istream &src) +inline void copy_stream(std::ostream &dest, std::istream &src) { // FIXME: optimize std::array<std::ostream::char_type, 1024> buf; // NOLINT(cppcoreguidelines-pro-type-member-init) @@ -251,12 +357,71 @@ inline void copystream(std::ostream &dest, std::istream &src) } } +/// +/// \brief utf8 filename aware ifstream wrapper +/// +class ifstream : public std::ifstream +{ +public: + + using filename_type = std::conditional<compile_info::win32() && (!compile_info::mingw() || compile_info::version::vmajor()>=9), + pstring_t<pwchar_traits>, pstring_t<putf8_traits>>::type; + + template <typename T> + explicit ifstream(const pstring_t<T> &name, ios_base::openmode mode = ios_base::in) + : std::ifstream(filename_type(name).c_str(), mode) + { + } + + explicit ifstream(const std::string &name, ios_base::openmode mode = ios_base::in) + : std::ifstream(filename_type(putf8string(name)).c_str(), mode) + { + } +}; + +/// +/// \brief utf8 filename aware ofstream wrapper +/// +class ofstream : public std::ofstream +{ +public: + using filename_type = std::conditional<compile_info::win32() && (!compile_info::mingw() || compile_info::version::vmajor()>=9), + pstring_t<pwchar_traits>, pstring_t<putf8_traits>>::type; + + ofstream() : std::ofstream() {} + + template <typename T> + explicit ofstream(const pstring_t<T> &name, ios_base::openmode mode = ios_base::out | ios_base::trunc) + : std::ofstream(filename_type(name).c_str(), mode) + { + } + + explicit ofstream(const std::string &name, ios_base::openmode mode = ios_base::out | ios_base::trunc) + : std::ofstream(filename_type(putf8string(name)).c_str(), mode) + { + } + + template <typename T> + void open(const pstring_t<T> &name, ios_base::openmode mode = ios_base::out | ios_base::trunc) + { + std::ofstream::open(filename_type(name).c_str(), mode); + } + + template <typename T> + void open(const std::string &name, ios_base::openmode mode = ios_base::out | ios_base::trunc) + { + std::ofstream::open(filename_type(putf8string(name)).c_str(), mode); + } + +}; + + struct perrlogger { template <typename ... Args> explicit perrlogger(Args&& ... args) { - h()(std::forward<Args>(args)...); + h()(std::forward<Args>(args)...); // NOLINT(cppcoreguidelines-pro-bounds-array-to-pointer-decay) } private: static putf8_fmt_writer &h() @@ -272,14 +437,17 @@ private: namespace filesystem { + + // FIXME: u8path should return a path object (c++17) + template< class Source > - pstring /*path */ u8path( const Source& source ) + pstring u8path( const Source& source ) { - return pstring(source); + return source; } -} +} // namespace filesystem } // namespace plib -#endif /* PSTREAM_H_ */ +#endif // PSTREAM_H_ diff --git a/src/lib/netlist/plib/pstring.cpp b/src/lib/netlist/plib/pstring.cpp index c304f11d1fd..7d5d5a7dbc7 100644 --- a/src/lib/netlist/plib/pstring.cpp +++ b/src/lib/netlist/plib/pstring.cpp @@ -1,113 +1,89 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_string.c - * - */ #include "pstring.h" #include "palloc.h" -#include "plists.h" #include <algorithm> #include <atomic> #include <stack> template<typename F> -int pstring_t<F>::compare(const pstring_t &right) const +int pstring_t<F>::compare(const pstring_t &right) const noexcept { - if (mem_t_size() == 0 && right.mem_t_size() == 0) - return 0; - else if (right.mem_t_size() == 0) - return 1; - else if (mem_t_size() == 0) - return -1; - +#if 0 + return m_str.compare(right.m_str); +#else auto si = this->begin(); auto ri = right.begin(); - while (si != this->end() && ri != right.end() && *si == *ri) + const auto se = this->end(); + const auto re = right.end(); + + while (si != se && ri != re && *si == *ri) { - ri++; - si++; + ++ri; + ++si; } - if (si != this->end() && ri != right.end()) - return static_cast<int>(*si) - static_cast<int>(*ri); - else if (this->mem_t_size() > right.mem_t_size()) + if (si != se && ri != re) + return plib::narrow_cast<int>(*si) - plib::narrow_cast<int>(*ri); + if (si != se) return 1; - else if (this->mem_t_size() < right.mem_t_size()) + if (ri != re) return -1; return 0; +#endif } template<typename F> pstring_t<F> pstring_t<F>::substr(size_type start, size_type nlen) const { pstring_t ret; + auto ps = begin(); + while (ps != end() && start > 0) + { + ++ps; + --start; + } //FIXME: throw ? - const size_type l = length(); - if (start < l) + if (ps != end()) { - if (nlen == npos || start + nlen > l) - nlen = l - start; - auto ps = std::next(begin(), static_cast<difference_type>(start)); - auto pe = std::next(ps, static_cast<difference_type>(nlen)); + auto pe = ps; + while (pe != end() && nlen > 0) + { + ++pe; + --nlen; + } ret.m_str.assign(ps.p, pe.p); } return ret; } template<typename F> -typename pstring_t<F>::size_type pstring_t<F>::find_first_not_of(const pstring_t &no) const +pstring_t<F> pstring_t<F>::substr(size_type start) const { - size_type pos = 0; - for (auto it = begin(); it != end(); ++it, ++pos) + pstring_t ret; + auto ps = begin(); + while (ps != end() && start > 0) { - bool f = true; - for (code_t const jt : no) - { - if (*it == jt) - { - f = false; - break; - } - } - if (f) - return pos; + ++ps; + --start; } - return npos; -} - -template<typename F> -typename pstring_t<F>::size_type pstring_t<F>::find_last_not_of(const pstring_t &no) const -{ - /* FIXME: reverse iterator */ - size_type last_found = npos; - size_type pos = 0; - for (auto it = begin(); it != end(); ++it, ++pos) + //FIXME: throw ? + if (ps != end()) { - bool f = true; - for (code_t const jt : no) - { - if (*it == jt) - { - f = false; - break; - } - } - if (f) - last_found = pos; + ret.m_str.assign(ps.p, end().p); } - return last_found; + return ret; } template<typename F> -typename pstring_t<F>::size_type pstring_t<F>::find(const pstring_t &search, size_type start) const +typename pstring_t<F>::size_type pstring_t<F>::find(const pstring_t &search, size_type start) const noexcept { auto istart = std::next(begin(), static_cast<difference_type>(start)); for (; istart != end(); ++istart) { - auto itc(istart); + auto itc = istart; auto cmp = search.begin(); while (itc != end() && cmp != search.end() && *itc == *cmp) { @@ -122,11 +98,16 @@ typename pstring_t<F>::size_type pstring_t<F>::find(const pstring_t &search, siz } template<typename F> -typename pstring_t<F>::size_type pstring_t<F>::find(code_t search, size_type start) const +typename pstring_t<F>::size_type pstring_t<F>::find(code_t search, size_type start) const noexcept { - pstring_t ss; - traits_type::encode(search, ss.m_str); - return find(ss, start); + auto i = std::next(begin(), static_cast<difference_type>(start)); + for (; i != end(); ++i) + { + if (*i == search) + return start; + ++start; + } + return npos; } // ---------------------------------------------------------------------------------------- @@ -136,4 +117,5 @@ typename pstring_t<F>::size_type pstring_t<F>::find(code_t search, size_type sta template struct pstring_t<pu8_traits>; template struct pstring_t<putf8_traits>; template struct pstring_t<putf16_traits>; +template struct pstring_t<putf32_traits>; template struct pstring_t<pwchar_traits>; diff --git a/src/lib/netlist/plib/pstring.h b/src/lib/netlist/plib/pstring.h index 96ab0bd0fa5..33ef2b083cf 100644 --- a/src/lib/netlist/plib/pstring.h +++ b/src/lib/netlist/plib/pstring.h @@ -1,17 +1,19 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * pstring.h - */ #ifndef PSTRING_H_ #define PSTRING_H_ +/// +/// \file pstring.h +/// + #include "ptypes.h" #include <exception> #include <iterator> #include <limits> +#include <ostream> #include <stdexcept> #include <string> #include <type_traits> @@ -51,8 +53,8 @@ public: constexpr bool operator==(const pstring_const_iterator& rhs) const noexcept { return p == rhs.p; } constexpr bool operator!=(const pstring_const_iterator& rhs) const noexcept { return p != rhs.p; } - reference operator*() const noexcept { return *reinterpret_cast<pointer>(&(*p)); } - pointer operator->() const noexcept { return reinterpret_cast<pointer>(&(*p)); } + reference operator*() const noexcept { return *reinterpret_cast<pointer>(&(*p)); } // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) + pointer operator->() const noexcept { return reinterpret_cast<pointer>(&(*p)); } // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) private: template <typename G> friend struct pstring_t; @@ -72,6 +74,9 @@ public: using size_type = std::size_t; using difference_type = std::ptrdiff_t; using string_type = typename traits_type::string_type; + // no non-const const_iterator for now + using iterator = pstring_const_iterator<pstring_t<F> >; + using const_iterator = pstring_const_iterator<pstring_t<F> >; // FIXME: this is ugly struct ref_value_type final @@ -94,32 +99,45 @@ public: pstring_t() = default; ~pstring_t() noexcept = default; - // FIXME: Do something with encoding - pstring_t(const mem_t *string) - : m_str(string) + pstring_t(const mem_t *string, const size_type len) + : m_str(string, len) { } - pstring_t(const mem_t *string, const size_type len) - : m_str(string, len) + // mingw treats string constants as char* instead of char[N] + template<typename C, + class = std::enable_if_t<std::is_same<C, const mem_t>::value>> + pstring_t(const C *string) + : m_str(string) { } template<typename C, std::size_t N, - class = typename std::enable_if<std::is_same<C, const mem_t>::value>::type> - pstring_t(C (&string)[N]) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) + class = std::enable_if_t<std::is_same<C, const mem_t>::value>> + pstring_t(C (&string)[N]) noexcept(false) // NOLINT(cppcoreguidelines-avoid-c-arrays, modernize-avoid-c-arrays) { static_assert(N > 0,"pstring from array of length 0"); + // need std::exception since pexception depends on pstring if (string[N-1] != 0) throw std::exception(); m_str.assign(string, N - 1); } + // interpret other string as putf8strings + template <typename C, + class = std::enable_if_t<std::is_same<std::remove_const_t<C>, char>::value + && !std::is_same<std::remove_const_t<C>, mem_t>::value>> + pstring_t(C *string); explicit pstring_t(const string_type &string) : m_str(string) { } + pstring_t(iterator first, iterator last) + { + m_str.assign(first.p, last.p); + } + pstring_t(const pstring_t &string) = default; pstring_t(pstring_t &&string) noexcept = default; pstring_t &operator=(const pstring_t &string) = default; @@ -127,12 +145,12 @@ public: explicit pstring_t(size_type n, code_t code) { - while (n--) + while (n-- != 0) *this += code; } template <typename T, - class = typename std::enable_if<!std::is_same<T, pstring_t::traits_type>::value>::type> + class = std::enable_if_t<!std::is_same<T, pstring_t::traits_type>::value>> explicit pstring_t(const pstring_t<T> &string) { m_str.clear(); @@ -142,9 +160,8 @@ public: operator string_type () const { return m_str; } - template <typename T, - class = typename std::enable_if<!std::is_same<T, pstring_t::traits_type>::value>::type> + class = std::enable_if_t<!std::is_same<T, pstring_t::traits_type>::value>> pstring_t &operator=(const pstring_t<T> &string) { m_str.clear(); @@ -153,66 +170,72 @@ public: return *this; } - // no non-const const_iterator for now - using iterator = pstring_const_iterator<pstring_t<F> >; - using const_iterator = pstring_const_iterator<pstring_t<F> >; - - iterator begin() { return iterator(m_str.begin()); } - iterator end() { return iterator(m_str.end()); } - const_iterator begin() const { return const_iterator(m_str.begin()); } - const_iterator end() const { return const_iterator(m_str.end()); } - const_iterator cbegin() const { return const_iterator(m_str.begin()); } - const_iterator cend() const { return const_iterator(m_str.end()); } + iterator begin() noexcept { return iterator(m_str.begin()); } + iterator end() noexcept { return iterator(m_str.end()); } + const_iterator begin() const noexcept { return const_iterator(m_str.begin()); } + const_iterator end() const noexcept { return const_iterator(m_str.end()); } + const_iterator cbegin() const noexcept { return const_iterator(m_str.begin()); } + const_iterator cend() const noexcept { return const_iterator(m_str.end()); } // C string conversion helpers - const mem_t *c_str() const { return static_cast<const mem_t *>(m_str.c_str()); } - const mem_t *data() const { return c_str(); } + const mem_t *c_str() const noexcept { return static_cast<const mem_t *>(m_str.c_str()); } + const mem_t *data() const noexcept { return c_str(); } + + /// \brief return number of codes in the string + /// + /// This may report a number less than what \ref size reports. pstrings + /// operate on character codes. In the case of utf pstrings thus the physical size + /// may be bigger than the logical size. + size_type length() const noexcept { return traits_type::len(m_str); } - size_type length() const { return traits_type::len(m_str); } - size_type size() const { return traits_type::len(m_str); } - bool empty() const { return m_str.size() == 0; } + /// \brief return number of memory units in the string + /// + /// This function returns the number of memory units used by a string. + /// Depending on the string type the size may be reported as bytes, words + /// or quad-words. + size_type size() const noexcept { return m_str.size(); } - pstring_t substr(size_type start, size_type nlen = npos) const; - int compare(const pstring_t &right) const; + bool empty() const noexcept { return m_str.empty(); } + void clear() noexcept { m_str.clear(); } - size_type find(const pstring_t &search, size_type start = 0) const; - size_type find(code_t search, size_type start = 0) const; + pstring_t substr(size_type start, size_type nlen) const; + pstring_t substr(size_type start) const; + int compare(const pstring_t &right) const noexcept; - size_type find_first_not_of(const pstring_t &no) const; - size_type find_last_not_of(const pstring_t &no) const; + size_type find(const pstring_t &search, size_type start = 0) const noexcept; + size_type find(code_t search, size_type start = 0) const noexcept; // concatenation operators pstring_t& operator+=(const pstring_t &string) { m_str.append(string.m_str); return *this; } pstring_t& operator+=(const code_t c) { traits_type::encode(c, m_str); return *this; } friend pstring_t operator+(const pstring_t &lhs, const pstring_t &rhs) { return pstring_t(lhs) += rhs; } - friend pstring_t operator+(const pstring_t &lhs, const code_t rhs) { return pstring_t(lhs) += rhs; } - friend pstring_t operator+(const code_t lhs, const pstring_t &rhs) { return pstring_t(1, lhs) += rhs; } + friend pstring_t operator+(const pstring_t &lhs, code_t rhs) { return pstring_t(lhs) += rhs; } + friend pstring_t operator+(code_t lhs, const pstring_t &rhs) { return pstring_t(1, lhs) += rhs; } // comparison operators - bool operator==(const pstring_t &string) const { return (compare(string) == 0); } - bool operator!=(const pstring_t &string) const { return (compare(string) != 0); } + bool operator==(const pstring_t &string) const noexcept { return m_str == string.m_str; } + bool operator!=(const pstring_t &string) const noexcept { return m_str != string.m_str; } - bool operator<(const pstring_t &string) const { return (compare(string) < 0); } - bool operator<=(const pstring_t &string) const { return (compare(string) <= 0); } - bool operator>(const pstring_t &string) const { return (compare(string) > 0); } - bool operator>=(const pstring_t &string) const { return (compare(string) >= 0); } + bool operator<(const pstring_t &string) const noexcept { return (compare(string) < 0); } + bool operator<=(const pstring_t &string) const noexcept { return (compare(string) <= 0); } + bool operator>(const pstring_t &string) const noexcept { return (compare(string) > 0); } + bool operator>=(const pstring_t &string) const noexcept { return (compare(string) >= 0); } - friend std::ostream& operator<<(std::ostream &ostrm, const pstring_t &str) + friend auto operator<<(std::basic_ostream<typename string_type::value_type> &ostrm, const pstring_t &str) -> std::basic_ostream<typename string_type::value_type> & { ostrm << str.m_str; return ostrm; } - const_reference at(const size_type pos) const { return *reinterpret_cast<const ref_value_type *>(F::nthcode(m_str.c_str(),pos)); } + const_reference at(const size_type pos) const { return *reinterpret_cast<const ref_value_type *>(F::nthcode(m_str.c_str(),pos)); } // NOLINT(cppcoreguidelines-pro-type-reinterpret static constexpr const size_type npos = static_cast<size_type>(-1); - /* the following are extensions to <string> */ - + // the following are extensions to <string> // FIXME: remove those - size_type mem_t_size() const { return m_str.size(); } - + size_type mem_t_size() const noexcept { return m_str.size(); } private: + string_type m_str; }; @@ -221,112 +244,111 @@ struct pu8_traits using mem_t = char; using code_t = char; using string_type = std::string; - static std::size_t len(const string_type &p) { return p.size(); } - static std::size_t codelen(const mem_t *p) { plib::unused_var(p); return 1; } - static std::size_t codelen(const code_t c) { plib::unused_var(c); return 1; } - static code_t code(const mem_t *p) { return *p; } + static std::size_t len(const string_type &p) noexcept { return p.size(); } + static std::size_t codelen(const mem_t *p) noexcept { plib::unused_var(p); return 1; } + static std::size_t codelen(code_t c) noexcept { plib::unused_var(c); return 1; } + static code_t code(const mem_t *p) noexcept { return *p; } static void encode(const code_t c, string_type &s) { s += static_cast<mem_t>(c); } - static const mem_t *nthcode(const mem_t *p, const std::size_t n) { return &(p[n]); } + static const mem_t *nthcode(const mem_t *p, std::size_t n) noexcept { return &(p[n]); } }; -/* No checking, this may deliver invalid codes */ -struct putf8_traits +// No checking, this may deliver invalid codes + + +template <std::size_t N, typename CT> +struct putf_traits { - using mem_t = char; +}; + +template<typename CT> +struct putf_traits<1, CT> +{ + using mem_t = CT; using code_t = char32_t; - using string_type = std::string; - static std::size_t len(const string_type &p) + using string_type = std::basic_string<CT>; + static std::size_t len(const string_type &p) noexcept { std::size_t ret = 0; for (const auto &c : p) { - if (!((c & 0xC0) == 0x80)) - ret++; + ret += (!((c & 0xC0) == 0x80)); // NOLINT } return ret; } - static std::size_t codelen(const mem_t *p) + + static constexpr std::size_t codelen(const mem_t *p) noexcept { - const auto p1 = reinterpret_cast<const unsigned char *>(p); - if ((*p1 & 0x80) == 0x00) - return 1; - else if ((*p1 & 0xE0) == 0xC0) - return 2; - else if ((*p1 & 0xF0) == 0xE0) - return 3; - else if ((*p1 & 0xF8) == 0xF0) - return 4; - else - { - return 1; // not correct - } + const auto *p1 = reinterpret_cast<const unsigned char *>(p); // NOLINT(cppcoreguidelines-pro-type-reinterpret + return ((*p1 & 0x80) == 0x00) ? 1 : // NOLINT + ((*p1 & 0xE0) == 0xC0) ? 2 : // NOLINT + ((*p1 & 0xF0) == 0xE0) ? 3 : // NOLINT + ((*p1 & 0xF8) == 0xF0) ? 4 : // NOLINT + 1; // Invalid UTF8 code - ignore } - static std::size_t codelen(const code_t c) + + static constexpr std::size_t codelen(code_t c) noexcept { - if (c < 0x0080) - return 1; - else if (c < 0x800) - return 2; - else if (c < 0x10000) - return 3; - else /* U+10000 U+1FFFFF */ - return 4; /* no checks */ + return (c < 0x00080) ? 1 : // NOLINT + (c < 0x00800) ? 2 : // NOLINT + (c < 0x10000) ? 3 : // NOLINT + 4; // U+10000 U+1FFFFF } - static code_t code(const mem_t *p) + + static constexpr code_t code(const mem_t *p) noexcept { - const auto p1 = reinterpret_cast<const unsigned char *>(p); - if ((*p1 & 0x80) == 0x00) - return *p1; - else if ((*p1 & 0xE0) == 0xC0) - return static_cast<code_t>(((p1[0] & 0x3f) << 6) | (p1[1] & 0x3f)); - else if ((*p1 & 0xF0) == 0xE0) - return static_cast<code_t>(((p1[0] & 0x1f) << 12) | ((p1[1] & 0x3f) << 6) | ((p1[2] & 0x3f) << 0)); - else if ((*p1 & 0xF8) == 0xF0) - return static_cast<code_t>(((p1[0] & 0x0f) << 18) | ((p1[1] & 0x3f) << 12) | ((p1[2] & 0x3f) << 6) | ((p1[3] & 0x3f) << 0)); - else - return *p1; // not correct + const auto *p1 = reinterpret_cast<const unsigned char *>(p); // NOLINT(cppcoreguidelines-pro-type-reinterpret-cast) + return ((*p1 & 0x80) == 0x00) ? *p1 : // NOLINT + ((*p1 & 0xE0) == 0xC0) ? static_cast<code_t>(((p1[0] & 0x3f) << 6) | (p1[1] & 0x3f)) : // NOLINT + ((*p1 & 0xF0) == 0xE0) ? static_cast<code_t>(((p1[0] & 0x1f) << 12) | ((p1[1] & 0x3f) << 6) | ((p1[2] & 0x3f) << 0)) : // NOLINT + ((*p1 & 0xF8) == 0xF0) ? static_cast<code_t>(((p1[0] & 0x0f) << 18) | ((p1[1] & 0x3f) << 12) | ((p1[2] & 0x3f) << 6) | ((p1[3] & 0x3f) << 0)) : // NOLINT + 0xFFFD; // NOLINT: unicode-replacement character } + static void encode(const code_t c, string_type &s) { - if (c < 0x0080) + if (c < 0x0080) // NOLINT { s += static_cast<mem_t>(c); } - else if (c < 0x800) + else if (c < 0x800) // NOLINT { - s += static_cast<mem_t>(0xC0 | (c >> 6)); - s += static_cast<mem_t>(0x80 | (c & 0x3f)); + s += static_cast<mem_t>(0xC0 | (c >> 6)); // NOLINT + s += static_cast<mem_t>(0x80 | (c & 0x3f)); // NOLINT } - else if (c < 0x10000) + else if (c < 0x10000) // NOLINT { - s += static_cast<mem_t>(0xE0 | (c >> 12)); - s += static_cast<mem_t>(0x80 | ((c>>6) & 0x3f)); - s += static_cast<mem_t>(0x80 | (c & 0x3f)); + s += static_cast<mem_t>(0xE0 | (c >> 12)); // NOLINT + s += static_cast<mem_t>(0x80 | ((c>>6) & 0x3f)); // NOLINT + s += static_cast<mem_t>(0x80 | (c & 0x3f)); // NOLINT } - else /* U+10000 U+1FFFFF */ + else // U+10000 U+1FFFFF { - s += static_cast<mem_t>(0xF0 | (c >> 18)); - s += static_cast<mem_t>(0x80 | ((c>>12) & 0x3f)); - s += static_cast<mem_t>(0x80 | ((c>>6) & 0x3f)); - s += static_cast<mem_t>(0x80 | (c & 0x3f)); + s += static_cast<mem_t>(0xF0 | (c >> 18)); // NOLINT + s += static_cast<mem_t>(0x80 | ((c>>12) & 0x3f)); // NOLINT + s += static_cast<mem_t>(0x80 | ((c>>6) & 0x3f)); // NOLINT + s += static_cast<mem_t>(0x80 | (c & 0x3f)); // NOLINT } } - static const mem_t *nthcode(const mem_t *p, const std::size_t n) + + static const mem_t *nthcode(const mem_t *p, std::size_t n) noexcept { const mem_t *p1 = p; std::size_t i = n; while (i-- > 0) + { p1 += codelen(p1); + } return p1; } }; -struct putf16_traits +template<typename CT> +struct putf_traits<2, CT> { - using mem_t = char16_t; + using mem_t = CT; using code_t = char32_t; - using string_type = std::u16string; - static std::size_t len(const string_type &p) + using string_type = std::basic_string<CT>; + static std::size_t len(const string_type &p) noexcept { std::size_t ret = 0; auto i = p.begin(); @@ -334,40 +356,39 @@ struct putf16_traits { // FIXME: check that size is equal auto c = static_cast<uint16_t>(*i++); - if (!((c & 0xd800) == 0xd800)) + if (!((c & 0xd800) == 0xd800)) // NOLINT + { ret++; + } } return ret; } - static std::size_t codelen(const mem_t *p) + static std::size_t codelen(const mem_t *p) noexcept { auto c = static_cast<uint16_t>(*p); - return ((c & 0xd800) == 0xd800) ? 2 : 1; + return ((c & 0xd800) == 0xd800) ? 2 : 1; // NOLINT } - static std::size_t codelen(const code_t c) + static std::size_t codelen(code_t c) noexcept { - if (c < 0x10000) - return 1; - else /* U+10000 U+1FFFFF */ - return 2; + return (c < 0x10000) ? 1 : 2; // NOLINT: U+10000 U+1FFFFF } - static code_t code(const mem_t *p) + static code_t code(const mem_t *p) noexcept { auto c = static_cast<uint32_t>(*p++); - if ((c & 0xd800) == 0xd800) + if ((c & 0xd800) == 0xd800) // NOLINT { - c = (c - 0xd800) << 10; - c += static_cast<uint32_t>(*p) - 0xdc00 + 0x10000; + c = (c - 0xd800) << 10; // NOLINT + c += static_cast<uint32_t>(*p) - 0xdc00 + 0x10000; // NOLINT } return static_cast<code_t>(c); } - static void encode(code_t c, string_type &s) + static void encode(code_t c, string_type &s) noexcept { auto cu = static_cast<uint32_t>(c); - if (c > 0xffff) + if (c > 0xffff) // NOLINT { //make a surrogate pair - uint32_t t = ((cu - 0x10000) >> 10) + 0xd800; - cu = (cu & 0x3ff) + 0xdc00; + uint32_t t = ((cu - 0x10000) >> 10) + 0xd800; // NOLINT + cu = (cu & 0x3ff) + 0xdc00; // NOLINT s += static_cast<mem_t>(t); s += static_cast<mem_t>(cu); } @@ -376,327 +397,131 @@ struct putf16_traits s += static_cast<mem_t>(cu); } } - static const mem_t *nthcode(const mem_t *p, const std::size_t n) + static const mem_t *nthcode(const mem_t *p, std::size_t n) noexcept { std::size_t i = n; while (i-- > 0) + { p += codelen(p); + } return p; } }; -struct pwchar_traits +template<typename CT> +struct putf_traits<4, CT> { - using mem_t = wchar_t; + using mem_t = CT; using code_t = char32_t; - using string_type = std::wstring; - static std::size_t len(const string_type &p) + using string_type = std::basic_string<CT>; + static std::size_t len(const string_type &p) noexcept { - if (sizeof(wchar_t) == 2) - { - std::size_t ret = 0; - auto i = p.begin(); - while (i != p.end()) - { - // FIXME: check that size is equal - auto c = static_cast<uint32_t>(*i++); - if (!((c & 0xd800) == 0xd800)) - ret++; - } - return ret; - } - else - return p.size(); + return p.size(); } - static std::size_t codelen(const mem_t *p) + static std::size_t codelen(const mem_t *p) noexcept { - if (sizeof(wchar_t) == 2) - { - auto c = static_cast<uint16_t>(*p); - return ((c & 0xd800) == 0xd800) ? 2 : 1; - } - else - return 1; + plib::unused_var(p); + return 1; } - static std::size_t codelen(const code_t c) + static std::size_t codelen(code_t c) noexcept { - if (sizeof(wchar_t) == 2) - return ((c & 0xd800) == 0xd800) ? 2 : 1; - else - return 1; + plib::unused_var(c); + return 1; } static code_t code(const mem_t *p) { - if (sizeof(wchar_t) == 2) - { - auto c = static_cast<uint32_t>(*p++); - if ((c & 0xd800) == 0xd800) - { - c = (c - 0xd800) << 10; - c += static_cast<uint32_t>(*p) - 0xdc00 + 0x10000; - } - return static_cast<code_t>(c); - } - else - return static_cast<code_t>(*p); + return static_cast<code_t>(*p); } static void encode(code_t c, string_type &s) { - if (sizeof(wchar_t) == 2) - { - auto cu = static_cast<uint32_t>(c); - if (c > 0xffff) - { //make a surrogate pair - uint32_t t = ((cu - 0x10000) >> 10) + 0xd800; - cu = (cu & 0x3ff) + 0xdc00; - s += static_cast<mem_t>(t); - s += static_cast<mem_t>(cu); - } - else - s += static_cast<mem_t>(cu); - } - else - s += static_cast<wchar_t>(c); + s += static_cast<mem_t>(c); } - static const mem_t *nthcode(const mem_t *p, const std::size_t n) + static const mem_t *nthcode(const mem_t *p, std::size_t n) noexcept { - if (sizeof(wchar_t) == 2) - { - std::size_t i = n; - while (i-- > 0) - p += codelen(p); - return p; - } - else - return p + n; + return p + n; } }; +using putf8_traits = putf_traits<sizeof(char), char>; +using putf16_traits = putf_traits<sizeof(char16_t), char16_t>; +using putf32_traits = putf_traits<sizeof(char32_t), char32_t>; +using pwchar_traits = putf_traits<sizeof(wchar_t), wchar_t>; + extern template struct pstring_t<pu8_traits>; extern template struct pstring_t<putf8_traits>; extern template struct pstring_t<putf16_traits>; +extern template struct pstring_t<putf32_traits>; extern template struct pstring_t<pwchar_traits>; #if (PSTRING_USE_STD_STRING) using pstring = std::string; -static inline pstring::size_type pstring_mem_t_size(const pstring &s) { return s.size(); } #else using pstring = pstring_t<putf8_traits>; -template <typename T> -static inline pstring::size_type pstring_mem_t_size(const pstring_t<T> &s) { return s.mem_t_size(); } #endif +using pu8string = pstring_t<pu8_traits>; using putf8string = pstring_t<putf8_traits>; -using pu16string = pstring_t<putf16_traits>; +using putf16string = pstring_t<putf16_traits>; +using putf32string = pstring_t<putf32_traits>; using pwstring = pstring_t<pwchar_traits>; +// interpret other string as putf8strings +template <typename F> +template <typename C, class> +pstring_t<F>::pstring_t(C *string) +{ + m_str.clear(); + putf8string utf8(string); + for (const auto &c : utf8) + *this += c; +} + namespace plib { template<class T> struct string_info { - using mem_t = typename T::mem_t; }; - template<> - struct string_info<std::string> - { - using mem_t = char; - }; - - template<typename T> - pstring to_string(const T &v) - { - return pstring(std::to_string(v)); - } - template<typename T> - pwstring to_wstring(const T &v) + struct string_info<pstring_t<T>> { - return pwstring(std::to_wstring(v)); - } - - - template<typename T> - typename T::size_type find_first_not_of(const T &str, const T &no) - { - typename T::size_type pos = 0; - for (auto it = str.begin(); it != str.end(); ++it, ++pos) - { - bool f = true; - for (typename T::value_type const jt : no) - { - if (*it == jt) - { - f = false; - break; - } - } - if (f) - return pos; - } - return T::npos; - } - - template<typename T> - typename T::size_type find_last_not_of(const T &str, const T &no) - { - /* FIXME: reverse iterator */ - typename T::size_type last_found = T::npos; - typename T::size_type pos = 0; - for (auto it = str.begin(); it != str.end(); ++it, ++pos) - { - bool f = true; - for (typename T::value_type const jt : no) - { - if (*it == jt) - { - f = false; - break; - } - } - if (f) - last_found = pos; - } - return last_found; - } - - template<typename T> - T ltrim(const T &str, const T &ws = T(" \t\n\r")) - { - auto f = find_first_not_of(str, ws); - return (f == T::npos) ? T() : str.substr(f); - } - - template<typename T> - T rtrim(const T &str, const T &ws = T(" \t\n\r")) - { - auto f = find_last_not_of(str, ws); - return (f == T::npos) ? T() : str.substr(0, f + 1); - } - - template<typename T> - T trim(const T &str, const T &ws = T(" \t\n\r")) - { - return rtrim(ltrim(str, ws), ws); - } - - template<typename T> - T left(const T &str, typename T::size_type len) - { - return str.substr(0, len); - } - - template<typename T> - T right(const T &str, typename T::size_type nlen) - { - return nlen >= str.length() ? str : str.substr(str.length() - nlen, nlen); - } - - template<typename T> - bool startsWith(const T &str, const T &arg) - { - return (arg == left(str, arg.length())); - } - - template<typename T> - bool endsWith(const T &str, const T &arg) - { - return (right(str, arg.length()) == arg); - } - - template<typename T> - bool startsWith(const T &str, const char *arg) - { - return startsWith(str, static_cast<pstring>(arg)); - } - - template<typename T> - bool endsWith(const T &str, const char *arg) - { - return endsWith(str, static_cast<pstring>(arg)); - } - - template<typename T> - std::size_t strlen(const T *str) - { - const T *p = str; - while (*p) - p++; - return static_cast<std::size_t>(p - str); - } - - template<typename T> - T ucase(const T &str) - { - T ret; - for (const auto &c : str) - if (c >= 'a' && c <= 'z') - ret += (c - 'a' + 'A'); - else - ret += c; - return ret; - } - - template<typename T> - T rpad(const T &str, const T &ws, const typename T::size_type cnt) - { - // FIXME: pstringbuffer ret(*this); - - T ret(str); - typename T::size_type wsl = ws.length(); - for (auto i = ret.length(); i < cnt; i+=wsl) - ret += ws; - return ret; - } + using mem_t = typename T::mem_t; +#if 0 + static std::size_t mem_size(const pstring_t<T> &s) { return s.mem_t_size(); } +#endif + }; template<typename T> - T replace_all(const T &str, const T &search, const T &replace) - { - T ret; - const typename T::size_type slen = search.length(); - - typename T::size_type last_s = 0; - typename T::size_type s = str.find(search, last_s); - while (s != T::npos) - { - ret += str.substr(last_s, s - last_s); - ret += replace; - last_s = s + slen; - s = str.find(search, last_s); - } - ret += str.substr(last_s); - return ret; - } - - template<typename T, typename T1, typename T2> - T replace_all(const T &str, const T1 &search, const T2 &replace) + struct string_info<std::basic_string<T>> { - return replace_all(str, static_cast<T>(search), static_cast<T>(replace)); - } - + using mem_t = T; +#if 0 + static std::size_t mem_size(const std::basic_string<T> &s) { return s.size(); } +#endif + }; } // namespace plib // custom specialization of std::hash can be injected in namespace std namespace std { - - template<typename T> struct hash<pstring_t<T>> + template<typename T> + struct hash<pstring_t<T>> { using argument_type = pstring_t<T>; using result_type = std::size_t; result_type operator()(const argument_type & s) const { const typename argument_type::mem_t *string = s.c_str(); - result_type result = 5381; + result_type result = 5381; // NOLINT for (typename argument_type::mem_t c = *string; c != 0; c = *string++) - result = ((result << 5) + result ) ^ (result >> (32 - 5)) ^ static_cast<result_type>(c); + result = ((result << 5) + result ) ^ (result >> (32 - 5)) ^ static_cast<result_type>(c); // NOLINT return result; } }; } // namespace std -#endif /* PSTRING_H_ */ +#endif // PSTRING_H_ diff --git a/src/lib/netlist/plib/pstrutil.h b/src/lib/netlist/plib/pstrutil.h new file mode 100644 index 00000000000..e88469a438c --- /dev/null +++ b/src/lib/netlist/plib/pstrutil.h @@ -0,0 +1,358 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PSTRUTIL_H_ +#define PSTRUTIL_H_ + +/// +/// \file pstrutil.h +/// + +#include "pgsl.h" +#include "pstring.h" +#include "ptypes.h" + +#include <algorithm> +#include <exception> +#include <iterator> +#include <limits> +#include <stdexcept> +#include <string> +#include <type_traits> +#include <vector> + +namespace plib +{ + template<typename T> + pstring to_string(const T &v) + { + return pstring(putf8string(std::to_string(v))); + } + + template<typename T> + pwstring to_wstring(const T &v) + { + return pwstring(std::to_wstring(v)); + } + + template<typename T> + typename T::size_type find_first_not_of(const T &str, const T &no) + { + typename T::size_type pos = 0; + for (auto it = str.begin(); it != str.end(); ++it, ++pos) + { + bool f = true; + for (typename T::value_type const jt : no) + { + if (*it == jt) + { + f = false; + break; + } + } + if (f) + return pos; + } + return T::npos; + } + + template<typename T> + typename T::size_type find_last_not_of(const T &str, const T &no) + { + // FIXME: use reverse iterator + typename T::size_type last_found = T::npos; + typename T::size_type pos = 0; + for (auto it = str.begin(); it != str.end(); ++it, ++pos) + { + bool f = true; + for (typename T::value_type const jt : no) + { + if (*it == jt) + { + f = false; + break; + } + } + if (f) + last_found = pos; + } + return last_found; + } + + template<typename T> + typename T::size_type find_last_of(const T &str, const T &no) + { + typename T::size_type last_found = T::npos; + typename T::size_type pos = 0; + for (auto it = str.begin(); it != str.end(); ++it, ++pos) + { + bool f = false; + for (typename T::value_type const jt : no) + { + if (*it == jt) + { + f = true; + break; + } + } + if (f) + last_found = pos; + } + return last_found; + } + + template<typename T> + T ltrim(const T &str, const T &ws = T(" \t\n\r")) + { + auto f = find_first_not_of(str, ws); + return (f == T::npos) ? T() : str.substr(f); + } + + template<typename T> + T rtrim(const T &str, const T &ws = T(" \t\n\r")) + { + auto f = find_last_not_of(str, ws); + return (f == T::npos) ? T() : str.substr(0, f + 1); + } + + template<typename T> + T trim(const T &str, const T &ws = T(" \t\n\r")) + { + return rtrim(ltrim(str, ws), ws); + } + + template<typename T> + T left(const T &str, typename T::size_type len) + { + return str.substr(0, len); + } + + template<typename T> + T right(const T &str, typename T::size_type nlen) + { + return nlen >= str.length() ? str : str.substr(str.length() - nlen, nlen); + } + + template<typename T> + bool startsWith(const T &str, const T &arg) + { + return (arg == left(str, arg.length())); + } + + template<typename T> + bool endsWith(const T &str, const T &arg) + { + return (right(str, arg.length()) == arg); + } + + template<typename T, typename TA> + bool startsWith(const T &str, const TA &arg) + { + return startsWith(str, static_cast<T>(arg)); + } + + template<typename T, typename TA> + bool endsWith(const T &str, const TA &arg) + { + return endsWith(str, static_cast<T>(arg)); + } + + template<typename T> + std::size_t strlen(const T *str) + { + const T *p = str; + while (*p != 0) + p++; + return narrow_cast<std::size_t>(p - str); + } + + template<typename T> + T ucase(const T &str) + { + T ret; + for (const auto &c : str) + if (c >= 'a' && c <= 'z') + ret += (c - 'a' + 'A'); + else + ret += c; + return ret; + } + + template<typename T> + T lcase(const T &str) + { + T ret; + for (const auto &c : str) + if (c >= 'A' && c <= 'Z') + ret += (c - 'A' + 'a'); + else + ret += c; + return ret; + } + + template<typename T> + T rpad(const T &str, const T &ws, const typename T::size_type cnt) + { + // FIXME: pstringbuffer ret(*this); + + T ret(str); + typename T::size_type wsl = ws.length(); + for (auto i = ret.length(); i < cnt; i+=wsl) + ret += ws; + return ret; + } + + template<typename T> + T replace_all(const T &str, typename T::value_type search, typename T::value_type replace) + { + T ret; + for (auto &c : str) + ret += (c == search) ? replace : c; + return ret; + } + + template<typename T> + T replace_all(const T &str, const T &search, const T &replace) + { + T ret; + const typename T::size_type slen = search.length(); + + typename T::size_type last_s = 0; + typename T::size_type s = str.find(search, last_s); + while (s != T::npos) + { + ret += str.substr(last_s, s - last_s); + ret += replace; + last_s = s + slen; + s = str.find(search, last_s); + } + ret += str.substr(last_s); + return ret; + } + + template<typename T, typename T1, typename T2> + std::enable_if_t<!std::is_integral<T1>::value, T> + replace_all(const T &str, const T1 &search, const T2 &replace) + { + return replace_all(str, static_cast<T>(search), static_cast<T>(replace)); + } + + template <typename T> + std::vector<T> psplit(const T &str, const T &onstr, bool ignore_empty = false) + { + std::vector<T> ret; + + auto p = str.begin(); + auto pn = std::search(p, str.end(), onstr.begin(), onstr.end()); + const auto ol = static_cast<typename T::difference_type>(onstr.length()); + + while (pn != str.end()) + { + if (!ignore_empty || p != pn) + ret.emplace_back(p, pn); + p = std::next(pn, ol); + pn = std::search(p, str.end(), onstr.begin(), onstr.end()); + } + if (p != str.end()) + { + ret.emplace_back(p, str.end()); + } + return ret; + } + + template <typename T> + std::vector<T> psplit(const T &str, const typename T::value_type &onstr, bool ignore_empty = false) + { + std::vector<T> ret; + + auto p = str.begin(); + auto pn = std::find(p, str.end(), onstr); + + while (pn != str.end()) + { + if (!ignore_empty || p != pn) + ret.emplace_back(p, pn); + p = std::next(pn, 1); + pn = std::find(p, str.end(), onstr); + } + if (p != str.end()) + { + ret.emplace_back(p, str.end()); + } + return ret; + } + + template <typename T> + std::vector<T> psplit_r(const T &stri, + const T &token, + const std::size_t max_split) + { + T str(stri); + std::vector<T> result; + std::size_t splits = 0; + + while(!str.empty()) + { + std::size_t index = str.rfind(token); + bool found = index!=T::npos; + if (found) + splits++; + if ((splits <= max_split || max_split == 0) && found) + { + result.push_back(str.substr(index+token.size())); + str = str.substr(0, index); + if (str.empty()) + result.push_back(str); + } + else + { + result.push_back(str); + str.clear(); + } + } + return result; + } + + template <typename T> + std::vector<T> psplit(const T &str, const std::vector<T> &onstrl) + { + T col = ""; + std::vector<T> ret; + + auto i = str.begin(); + while (i != str.end()) + { + auto p = T::npos; + for (std::size_t j=0; j < onstrl.size(); j++) + { + if (std::equal(onstrl[j].begin(), onstrl[j].end(), i)) + { + p = j; + break; + } + } + if (p != T::npos) + { + if (!col.empty()) + ret.push_back(col); + + col.clear(); + ret.push_back(onstrl[p]); + i = std::next(i, narrow_cast<typename T::difference_type>(onstrl[p].length())); + } + else + { + typename T::value_type c = *i; + col += c; + i++; + } + } + if (!col.empty()) + ret.push_back(col); + + return ret; + } + +} // namespace plib + +#endif // PSTRUTIL_H_ diff --git a/src/lib/netlist/plib/ptests.h b/src/lib/netlist/plib/ptests.h new file mode 100644 index 00000000000..4e65de7f978 --- /dev/null +++ b/src/lib/netlist/plib/ptests.h @@ -0,0 +1,313 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PTESTS_H_ +#define PTESTS_H_ + +/// +/// \file ptests.h +/// +/// google tests compatible (hopefully) test macros. This is work in progress! +/// + +#include <algorithm> +#include <exception> +#include <functional> +#include <iostream> +#include <sstream> +#include <string> +#include <vector> + +#if defined(__clang__) +#pragma clang diagnostic ignored "-Wglobal-constructors" +#endif + +#define PEXPECT_EQ(exp1, exp2) PINT_EXPECT(eq, exp1, exp2) +#define PEXPECT_NE(exp1, exp2) PINT_EXPECT(ne, exp1, exp2) +#define PEXPECT_GT(exp1, exp2) PINT_EXPECT(gt, exp1, exp2) +#define PEXPECT_LT(exp1, exp2) PINT_EXPECT(lt, exp1, exp2) +#define PEXPECT_GE(exp1, exp2) PINT_EXPECT(ge, exp1, exp2) +#define PEXPECT_LE(exp1, exp2) PINT_EXPECT(le, exp1, exp2) + +#define PEXPECT_TRUE(exp1) PINT_EXPECT(eq, exp1, true) +#define PEXPECT_FALSE(exp1) PINT_EXPECT(eq, exp1, false) + +#define PEXPECT_THROW(exp, excep) PINT_EXPECT_THROW(exp, excep) +#define PEXPECT_NO_THROW(exp) PINT_EXPECT_NO_THROW(exp) + +#define PTEST(name, desc) PINT_TEST(name, desc) +#define PTEST_F(name, desc) PINT_TEST_F(name, desc, name) +#define PRUN_ALL_TESTS(loglevel) plib::testing::run_all_tests(loglevel) + +#define PINT_TEST(name, desc) PINT_TEST_F(name, desc, plib::testing::Test) + +#define PINT_TESTNAME(name, desc) name ## _ ## desc +#define PINT_LOCATION() ::plib::testing::test_location(__FILE__, __LINE__) +#define PINT_SET_LAST(loc) this->m_parameters->m_last_source = loc + +#define PINT_REGISTER(name, desc) \ + extern const plib::testing::reg_entry<PINT_TESTNAME(name, desc)> PINT_TESTNAME(name, desc ## _reg); \ + const plib::testing::reg_entry<PINT_TESTNAME(name, desc)> PINT_TESTNAME(name, desc ## _reg)(#name, #desc, PINT_LOCATION()); + +#define PINT_TEST_F(name, desc, base) \ + class PINT_TESTNAME(name, desc) : public base \ + { public:\ + void desc (); \ + void run() override { desc (); } \ + }; \ + PINT_REGISTER(name, desc) \ + void PINT_TESTNAME(name, desc) :: desc () + +#define PINT_EXPECT(comp, exp1, exp2) \ + if (true) \ + { \ + ::plib::testing::test_location source = PINT_LOCATION(); PINT_SET_LAST(source); \ + m_parameters->m_num_tests++; \ + if (!this->internal_assert(plib::testing::comp_ ## comp (), # exp1, # exp2, exp1, exp2)) \ + this->test_error(source) << "test failed" << std::endl; \ + } else do {} while (0) + +#define PINT_EXPECT_THROW(exp, excep) \ + if (true) \ + { \ + ::plib::testing::test_location source = PINT_LOCATION(); PINT_SET_LAST(source); \ + m_parameters->m_num_tests++; \ + try { exp; this->test_error(source) << "no " #excep " exception thrown" << std::endl;} \ + catch (excep &) { this->test_ok() << "got " #excep " for " # exp "" << std::endl;} \ + catch (std::exception &ptest_e) { this->test_error(source) << "unexpected exception thrown: " << ptest_e.what() << std::endl; } \ + catch (...) { this->test_error(source) << "unexpected exception thrown" << std::endl; } \ + } else do {} while (0) + +#define PINT_EXPECT_NO_THROW(exp) \ + if (true) \ + { \ + ::plib::testing::test_location source = PINT_LOCATION(); PINT_SET_LAST(source); \ + m_parameters->m_num_tests++; \ + try { exp; this->test_ok() << "got no exception for " # exp << std::endl;} \ + catch (std::exception &test_exception) { this->test_error(source) << "unexpected exception thrown: " << test_exception.what() << std::endl; } \ + catch (...) { this->test_error(source) << "unexpected exception thrown" << std::endl; } \ + } else do {} while (0) + +namespace plib::testing +{ + enum class loglevel + { + INFO, + WARNING, + ERROR + }; + + using test_location = std::pair<const char *, std::size_t>; + + struct test_parameters + { + loglevel m_loglevel = loglevel::INFO; + std::size_t m_num_errors = 0; + std::size_t m_num_tests = 0; + test_location m_last_source = {"", 0 }; + }; + + static std::ostream &stream_error(std::ostream &os, test_location loc) + { + return os << loc.first << ":" << loc.second << ":1: error: "; + } + + class Test + { + public: + Test() = default; + virtual ~Test() = default; + + Test(const Test &) = delete; + Test &operator=(const Test &) = delete; + Test(Test &&) = delete; + Test &operator=(Test &&) = delete; + + virtual void run() {} + virtual void SetUp() {} + virtual void TearDown() {} + + void set_parameters(test_parameters *params) + { + m_parameters = params; + } + protected: + std::ostream & test_ok() { return output(loglevel::INFO) << "\tOK: "; } + std::ostream & test_fail() { return output(loglevel::WARNING) << "\tFAIL: "; } + std::ostream & test_error(const test_location & loc) + { + return stream_error(output(loglevel::ERROR), loc); + } + + template <typename C, typename T1, typename T2> + bool internal_assert(C comp, + const char* exp1, const char* exp2, + const T1& val1, const T2& val2); + test_parameters *m_parameters = nullptr; + private: + std::ostream &output(loglevel ll) + { + if (ll == loglevel::ERROR) + m_parameters->m_num_errors++; + return (ll >= m_parameters->m_loglevel) ? std::cout : m_nulstream; + } + std::ostringstream m_nulstream; + }; + + template <typename C, typename T1, typename T2> + bool Test::internal_assert(C comp, + const char* exp1, const char* exp2, + const T1& val1, const T2& val2) + { + if (comp(val1, val2)) + { + test_ok() << exp1 << " " << C::opstr() << " " << exp2 << std::endl; + return true; + } + test_fail() << exp1 << " " << C::opstr() << " " << exp2 + << " <" << val1 << ">,<" << val2 << ">" << std::endl; + return false; + } + + struct reg_entry_base + { + using list_t = std::vector<reg_entry_base *>; + reg_entry_base(const char *n, const char *d, test_location l) + : name(n), desc(d), location(l) + { + try + { + registry().push_back(this); + } + catch (...) + { + std::terminate(); + } + } + + reg_entry_base(const reg_entry_base &) = delete; + reg_entry_base &operator=(const reg_entry_base &) = delete; + reg_entry_base(reg_entry_base &&) = delete; + reg_entry_base &operator=(reg_entry_base &&) = delete; + + virtual ~reg_entry_base() = default; + + virtual Test *create() const { return nullptr; } + + const char *name; + const char *desc; + test_location location; + public: + static list_t & registry() + { + static list_t prlist; + return prlist; + } + }; + + template <typename T> + struct reg_entry : public reg_entry_base + { + using reg_entry_base::reg_entry_base; + + Test *create() const override { return new T(); } // NOLINT + }; + + template <typename L> + std::pair<bool, std::string> catch_exception(L lambda) + { + try { + lambda(); + } + catch (std::exception &ptest_e) + { + return { true, ptest_e.what() }; + } + catch (...) + { + return { true, "" }; + } + return { false, "" }; + } + + static inline int run_all_tests(loglevel ll) + { + std::cout << "================================================" << std::endl; + std::cout << "Running " << reg_entry_base::registry().size() << " test groups" << std::endl; + std::cout << "================================================" << std::endl; + + auto &list = reg_entry_base::registry(); + + std::sort(list.begin(), list.end(), [](reg_entry_base *a, reg_entry_base *b) { + return (a->name < b->name); + }); + + std::size_t total_errors(0); + std::size_t total_tests(0); + + for (auto &e : list) + { + test_parameters params; + params.m_loglevel = ll; + params.m_last_source = e->location; + + std::cout << e->name << "::" << e->desc << ":" << std::endl; + Test *t = nullptr; + + std::pair<bool, std::string> r; + if ((r = catch_exception([&]{ + t = e->create(); + t->set_parameters(¶ms); + })).first) + { + stream_error(std::cout, e->location) << "unexpected exception thrown during instantiation" << (!r.second.empty() ? ": " + r.second : "") << std::endl; + total_errors++; + } + else if ((r = catch_exception([&]{ t->SetUp(); })).first) + { + stream_error(std::cout, e->location) << "unexpected exception thrown during Setup" << (!r.second.empty() ? ": " + r.second : "") << std::endl; + total_errors++; + } + else if ((r = catch_exception([&]{ t->run(); })).first) + { + stream_error(std::cout, params.m_last_source) << "unexpected exception thrown during run after this line" << (!r.second.empty() ? ": " + r.second : "") << std::endl; + total_errors++; + } + else if ((r = catch_exception([&]{ t->TearDown(); })).first) + { + stream_error(std::cout, e->location) << "unexpected exception thrown during Teardown" << (!r.second.empty() ? ": " + r.second : "") << std::endl; + total_errors++; + } + + total_errors += params.m_num_errors; + total_tests += params.m_num_tests; + if (t != nullptr) + delete t; + } + std::cout << "================================================" << std::endl; + std::cout << "Found " << total_errors << " errors in " << total_tests << " tests from " << reg_entry_base::registry().size() << " test groups" << std::endl; + std::cout << "================================================" << std::endl; + return (total_errors ? 1 : 0); + } + +#define DEF_COMP(name, op) \ + struct comp_ ## name \ + { \ + static const char * opstr() { return #op ; } \ + template <typename T1, typename T2> \ + bool operator()(const T1 &v1, const T2 &v2) { return v1 op v2; } \ + }; + + DEF_COMP(eq, ==) + DEF_COMP(ne, !=) + DEF_COMP(gt, >) + DEF_COMP(lt, <) + DEF_COMP(ge, >=) + DEF_COMP(le, <=) + +#undef DEF_COMP + +} // namespace plib::testing + + +#endif // PTESTS_H_ diff --git a/src/lib/netlist/plib/ptime.h b/src/lib/netlist/plib/ptime.h index 9668e0cf428..0881f337371 100644 --- a/src/lib/netlist/plib/ptime.h +++ b/src/lib/netlist/plib/ptime.h @@ -1,18 +1,19 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * ptime.h - */ #ifndef PTIME_H_ #define PTIME_H_ +/// +/// \file ptime.h +/// + +#include <type_traits> + #include "pconfig.h" +#include "pmath.h" // std::floor #include "ptypes.h" -#include <cmath> // std::floor -//#include <cstdint> - // ---------------------------------------------------------------------------------------- // netlist_time // ---------------------------------------------------------------------------------------- @@ -20,6 +21,12 @@ namespace plib { + template <typename T, typename U> + struct ptime_le + { + const static bool value = sizeof(T) <= sizeof(U); + }; + template <typename TYPE, TYPE RES> struct ptime final { @@ -28,6 +35,9 @@ namespace plib using internal_type = TYPE; using mult_type = TYPE; + template <typename altTYPE, altTYPE altRES> + friend struct ptime; + constexpr ptime() noexcept : m_time(0) {} ~ptime() noexcept = default; @@ -36,102 +46,184 @@ namespace plib constexpr ptime(ptime &&rhs) noexcept = default; constexpr explicit ptime(const internal_type &time) noexcept : m_time(time) {} constexpr explicit ptime(internal_type &&time) noexcept : m_time(time) {} - C14CONSTEXPR ptime &operator=(const ptime &rhs) noexcept = default; - C14CONSTEXPR ptime &operator=(ptime &&rhs) noexcept = default; + constexpr ptime &operator=(const ptime &rhs) noexcept = default; + constexpr ptime &operator=(ptime &&rhs) noexcept = default; constexpr explicit ptime(const double t) = delete; - //: m_time((internal_type) ( t * (double) resolution)) { } constexpr explicit ptime(const internal_type nom, const internal_type den) noexcept : m_time(nom * (RES / den)) { } - C14CONSTEXPR ptime &operator+=(const ptime rhs) noexcept { m_time += rhs.m_time; return *this; } - C14CONSTEXPR ptime &operator-=(const ptime rhs) noexcept { m_time -= rhs.m_time; return *this; } - C14CONSTEXPR ptime &operator*=(const mult_type factor) noexcept { m_time *= static_cast<internal_type>(factor); return *this; } + template <typename O, typename = std::enable_if_t<ptime_le<ptime<O, RES>, ptime>::value>> + constexpr ptime(const ptime<O, RES> &rhs) noexcept + : m_time(static_cast<TYPE>(rhs.m_time)) + { + } + + template <typename O, typename T = std::enable_if_t<!ptime_le<ptime<O, RES>, ptime>::value, int>> + constexpr explicit ptime(const ptime<O, RES> &rhs, [[maybe_unused]] T dummy = 0) noexcept + : m_time(static_cast<TYPE>(rhs.m_time)) + { + } - friend constexpr const ptime operator-(ptime lhs, const ptime rhs) noexcept + template <typename O> + constexpr ptime &operator+=(const ptime<O, RES> &rhs) noexcept + { + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + m_time += rhs.m_time; + return *this; + } + template <typename O> + constexpr ptime &operator-=(const ptime<O, RES> &rhs) noexcept { - return ptime(lhs.m_time - rhs.m_time); + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + m_time -= rhs.m_time; + return *this; } - friend constexpr const ptime operator+(ptime lhs, const ptime rhs) noexcept + template <typename M> + constexpr ptime &operator*=(const M &factor) noexcept { - return ptime(lhs.m_time + rhs.m_time); + static_assert(plib::is_integral<M>::value, "Factor must be an integral type"); + m_time *= factor; + return *this; } - friend constexpr const ptime operator*(ptime lhs, const mult_type &factor) noexcept + template <typename O> + constexpr ptime operator-(const ptime<O, RES> &rhs) const noexcept { - return ptime(lhs.m_time * factor); + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return ptime(m_time - rhs.m_time); } - friend constexpr mult_type operator/(const ptime lhs, const ptime rhs) noexcept + template <typename O> + constexpr ptime operator+(ptime<O, RES> rhs) const noexcept { - return static_cast<mult_type>(lhs.m_time / rhs.m_time); + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return ptime(m_time + rhs.m_time); } - friend constexpr bool operator<(const ptime lhs, const ptime rhs) noexcept + template <typename M> + constexpr ptime operator*(const M &factor) const noexcept { - return (lhs.m_time < rhs.m_time); + static_assert(plib::is_integral<M>::value, "Factor must be an integral type"); + return ptime(m_time * static_cast<mult_type>(factor)); } - friend constexpr bool operator>(const ptime lhs, const ptime rhs) noexcept + template <typename O> + constexpr mult_type operator/(const ptime<O, RES> &rhs) const noexcept { - return (rhs < lhs); + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return static_cast<mult_type>(m_time / rhs.m_time); } - friend constexpr bool operator<=(const ptime lhs, const ptime rhs) noexcept + template <typename T> + constexpr std::enable_if_t<std::is_integral<T>::value, ptime> + operator/(const T &rhs) const noexcept + { + return ptime(m_time / rhs); + } + + template <typename O> + friend constexpr bool operator<(const ptime &lhs, const ptime<O, RES> &rhs) noexcept + { + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return (lhs.m_time < rhs.as_raw()); + //return (lhs.m_time < rhs.m_time); + } + + template <typename O> + friend constexpr bool operator>(const ptime &lhs, const ptime<O, RES> &rhs) noexcept + { + static_assert(ptime_le<ptime<O, RES>, ptime>::value, "Invalid ptime type"); + return (lhs.m_time > rhs.as_raw()); + } + + template <typename O> + friend constexpr bool operator<=(const ptime &lhs, const ptime<O, RES> &rhs) noexcept { return !(lhs > rhs); } - friend constexpr bool operator>=(const ptime lhs, const ptime rhs) noexcept + template <typename O> + friend constexpr bool operator>=(const ptime &lhs, const ptime<O, RES> &rhs) noexcept { return !(lhs < rhs); } - friend constexpr bool operator==(const ptime lhs, const ptime rhs) noexcept + template <typename O> + friend constexpr bool operator==(const ptime &lhs, const ptime<O, RES> &rhs) noexcept { - return lhs.m_time == rhs.m_time; + return lhs.m_time == rhs.as_raw(); } - friend constexpr bool operator!=(const ptime lhs, const ptime rhs) noexcept + template <typename O> + friend constexpr bool operator!=(const ptime &lhs, const ptime<O, RES> &rhs) noexcept { return !(lhs == rhs); } constexpr internal_type as_raw() const noexcept { return m_time; } - constexpr double as_double() const noexcept + + template <typename FT, typename = std::enable_if<plib::is_floating_point<FT>::value, FT>> + constexpr FT + as_fp() const noexcept { - return static_cast<double>(m_time) * inv_res; + return static_cast<FT>(m_time) * inv_res<FT>(); } + constexpr double as_double() const noexcept { return as_fp<double>(); } + constexpr float as_float() const noexcept { return as_fp<float>(); } + constexpr long double as_long_double() const noexcept { return as_fp<long double>(); } + + + constexpr ptime shl(unsigned shift) const noexcept { return ptime(m_time << shift); } + constexpr ptime shr(unsigned shift) const noexcept { return ptime(m_time >> shift); } + // for save states .... - C14CONSTEXPR internal_type *get_internaltype_ptr() noexcept { return &m_time; } - static constexpr ptime from_nsec(const internal_type ns) noexcept { return ptime(ns, UINT64_C(1000000000)); } - static constexpr ptime from_usec(const internal_type us) noexcept { return ptime(us, UINT64_C( 1000000)); } - static constexpr ptime from_msec(const internal_type ms) noexcept { return ptime(ms, UINT64_C( 1000)); } - static constexpr ptime from_sec(const internal_type s) noexcept { return ptime(s, UINT64_C( 1)); } - static constexpr ptime from_hz(const internal_type hz) noexcept { return ptime(1 , hz); } - static constexpr ptime from_raw(const internal_type raw) noexcept { return ptime(raw); } - static constexpr ptime from_double(const double t) noexcept { return ptime(static_cast<internal_type>(std::floor(t * static_cast<double>(RES) + 0.5)), RES); } + template <typename ST> + void save_state(ST &&st) + { + st.save_item(m_time, "m_time"); + } + + static constexpr ptime from_nsec(internal_type ns) noexcept { return ptime(ns, UINT64_C(1000000000)); } + static constexpr ptime from_usec(internal_type us) noexcept { return ptime(us, UINT64_C( 1000000)); } + static constexpr ptime from_msec(internal_type ms) noexcept { return ptime(ms, UINT64_C( 1000)); } + static constexpr ptime from_sec(internal_type s) noexcept { return ptime(s, UINT64_C( 1)); } + static constexpr ptime from_hz(internal_type hz) noexcept { return ptime(1 , hz); } + static constexpr ptime from_raw(internal_type raw) noexcept { return ptime(raw); } + + template <typename FT> + static constexpr std::enable_if_t<plib::is_floating_point<FT>::value, ptime> + from_fp(FT t) noexcept { return ptime(static_cast<internal_type>(plib::floor(t * static_cast<FT>(RES) + static_cast<FT>(0.5))), RES); } + + static constexpr ptime from_double(double t) noexcept + { return from_fp<double>(t); } + + static constexpr ptime from_float(float t) noexcept + { return from_fp<float>(t); } + + static constexpr ptime from_long_double(long double t) noexcept + { return from_fp<long double>(t); } static constexpr ptime zero() noexcept { return ptime(0, RES); } static constexpr ptime quantum() noexcept { return ptime(1, RES); } static constexpr ptime never() noexcept { return ptime(plib::numeric_limits<internal_type>::max(), RES); } static constexpr internal_type resolution() noexcept { return RES; } - constexpr internal_type in_nsec() const noexcept { return m_time / (RES / UINT64_C(1000000000)); } - constexpr internal_type in_usec() const noexcept { return m_time / (RES / UINT64_C( 1000000)); } - constexpr internal_type in_msec() const noexcept { return m_time / (RES / UINT64_C( 1000)); } - constexpr internal_type in_sec() const noexcept { return m_time / (RES / UINT64_C( 1)); } + constexpr internal_type in_nsec() const noexcept { return m_time / (RES / INT64_C(1000000000)); } + constexpr internal_type in_usec() const noexcept { return m_time / (RES / INT64_C( 1000000)); } + constexpr internal_type in_msec() const noexcept { return m_time / (RES / INT64_C( 1000)); } + constexpr internal_type in_sec() const noexcept { return m_time / (RES / INT64_C( 1)); } private: - static constexpr const double inv_res = 1.0 / static_cast<double>(RES); + template <typename FT> + static constexpr FT inv_res() noexcept { return static_cast<FT>(1.0) / static_cast<FT>(RES); } internal_type m_time; }; - } // namespace plib -#endif /* PTIME_H_ */ +#endif // PTIME_H_ diff --git a/src/lib/netlist/plib/ptimed_queue.h b/src/lib/netlist/plib/ptimed_queue.h new file mode 100644 index 00000000000..495a8c89a89 --- /dev/null +++ b/src/lib/netlist/plib/ptimed_queue.h @@ -0,0 +1,357 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PTIMED_QUEUE_H_ +#define PTIMED_QUEUE_H_ + +/// +/// \file ptimed_queue.h +/// + +#include "palloc.h" // FIXME: for aligned_vector +#include "pchrono.h" +#include "pmulti_threading.h" +#include "ptypes.h" + +#include <algorithm> +#include <mutex> +#include <type_traits> +#include <utility> +#include <vector> + +namespace plib { + + // ---------------------------------------------------------------------------------------- + // timed queue + // ---------------------------------------------------------------------------------------- + + template <typename Time, typename Element> + struct queue_entry_t final + { + using element_type = Element; + + constexpr queue_entry_t() noexcept : m_exec_time(), m_object(nullptr) { } + constexpr queue_entry_t(const Time &t, const Element &o) noexcept : m_exec_time(t), m_object(o) { } + + queue_entry_t(const queue_entry_t &) = default; + queue_entry_t &operator=(const queue_entry_t &) = default; + queue_entry_t(queue_entry_t &&) noexcept = default; + queue_entry_t &operator=(queue_entry_t &&) noexcept = default; + + ~queue_entry_t() = default; + + constexpr bool operator ==(const queue_entry_t &rhs) const noexcept + { + return m_object == rhs.m_object; + } + + constexpr bool operator ==(const Element &rhs) const noexcept + { + return m_object == rhs; + } + + constexpr bool operator <=(const queue_entry_t &rhs) const noexcept + { + return (m_exec_time <= rhs.m_exec_time); + } + + constexpr bool operator <(const queue_entry_t &rhs) const noexcept + { + return (m_exec_time < rhs.m_exec_time); + } + + static constexpr queue_entry_t never() noexcept { return queue_entry_t(Time::never(), nullptr); } + + constexpr const Time &exec_time() const noexcept { return m_exec_time; } + constexpr const Element &object() const noexcept { return m_object; } + private: + Time m_exec_time; + Element m_object; + }; + + template <class A, class T> + class timed_queue_linear + { + public: + + explicit timed_queue_linear(A &arena, const std::size_t list_size) + : m_list(arena, list_size) + { + clear(); + } + ~timed_queue_linear() = default; + + timed_queue_linear(const timed_queue_linear &) = delete; + timed_queue_linear &operator=(const timed_queue_linear &) = delete; + timed_queue_linear(timed_queue_linear &&) noexcept = delete; + timed_queue_linear &operator=(timed_queue_linear &&) noexcept = delete; + + constexpr std::size_t capacity() const noexcept { return m_list.capacity() - 1; } + constexpr bool empty() const noexcept { return (m_end == &m_list[1]); } + + template <bool KEEPSTAT, typename... Args> + constexpr void emplace (Args&&... args) noexcept; + + template <bool KEEPSTAT> + constexpr void push(T && e) noexcept; + + constexpr void pop() noexcept { --m_end; } + + constexpr const T &top() const noexcept { return *(m_end-1); } + + constexpr bool exists(const typename T::element_type &elem) const noexcept; + + template <bool KEEPSTAT> + constexpr void remove(const T &elem) noexcept; + + template <bool KEEPSTAT> + constexpr void remove(const typename T::element_type &elem) noexcept; + + constexpr void clear() noexcept + { + m_end = &m_list[0]; + // put an empty element with maximum time into the queue. + // the insert algo above will run into this element and doesn't + // need a comparison with queue start. + // + m_list[0] = T::never(); + m_end++; + } + + // save state support & mame disassembler + + constexpr const T *list_pointer() const noexcept { return &m_list[1]; } + constexpr std::size_t size() const noexcept { return narrow_cast<std::size_t>(m_end - &m_list[1]); } + constexpr const T & operator[](std::size_t index) const noexcept { return m_list[ 1 + index]; } + + private: + PALIGNAS(PALIGN_CACHELINE) + T * m_end; + plib::arena_vector<A, T, PALIGN_CACHELINE> m_list; + + public: + // profiling + // FIXME: Make those private + pperfcount_t<true> m_prof_sort_move; // NOLINT + pperfcount_t<true> m_prof_call; // NOLINT + pperfcount_t<true> m_prof_remove; // NOLINT + }; + + template <class A, class T> + template <bool KEEPSTAT, typename... Args> + inline constexpr void timed_queue_linear<A, T>::emplace (Args&&... args) noexcept + { + T * i(m_end); + *i = T(std::forward<Args>(args)...); + //if (i->object() != nullptr && exists(i->object())) + // printf("Object exists %s\n", i->object()->name().c_str()); + m_end++; + if constexpr (!KEEPSTAT) + { + for (; *(i-1) < *i; --i) + { + std::swap(*(i-1), *(i)); + } + } + else + { + for (; *(i-1) < *i; --i) + { + std::swap(*(i-1), *(i)); + m_prof_sort_move.inc(); + } + m_prof_call.inc(); + } + } + + template <class A, class T> + template <bool KEEPSTAT> + inline constexpr void timed_queue_linear<A, T>::push(T && e) noexcept + { +#if 0 + // The code is not as fast as the code path which is enabled. + // It is left here in case on a platform different to x64 it may + // be faster. + T * i(m_end-1); + for (; *i < e; --i) + { + *(i+1) = *(i); + if (KEEPSTAT) + m_prof_sort_move.inc(); + } + *(i+1) = std::move(e); + ++m_end; +#else + //if (e.object() != nullptr && exists(e.object())) + // printf("Object exists %s\n", e.object()->name().c_str()); + T * i(m_end++); + *i = std::move(e); + for (; *(i-1) < *i; --i) + { + std::swap(*(i-1), *(i)); + if constexpr (KEEPSTAT) + m_prof_sort_move.inc(); + } +#endif + if constexpr (KEEPSTAT) + m_prof_call.inc(); + } + + template <class A, class T> + template <bool KEEPSTAT> + inline constexpr void timed_queue_linear<A, T>::remove(const T &elem) noexcept + { + if constexpr (KEEPSTAT) + m_prof_remove.inc(); + for (T * i = m_end - 1; i > &m_list[0]; --i) + { + // == operator ignores time! + if (*i == elem) + { + std::copy(i+1, m_end--, i); + return; + } + } + //printf("Element not found in delete %s\n", elem->name().c_str()); + } + + template <class A, class T> + template <bool KEEPSTAT> + inline constexpr void timed_queue_linear<A, T>::remove(const typename T::element_type &elem) noexcept + { + if constexpr (KEEPSTAT) + m_prof_remove.inc(); + for (T * i = m_end - 1; i > &m_list[0]; --i) + { + // == operator ignores time! + if (*i == elem) + { + std::copy(i+1, m_end--, i); + return; + } + } + //printf("Element not found in delete %s\n", elem->name().c_str()); + } + + template <class A, class T> + inline constexpr bool timed_queue_linear<A, T>::exists(const typename T::element_type &elem) const noexcept + { + for (T * i = &m_list[1]; i < m_end; ++i) + { + if (*i == elem) + { + return true; + } + } + return false; + } + + + + template <class A, class T> + class timed_queue_heap + { + public: + + struct compare + { + constexpr bool operator()(const T &a, const T &b) const noexcept { return b <= a; } + }; + + explicit timed_queue_heap(A &arena, const std::size_t list_size) + : m_list(arena, list_size) + { + clear(); + } + ~timed_queue_heap() = default; + + PCOPYASSIGNMOVE(timed_queue_heap, delete) + + std::size_t capacity() const noexcept { return m_list.capacity(); } + bool empty() const noexcept { return &m_list[0] == m_end; } + + template <bool KEEPSTAT, typename... Args> + void emplace(Args&&... args) noexcept + { + *m_end++ = T(std::forward<Args>(args)...); + std::push_heap(&m_list[0], m_end, compare()); + if (KEEPSTAT) + m_prof_call.inc(); + } + + template <bool KEEPSTAT> + void push(T &&e) noexcept + { + *m_end++ = e; + std::push_heap(&m_list[0], m_end, compare()); + if (KEEPSTAT) + m_prof_call.inc(); + } + + void pop() noexcept + { + std::pop_heap(&m_list[0], m_end, compare()); + m_end--; + } + + const T &top() const noexcept { return m_list[0]; } + + template <bool KEEPSTAT> + void remove(const T &elem) noexcept + { + if (KEEPSTAT) + m_prof_remove.inc(); + for (T * i = m_end - 1; i >= &m_list[0]; i--) + { + if (*i == elem) + { + m_end--; + *i = *m_end; + std::make_heap(&m_list[0], m_end, compare()); + return; + } + } + } + + template <bool KEEPSTAT> + void remove(const typename T::element_type &elem) noexcept + { + if (KEEPSTAT) + m_prof_remove.inc(); + for (T * i = m_end - 1; i >= &m_list[0]; i--) + { + if (*i == elem) + { + m_end--; + *i = *m_end; + std::make_heap(&m_list[0], m_end, compare()); + return; + } + } + } + + void clear() + { + m_list.clear(); + m_end = &m_list[0]; + } + + // save state support & mame disassembler + + constexpr const T *list_pointer() const { return &m_list[0]; } + constexpr std::size_t size() const noexcept { return m_list.size(); } + constexpr const T & operator[](const std::size_t index) const { return m_list[ 0 + index]; } + private: + T * m_end; + plib::arena_vector<A, T> m_list; + + public: + // profiling + pperfcount_t<true> m_prof_sort_move; // NOLINT + pperfcount_t<true> m_prof_call; // NOLINT + pperfcount_t<true> m_prof_remove; // NOLINT + }; + +} // namespace plib + +#endif // PTIMED_QUEUE_H_ diff --git a/src/lib/netlist/plib/ptokenizer.cpp b/src/lib/netlist/plib/ptokenizer.cpp new file mode 100644 index 00000000000..59468bf84cd --- /dev/null +++ b/src/lib/netlist/plib/ptokenizer.cpp @@ -0,0 +1,371 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#include "ptokenizer.h" + +#include "palloc.h" +#include "pstonum.h" +#include "pstrutil.h" + +namespace plib { + + PERRMSGV(MF_EXPECTED_TOKEN_1_GOT_2, 2, "Expected token <{1}>, got <{2}>") + PERRMSGV(MF_EXPECTED_STRING_GOT_1, 1, "Expected a string, got <{1}>") + PERRMSGV(MF_EXPECTED_IDENTIFIER_GOT_1, 1, "Expected an identifier, got <{1}>") + PERRMSGV(MF_EXPECTED_ID_OR_NUM_GOT_1, 1, "Expected an identifier or number, got <{1}>") + PERRMSGV(MF_EXPECTED_NUMBER_GOT_1, 1, "Expected a number, got <{1}>") + PERRMSGV(MF_EXPECTED_LONGINT_GOT_1, 1, "Expected a long int, got <{1}>") + PERRMSGV(MF_EXPECTED_LINENUM_GOT_1, 1, "Expected line number after line marker but got <{1}>") + PERRMSGV(MF_EXPECTED_FILENAME_GOT_1, 1, "Expected file name after line marker but got <{1}>") + + // ---------------------------------------------------------------------------------------- + // A simple tokenizer + // ---------------------------------------------------------------------------------------- + + void tokenizer_t::skip_eol() + { + pstring::value_type c = getc(); + while (c != 0) + { + if (c == 10) + { + c = getc(); + if (c != 13) + ungetc(c); + return; + } + c = getc(); + } + } + + pstring::value_type tokenizer_t::getc() + { + if (m_unget != 0) + { + pstring::value_type c = m_unget; + m_unget = 0; + return c; + } + if (m_px == m_cur_line.end()) + { + //++m_source_location.back(); + putf8string line; + if (m_strm->read_line_lf(line)) + { + m_cur_line = pstring(line); + m_px = m_cur_line.begin(); + if (*m_px != '#') + m_token_queue->push_back(token_t(token_type::SOURCELINE, m_cur_line)); + } + else + return 0; + } + pstring::value_type c = *(m_px++); + return c; + } + + void tokenizer_t::ungetc(pstring::value_type c) + { + m_unget = c; + } + + void tokenizer_t::append_to_store(putf8_reader *reader, token_store_t &store) + { + clear(); + m_strm = reader; + // Process tokens into queue + token_t ret(token_type::UNKNOWN); + m_token_queue = &store; + do { + ret = get_token_comment(); + store.push_back(ret); + } while (!ret.is_type(token_type::token_type::ENDOFFILE)); + m_token_queue = nullptr; + } + + void token_reader_t::require_token(const token_id_t &token_num) + { + require_token(get_token(), token_num); + } + + void token_reader_t::require_token(const token_t &tok, const token_id_t &token_num) + { + if (!tok.is(token_num)) + { + error(MF_EXPECTED_TOKEN_1_GOT_2(token_num.name(), tok.str())); + } + } + + pstring token_reader_t::get_string() + { + token_t tok = get_token(); + if (!tok.is_type(token_type::STRING)) + { + error(MF_EXPECTED_STRING_GOT_1(tok.str())); + } + return tok.str(); + } + + + pstring token_reader_t::get_identifier() + { + token_t tok = get_token(); + if (!tok.is_type(token_type::IDENTIFIER)) + { + error(MF_EXPECTED_IDENTIFIER_GOT_1(tok.str())); + } + return tok.str(); + } + + pstring token_reader_t::get_identifier_or_number() + { + token_t tok = get_token(); + if (!(tok.is_type(token_type::IDENTIFIER) || tok.is_type(token_type::NUMBER))) + { + error(MF_EXPECTED_ID_OR_NUM_GOT_1(tok.str())); + } + return tok.str(); + } + + // FIXME: combine into template + double token_reader_t::get_number_double() + { + token_t tok = get_token(); + if (!tok.is_type(token_type::NUMBER)) + { + error(MF_EXPECTED_NUMBER_GOT_1(tok.str())); + } + bool err(false); + auto ret = plib::pstonum_ne<double>(tok.str(), err); + if (err) + error(MF_EXPECTED_NUMBER_GOT_1(tok.str())); + return ret; + } + + long token_reader_t::get_number_long() + { + token_t tok = get_token(); + if (!tok.is_type(token_type::NUMBER)) + { + error(MF_EXPECTED_LONGINT_GOT_1(tok.str()) ); + } + bool err(false); + auto ret = plib::pstonum_ne<long>(tok.str(), err); + if (err) + error(MF_EXPECTED_LONGINT_GOT_1(tok.str()) ); + return ret; + } + + bool token_reader_t::process_line_token(const token_t &tok) + { + if (tok.is_type(token_type::LINEMARKER)) + { + bool benter(false); + bool bexit(false); + pstring file; + unsigned lineno(0); + + auto sp = psplit(tok.str(), ' '); + //printf("%d %s\n", (int) sp.size(), ret.str().c_str()); + + bool err = false; + lineno = pstonum_ne<unsigned>(sp[1], err); + if (err) + error(MF_EXPECTED_LINENUM_GOT_1(tok.str())); + if (sp[2].substr(0,1) != "\"") + error(MF_EXPECTED_FILENAME_GOT_1(tok.str())); + file = sp[2].substr(1, sp[2].length() - 2); + + for (std::size_t i = 3; i < sp.size(); i++) + { + if (sp[i] == "1") + benter = true; + if (sp[i] == "2") + bexit = true; + // FIXME: process flags; actually only 1 (file enter) and 2 (after file exit) + } + if (bexit) // pop the last location + m_source_location.pop_back(); + if (!benter) // new location! + m_source_location.pop_back(); + m_source_location.emplace_back(plib::source_location(file, lineno)); + return true; + } + + if (tok.is_type(token_type::SOURCELINE)) + { + m_line = tok.str(); + ++m_source_location.back(); + return true; + } + + return false; + } + + token_reader_t::token_t token_reader_t::get_token() + { + token_t ret = get_token_queue(); + while (true) + { + if (ret.is_type(token_type::token_type::ENDOFFILE)) + return ret; + + //printf("%s\n", ret.str().c_str()); + if (process_line_token(ret)) + { + ret = get_token_queue(); + } + else + { + return ret; + } + } + } + + token_reader_t::token_t token_reader_t::get_token_raw() + { + token_t ret = get_token_queue(); + process_line_token(ret); + return ret; + } + + token_reader_t::token_t tokenizer_t::get_token_internal() + { + // skip ws + pstring::value_type c = getc(); + while (m_whitespace.find(c) != pstring::npos) + { + c = getc(); + if (eof()) + { + return token_t(token_type::ENDOFFILE); + } + } + if (m_support_line_markers && c == '#') + { + pstring lm("#"); + do + { + c = getc(); + if (eof()) + return token_t(token_type::ENDOFFILE); + if (c == '\r' || c == '\n') + return { token_type::LINEMARKER, lm }; + lm += c; + } while (true); + } + if (m_number_chars_start.find(c) != pstring::npos) + { + // read number while we receive number or identifier chars + // treat it as an identifier when there are identifier chars in it + token_type ret = token_type::NUMBER; + pstring tokstr = ""; + while (true) { + if (m_identifier_chars.find(c) != pstring::npos && m_number_chars.find(c) == pstring::npos) + ret = token_type::IDENTIFIER; + else if (m_number_chars.find(c) == pstring::npos) + break; + tokstr += c; + c = getc(); + } + ungetc(c); + return { ret, tokstr }; + } + + // not a number, try identifier + if (m_identifier_chars.find(c) != pstring::npos) + { + // read identifier till non identifier char + pstring tokstr = ""; + while (m_identifier_chars.find(c) != pstring::npos) + { + tokstr += c; + c = getc(); + } + ungetc(c); + auto id = m_tokens.find(tokstr); + return (id != m_tokens.end()) ? + token_t(id->second, tokstr) + : token_t(token_type::IDENTIFIER, tokstr); + } + + if (c == m_string) + { + pstring tokstr = ""; + c = getc(); + while (c != m_string) + { + tokstr += c; + c = getc(); + } + return { token_type::STRING, tokstr }; + } + + // read identifier till first identifier char or ws + pstring tokstr = ""; + while ((m_identifier_chars.find(c) == pstring::npos) && (m_whitespace.find(c) == pstring::npos)) + { + tokstr += c; + // expensive, check for single char tokens + if (tokstr.length() == 1) + { + auto id = m_tokens.find(tokstr); + if (id != m_tokens.end()) + return { id->second, tokstr }; + } + c = getc(); + } + ungetc(c); + auto id = m_tokens.find(tokstr); + return (id != m_tokens.end()) ? + token_t(id->second, tokstr) + : token_t(token_type::UNKNOWN, tokstr); + } + + token_reader_t::token_t tokenizer_t::get_token_comment() + { + token_t ret = get_token_internal(); + while (true) + { + if (ret.is_type(token_type::token_type::ENDOFFILE)) + return ret; + + if (ret.is(m_tok_comment_start)) + { + do { + ret = get_token_internal(); + } while (ret.is_not(m_tok_comment_end)); + ret = get_token_internal(); + } + else if (ret.is(m_tok_line_comment)) + { + skip_eol(); + ret = get_token_internal(); + } + else + { + return ret; + } + } + } + + + void token_reader_t::error(const perrmsg &errs) + { + pstring s(""); + pstring trail (" from "); + pstring trail_first("In file included from "); + pstring e = plib::pfmt("{1}:{2}:0: error: {3}\n") + (m_source_location.back().file_name(), m_source_location.back().line(), errs()); + m_source_location.pop_back(); + while (!m_source_location.empty()) + { + if (m_source_location.size() == 1) + trail = trail_first; + s = plib::pfmt("{1}{2}:{3}:0\n{4}")(trail, m_source_location.back().file_name(), m_source_location.back().line(), s); + m_source_location.pop_back(); + } + verror("\n" + s + e + " " + m_line + "\n"); + } + +} // namespace plib diff --git a/src/lib/netlist/plib/ptokenizer.h b/src/lib/netlist/plib/ptokenizer.h new file mode 100644 index 00000000000..5bc69eecc6b --- /dev/null +++ b/src/lib/netlist/plib/ptokenizer.h @@ -0,0 +1,277 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef PTOKENIZER_H_ +#define PTOKENIZER_H_ + +/// +/// \file ptokenizer.h +/// + +#include "pstream.h" +#include "pstring.h" + +#include "penum.h" +#include "psource.h" + +#include <unordered_map> +#include <vector> + +namespace plib { + + namespace detail { + + PENUM(token_type, + IDENTIFIER, + NUMBER, + TOKEN, + STRING, + COMMENT, + LINEMARKER, + SOURCELINE, + UNKNOWN, + ENDOFFILE + ) + + struct token_id_t + { + public: + + static constexpr std::size_t npos = static_cast<std::size_t>(-1); + + token_id_t() + : m_id(npos) + {} + + explicit token_id_t(std::size_t id, const pstring &name) + : m_id(id) + , m_name(name) + {} + + token_id_t(const token_id_t &) = default; + token_id_t &operator=(const token_id_t &) = default; + token_id_t(token_id_t &&) noexcept = default; + token_id_t &operator=(token_id_t &&) noexcept = default; + + ~token_id_t() = default; + + constexpr std::size_t id() const { return m_id; } + constexpr const pstring & name() const { return m_name; } + private: + std::size_t m_id; + pstring m_name; + }; + + struct token_t + { + explicit token_t(token_type type) + : m_type(type), m_id(token_id_t::npos), m_token("") + { + } + token_t(token_type type, const pstring &str) + : m_type(type), m_id(token_id_t::npos), m_token(str) + { + } + token_t(const token_id_t &id) + : m_type(token_type::TOKEN), m_id(id.id()), m_token(id.name()) + { + } + token_t(const token_id_t &id, const pstring &str) + : m_type(token_type::TOKEN), m_id(id.id()), m_token(str) + { + } + + token_t(const token_t &) = default; + token_t &operator=(const token_t &) = default; + token_t(token_t &&) noexcept = default; + token_t &operator=(token_t &&) noexcept = default; + + ~token_t() = default; + + constexpr bool is(const token_id_t &tok_id) const noexcept { return m_id == tok_id.id(); } + constexpr bool is_not(const token_id_t &tok_id) const noexcept { return !is(tok_id); } + constexpr bool is_type(const token_type type) const noexcept { return m_type == type; } + constexpr token_type type() const noexcept { return m_type; } + constexpr const pstring &str() const noexcept { return m_token; } + + private: + token_type m_type; + std::size_t m_id; + pstring m_token; + }; + + class token_store_t : public std::vector<token_t> + { + using std::vector<token_t>::vector; + }; + + } // namespace detail + + class tokenizer_t + { + public: + using token_type = detail::token_type; + using token_id_t = detail::token_id_t; + using token_t = detail::token_t; + using token_store_t = detail::token_store_t; + + explicit tokenizer_t() // NOLINT(misc-forwarding-reference-overload, bugprone-forwarding-reference-overload) + : m_strm(nullptr) + , m_unget(0) + , m_string('"') + , m_support_line_markers(true) // FIXME + , m_token_queue(nullptr) + { + clear(); + } + + tokenizer_t(const tokenizer_t &) = delete; + tokenizer_t &operator=(const tokenizer_t &) = delete; + tokenizer_t(tokenizer_t &&) noexcept = delete; + tokenizer_t &operator=(tokenizer_t &&) noexcept = delete; + + virtual ~tokenizer_t() = default; + + // tokenizer stuff follows ... + + token_id_t register_token(const pstring &token) + { + token_id_t ret(m_tokens.size(), token); + m_tokens.emplace(token, ret); + return ret; + } + + tokenizer_t & identifier_chars(const pstring &s) { m_identifier_chars = s; return *this; } + tokenizer_t & number_chars(const pstring &st, const pstring & rem) { m_number_chars_start = st; m_number_chars = rem; return *this; } + tokenizer_t & string_char(pstring::value_type c) { m_string = c; return *this; } + tokenizer_t & whitespace(const pstring & s) { m_whitespace = s; return *this; } + tokenizer_t & comment(const pstring &start, const pstring &end, const pstring &line) + { + m_tok_comment_start = register_token(start); + m_tok_comment_end = register_token(end); + m_tok_line_comment = register_token(line); + return *this; + } + + void append_to_store(putf8_reader *reader, token_store_t &store); + + private: + + void clear() + { + m_cur_line = ""; + m_px = m_cur_line.begin(); + m_unget = 0; + } + + token_t get_token_internal(); + + // get internal token with comment processing + token_t get_token_comment(); + + void skip_eol(); + + pstring::value_type getc(); + void ungetc(pstring::value_type c); + + bool eof() const { return m_strm->eof(); } + + putf8_reader *m_strm; + + pstring m_cur_line; + pstring::const_iterator m_px; + pstring::value_type m_unget; + + // tokenizer stuff follows ... + + pstring m_identifier_chars; + pstring m_number_chars; + pstring m_number_chars_start; + std::unordered_map<pstring, token_id_t> m_tokens; + pstring m_whitespace; + pstring::value_type m_string; + + token_id_t m_tok_comment_start; + token_id_t m_tok_comment_end; + token_id_t m_tok_line_comment; + + protected: + bool m_support_line_markers; + token_store_t *m_token_queue; + }; + + class token_reader_t + { + public: + + using token_t = tokenizer_t::token_t; + using token_type = tokenizer_t::token_type; + using token_id_t = tokenizer_t::token_id_t; + using token_store = tokenizer_t::token_store_t; + + explicit token_reader_t() + : m_idx(0) + , m_token_store(nullptr) + { + // add a first entry to the stack + m_source_location.emplace_back(plib::source_location("Unknown", 0)); + } + + token_reader_t(const token_reader_t &) = delete; + token_reader_t &operator=(const token_reader_t &) = delete; + token_reader_t(token_reader_t &&) noexcept = delete; + token_reader_t &operator=(token_reader_t &&) noexcept = delete; + + virtual ~token_reader_t() = default; + + void set_token_source(const token_store *store) + { + m_token_store = store; + } + + pstring current_line_str() const; + + // tokenizer stuff follows ... + + token_t get_token(); + token_t get_token_raw(); // includes line information + pstring get_string(); + pstring get_identifier(); + pstring get_identifier_or_number(); + + double get_number_double(); + long get_number_long(); + + void require_token(const token_id_t &token_num); + void require_token(const token_t &tok, const token_id_t &token_num); + + void error(const perrmsg &errs); + + plib::source_location location() { return m_source_location.back(); } + + pstring current_line() const { return m_line; } + + protected: + virtual void verror(const pstring &msg) = 0; + + private: + bool process_line_token(const token_t &tok); + + token_t get_token_queue() + { + if (m_idx < m_token_store->size()) + return (*m_token_store)[m_idx++]; + return token_t(token_type::ENDOFFILE); + } + + // source locations, vector used as stack because we need to loop through stack + + std::vector<plib::source_location> m_source_location; + pstring m_line; + std::size_t m_idx; + const token_store * m_token_store; + }; + +} // namespace plib + +#endif // PTOKENIZER_H_ diff --git a/src/lib/netlist/plib/ptypes.h b/src/lib/netlist/plib/ptypes.h index bda62099150..971a509406c 100644 --- a/src/lib/netlist/plib/ptypes.h +++ b/src/lib/netlist/plib/ptypes.h @@ -1,138 +1,411 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * ptypes.h - * - */ #ifndef PTYPES_H_ #define PTYPES_H_ +/// +/// \file ptypes.h +/// + #include "pconfig.h" +#include <cstdint> #include <limits> #include <string> #include <type_traits> -#define COPYASSIGNMOVE(name, def) \ - name(const name &) = def; \ - name(name &&) noexcept = def; \ - name &operator=(const name &) = def; \ - name &operator=(name &&) noexcept = def; +#if (PUSE_FLOAT128) +#if defined(__has_include) +#if __has_include(<quadmath.h>) +#include <quadmath.h> +#endif +#endif +#endif + +#define PCOPYASSIGNMOVE(name, def) \ + PCOPYASSIGN(name, def) \ + PMOVEASSIGN(name, def) + +#define PCOPYASSIGN(name, def) \ + name(const name &) = def; \ + name &operator=(const name &) = def; + +#define PMOVEASSIGN(name, def) \ + name(name &&) noexcept = def; \ + name &operator=(name &&) noexcept = def; + +#if defined(EMSCRIPTEN) +#undef EMSCRIPTEN +#endif + +// ----------------------------------------------------------------------------- +// forward definitions +// ----------------------------------------------------------------------------- + +namespace plib +{ + template <typename BASEARENA, std::size_t MINALIGN> + class mempool_arena; + + template <std::size_t MINALLOC = 0> + struct aligned_arena; + + class dynamic_library_base; + + template<bool debug_enabled> + class plog_base; + + struct plog_level; -#define COPYASSIGN(name, def) \ - name(const name &) = def; \ - name &operator=(const name &) = def; \ + template <typename A, typename T> + class timed_queue_linear; + + template <typename A, typename T> + class timed_queue_heap; + + namespace detail + { + class token_store_t; + } // namespace detail + +} // namespace plib namespace plib { + //============================================================ + // compile time information + //============================================================ + + /// \brief Dummy 128 bit types for platforms which don't support 128 bit + /// + /// Users should always consult compile_info::has_int128 prior to + /// using the UINT128/INT128 data type. + /// + struct UINT128_DUMMY {}; + struct INT128_DUMMY {}; + + enum class ci_compiler + { + UNKNOWN, + CLANG, + GCC, + MSC + }; + + enum class ci_cpp_stdlib + { + UNKNOWN, + LIBSTDCXX, + LIBCPP, + MSVCPRT + }; + + enum class ci_os + { + UNKNOWN, + LINUX, + FREEBSD, + OPENBSD, + WINDOWS, + MACOSX, + EMSCRIPTEN + }; + + enum class ci_arch + { + UNKNOWN, + X86, + ARM, + MIPS, + IA64 + }; + + enum class ci_env + { + DEFAULT, + MSVC, + NVCC + }; + + // <sys/types.h> on ubuntu system may define major and minor as macros + // That's why we use vmajor, .. here + template <std::size_t MAJOR, std::size_t MINOR, std::size_t PL = 0> + struct typed_version + { + static_assert((MINOR < 100) && (PL < 100), "typed_version: MAJOR, MINOR or PATCHLEVEL exceeds or equal to 100"); + using vmajor = std::integral_constant<std::size_t, MAJOR>; + using vminor = std::integral_constant<std::size_t, MINOR>; + using vpatchlevel = std::integral_constant<std::size_t, PL>; + using full = std::integral_constant<std::size_t, MAJOR * 10000 + MINOR * 100 + PL>; + }; + + struct compile_info + { + #ifdef _WIN32 + using win32 = std::integral_constant<bool, true>; + #ifdef UNICODE + using unicode = std::integral_constant<bool, true>; + #else + using unicode = std::integral_constant<bool, false>; + #endif + #else + using win32 = std::integral_constant<bool, false>; + using unicode = std::integral_constant<bool, true>; + #endif + #ifdef __SIZEOF_INT128__ + using has_int128 = std::integral_constant<bool, true>; + using int128_type = __int128_t; + using uint128_type = __uint128_t; + static constexpr int128_type int128_max() { return (~static_cast<uint128_type>(0)) >> 1; } + static constexpr uint128_type uint128_max() { return ~(static_cast<uint128_type>(0)); } + #else + using has_int128 = std::integral_constant<bool, false>; + using int128_type = INT128_DUMMY; + using uint128_type = UINT128_DUMMY; + static constexpr int128_type int128_max() { return int128_type(); } + static constexpr uint128_type uint128_max() { return uint128_type(); } + #endif + #if defined(__clang__) + using type = std::integral_constant<ci_compiler, ci_compiler::CLANG>; + using version = typed_version<__clang_major__, __clang_minor__, __clang_patchlevel__>; + #elif defined(__GNUC__) + using type = std::integral_constant<ci_compiler, ci_compiler::GCC>; + using version = typed_version<__GNUC__, __GNUC_MINOR__, __GNUC_PATCHLEVEL__>; + #elif defined(_MSC_VER) + using type = std::integral_constant<ci_compiler, ci_compiler::MSC>; + using version = typed_version<_MSC_VER / 100, _MSC_VER % 100>; + #else + using type = std::integral_constant<ci_compiler, ci_compiler::UNKNOWN>; + using version = typed_version<0, 0>; + #endif + #if defined(_LIBCPP_VERSION) + using cpp_stdlib = std::integral_constant<ci_cpp_stdlib, ci_cpp_stdlib::LIBCPP>; + using cpp_stdlib_version = typed_version<(_LIBCPP_VERSION) / 1000, ((_LIBCPP_VERSION) / 100) % 10, _LIBCPP_VERSION % 100>; + #elif defined(__GLIBCXX__) + using cpp_stdlib = std::integral_constant<ci_cpp_stdlib, ci_cpp_stdlib::LIBSTDCXX>; + using cpp_stdlib_version = typed_version<(_GLIBCXX_RELEASE), 0>; + #elif defined(_CPPLIB_VER) && defined(_MSVC_STL_VERSION) + using cpp_stdlib = std::integral_constant<ci_cpp_stdlib, ci_cpp_stdlib::MSVCPRT>; + using cpp_stdlib_version = typed_version<_CPPLIB_VER, 0>; + #else + using cpp_stdlib = std::integral_constant<ci_cpp_stdlib, ci_cpp_stdlib::UNKNOWN>; + using cpp_stdlib_version = typed_version<0, 0, 0>; + #endif + #ifdef __unix__ + using is_unix = std::integral_constant<bool, true>; + #else + using is_unix = std::integral_constant<bool, false>; + #endif + #if defined(__linux__) + using os = std::integral_constant<ci_os, ci_os::LINUX>; + #elif defined(__FreeBSD__) + using os = std::integral_constant<ci_os, ci_os::FREEBSD>; + #elif defined(__OpenBSD__) + using os = std::integral_constant<ci_os, ci_os::OPENBSD>; + #elif defined(__EMSCRIPTEN__) + using os = std::integral_constant<ci_os, ci_os::EMSCRIPTEN>; + #elif defined(_WIN32) + using os = std::integral_constant<ci_os, ci_os::WINDOWS>; + #elif defined(__APPLE__) + using os = std::integral_constant<ci_os, ci_os::MACOSX>; + #else + using os = std::integral_constant<ci_os, ci_os::UNKNOWN>; + #endif + #if defined(__x86_64__) || defined (_M_X64) || defined(__aarch64__) || defined(__mips64) || defined(_M_AMD64) || defined(_M_ARM64) + using m64 = std::integral_constant<bool, true>; + #else + using m64 = std::integral_constant<bool, false>; + #endif + #if defined(__x86_64__) || defined(__i386__) + using arch = std::integral_constant<ci_arch, ci_arch::X86>; + #elif defined(__arm__) || defined(__ARMEL__) || defined(__aarch64__) || defined(_M_ARM) + using arch = std::integral_constant<ci_arch, ci_arch::ARM>; + #elif defined(__MIPSEL__) || defined(__mips_isa_rev) || defined(__mips64) + using arch = std::integral_constant<ci_arch, ci_arch::MIPS>; + #elif defined(__ia64__) + using arch = std::integral_constant<ci_arch, ci_arch::IA64>; + #else + using arch = std::integral_constant<ci_arch, ci_arch::UNKNOWN>; + #endif + #if defined(__MINGW32__) + using mingw = std::integral_constant<bool, true>; + #else + using mingw = std::integral_constant<bool, false>; + #endif + #if defined(__APPLE__) + using clang_noexcept_issue = std::integral_constant<bool, (type::value == ci_compiler::CLANG) && (version::full::value < 110003)>; + #else + using clang_noexcept_issue = std::integral_constant<bool, (type::value == ci_compiler::CLANG) && (version::vmajor::value < 9)>; + #endif + #if defined(__ia64__) + using abi_vtable_function_descriptors = std::integral_constant<bool, true>; + #else + using abi_vtable_function_descriptors = std::integral_constant<bool, false>; + #endif + #if defined(_MSC_VER) + using env = std::integral_constant<ci_env, ci_env::MSVC>; + using env_version = typed_version<_MSC_VER / 100, _MSC_VER % 100>; + #elif defined(__NVCC__) || defined(__CUDACC__) + using env = std::integral_constant<ci_env, ci_env::NVCC>; + using env_version = typed_version<__CUDA_API_VER_MAJOR__, __CUDA_API_VER_MINOR__, __CUDACC_VER_BUILD__>; + #if defined(__CUDA_ARCH__) + using cuda_arch = std::integral_constant<std::size_t, __CUDA_ARCH__>; + #else + using cuda_arch = std::integral_constant<std::size_t, 0>; + #endif + #else + using env = std::integral_constant<ci_env, ci_env::DEFAULT>; + using env_version = version; + #endif + }; + +} // namespace plib + +using INT128 = plib::compile_info::int128_type; +using UINT128 = plib::compile_info::uint128_type; + +namespace plib +{ + template<typename T> struct is_integral : public std::is_integral<T> { }; + template<typename T> struct is_signed : public std::is_signed<T> { }; + template<typename T> struct is_unsigned : public std::is_unsigned<T> { }; template<typename T> struct numeric_limits : public std::numeric_limits<T> { }; - /* 128 bit support at least on GCC is not fully supported */ -#if PHAS_INT128 + // 128 bit support at least on GCC is not fully supported + template<> struct is_integral<UINT128> { static constexpr bool value = true; }; template<> struct is_integral<INT128> { static constexpr bool value = true; }; + + template<> struct is_signed<UINT128> { static constexpr bool value = false; }; + template<> struct is_signed<INT128> { static constexpr bool value = true; }; + + template<> struct is_unsigned<UINT128> { static constexpr bool value = true; }; + template<> struct is_unsigned<INT128> { static constexpr bool value = false; }; + template<> struct numeric_limits<UINT128> { - static constexpr UINT128 max() + static constexpr UINT128 max() noexcept { - return ~((UINT128)0); + return compile_info::uint128_max(); } }; template<> struct numeric_limits<INT128> { - static constexpr INT128 max() + static constexpr INT128 max() noexcept { - return (~((UINT128)0)) >> 1; + return compile_info::int128_max(); } }; -#endif - //============================================================ - // prevent implicit copying - //============================================================ + template<typename T> struct is_floating_point : public std::is_floating_point<T> { }; - struct nocopyassignmove - { - nocopyassignmove(const nocopyassignmove &) = delete; - nocopyassignmove(nocopyassignmove &&) = delete; - nocopyassignmove &operator=(const nocopyassignmove &) = delete; - nocopyassignmove &operator=(nocopyassignmove &&) = delete; - protected: - nocopyassignmove() = default; - ~nocopyassignmove() = default; - }; + template<class T> + struct is_arithmetic : std::integral_constant<bool, + plib::is_integral<T>::value || plib::is_floating_point<T>::value> {}; - struct nocopyassign +#if PUSE_FLOAT128 + template<> struct is_floating_point<FLOAT128> { static constexpr bool value = true; }; + template<> struct numeric_limits<FLOAT128> { - nocopyassign(const nocopyassign &) = delete; - nocopyassign &operator=(const nocopyassign &) = delete; - protected: - nocopyassign() = default; - ~nocopyassign() = default; - nocopyassign(nocopyassign &&) = default; - nocopyassign &operator=(nocopyassign &&) = default; + static constexpr FLOAT128 max() noexcept + { + return FLT128_MAX; + } + static constexpr FLOAT128 lowest() noexcept + { + return -FLT128_MAX; + } }; +#endif - //============================================================ - // Avoid unused variable warnings - //============================================================ - template<typename... Ts> - inline void unused_var(Ts&&...) {} - - //============================================================ - // is_pow2 - //============================================================ - template <typename T> - constexpr bool is_pow2(T v) noexcept + template<unsigned bits> + struct size_for_bits { - static_assert(is_integral<T>::value, "is_pow2 needs integer arguments"); - return !(v & (v-1)); - } + static_assert(bits <= 64 || (bits <= 128 && compile_info::has_int128::value), "not supported"); + enum { value = + bits <= 8 ? 1 : + bits <= 16 ? 2 : + bits <= 32 ? 4 : + bits <= 64 ? 8 : + 16 + }; + }; + template<unsigned N> struct least_type_for_size; + template<> struct least_type_for_size<1> { using type = uint_least8_t; }; + template<> struct least_type_for_size<2> { using type = uint_least16_t; }; + template<> struct least_type_for_size<4> { using type = uint_least32_t; }; + template<> struct least_type_for_size<8> { using type = uint_least64_t; }; + template<> struct least_type_for_size<16> { using type = UINT128; }; - //============================================================ - // abs, lcd, gcm - //============================================================ + // This is different to the standard library. Mappings provided in stdint + // are not always fastest. + template<unsigned N> struct fast_type_for_size; + template<> struct fast_type_for_size<1> { using type = uint32_t; }; + template<> struct fast_type_for_size<2> { using type = uint32_t; }; + template<> struct fast_type_for_size<4> { using type = uint32_t; }; + template<> struct fast_type_for_size<8> { using type = uint_fast64_t; }; + template<> struct fast_type_for_size<16> { using type = UINT128; }; - template<typename T> - constexpr - typename std::enable_if<std::is_integral<T>::value && std::is_signed<T>::value, T>::type - abs(T v) + template<unsigned bits> + struct least_type_for_bits { - return v < 0 ? -v : v; - } + static_assert(bits <= 64 || (bits <= 128 && compile_info::has_int128::value), "not supported"); + using type = typename least_type_for_size<size_for_bits<bits>::value>::type; + }; - template<typename T> - constexpr - typename std::enable_if<std::is_integral<T>::value && std::is_unsigned<T>::value, T>::type - abs(T v) + template<unsigned bits> + struct fast_type_for_bits { - return v; - } + static_assert(bits <= 64 || (bits <= 128 && compile_info::has_int128::value), "not supported"); + using type = typename fast_type_for_size<size_for_bits<bits>::value>::type; + }; - template<typename M, typename N> - constexpr typename std::common_type<M, N>::type - gcd(M m, N n) - { - static_assert(std::is_integral<M>::value, "gcd: M must be an integer"); - static_assert(std::is_integral<N>::value, "gcd: N must be an integer"); + /// \brief mark arguments as not used for compiler + /// + /// \tparam Ts unused parameters + /// + template<typename... Ts> + inline void unused_var(Ts&&...) noexcept {} // NOLINT(readability-named-parameter) // FIXME: remove unused var completely - return m == 0 ? plib::abs(n) - : n == 0 ? plib::abs(m) - : gcd(n, m % n); + /// \brief copy type S to type D byte by byte + /// + /// The purpose of this copy function is to suppress compiler warnings. + /// Use at your own risk. This is dangerous. + /// + /// \param s Source object + /// \param d Destination object + /// \tparam S Type of source object + /// \tparam D Type of destination object + template <typename S, typename D> + void reinterpret_copy(S &s, D &d) + { + static_assert(sizeof(D) >= sizeof(S), "size mismatch"); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + auto *dp = reinterpret_cast<std::uint8_t *>(&d); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-reinterpret-cast) + const auto *sp = reinterpret_cast<std::uint8_t *>(&s); + std::copy(sp, sp + sizeof(S), dp); } - template<typename M, typename N> - constexpr typename std::common_type<M, N>::type - lcm(M m, N n) - { - static_assert(std::is_integral<M>::value, "lcm: M must be an integer"); - static_assert(std::is_integral<N>::value, "lcm: N must be an integer"); + /// \brief Test if type R has a stream operator << defined + /// + /// has_ostream_operator<std::ostream, int>:: value should be true + /// + /// \tparam LEFT Stream type + /// \tparam RIGHT Type to check for operator overload - return (m != 0 && n != 0) ? (plib::abs(m) / gcd(m, n)) * plib::abs(n) : 0; - } + template<class LEFT, class RIGHT> + struct has_ostream_operator_impl { + template<class V> static auto test(V*) -> decltype(std::declval<LEFT &>() << std::declval<V>()); + template<typename> static auto test(...) -> std::false_type; + //static constexpr const bool value = std::is_same<LEFT &, decltype(test<RIGHT>(0))>::value; + using type = typename std::is_same<LEFT &, decltype(test<RIGHT>(nullptr))>::type; + }; + template<class LEFT, class RIGHT> + struct has_ostream_operator : has_ostream_operator_impl<LEFT, RIGHT>::type {}; } // namespace plib @@ -144,9 +417,9 @@ namespace plib template <typename T> class name \ { \ template <typename U> static long test(decltype(&U:: member)); \ - template <typename U> static char test(...); \ + template <typename U> static char test(...); \ public: \ static constexpr const bool value = sizeof(test<T>(nullptr)) == sizeof(long); \ } -#endif /* PTYPES_H_ */ +#endif // PTYPES_H_ diff --git a/src/lib/netlist/plib/putil.cpp b/src/lib/netlist/plib/putil.cpp index a9531006904..fb430f89a68 100644 --- a/src/lib/netlist/plib/putil.cpp +++ b/src/lib/netlist/plib/putil.cpp @@ -1,153 +1,84 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud #include "putil.h" -#include "plists.h" +#include "penum.h" +#include "pstream.h" +#include "pstrutil.h" #include "ptypes.h" #include <algorithm> -//#include <cstdlib> -//#include <cstring> +// needed for getenv ... #include <initializer_list> namespace plib { namespace util { - const pstring buildpath(std::initializer_list<pstring> list ) + static constexpr const char PATH_SEP = compile_info::win32::value ? '\\' : '/'; + static constexpr const char *PATH_SEPS = compile_info::win32::value ? "\\/" :"/"; + + pstring basename(const pstring &filename, const pstring &suffix) { - pstring ret = ""; - for( const auto &elem : list ) - { - if (ret == "") - ret = elem; - else - #ifdef _WIN32 - ret = ret + '\\' + elem; - #else - ret += ('/' + elem); - #endif - } + auto p=find_last_of(filename, pstring(PATH_SEPS)); + pstring ret = (p == pstring::npos) ? filename : filename.substr(p+1); + if (!suffix.empty() && endsWith(ret, suffix)) + return ret.substr(0, ret.length() - suffix.length()); return ret; } - const pstring environment(const pstring &var, const pstring &default_val) + pstring path(const pstring &filename) { - if (std::getenv(var.c_str()) == nullptr) - return default_val; - else - return pstring(std::getenv(var.c_str())); - } - } // namespace util + auto p=find_last_of(filename, pstring(1, PATH_SEP)); + if (p == pstring::npos) + return ""; + if (p == 0) // root case + return filename.substr(0, 1); - std::vector<pstring> psplit(const pstring &str, const pstring &onstr, bool ignore_empty) - { - std::vector<pstring> ret; - - pstring::size_type p = 0; - pstring::size_type pn = str.find(onstr, p); - - while (pn != pstring::npos) - { - pstring t = str.substr(p, pn - p); - if (!ignore_empty || t.length() != 0) - ret.push_back(t); - p = pn + onstr.length(); - pn = str.find(onstr, p); + return filename.substr(0, p); } - if (p < str.length()) + + bool exists (const pstring &filename) { - pstring t = str.substr(p); - if (!ignore_empty || t.length() != 0) - ret.push_back(t); + plib::ifstream f(filename); + return f.good(); } - return ret; - } - std::vector<std::string> psplit_r(const std::string &stri, - const std::string &token, - const std::size_t maxsplit) - { - std::string str(stri); - std::vector<std::string> result; - std::size_t splits = 0; - - while(str.size()) + pstring build_path(std::initializer_list<pstring> list ) { - std::size_t index = str.rfind(token); - bool found = index!=std::string::npos; - if (found) - splits++; - if ((splits <= maxsplit || maxsplit == 0) && found) - { - result.push_back(str.substr(index+token.size())); - str = str.substr(0, index); - if (str.size()==0) - result.push_back(str); - } - else + pstring ret = ""; + for( const auto &elem : list ) { - result.push_back(str); - str = ""; + if (ret.empty()) + ret = elem; + else + ret += (PATH_SEP + elem); } + return ret; } - return result; - } - - std::vector<pstring> psplit(const pstring &str, const std::vector<pstring> &onstrl) - { - pstring col = ""; - std::vector<pstring> ret; - auto i = str.begin(); - while (i != str.end()) + pstring environment(const pstring &var, const pstring &default_val) { - auto p = static_cast<std::size_t>(-1); - for (std::size_t j=0; j < onstrl.size(); j++) - { - if (std::equal(onstrl[j].begin(), onstrl[j].end(), i)) - { - p = j; - break; - } - } - if (p != static_cast<std::size_t>(-1)) - { - if (col != "") - ret.push_back(col); - - col = ""; - ret.push_back(onstrl[p]); - i = std::next(i, static_cast<pstring::difference_type>(onstrl[p].length())); - } - else - { - pstring::value_type c = *i; - col += c; - i++; - } + putf8string varu8(var); + return (std::getenv(varu8.c_str()) == nullptr) ? default_val + : pstring(std::getenv(varu8.c_str())); } - if (col != "") - ret.push_back(col); - - return ret; - } - + } // namespace util - int penum_base::from_string_int(const char *str, const char *x) + int penum_base::from_string_int(const pstring &str, const pstring &x) { int cnt = 0; - for (auto &s : psplit(str, ",", false)) + for (auto &s : psplit(str, ',', false)) { - if (s == x) + if (trim(s) == x) return cnt; cnt++; } return -1; } - std::string penum_base::nthstr(int n, const char *str) + pstring penum_base::nthstr(std::size_t n, const pstring &str) { - return psplit(str, ",", false)[static_cast<std::size_t>(n)]; + return psplit(str, ',', false)[n]; } } // namespace plib diff --git a/src/lib/netlist/plib/putil.h b/src/lib/netlist/plib/putil.h index e6e6153d840..ae383aaf807 100644 --- a/src/lib/netlist/plib/putil.h +++ b/src/lib/netlist/plib/putil.h @@ -1,33 +1,121 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * putil.h - * - */ #ifndef PUTIL_H_ #define PUTIL_H_ +/// +/// \file putil.h +/// + +#include "palloc.h" #include "pexception.h" #include "pstring.h" + #include <algorithm> #include <initializer_list> -#include <locale> #include <sstream> #include <vector> -#include <iostream> -#define PSTRINGIFY_HELP(y) # y +#define PSTRINGIFY_HELP(y) #y #define PSTRINGIFY(x) PSTRINGIFY_HELP(x) +// Discussion and background of this MSVC bug: +// https://github.com/mamedev/mame/issues/6106 +/// +/// \brief Macro to work around a bug in MSVC treatment of __VA_ARGS__ +/// +#define PMSVC_VARARG_BUG(MACRO, ARGS) MACRO ARGS + +// clang-format off + +/// \brief Determine number of arguments in __VA_ARGS__ +/// +/// This macro works up to 16 arguments in __VA_ARGS__ +/// +/// \returns Number of arguments +/// +#define PNARGS(...) PNARGS_1(__VA_ARGS__, 16, 15, 14, 13, 12, 11, 10, 9, 8, 7, 6, 5, 4, 3, 2, 1, 0) + +#define PNARGS_2(_1, _2, _3, _4, _5, _6, _7, _8, _9, _10, _11, _12, _13, _14, _15, _16, N, ...) N +#define PNARGS_1(...) PMSVC_VARARG_BUG(PNARGS_2, (__VA_ARGS__)) + +/// \brief Concatenate two arguments after expansion +/// +/// \returns Concatenated expanded arguments +/// +#define PCONCAT(a, b) PCONCAT_(a, b) + +#define PCONCAT_(a, b) a ## b + +#define PSTRINGIFY_1(x) #x +#define PSTRINGIFY_2(x, x2) #x, #x2 +#define PSTRINGIFY_3(x, x2, x3) #x, #x2, #x3 +#define PSTRINGIFY_4(x, x2, x3, x4) #x, #x2, #x3, #x4 +#define PSTRINGIFY_5(x, x2, x3, x4, x5) #x, #x2, #x3, #x4, #x5 +#define PSTRINGIFY_6(x, x2, x3, x4, x5, x6) #x, #x2, #x3, #x4, #x5, #x6 +#define PSTRINGIFY_7(x, x2, x3, x4, x5, x6, x7) #x, #x2, #x3, #x4, #x5, #x6, #x7 +#define PSTRINGIFY_8(x, x2, x3, x4, x5, x6, x7, x8) #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8 +#define PSTRINGIFY_9(x, x2, x3, x4, x5, x6, x7, x8, x9) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9 +#define PSTRINGIFY_10(x, x2, x3, x4, x5, x6, x7, x8, x9, xa) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa +#define PSTRINGIFY_11(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb +#define PSTRINGIFY_12(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc +#define PSTRINGIFY_13(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd +#define PSTRINGIFY_14(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd, #xe +#define PSTRINGIFY_15(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd, #xe, #xf +#define PSTRINGIFY_16(x, x2, x3, x4, x5, x6, x7, x8, x9, xa, xb, xc, xd, xe, xf, x10) \ + #x, #x2, #x3, #x4, #x5, #x6, #x7, #x8, #x9, #xa, #xb, #xc, #xd, #xe, #xf, #x10 + +// clang-format on + +/// \brief Individually stringify up to 16 arguments +/// +/// PSTRINGIFY_VA(a, b, c) will be expanded to "a", "b", "c" +/// +/// \returns List of stringified individual arguments +/// +#define PSTRINGIFY_VA(...) \ + PMSVC_VARARG_BUG(PCONCAT, (PSTRINGIFY_, PNARGS(__VA_ARGS__)))(__VA_ARGS__) + +/// \brief Dispatch VARARG macro to specialized macros +/// +/// ``` +/// #define LOCAL_LIB_ENTRY(...) PCALLVARARG(LOCAL_LIB_ENTRY_, __VA_ARGS__) +/// ``` +/// +/// Will pass varargs depending on number of arguments to +/// +/// ``` +/// LOCAL_LIB_ENTRY_1(a1) +/// LOCAL_LIB_ENTRY_2(a1 , a2) +/// ``` +/// +/// \returns result of specialized macro +/// +#define PCALLVARARG(MAC, ...) \ + PMSVC_VARARG_BUG(PCONCAT, (MAC, PNARGS(__VA_ARGS__)))(__VA_ARGS__) + +// FIXME:: __FUNCTION__ may be not be supported by all compilers. + +#define PSOURCELOC() plib::source_location(__FILE__, __LINE__) namespace plib { namespace util { - const pstring buildpath(std::initializer_list<pstring> list ); - const pstring environment(const pstring &var, const pstring &default_val); + pstring basename(const pstring &filename, const pstring &suffix = ""); + pstring path(const pstring &filename); + bool exists(const pstring &filename); + pstring build_path(std::initializer_list<pstring> list); + pstring environment(const pstring &var, const pstring &default_val); } // namespace util namespace container @@ -40,18 +128,19 @@ namespace plib static constexpr const std::size_t npos = static_cast<std::size_t>(-1); template <class C> - std::size_t indexof(C &con, const typename C::value_type &elem) + std::size_t index_of(C &con, const typename C::value_type &elem) { auto it = std::find(con.begin(), con.end(), elem); if (it != con.end()) - return static_cast<std::size_t>(it - con.begin()); + return narrow_cast<std::size_t>(it - con.begin()); return npos; } template <class C> - void insert_at(C &con, const std::size_t index, const typename C::value_type &elem) + void insert_at(C &con, const std::size_t index, + const typename C::value_type &elem) { - con.insert(con.begin() + static_cast<std::ptrdiff_t>(index), elem); + con.insert(con.begin() + narrow_cast<std::ptrdiff_t>(index), elem); } template <class C> @@ -61,198 +150,72 @@ namespace plib } } // namespace container - /* May be further specialized .... This is the generic version */ - template <typename T> - struct constants - { - static constexpr T zero() noexcept { return static_cast<T>(0); } - static constexpr T one() noexcept { return static_cast<T>(1); } - static constexpr T two() noexcept { return static_cast<T>(2); } - static constexpr T sqrt2() noexcept { return static_cast<T>(1.414213562373095048801688724209); } - static constexpr T pi() noexcept { return static_cast<T>(3.14159265358979323846264338327950); } - - /*! - * \brief Electric constant of vacuum - */ - static constexpr T eps_0() noexcept { return static_cast<T>(8.854187817e-12); } - /*! - * \brief Relative permittivity of Silicon dioxide - */ - static constexpr T eps_SiO2() noexcept { return static_cast<T>(3.9); } - /*! - * \brief Relative permittivity of Silicon - */ - static constexpr T eps_Si() noexcept { return static_cast<T>(11.7); } - /*! - * \brief Boltzmann constant - */ - static constexpr T k_b() noexcept { return static_cast<T>(1.38064852e-23); } - /*! - * \brief room temperature (gives VT = 0.02585 at T=300) - */ - static constexpr T T0() noexcept { return static_cast<T>(300); } - /*! - * \brief Elementary charge - */ - static constexpr T Q_e() noexcept { return static_cast<T>(1.6021765314e-19); } - /*! - * \brief Intrinsic carrier concentration in 1/m^3 of Silicon - */ - static constexpr T NiSi() noexcept { return static_cast<T>(1.45e16); } - - template <typename V> - static constexpr const T cast(V &&v) noexcept { return static_cast<T>(v); } - }; - - static_assert(noexcept(constants<double>::one()) == true, "Not evaluated as constexpr"); - - - template <class C> - struct indexed_compare + /// \brief Consistent hash implementation + /// + /// Hash implementations in c++ standard libraries may differ and deliver + /// different results. This hash can be used as a replacement hash in e.g. + /// std::map to deliver consistent results. + /// + /// \tparam V result type + /// \tparam T buffer element type + /// \param buf pointer to buffer for which hash should be calculated + /// \param size number of buffer elements + /// \return the hash of the buffer + /// + template <typename V, typename T> + constexpr V hash(const T *buf, std::size_t size) noexcept { - explicit indexed_compare(const C& target): m_target(target) {} - - bool operator()(int a, int b) const { return m_target[a] < m_target[b]; } - - const C& m_target; - }; - - // ---------------------------------------------------------------------------------------- - // string list - // ---------------------------------------------------------------------------------------- - - std::vector<pstring> psplit(const pstring &str, const pstring &onstr, bool ignore_empty = false); - std::vector<pstring> psplit(const pstring &str, const std::vector<pstring> &onstrl); - std::vector<std::string> psplit_r(const std::string &stri, - const std::string &token, - const std::size_t maxsplit); - - // ---------------------------------------------------------------------------------------- - // number conversions - // ---------------------------------------------------------------------------------------- - - template <typename T, typename S> - T pstonum_locale(const std::locale &loc, const S &arg, std::size_t *idx) - { - std::stringstream ss; - ss.imbue(loc); - ss << arg; - auto len(ss.tellp()); - T x(constants<T>::zero()); - if (ss >> x) - { - auto pos(ss.tellg()); - if (pos == static_cast<decltype(pos)>(-1)) - pos = len; - *idx = static_cast<std::size_t>(pos); - } - else - *idx = constants<std::size_t>::zero(); - //printf("%s, %f, %lu %ld\n", arg, (double)x, *idx, (long int) ss.tellg()); - return x; + V result = 5381; // NOLINT + for (const T *p = buf; p != buf + size; p++) + result = ((result << 5) + result) ^ (result >> (32 - 5)) + ^ narrow_cast<std::size_t>(*p); // NOLINT + return result; } - template <typename T, typename E = void> - struct pstonum_helper; - - template<typename T> - struct pstonum_helper<T, typename std::enable_if<std::is_integral<T>::value && std::is_signed<T>::value>::type> + /// \brief Execute code at end of block + /// + /// The class can be used to execute code at the end of a block. It follows + /// the same design as std::lock_guard. + /// + /// Since the functor is executed in the destructor of the class the + /// execution is protected by a try catch block. If an exception is raised, + /// \ref plib::terminate is called. + /// + /// \tparam F type of functor - will be derived by template deduction guide + /// + template <typename F> + struct functor_guard { - template <typename S> - long long operator()(std::locale loc, const S &arg, std::size_t *idx) + /// \brief constructor + /// + /// \param f functor to execute + functor_guard(F &&f) + : m_f(std::move(f)) { - //return std::stoll(arg, idx); - return pstonum_locale<long long>(loc, arg, idx); } - }; - - template<typename T> - struct pstonum_helper<T, typename std::enable_if<std::is_integral<T>::value && !std::is_signed<T>::value>::type> - { - template <typename S> - unsigned long long operator()(std::locale loc, const S &arg, std::size_t *idx) + /// \brief destructor + /// + ~functor_guard() { - //return std::stoll(arg, idx); - return pstonum_locale<unsigned long long>(loc, arg, idx); + try + { + m_f(); + } + catch (...) + { + plib::terminate("exception raised in lambda_guard"); + } } - }; - template<typename T> - struct pstonum_helper<T, typename std::enable_if<std::is_floating_point<T>::value>::type> - { - template <typename S> - long double operator()(std::locale loc, const S &arg, std::size_t *idx) - { - return pstonum_locale<long double>(loc, arg, idx); - } + private: + F m_f; }; - template<typename T, typename S> - T pstonum(const S &arg, std::locale loc = std::locale::classic()) - { - decltype(arg.c_str()) cstr = arg.c_str(); - std::size_t idx(0); - auto ret = pstonum_helper<T>()(loc, cstr, &idx); - using ret_type = decltype(ret); - if (ret >= static_cast<ret_type>(std::numeric_limits<T>::lowest()) - && ret <= static_cast<ret_type>(std::numeric_limits<T>::max())) - //&& (ret == T(0) || std::abs(ret) >= std::numeric_limits<T>::min() )) - { - if (cstr[idx] != 0) - throw pexception(pstring("Continuation after numeric value ends: ") + cstr); - } - else - { - throw pexception(pstring("Out of range: ") + cstr); - } - return static_cast<T>(ret); - } - - template<typename R, bool CLOCALE, typename T> - R pstonum_ne(const T &str, bool &err, std::locale loc = std::locale::classic()) noexcept - { - try - { - err = false; - return pstonum<R>(str, loc); - } - catch (...) - { - err = true; - return R(0); - } - } - - //============================================================ - // penum - strongly typed enumeration - //============================================================ - - struct penum_base - { - protected: - static int from_string_int(const char *str, const char *x); - static std::string nthstr(int n, const char *str); - }; + /// \brief template deduction guide + /// + template <class F> + functor_guard(F f) -> functor_guard<F>; } // namespace plib -#define P_ENUM(ename, ...) \ - struct ename : public plib::penum_base { \ - enum E { __VA_ARGS__ }; \ - ename (E v) : m_v(v) { } \ - bool set_from_string (const std::string &s) { \ - static char const *const strings = # __VA_ARGS__; \ - int f = from_string_int(strings, s.c_str()); \ - if (f>=0) { m_v = static_cast<E>(f); return true; } else { return false; } \ - } \ - operator E() const {return m_v;} \ - bool operator==(const ename &rhs) const {return m_v == rhs.m_v;} \ - bool operator==(const E &rhs) const {return m_v == rhs;} \ - std::string name() const { \ - static char const *const strings = # __VA_ARGS__; \ - return nthstr(static_cast<int>(m_v), strings); \ - } \ - private: E m_v; }; - - -#endif /* PUTIL_H_ */ +#endif // PUTIL_H_ diff --git a/src/lib/netlist/plib/vector_ops.h b/src/lib/netlist/plib/vector_ops.h index bdeb24ae502..f669f6a29d9 100644 --- a/src/lib/netlist/plib/vector_ops.h +++ b/src/lib/netlist/plib/vector_ops.h @@ -1,20 +1,21 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * vector_ops.h - * - * Base vector operations - * - */ #ifndef PLIB_VECTOR_OPS_H_ #define PLIB_VECTOR_OPS_H_ +/// +/// \file vector_ops.h +/// +/// Base vector operations +/// +/// #include "pconfig.h" +#include "pgsl.h" +#include "pmath.h" #include <algorithm> #include <array> -#include <cmath> #include <type_traits> #if !defined(__clang__) && !defined(_MSC_VER) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ > 6)) @@ -27,117 +28,123 @@ namespace plib { template<typename VT, typename T> - void vec_set_scalar(const std::size_t n, VT &v, T && scalar) + void vec_set_scalar(VT &v, T && scalar) noexcept { + const std::size_t n(v.size()); const typename std::remove_reference<decltype(v[0])>::type s(std::forward<T>(scalar)); for ( std::size_t i = 0; i < n; i++ ) v[i] = s; } template<typename VT, typename VS> - void vec_set(const std::size_t n, VT &v, const VS & source) + void vec_set(VT &v, const VS & source) noexcept { + const std::size_t n(v.size()); + gsl_Expects(n <= source.size()); for ( std::size_t i = 0; i < n; i++ ) v[i] = source[i]; } template<typename T, typename V1, typename V2> - T vec_mult(const std::size_t n, const V1 & v1, const V2 & v2 ) + T vec_mult(const V1 & v1, const V2 & v2 ) noexcept { - using b8 = std::array<T, 8>; - PALIGNAS_VECTOROPT() b8 value = {0}; + const std::size_t n(v1.size()); + gsl_Expects(n <= v2.size()); + T ret(plib::constants<T>::zero()); for (std::size_t i = 0; i < n ; i++ ) { - value[i & 7] += v1[i] * v2[i]; + ret += v1[i] * v2[i]; // NOLINT } - return value[0] + value[1] + value[2] + value[3] + value[4] + value[5] + value[6] + value[7]; + return ret; } template<typename T, typename VT> - T vec_mult2(const std::size_t n, const VT &v) + T vec_mult2(const VT &v) noexcept { - using b8 = std::array<T, 8>; - PALIGNAS_VECTOROPT() b8 value = {0}; + const std::size_t n(v.size()); + T ret(plib::constants<T>::zero()); for (std::size_t i = 0; i < n ; i++ ) { - value[i & 7] += v[i] * v[i]; + ret += v[i] * v[i]; } - return value[0] + value[1] + value[2] + value[3] + value[4] + value[5] + value[6] + value[7]; + return ret; } template<typename T, typename VT> - T vec_sum(const std::size_t n, const VT &v) + T vec_sum(const VT &v) noexcept { - if (n<8) + const std::size_t n(v.size()); + T ret(plib::constants<T>::zero()); + for (std::size_t i = 0; i < n ; i++ ) { - T value(0); - for (std::size_t i = 0; i < n ; i++ ) - value += v[i]; - - return value; + ret += v[i]; } - else - { - using b8 = std::array<T, 8>; - PALIGNAS_VECTOROPT() b8 value = {0}; - for (std::size_t i = 0; i < n ; i++ ) - value[i & 7] += v[i]; - return ((value[0] + value[1]) + (value[2] + value[3])) + ((value[4] + value[5]) + (value[6] + value[7])); - } + return ret; } template<typename VV, typename T, typename VR> - void vec_mult_scalar(const std::size_t n, VR & result, const VV & v, T && scalar) + void vec_mult_scalar(VR & result, const VV & v, T && scalar) noexcept { + const std::size_t n(result.size()); + gsl_Expects(n <= v.size()); const typename std::remove_reference<decltype(v[0])>::type s(std::forward<T>(scalar)); for ( std::size_t i = 0; i < n; i++ ) result[i] = s * v[i]; } template<typename VR, typename VV, typename T> - void vec_add_mult_scalar(const std::size_t n, VR & result, const VV & v, T && scalar) + void vec_add_mult_scalar(VR & result, const VV & v, T && scalar) noexcept { + const std::size_t n(result.size()); + gsl_Expects(n <= v.size()); const typename std::remove_reference<decltype(v[0])>::type s(std::forward<T>(scalar)); for ( std::size_t i = 0; i < n; i++ ) result[i] += s * v[i]; } template<typename T> - void vec_add_mult_scalar_p(const std::size_t n, T * result, const T * v, T scalar) + void vec_add_mult_scalar_p(const std::size_t n, T * result, const T * v, T scalar) noexcept { for ( std::size_t i = 0; i < n; i++ ) result[i] += scalar * v[i]; } template<typename R, typename V> - void vec_add_ip(const std::size_t n, R & result, const V & v) + void vec_add_ip(R & result, const V & v) noexcept { + const std::size_t n(result.size()); + gsl_Expects(n <= v.size()); for ( std::size_t i = 0; i < n; i++ ) result[i] += v[i]; } template<typename VR, typename V1, typename V2> - void vec_sub(const std::size_t n, VR & result, const V1 &v1, const V2 & v2) + void vec_sub(VR & result, const V1 &v1, const V2 & v2) noexcept { + const std::size_t n(result.size()); + gsl_Expects(n <= v1.size()); + gsl_Expects(n <= v2.size()); for ( std::size_t i = 0; i < n; i++ ) result[i] = v1[i] - v2[i]; } template<typename V, typename T> - void vec_scale(const std::size_t n, V & v, T &&scalar) + void vec_scale(V & v, T &&scalar) noexcept { + const std::size_t n(v.size()); const typename std::remove_reference<decltype(v[0])>::type s(std::forward<T>(scalar)); for ( std::size_t i = 0; i < n; i++ ) v[i] *= s; } template<typename T, typename V> - T vec_maxabs(const std::size_t n, const V & v) + T vec_max_abs(const V & v) noexcept { - T ret = 0.0; + const std::size_t n(v.size()); + T ret(plib::constants<T>::zero()); for ( std::size_t i = 0; i < n; i++ ) - ret = std::max(ret, std::abs(v[i])); + ret = std::max(ret, plib::abs(v[i])); return ret; } @@ -149,4 +156,4 @@ namespace plib #endif #endif -#endif /* PLIB_VECTOR_OPS_H_ */ +#endif // PLIB_VECTOR_OPS_H_ diff --git a/src/lib/netlist/prg/nltool.cpp b/src/lib/netlist/prg/nltool.cpp index 1c5256654b1..85654e174ce 100644 --- a/src/lib/netlist/prg/nltool.cpp +++ b/src/lib/netlist/prg/nltool.cpp @@ -1,240 +1,322 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/*************************************************************************** - nltool.c - - Simple tool to debug netlists outside MAME. - -****************************************************************************/ - -#include "netlist/plib/pmain.h" -#include "netlist/devices/net_lib.h" -#include "netlist/nl_parser.h" -#include "netlist/nl_errstr.h" -#include "netlist/nl_setup.h" -#include "netlist/solver/nld_solver.h" -#include "netlist/tools/nl_convert.h" +// *************************************************************************** +// +// nltool.cpp +// +// Simple tool to debug netlists outside MAME. +// +// *************************************************************************** + +#include "plib/pdynlib.h" +#include "core/setup.h" +#include "devices/net_lib.h" +#include "nl_errstr.h" +#include "nl_parser.h" +#include "nl_setup.h" +#include "plib/pmain.h" +#include "plib/pstrutil.h" +#include "solver/nld_solver.h" +#include "tools/nl_convert.h" + +#include "plib/ptests.h" #include <cstdio> // scanf #include <iomanip> // scanf -#include <iostream> // scanf #include <ios> +#include <iostream> // scanf + +#ifndef NL_DISABLE_DYNAMIC_LOAD +#define NL_DISABLE_DYNAMIC_LOAD 0 +#endif + +// FIXME: "NamingConvention", "FunctionTable:", "Pinalias" need to be renamed here +// and in all source locations. +// spell-checker: words Pinalias, devsyn, csynopsis, subpage + +// +// Names +// spell-checker: words Woodbury, Raphson, +// +// FIXME: These are either defined in other parts or have more complex consequences +// spell-checker: words nlconst, rpad, pfmt, pexception, pbinary, dynlib, pstring, psplit,putf +// +// FIXME: nlconst -> nl_const +// +// Specific technical terms +// spell-checker: words rinf -#define NLTOOL_VERSION 20190420 +extern const plib::static_library::symbol nl_static_solver_syms[]; + +// Forward declarations + +class netlist_tool_t; class tool_app_t : public plib::app { public: tool_app_t() : plib::app(), + m_warnings(0), + m_errors(0), + opt_grp1(*this, "General options", "The following options apply to all commands."), - opt_cmd (*this, "c", "cmd", 0, std::vector<pstring>({"run","validate","convert","listdevices","static","header","docheader"}), "run|validate|convert|listdevices|static|header|docheader"), - opt_file(*this, "f", "file", "-", "file to process (default is stdin)"), + opt_cmd (*this, "c", "cmd", 0, std::vector<pstring>({"run","validate","convert","list-devices","list-models","static","header","doc-header","tests"}), "run|validate|convert|list-devices|list-models|static|header|doc-header|tests"), + opt_includes(*this, "I", "include", "Add the directory to the list of directories to be searched for header files. This option may be specified repeatedly."), opt_defines(*this, "D", "define", "predefine value as macro, e.g. -Dname=value. If '=value' is omitted predefine it as 1. This option may be specified repeatedly."), - opt_rfolders(*this, "r", "rom", "where to look for data files"), + opt_data_folders(*this, "d", "data", "where to look for data files"), opt_verb(*this, "v", "verbose", "be verbose - this produces lots of output"), opt_quiet(*this, "q", "quiet", "be quiet - no warnings"), + opt_pre_pro(*this, "", "prepro", "output preprocessor output to stderr"), + opt_progress(*this, "", "progress", "show progress bar on longer operations"), + + opt_files(*this, "files to process"), + opt_version(*this, "", "version", "display version and exit"), opt_help(*this, "h", "help", "display help and exit"), opt_grp2(*this, "Options for run and static commands", "These options apply to run and static commands."), opt_name(*this, "n", "name", "", "the netlist in file specified by ""-f"" option to run; default is first one"), - opt_grp3(*this, "Options for run command", "These options are only used by the run command."), - opt_ttr (*this, "t", "time_to_run", 1.0, "time to run the emulation (seconds)\n\n abc def\n\n xyz"), + opt_grp3(*this, "Options for static command", "These options apply to static command."), + opt_dir(*this, "d", "dir", "", "output directory for the generated files."), + opt_out(*this, "o", "output", "", "single output file for the generated code.\nEither --dir or --output can be specificied"), +// opt_static_include(*this, "", "static-include", "write static solvers to individual files\nincluded by file specified with --output.\n--dir must be path to \"generated/static\" path in netlist folder."), + opt_static_include(*this, "", "static-include", "write static solvers to individual files included by file specified with --output. --dir must be path to \"generated/static\" path in netlist folder."), + + opt_grp4(*this, "Options for run command", "These options are only used by the run command."), + opt_ttr (*this, "t", "time_to_run", 1, "time to run the emulation (seconds)"), + opt_boost_lib(*this, "", "boost-lib", "builtin", "generic: will use generic solvers.\nbuiltin: Use optimized solvers compiled in.\nsome_lib.so: Use library with precompiled solvers."), opt_stats(*this, "s", "statistics", "gather runtime statistics"), opt_logs(*this, "l", "log" , "define terminal to log. This option may be specified repeatedly."), opt_inp(*this, "i", "input", "", "input file to process (default is none)"), - opt_loadstate(*this,"", "loadstate", "", "load state from file and continue from there"), - opt_savestate(*this,"", "savestate", "", "save state to file at end of run"), + opt_load_state(*this,"", "load-state", "", "load state from file and continue from there"), + opt_save_state(*this,"", "save-state", "", "save state to file at end of run"), + opt_fp_error(*this, "", "fp-error", "raise exception on floating point errors. This is intended to be used during debugging."), - opt_grp4(*this, "Options for convert command", "These options are only used by the convert command."), - opt_type(*this, "y", "type", 0, std::vector<pstring>({"spice","eagle","rinf"}), "type of file to be converted: spice,eagle,rinf"), + opt_grp5(*this, "Options for convert command", "These options are only used by the convert command."), + opt_type(*this, "y", "type", 0, std::vector<pstring>({"spice","eagle","rinf"}), "type of file to be converted: spice,eagle,rinf"), - opt_grp5(*this, "Options for header command", "These options are only used by the header command."), - opt_tabwidth(*this, "", "tab-width", 4, "Tab width for output."), - opt_linewidth(*this,"", "line-width", 72, "Line width for output."), + opt_grp6(*this, "Options for validate command", "These options are only used by the validate command."), - opt_ex1(*this, "nltool -c run -t 3.5 -f nl_examples/cdelay.c -n cap_delay", + opt_grp7(*this, "Options for header command", "These options are only used by the header command."), + opt_tab_width(*this, "", "tab-width", 4, "Tab width for output."), + opt_line_width(*this,"", "line-width", 72, "Line width for output."), + opt_pattern(*this, "", "pattern", "Pattern to match against device names. If the device name contains pattern, the device will be included in the output. Multiple patterns can be specified, if none is given, all devices will be output."), + + opt_ex1(*this, "nltool -c run -t 3.5 -n cap_delay nl_examples/cdelay.c", "Run netlist \"cap_delay\" from file nl_examples/cdelay.c for 3.5 seconds"), - opt_ex2(*this, "nltool --cmd=listdevices", + opt_ex2(*this, "nltool --cmd=list-devices", "List all known devices."), opt_ex3(*this, "nltool --cmd=header --tab-width=8 --line-width=80", "Create the header file needed for including netlists as code."), - - m_warnings(0), - m_errors(0) + opt_ex4(*this, "nltool --cmd static --output src/lib/netlist/generated/static_solvers.cpp src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp", + "Create static solvers for the MAME project using one single source file."), + opt_ex5(*this, "nltool --cmd static --output src/lib/netlist/generated/static_solvers.cpp --dir src/lib/netlist/generated/static --static_include src/mame/audio/nl_*.cpp src/mame/machine/nl_*.cpp", + "Create static solvers for the MAME project using a single source file which includes generated solvers written to --dir folder."), + opt_ex6(*this, "nltool --cmd tests", + "Run unit tests. In case the unit tests are not linked in, this will do nothing.") {} + int execute() override; + pstring usage() override; + + template<typename... ARGS> + void output_with_prefix(const pstring &prefix, const pstring &fmt, ARGS&&... args) + { + pstring res = plib::pfmt(fmt)(std::forward<ARGS>(args)...); + auto lines(plib::psplit(res, '\n', false)); + if (lines.empty()) + std_out(prefix + "\n"); + else + for (auto &l : lines) + std_out(prefix + l + "\n"); + } + + int m_warnings; + int m_errors; +private: plib::option_group opt_grp1; plib::option_str_limit<unsigned> opt_cmd; - plib::option_str opt_file; + plib::option_vec opt_includes; plib::option_vec opt_defines; - plib::option_vec opt_rfolders; + plib::option_vec opt_data_folders; plib::option_bool opt_verb; plib::option_bool opt_quiet; + plib::option_bool opt_pre_pro; + plib::option_bool opt_progress; + plib::option_args opt_files; plib::option_bool opt_version; plib::option_bool opt_help; + plib::option_group opt_grp2; plib::option_str opt_name; + plib::option_group opt_grp3; - plib::option_num<double> opt_ttr; + plib::option_str opt_dir; + plib::option_str opt_out; + plib::option_bool opt_static_include; + + plib::option_group opt_grp4; + plib::option_num<netlist::nl_fptype> opt_ttr; + plib::option_str opt_boost_lib; plib::option_bool opt_stats; plib::option_vec opt_logs; plib::option_str opt_inp; - plib::option_str opt_loadstate; - plib::option_str opt_savestate; - plib::option_group opt_grp4; - plib::option_str_limit<unsigned> opt_type; + plib::option_str opt_load_state; + plib::option_str opt_save_state; + plib::option_bool opt_fp_error; + plib::option_group opt_grp5; - plib::option_num<unsigned> opt_tabwidth; - plib::option_num<unsigned> opt_linewidth; + plib::option_str_limit<unsigned> opt_type; + + plib::option_group opt_grp6; + plib::option_group opt_grp7; + plib::option_num<unsigned> opt_tab_width; + plib::option_num<unsigned> opt_line_width; + plib::option_vec opt_pattern; plib::option_example opt_ex1; plib::option_example opt_ex2; plib::option_example opt_ex3; + plib::option_example opt_ex4; + plib::option_example opt_ex5; + plib::option_example opt_ex6; - int execute() override; - pstring usage() override; + struct compile_map_entry + { + compile_map_entry(const pstring &mod, const pstring &code) + : m_code(code) + { + m_modules.push_back(mod); + } + pstring m_code; + std::vector<pstring> m_modules; + }; + + using compile_map = std::map<pstring, compile_map_entry>; + + void logger(plib::plog_level l, const pstring &ls); + + void run_with_progress(netlist_tool_t &nt, netlist::netlist_time_ext start, netlist::netlist_time_ext duration); - int m_warnings; - int m_errors; -private: void run(); void validate(); void convert(); + + void compile_one_and_add_to_map(const pstring &file, + const pstring &name, netlist::solver::static_compile_target target, + compile_map &map); void static_compile(); - void mac_out(const pstring &s, const bool cont = true); + void mac_out(const pstring &s, bool cont = true); void header_entry(const netlist::factory::element_t *e); void mac(const netlist::factory::element_t *e); void create_header(); - void create_docheader(); + void create_doc_header(); - void listdevices(); + void list_models(); + void list_devices(); - std::vector<pstring> m_options; + std::vector<pstring> m_defines; }; static NETLIST_START(dummy) - /* Standard stuff */ - - CLOCK(clk, 1000) // 1000 Hz - SOLVER(Solver, 48000) - -NETLIST_END() +{ +} -/*************************************************************************** - CORE IMPLEMENTATION -***************************************************************************/ +// ************************************************************************** +// CORE IMPLEMENTATION +// ************************************************************************** -class netlist_data_folder_t : public netlist::source_t +class netlist_data_folder_t : public netlist::source_data_t { public: - netlist_data_folder_t(const pstring &folder) - : netlist::source_t(netlist::source_t::DATA) - , m_folder(folder) + explicit netlist_data_folder_t(const pstring &folder) + : m_folder(folder) { } - plib::unique_ptr<std::istream> stream(const pstring &file) override + plib::istream_uptr stream(const pstring &file) override { pstring name = m_folder + "/" + file; - auto strm(plib::make_unique<std::ifstream>(plib::filesystem::u8path(name))); + plib::istream_uptr strm(std::make_unique<plib::ifstream>(plib::filesystem::u8path(name)), plib::filesystem::u8path(name)); if (strm->fail()) - return plib::unique_ptr<std::istream>(nullptr); - else - { - strm->imbue(std::locale::classic()); - return std::move(strm); - } + return plib::istream_uptr(); + + strm->imbue(std::locale::classic()); + return strm; } private: pstring m_folder; }; -class netlist_tool_callbacks_t : public netlist::callbacks_t +class netlist_tool_t : public netlist::netlist_state_t { public: - netlist_tool_callbacks_t(tool_app_t &app) - : netlist::callbacks_t() - , m_app(app) - { } - - void vlog(const plib::plog_level &l, const pstring &ls) const override; -private: - tool_app_t &m_app; -}; - -class netlist_tool_t : public netlist::netlist_t -{ -public: - - netlist_tool_t(tool_app_t &app, const pstring &aname) - : netlist::netlist_t(aname, plib::make_unique<netlist_tool_callbacks_t>(app)) - { - } - - void init() + netlist_tool_t(plib::plog_delegate logger, const pstring &name, const pstring &boost_lib) + : netlist::netlist_state_t(name, logger) { + if (boost_lib == "builtin") + set_static_solver_lib(std::make_unique<plib::static_library>(nl_static_solver_syms)); + else if (boost_lib == "generic") + set_static_solver_lib(std::make_unique<plib::static_library>(nullptr)); + else if (NL_DISABLE_DYNAMIC_LOAD) + throw netlist::nl_exception("Dynamic library loading not supported due to project security concerns."); + else + //#pstring libpath = plib::util::environment("NL_BOOSTLIB", plib::util::buildpath({".", "nlboost.so"})); + set_static_solver_lib(std::make_unique<plib::dynamic_library>(boost_lib)); } - netlist::setup_t &setup() { return nlstate().setup(); } - void read_netlist(const pstring &filename, const pstring &name, const std::vector<pstring> &logs, const std::vector<pstring> &defines, - const std::vector<pstring> &roms) + const std::vector<pstring> &roms, + const std::vector<pstring> &includes) { // read the netlist ... - for (auto & d : defines) - setup().add_define(d); + for (const auto & d : defines) + parser().add_define(d); + + for (const auto & r : roms) + parser().register_source<netlist_data_folder_t>(r); - for (auto & r : roms) - setup().register_source(plib::make_unique<netlist_data_folder_t>(r)); + parser().add_include<netlist_data_folder_t>(plib::util::path(filename)); - setup().register_source(plib::make_unique<netlist::source_file_t>(filename)); - setup().include(name); - create_dynamic_logs(logs); + for (const auto & i : includes) + parser().add_include<netlist_data_folder_t>(i); + + parser().register_source<netlist::source_file_t>(filename); + parser().include(name); + parser().register_dynamic_log_devices(logs); // start devices setup().prepare_to_run(); } - void create_dynamic_logs(const std::vector<pstring> &logs) - { - log().debug("Creating dynamic logs ...\n"); - for (auto & log : logs) - { - pstring name = "log_" + log; - /*netlist_device_t *nc = */ setup().register_dev("LOG", name); - setup().register_link(name + ".I", log); - } - } - std::vector<char> save_state() { run_state_manager().pre_save(); std::size_t size = 0; for (auto const & s : run_state_manager().save_list()) - size += s->m_dt.size * s->m_count; + size += s->dt().size() * s->count(); std::vector<char> buf(size); char *p = buf.data(); for (auto const & s : run_state_manager().save_list()) { - std::size_t sz = s->m_dt.size * s->m_count; - if (s->m_dt.is_float || s->m_dt.is_integral) - std::copy(static_cast<char *>(s->m_ptr), - static_cast<char *>(s->m_ptr) + sz, p); + std::size_t sz = s->dt().size() * s->count(); + if (s->dt().is_float() || s->dt().is_integral()) + std::copy(static_cast<char *>(s->ptr()), + static_cast<char *>(s->ptr()) + sz, p); else - log().fatal("found unsupported save element {1}\n", s->m_name); + log().fatal("found unsupported save element {1}\n", s->name()); p += sz; } return buf; @@ -244,7 +326,7 @@ public: { std::size_t size = 0; for (auto const & s : run_state_manager().save_list()) - size += s->m_dt.size * s->m_count; + size += s->dt().size() * s->count(); if (buf.size() != size) throw netlist::nl_exception("Size different during load state."); @@ -253,15 +335,15 @@ public: for (auto const & s : run_state_manager().save_list()) { - std::size_t sz = s->m_dt.size * s->m_count; - if (s->m_dt.is_float || s->m_dt.is_integral) - std::copy(p, p + sz, static_cast<char *>(s->m_ptr)); + std::size_t sz = s->dt().size() * s->count(); + if (s->dt().is_float() || s->dt().is_integral()) + std::copy(p, p + sz, static_cast<char *>(s->ptr())); else - log().fatal("found unsupported save element {1}\n", s->m_name); + log().fatal("found unsupported save element {1}\n", s->name()); p += sz; } run_state_manager().post_load(); - nlstate().rebuild_lists(); + this->rebuild_lists(); } protected: @@ -269,74 +351,62 @@ protected: private: }; -void netlist_tool_callbacks_t::vlog(const plib::plog_level &l, const pstring &ls) const -{ - pstring err = plib::pfmt("{}: {}\n")(l.name())(ls.c_str()); - if (l == plib::plog_level::WARNING) - m_app.m_warnings++; - if (l == plib::plog_level::ERROR) - m_app.m_errors++; - if (l == plib::plog_level::FATAL) - { - m_app.m_errors++; - throw netlist::nl_exception(err); - } - else - m_app.pout("{}", err); -} struct input_t { - input_t(const netlist::setup_t &setup, const pstring &line) - : m_value(0.0) + input_t(const netlist::setup_t &setup, const putf8string &line) + : m_value(netlist::nlconst::zero()) { std::array<char, 400> buf; // NOLINT(cppcoreguidelines-pro-type-member-init) - double t; + double t(0); + double val(0); + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) - int e = std::sscanf(line.c_str(), "%lf,%[^,],%lf", &t, buf.data(), &m_value); + int e = std::sscanf(line.c_str(), "%lf,%[^,],%lf", &t, buf.data(), &val); if (e != 3) throw netlist::nl_exception(plib::pfmt("error {1} scanning line {2}\n")(e)(line)); - m_time = netlist::netlist_time::from_double(t); - m_param = setup.find_param(pstring(buf.data()), true); + m_value = static_cast<netlist::nl_fptype>(val); + m_time = netlist::netlist_time_ext::from_fp(t); + m_param = setup.find_param(pstring(buf.data())); } - void setparam() + void setparam() const { - switch (m_param->param_type()) + switch (m_param.param().param_type()) { case netlist::param_t::STRING: case netlist::param_t::POINTER: - throw netlist::nl_exception(plib::pfmt("param {1} is not numeric\n")(m_param->name())); + throw netlist::nl_exception(plib::pfmt("param {1} is not numeric\n")(m_param.param().name())); case netlist::param_t::DOUBLE: - static_cast<netlist::param_double_t*>(m_param)->setTo(m_value); + plib::downcast<netlist::param_fp_t &>(m_param.param()).set(m_value); break; case netlist::param_t::INTEGER: - static_cast<netlist::param_int_t*>(m_param)->setTo(static_cast<int>(m_value)); + plib::downcast<netlist::param_int_t &>(m_param.param()).set(static_cast<int>(m_value)); break; case netlist::param_t::LOGIC: - static_cast<netlist::param_logic_t*>(m_param)->setTo(static_cast<bool>(m_value)); + plib::downcast<netlist::param_logic_t &>(m_param.param()).set(static_cast<bool>(m_value)); break; } } - netlist::netlist_time m_time; - netlist::param_t *m_param; - double m_value; + netlist::netlist_time_ext m_time; + netlist::param_ref_t m_param; + netlist::nl_fptype m_value; }; static std::vector<input_t> read_input(const netlist::setup_t &setup, const pstring &fname) { std::vector<input_t> ret; - if (fname != "") + if (!fname.empty()) { - plib::putf8_reader r = plib::putf8_reader(std::ifstream(plib::filesystem::u8path(fname))); + plib::putf8_reader r = plib::putf8_reader(std::make_unique<plib::ifstream>(plib::filesystem::u8path(fname))); if (r.stream().fail()) throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(fname)); r.stream().imbue(std::locale::classic()); - pstring l; - while (r.readline(l)) + putf8string l; + while (r.read_line(l)) { - if (l != "") + if (!l.empty()) { input_t inp(setup, l); ret.push_back(inp); @@ -346,106 +416,154 @@ static std::vector<input_t> read_input(const netlist::setup_t &setup, const pstr return ret; } +void tool_app_t::run_with_progress(netlist_tool_t &nt, netlist::netlist_time_ext start, netlist::netlist_time_ext duration) +{ + if (!opt_progress()) + nt.exec().process_queue(duration); + else + { + auto now = nt.exec().time(); + auto end = now + duration; + // run to next_sec + while (now < end) + { + auto elapsed = now - start; + auto elapsed_sec = elapsed.in_sec() + 1; + + auto next_sec = start + netlist::netlist_time_ext::from_sec(elapsed_sec); + if (end < next_sec) + { + nt.exec().process_queue(end - now); + } + else + { + nt.exec().process_queue(next_sec - now); + std_out("progress {1:4}s : {2}\r", elapsed_sec, pstring(gsl::narrow_cast<std::size_t>(elapsed_sec), '*')); + std_out.flush(); + } + now = nt.exec().time(); + } + } +} + +void tool_app_t::logger(plib::plog_level l, const pstring &ls) +{ + pstring err = plib::pfmt("{}: {}\n")(l.name())(ls.c_str()); + if (l == plib::plog_level::WARNING) + m_warnings++; + if (l == plib::plog_level::ERROR) + m_errors++; + if (l == plib::plog_level::FATAL) + m_errors++; + std_out("{}", err); +} + void tool_app_t::run() { plib::chrono::timer<plib::chrono::system_ticks> t; - std::vector<input_t> inps; - netlist::netlist_time ttr; - netlist_tool_t nt(*this, "netlist"); + std::vector<input_t> inputs; + netlist::netlist_time_ext duration; - { - auto t_guard(t.guard()); - //plib::perftime_t<plib::exact_ticks> t; + if (opt_files().size() != 1) + throw netlist::nl_exception("nltool: run needs exactly one file"); - nt.enable_stats(opt_stats()); - nt.init(); + if (!plib::util::exists(opt_files()[0])) + throw netlist::nl_exception("nltool: file doesn't exists: {}", opt_files()[0]); - if (!opt_verb()) - nt.log().verbose.set_enabled(false); - if (opt_quiet()) - nt.log().info.set_enabled(false); + t.start(); - nt.read_netlist(opt_file(), opt_name(), - opt_logs(), - m_options, opt_rfolders()); + netlist_tool_t nt(plib::plog_delegate(&tool_app_t::logger, this), "netlist", opt_boost_lib()); - nt.reset(); + nt.exec().enable_stats(opt_stats()); - inps = read_input(nt.setup(), opt_inp()); - ttr = netlist::netlist_time::from_double(opt_ttr()); - } + if (!opt_verb()) + nt.log().verbose.set_enabled(false); + if (opt_quiet()) + nt.log().info.set_enabled(false); + nt.read_netlist(opt_files()[0], opt_name(), + opt_logs(), + m_defines, opt_data_folders(), opt_includes()); - pout("startup time ==> {1:5.3f}\n", t.as_seconds() ); + // Inputs must be read before reset -> will clear setup and parser + inputs = read_input(nt.setup(), opt_inp()); + nt.free_setup_resources(); + nt.exec().reset(); - t.reset(); + duration = netlist::netlist_time_ext::from_fp(opt_ttr()); + t.stop(); + std_out("startup time ==> {1:5.3f}\n", t.as_seconds<netlist::nl_fptype>() ); - netlist::netlist_time nlt = nt.time(); + // FIXME: error handling + if (opt_load_state.was_specified()) { - auto t_guard(t.guard()); + plib::ifstream strm(plib::filesystem::u8path(opt_load_state())); + if (strm.fail()) + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_load_state())); + strm.imbue(std::locale::classic()); + plib::pbinary_reader reader(strm); + std::vector<char> load_state; + reader.read(load_state); + nt.load_state(load_state); + std_out("Loaded state, run will continue at {1:.6f}\n", nt.exec().time().as_double()); + } - // FIXME: error handling - if (opt_loadstate.was_specified()) - { - std::ifstream strm(plib::filesystem::u8path(opt_loadstate())); - if (strm.fail()) - throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_loadstate())); - strm.imbue(std::locale::classic()); - plib::pbinary_reader reader(strm); - std::vector<char> loadstate; - reader.read(loadstate); - nt.load_state(loadstate); - pout("Loaded state, run will continue at {1:.6f}\n", nt.time().as_double()); - } + t.reset(); + netlist::netlist_time_ext start = nt.exec().time(); + { + std_out("runnning ...\n"); unsigned pos = 0; + netlist::netlist_time_ext nlt = start; + auto t_guard(t.guard()); - - while (pos < inps.size() - && inps[pos].m_time < ttr - && inps[pos].m_time >= nlt) + while (pos < inputs.size() + && inputs[pos].m_time < duration + && inputs[pos].m_time >= nlt) { - nt.process_queue(inps[pos].m_time - nlt); - inps[pos].setparam(); - nlt = inps[pos].m_time; + run_with_progress(nt, start, inputs[pos].m_time - nlt); + inputs[pos].setparam(); + nlt = inputs[pos].m_time; pos++; } - pout("runnning ...\n"); - - if (ttr > nlt) - nt.process_queue(ttr - nlt); + if (duration > nlt) + run_with_progress(nt, start, duration - nlt); else { - pout("end time {1:.6f} less than saved time {2:.6f}\n", - ttr.as_double(), nlt.as_double()); - ttr = nlt; + std_out("end time {1:.6f} less than saved time {2:.6f}\n", + duration.as_double(), nlt.as_double()); + duration = nlt; } - - if (opt_savestate.was_specified()) - { - auto savestate = nt.save_state(); - std::ofstream strm(plib::filesystem::u8path(opt_savestate()), std::ios_base::binary); - if (strm.fail()) - throw plib::file_open_e(opt_savestate()); - strm.imbue(std::locale::classic()); - - plib::pbinary_writer writer(strm); - writer.write(savestate); - } - nt.stop(); } - double emutime = t.as_seconds(); - pout("{1:f} seconds emulation took {2:f} real time ==> {3:5.2f}%\n", - (ttr - nlt).as_double(), emutime, - (ttr - nlt).as_double() / emutime * 100.0); + if (opt_save_state.was_specified()) + { + auto save_state = nt.save_state(); + plib::ofstream strm(plib::filesystem::u8path(opt_save_state()), std::ios_base::binary); + if (strm.fail()) + throw plib::file_open_e(opt_save_state()); + strm.imbue(std::locale::classic()); + + plib::pbinary_writer writer(strm); + writer.write(save_state); + } + nt.exec().stop(); + + if (opt_progress()) + std_out("\n"); + auto emulation_time(t.as_seconds<netlist::nl_fptype>()); + std_out("{1:f} seconds emulation took {2:f} real time ==> {3:5.2f}%\n", + (duration - start).as_fp<netlist::nl_fptype>(), emulation_time, + (duration - start).as_fp<netlist::nl_fptype>() / emulation_time * netlist::nlconst::hundred()); } void tool_app_t::validate() { - std::vector<input_t> inps; - netlist_tool_t nt(*this, "netlist"); + netlist_tool_t nt(plib::plog_delegate(&tool_app_t::logger, this), "netlist", opt_boost_lib()); + + if (opt_files().size() != 1) + throw netlist::nl_exception("nltool: validate needs exactly one file"); if (!opt_verb()) nt.log().verbose.set_enabled(false); @@ -455,23 +573,19 @@ void tool_app_t::validate() m_errors = 0; m_warnings = 0; - nt.setup().enable_validation(); - try { - nt.init(); - - nt.read_netlist(opt_file(), opt_name(), + nt.read_netlist(opt_files()[0], opt_name(), opt_logs(), - m_options, opt_rfolders()); + m_defines, opt_data_folders(), opt_includes()); } catch (netlist::nl_exception &e) { - pout("Netlist exception caught: {}\n", e.text()); + std_out("Netlist exception caught: {}\n", e.text()); } catch (plib::pexception &e) { - pout("plib exception caught: {}\n", e.text()); + std_out("plib exception caught: {}\n", e.text()); } //pout("Validation warnings: {}\n", m_warnings); @@ -482,32 +596,298 @@ void tool_app_t::validate() } +void tool_app_t::compile_one_and_add_to_map(const pstring &file, + const pstring &name, netlist::solver::static_compile_target target, + compile_map &map) +{ + try + { + netlist_tool_t nt(plib::plog_delegate(&tool_app_t::logger, this), "netlist", opt_boost_lib()); + + nt.log().verbose.set_enabled(false); + nt.log().info.set_enabled(false); + nt.log().warning.set_enabled(false); + + nt.read_netlist(file, name, + opt_logs(), + m_defines, opt_data_folders(), opt_includes()); + + // need to reset ... + + nt.free_setup_resources(); + nt.exec().reset(); + + auto mp(nt.exec().solver()->create_solver_code(target)); + + for (auto &e : mp) + { + auto it = map.find(e.first); + if (it == map.end()) + map.insert({e.first, compile_map_entry(name, e.second)}); + else + { + if (it->second.m_code != e.second) + { + pstring msg = plib::pfmt("nltool: found hash conflict in {1}, netlist {2}")(file, name); + throw netlist::nl_exception(msg); + } + if (!plib::container::contains(it->second.m_modules, name)) + it->second.m_modules.push_back(name); + } + } + + nt.exec().stop(); + } + catch (netlist::nl_exception &e) + { + std_err("{} : Netlist exception : {}\n", file, e.text()); + } + catch (plib::pexception &e) + { + std_err("{} : Netlist exception : {}\n", file, e.text()); + } +} + void tool_app_t::static_compile() { - netlist_tool_t nt(*this, "netlist"); - nt.init(); + netlist::solver::static_compile_target target = netlist::solver::CXX_STATIC; - nt.log().verbose.set_enabled(false); - nt.log().info.set_enabled(false); + if (!opt_static_include() && ((opt_dir.was_specified() ^ opt_out.was_specified()) == 0)) + throw netlist::nl_exception("either --dir or --output option needed"); - nt.read_netlist(opt_file(), opt_name(), - opt_logs(), - m_options, opt_rfolders()); + if (opt_static_include() && (!opt_dir.was_specified() || !opt_out.was_specified())) + throw netlist::nl_exception("--split requires both --dir and --output option"); - // no reset needed ... + if (!opt_static_include() && opt_dir.was_specified()) + { + if (opt_files().size() != 1) + throw netlist::nl_exception("nltool: static_compile needs exactly one file"); - std::map<pstring, pstring> mp; + compile_map mp; - nt.solver()->create_solver_code(mp); + compile_one_and_add_to_map(opt_files()[0], opt_name(), target, mp); - for (auto &e : mp) + for (auto &e : mp) + { + plib::ofstream output_stream(opt_dir() + "/" + e.first + ".c" ); + output_stream << putf8string(e.second.m_code); + } + } + else { - pout.write(e.second); + compile_map map; + + for (const auto &f : opt_files()) + { + std::vector<pstring> names; + if (opt_name.was_specified()) + names.push_back(opt_name()); + else + { + plib::putf8_reader r = plib::putf8_reader(std::make_unique<plib::ifstream>(plib::filesystem::u8path(f))); + if (r.stream().fail()) + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(f)); + r.stream().imbue(std::locale::classic()); + putf8string line; + while (r.read_line(line)) + { + if (plib::startsWith(line, "//NL_CONTAINS ")) + { + auto sp = plib::psplit(pstring(plib::trim(line.substr(13))), ' ', true); + for (auto &e : sp) + names.push_back(e); + } + } + + if (names.empty()) + { + pstring name = plib::util::basename(f, ".cpp"); + if (plib::startsWith(name, "nl_")) + name = name.substr(3); + names.push_back(name); + } + + } + std::sort(names.begin(), names.end()); + for (auto &name : names) + { + if (!opt_quiet()) + std_out("Processing {}({}) ... \n", name, f); + + compile_one_and_add_to_map(f, name, target, map); + } + } + plib::ofstream output_stream(opt_out()); + if (output_stream.fail()) + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_out())); + + output_stream << "// spell-checker: disable\n\n"; + output_stream << "#include \"plib/pdynlib.h\"\n\n"; + output_stream << "#if !defined(__EMSCRIPTEN__)\n\n"; + + std::vector<std::pair<pstring,pstring>> sort_map; + for (auto &e : map) + sort_map.emplace_back(e.second.m_modules[0], e.first); + + std::sort(sort_map.begin(), sort_map.end(), [](const auto &a, const auto &b) { + return a.first < b.first ? true : (a.first == b.first && a.second < b.second); + }); + + pstring last; + plib::ofstream output_splitted; + for (auto &se : sort_map) + { + const auto &e = map.find(se.second); + pstring mods; + for (auto &s : e->second.m_modules) + mods += s + ","; + mods = plib::left(mods, mods.length()-1); + if (opt_static_include()) + { + auto fname = pstring("sc_") + e->second.m_modules[0] + ".hpp"; + auto fpath(plib::util::build_path({opt_dir(), fname})); + if (last != fpath) + { + last = fpath; + if (output_splitted.is_open()) + output_splitted.close(); + output_splitted.open(fpath); + if (output_stream.fail()) + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(fpath)); + output_stream << "// spell-checker: disable\n\n"; + output_stream << "// " << putf8string(mods) << "\n"; + output_stream << "#include \"generated/static/" << fname << "\"\n"; + } + output_splitted << "// " << putf8string(mods) << "\n"; + output_splitted << putf8string(e->second.m_code); + } + else + { + output_stream << "// " << putf8string(mods) << "\n"; + output_stream << putf8string(e->second.m_code); + } + } + + output_stream << "#endif\n\n"; + output_stream << "extern const plib::static_library::symbol nl_static_solver_syms[];\n"; + output_stream << "const plib::static_library::symbol nl_static_solver_syms[] = {\n"; + output_stream << "#if !defined(__EMSCRIPTEN__)\n\n"; + for (auto &se : sort_map) + { + const auto &e = map.find(se.second); + pstring mods; + for (auto &s : e->second.m_modules) + mods += s + ","; + output_stream << "// " << putf8string(plib::left(mods, mods.length()-1)) << "\n"; + output_stream << "\t{\"" << putf8string(e->first) << "\", reinterpret_cast<void *>(&" << putf8string(e->first) << ")}, // NOLINT\n"; + } + output_stream << "#endif\n\n"; + output_stream << "{\"\", nullptr}\n"; + output_stream << "};\n"; + } +} + + - nt.stop(); +// "Description: The Swiss army knife for timing purposes\n" +// " which has a ton of applications.\n" +// "DipAlias: GND,TRIG,OUT,RESET,VCC,DISCH,THRES,CONT\n" +// "Package: DIP\n" +// "NamingConvention: Naming conventions follow Texas Instruments datasheet\n" +// "Limitations: Internal resistor network currently fixed to 5k\n" +// " more limitations\n" +// "FunctionTable:\n" +// +struct doc_ext +{ + pstring id; + pstring title; + pstring description; + std::vector<pstring> pin_alias; + pstring package; + std::vector<std::pair<pstring, pstring>> params; + pstring naming_conventions; + pstring limitations; + pstring function_table; + std::vector<pstring> example; +}; + +static doc_ext read_documentation_from_source(const pstring &fname, const pstring &id) +{ + plib::putf8_reader r = plib::putf8_reader(std::make_unique<plib::ifstream>(plib::filesystem::u8path(fname))); + if (r.stream().fail()) + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(fname)); + r.stream().imbue(std::locale::classic()); + doc_ext ret; + + putf8string l; + if (!r.read_line(l)) + return ret; + do + { + l = plib::trim(l); + if (plib::startsWith(l, "//-")) + { + l = plib::trim(l.substr(3)); + if (!l.empty()) + { + auto a(plib::psplit(pstring(l), ':', true)); + if (a.empty() || (a.size() > 2)) + throw netlist::nl_exception(pstring(l) + " size mismatch"); + pstring n(plib::trim(a[0])); + pstring v(a.size() < 2 ? "" : plib::trim(a[1])); + pstring v2(v); + if (n == "Identifier") + { + if (!r.read_line(l) || ret.id == id) + return (ret.id == id ? ret : doc_ext()); + ret = doc_ext(); + ret.id = v; + } + else + { + while (r.read_line(l)) + { + l = plib::ltrim(l); + if (!(plib::startsWith(l, "//- ") || plib::startsWith(l, "//-\t")) + && !(plib::rtrim(l) == "//-")) + break; + v = v + "\n" + pstring(l.substr(3)); + } + if (n == "Title") + ret.title = plib::trim(v); + else if (n == "Pinalias") + ret.pin_alias = plib::psplit(plib::trim(v),',',true); + else if (n == "Description") + ret.description = v; + else if (n == "Package") + ret.package = plib::trim(v); + else if (n == "NamingConvention") + ret.naming_conventions = v; + else if (n == "Limitations") + ret.limitations = v; + else if (n == "FunctionTable") + ret.function_table = v; + else if (n == "Param") + ret.params.emplace_back(v2, plib::trim(v.substr(v2.length()))); + else if (n == "Example") + { + ret.example = plib::psplit(plib::trim(v),',',true); + if (ret.example.size() != 2 && !ret.example.empty()) + throw netlist::nl_exception("Example requires 2 parameters, but found {1}", ret.example.size()); + } + else + throw netlist::nl_exception(n); + } + } + } + else if (!r.read_line(l)) + return (ret.id == id ? ret : doc_ext()); + } while (true); + //return ret; } void tool_app_t::mac_out(const pstring &s, const bool cont) @@ -520,8 +900,8 @@ void tool_app_t::mac_out(const pstring &s, const bool cont) { if (x == '\t') { - auto pos_mod_4 = pos % opt_tabwidth(); - auto tab_adj = opt_tabwidth() - pos_mod_4; + auto pos_mod_4 = pos % opt_tab_width(); + auto tab_adj = opt_tab_width() - pos_mod_4; r += plib::rpad(pstring(""), pstring(" "), tab_adj); pos += tab_adj; } @@ -531,186 +911,299 @@ void tool_app_t::mac_out(const pstring &s, const bool cont) pos++; } } - pout("{1}\\\n", plib::rpad(r, pstring(" "), opt_linewidth()-1)); + std_out("{1}\\\n", plib::rpad(r, pstring(" "), opt_line_width()-1)); } else - pout("{1}\n", s); + std_out("{1}\n", s); } void tool_app_t::header_entry(const netlist::factory::element_t *e) { - auto v = plib::psplit(e->param_desc(), ","); + auto v = plib::psplit(e->param_desc(), ','); pstring vs; + pstring avs; for (const auto &s : v) if (!plib::startsWith(s, "@")) vs += ", p" + plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"); - mac_out("#define " + e->name() + "(name" + vs + ")"); - mac_out("\tNET_REGISTER_DEV(" + e->name() +", name)"); - - for (const auto &s : v) - { - pstring r(plib::replace_all(plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"), "@","")); - if (plib::startsWith(s, "+")) - mac_out("\tNET_CONNECT(name, " + r + ", p" + r + ")"); - else if (plib::startsWith(s, "@")) - mac_out("\tNET_CONNECT(name, " + r + ", " + r + ")"); else - mac_out("\tNETDEV_PARAMI(name, " + r + ", p" + r + ")"); - } + avs += ", " + s.substr(1); + + mac_out("// usage : " + e->name() + "(name" + vs + ")", false); + if (!avs.empty()) + mac_out("// auto connect: " + avs.substr(2), false); + + mac_out("#define " + e->name() + "(...)"); + mac_out("\tNET_REGISTER_DEVEXT(" + e->name() +", __VA_ARGS__)", false); mac_out("", false); } void tool_app_t::mac(const netlist::factory::element_t *e) { - auto v = plib::psplit(e->param_desc(), ","); + auto v = plib::psplit(e->param_desc(), ','); pstring vs; for (const auto &s : v) if (!plib::startsWith(s, "@")) vs += ", " + plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"); - pout("{1}(name{2})\n", e->name(), vs); - if (v.size() > 0) + std_out("{1}(name{2})\n", e->name(), vs); + if (!v.empty()) { - pout("/*\n"); + std_out("/*\n"); for (const auto &s : v) { pstring r(plib::replace_all(plib::replace_all(plib::replace_all(s, "+", ""), ".", "_"), "@","")); if (plib::startsWith(s, "+")) - pout("{1:10}: Terminal\n",r); + std_out("{1:10}: Terminal\n",r); else if (plib::startsWith(s, "@")) - pout("{1:10}: Power terminal - automatically connected\n", r); + std_out("{1:10}: Power terminal - automatically connected\n", r); else - pout("{1:10}: Parameter\n", r); + std_out("{1:10}: Parameter\n", r); } - pout("*/\n"); + std_out("*/\n"); } } void tool_app_t::create_header() { - netlist_tool_t nt(*this, "netlist"); + if (!opt_files().empty()) + throw netlist::nl_exception("Header doesn't support input files, but {1} where given", opt_files().size()); - nt.init(); + netlist_tool_t nt(plib::plog_delegate(&tool_app_t::logger, this), "netlist", opt_boost_lib()); nt.log().verbose.set_enabled(false); nt.log().info.set_enabled(false); - nt.setup().register_source(plib::make_unique<netlist::source_proc_t>("dummy", &netlist_dummy)); - nt.setup().include("dummy"); - - pout("// license:GPL-2.0+\n"); - pout("// copyright-holders:Couriersud\n"); - pout("#ifndef NLD_DEVINC_H\n"); - pout("#define NLD_DEVINC_H\n"); - pout("\n"); - pout("#include \"nl_setup.h\"\n"); - pout("#ifndef __PLIB_PREPROCESSOR__\n"); - pout("\n"); - pout("/* ----------------------------------------------------------------------------\n"); - pout(" * Netlist Macros\n"); - pout(" * ---------------------------------------------------------------------------*/\n"); - pout("\n"); + nt.parser().register_source<netlist::source_proc_t>("dummy", &netlist_dummy); + nt.parser().include("dummy"); + + std_out("// license:BSD-3-Clause\n"); + std_out("// copyright-holders:Couriersud\n"); + std_out("#ifndef NLD_DEVINC_H\n"); + std_out("#define NLD_DEVINC_H\n"); + std_out("\n"); + std_out("#ifndef __PLIB_PREPROCESSOR__\n"); + std_out("\n"); + std_out("#include ""../nl_setup.h""\n"); + std_out("\n"); + + std_out("// ----------------------------------------------------------------------------\n"); + std_out("// Netlist Macros\n"); + std_out("// ---------------------------------------------------------------------------\n"); + std_out("\n"); pstring last_source(""); - for (auto &e : nt.setup().factory()) + for (auto &e : nt.parser().factory()) { - if (last_source != e->sourcefile()) + bool found(opt_pattern().empty()); + + for (const auto &p : opt_pattern()) + found |= (e->name().find(p) != pstring::npos); + + if (found) { - last_source = e->sourcefile(); - pout("{1}\n", plib::rpad(pstring("// "), pstring("-"), opt_linewidth())); - pout("{1}{2}\n", pstring("// Source: "), plib::replace_all(e->sourcefile(), "../", "")); - pout("{1}\n", plib::rpad(pstring("// "), pstring("-"), opt_linewidth())); + if (last_source != e->source().file_name()) + { + last_source = e->source().file_name(); + std_out("{1}\n", plib::rpad(pstring("// "), pstring("-"), opt_line_width())); + std_out("{1}{2}\n", "// Source: ", plib::replace_all(e->source().file_name(), "../", "")); + std_out("{1}\n", plib::rpad(pstring("// "), pstring("-"), opt_line_width())); + } + header_entry(e.get()); } - header_entry(e.get()); } - pout("#endif // __PLIB_PREPROCESSOR__\n"); - pout("#endif\n"); - nt.stop(); + std_out("#endif // __PLIB_PREPROCESSOR__\n"); + std_out("#endif\n"); + nt.exec().stop(); } -void tool_app_t::create_docheader() +void tool_app_t::create_doc_header() { - netlist_tool_t nt(*this, "netlist"); - - nt.init(); + netlist_tool_t nt(plib::plog_delegate(&tool_app_t::logger, this), "netlist", opt_boost_lib()); nt.log().verbose.set_enabled(false); nt.log().info.set_enabled(false); - nt.setup().register_source(plib::make_unique<netlist::source_proc_t>("dummy", &netlist_dummy)); - nt.setup().include("dummy"); + nt.parser().register_source<netlist::source_proc_t>("dummy", &netlist_dummy); + nt.parser().include("dummy"); - std::vector<pstring> devs; - for (auto &e : nt.setup().factory()) - devs.push_back(e->name()); - std::sort(devs.begin(), devs.end(), [&](pstring &a, pstring &b) { return a < b; }); + std::vector<pstring> devices; + for (auto &e : nt.parser().factory()) + devices.push_back(e->name()); + std::sort(devices.begin(), devices.end(), [&](pstring &a, pstring &b) { return a < b; }); - pout("// license:GPL-2.0+\n"); - pout("// copyright-holders:Couriersud\n"); - pout("/* ----------------------------------------------------------------------------\n"); - pout(" * Automatically created file. DO NOT MODIFY.\n"); - pout(" * ---------------------------------------------------------------------------*/\n"); - pout("/*!\n"); - pout(" * \\page devices Devices\n"); - pout(" *\n"); - pout(" * Below is a list of all the devices currently known to the system ...\n"); - pout(" *\n"); + std_out("// license:BSD-3-Clause\n"); + std_out("// copyright-holders:Couriersud\n"); + std_out("\n"); + std_out("// ----------------------------------------------------------------------------\n"); + std_out("// Automatically created file. DO NOT MODIFY.\n"); + std_out("// ---------------------------------------------------------------------------\n"); + std_out("///\n"); + std_out("/// \\page devices Devices\n"); + std_out("///\n"); + std_out("/// Below is a list of all the devices currently known to the system ...\n"); + std_out("///\n"); - for (auto &s : devs) - pout(" * - \\subpage {1}\n", s); + for (auto &s : devices) + std_out("/// - @subpage {1}\n", s); - pout(" *\n"); + std_out("\n"); - for (auto &e : nt.setup().factory()) + std::vector<doc_ext> de_cache; + + for (auto &e : nt.parser().factory()) { - pout("//! [{1} csynopsis]\n", e->name()); - header_entry(e.get()); - pout("//! [{1} csynopsis]\n", e->name()); - pout("//! [{1} synopsis]\n", e->name()); - mac(e.get()); - pout("//! [{1} synopsis]\n", e->name()); + auto d(read_documentation_from_source(e->source().file_name(), e->name())); + + if (!d.id.empty()) + { + std_out("//! [{1} csynopsis]\n", e->name()); + header_entry(e.get()); + std_out("//! [{1} csynopsis]\n", e->name()); + std_out("//! [{1} synopsis]\n", e->name()); + mac(e.get()); + std_out("//! [{1} synopsis]\n", e->name()); + } + de_cache.push_back(std::move(d)); + } + + output_with_prefix("", ""); + output_with_prefix("///", ""); + //output_with_prefix("///", " @file "); + output_with_prefix("///", " @page ''"); // FIXME: snippets and pages need to be separate files + output_with_prefix("", ""); + + for (auto &d : de_cache) + { + //auto d(read_documentation_from_source(e->source().file_name(), e->name())); + + if (!d.id.empty()) + { + + output_with_prefix("///", ""); + //output_with_prefix("///", " @file {}", e->sourcefile()); + output_with_prefix("///", ""); + output_with_prefix("///", " @page {} {}", d.id, d.title); + output_with_prefix("///", ""); + output_with_prefix("///", " {}", d.description); + output_with_prefix("///", ""); + output_with_prefix("///", " @section {}_1 Synopsis", d.id); + output_with_prefix("///", ""); + output_with_prefix("///", " @snippet devsyn.dox.h {} synopsis", d.id); + output_with_prefix("///", ""); + output_with_prefix("///", " @section {}_11 C Synopsis", d.id); + output_with_prefix("///", ""); + output_with_prefix("///", " @snippet devsyn.dox.h {} csynopsis", d.id); + output_with_prefix("///", ""); + + output_with_prefix("///", " @section {}_2 Parameters", d.id); + output_with_prefix("///", ""); + if (!d.params.empty()) + { + output_with_prefix("///", " <table>"); + output_with_prefix("///", " <tr><th>Name</th><th>Description</th></tr>"); + for (auto &e : d.params) + output_with_prefix("///", " <tr><td>{1}</td><td>{2}</td></tr>", e.first, e.second); + output_with_prefix("///", " </table>"); + } + else + output_with_prefix("///", " This device has no parameters."); + output_with_prefix("///", ""); + output_with_prefix("///", " @section {}_3 Connection Diagram", d.id); + output_with_prefix("///", ""); + + if (!d.pin_alias.empty()) + { + output_with_prefix("///", " <pre>"); + if (d.package == "DIP") + { + auto & pins = d.pin_alias; + //const int w = 8; + output_with_prefix("///", " {1:10} +--------+", " "); + for (std::size_t i=0; i < pins.size() / 2; i++) + { + output_with_prefix("///", " {1:10} |{2:-2} {3:2}| {4:-10}", + pins[i], i+1, pins.size()-i, pins[pins.size()-i-1]); + } + output_with_prefix("///", " {1:10} +--------+", " "); + } + else if (d.package == "SIL") + { + auto & pins = d.pin_alias; + //const int w = 8; + output_with_prefix("///", " {1:10} +--------+", " "); + for (std::size_t i=0; i < pins.size(); i++) + { + output_with_prefix("///", " {1:10} |{2:-2} |", + pins[i], i+1); + } + output_with_prefix("///", " {1:10} +--------+", " "); + } + output_with_prefix("///", " </pre>"); + } + output_with_prefix("///", ""); + output_with_prefix("///", " {}", d.naming_conventions); + output_with_prefix("///", ""); + output_with_prefix("///", " @section {}_4 Function Table", d.id); + output_with_prefix("///", ""); + if (d.function_table.empty()) + output_with_prefix("///", " Please refer to the datasheet."); + else + output_with_prefix("///", " {}", d.function_table); + output_with_prefix("///", ""); + output_with_prefix("///", " @section {}_5 Limitations", d.id); + output_with_prefix("///", ""); + output_with_prefix("///", " {}", d.limitations); + if (!d.example.empty()) + { + output_with_prefix("///", ""); + output_with_prefix("///", " @section {}_6 Example", d.id); + output_with_prefix("///", " @snippet {1} {2}", d.example[0], d.example[1]); + output_with_prefix("///", ""); + output_with_prefix("", ""); + } + } } - nt.stop(); + nt.exec().stop(); } -/*------------------------------------------------- - listdevices - list all known devices --------------------------------------------------*/ +// ------------------------------------------------- +// list_devices - list all known devices +// ------------------------------------------------- -void tool_app_t::listdevices() +void tool_app_t::list_devices() { - netlist_tool_t nt(*this, "netlist"); - nt.init(); + netlist_tool_t nt(plib::plog_delegate(&tool_app_t::logger, this), "netlist", opt_boost_lib()); nt.log().verbose.set_enabled(false); nt.log().info.set_enabled(false); nt.log().warning.set_enabled(false); - netlist::factory::list_t &list = nt.setup().factory(); - - nt.setup().register_source(plib::make_unique<netlist::source_proc_t>("dummy", &netlist_dummy)); - nt.setup().include("dummy"); - + netlist::factory::list_t &list = nt.parser().factory(); + nt.parser().register_source<netlist::source_proc_t>("dummy", &netlist_dummy); + nt.parser().include("dummy"); nt.setup().prepare_to_run(); - std::vector<netlist::pool_owned_ptr<netlist::core_device_t>> devs; + std::vector<netlist::device_arena::unique_ptr<netlist::core_device_t>> devices; - for (auto & f : list) + for (auto & fl : list) { - pstring out = plib::pfmt("{1:-20} {2}(<id>")(f->classname())(f->name()); + pstring out = plib::pfmt("{1:-20} {2}(<id>")(fl->name())(fl->name()); + + netlist::factory::element_t *f = nullptr; + nt.parser().register_dev(fl->name(), fl->name() + "_lc", + std::vector<pstring>(), &f); - f->macro_actions(nt.setup(), f->name() + "_lc"); - auto d = f->Create(nt.nlstate(), f->name() + "_lc"); + auto d = f->make_device(nt.pool(), nt, f->name() + "_lc"); // get the list of terminals ... std::vector<pstring> terms(nt.setup().get_terminals_for_device_name(d->name())); out += "," + f->param_desc(); - for (const auto &p : plib::psplit(f->param_desc(),",") ) + for (const auto &p : plib::psplit(f->param_desc(),',') ) { if (plib::startsWith(p, "+")) { @@ -718,67 +1211,114 @@ void tool_app_t::listdevices() } } out += ")"; - pout("{}\n", out); - if (terms.size() > 0) + std_out("{}\n", out); + if (!terms.empty()) { pstring t = ""; for (auto & j : terms) t += "," + j; - pout("\tTerminals: {}\n", t.substr(1)); + std_out("\tTerminals: {}\n", t.substr(1)); } - devs.emplace_back(std::move(d)); + devices.emplace_back(std::move(d)); } } -/*------------------------------------------------- - convert - convert spice et al to netlist --------------------------------------------------*/ +void tool_app_t::list_models() +{ + netlist_tool_t nt(plib::plog_delegate(&tool_app_t::logger, this), "netlist", opt_boost_lib()); + + nt.log().verbose.set_enabled(false); + nt.log().info.set_enabled(false); + nt.log().warning.set_enabled(false); + + nt.parser().register_source<netlist::source_proc_t>("dummy", &netlist_dummy); + nt.parser().include("dummy"); + nt.setup().prepare_to_run(); + + using string_pair = std::pair<pstring, pstring>; + + struct comp_s { + bool operator() (const string_pair &i, const string_pair &j) + { + if (i.first < j.first) + return true; + if (i.first == j.first) + return (i.second < j.second); + return false; + } + } comp; + + std::vector<string_pair> elems; + + for (auto & e : nt.setup().models().known_models()) + { + auto model = nt.setup().models().get_model(e); + + elems.emplace_back(model.type(), e); + } + + std::sort(elems.begin(), elems.end(), comp); + + for (auto & e : elems) + { + pstring out = plib::pfmt("{1:-15} {2}")(e.first, e.second); + std_out("{}\n", out); + } +} + +// ------------------------------------------------- +// convert - convert spice et al to netlist +// ------------------------------------------------- void tool_app_t::convert() { - pstring contents; - std::stringstream ostrm; - ostrm.imbue(std::locale::classic()); - if (opt_file() == "-") + std::stringstream out_stream; + out_stream.imbue(std::locale::classic()); + + if (opt_files().size() > 1) + throw netlist::nl_exception("nltool: convert needs exactly one file"); + + if (opt_files().empty() || opt_files()[0] == "-") { - plib::copystream(ostrm, std::cin); + plib::copy_stream(out_stream, std::cin); } else { - std::ifstream strm(plib::filesystem::u8path(opt_file())); + plib::ifstream strm(plib::filesystem::u8path(opt_files()[0])); if (strm.fail()) - throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_file())); + throw netlist::nl_exception(netlist::MF_FILE_OPEN_ERROR(opt_files()[0])); strm.imbue(std::locale::classic()); - plib::copystream(ostrm, strm); + plib::copy_stream(out_stream, strm); } - contents = pstring(ostrm.str()); + + pstring contents(putf8string(out_stream.str())); pstring result; if (opt_type.as_string() == "spice") { - nl_convert_spice_t c; + netlist::convert::nl_convert_spice_t c; c.convert(contents); result = c.result(); } else if (opt_type.as_string() == "eagle") { - nl_convert_eagle_t c; + netlist::convert::nl_convert_eagle_t c; c.convert(contents); result = c.result(); } else if (opt_type.as_string() == "rinf") { - nl_convert_rinf_t c; + netlist::convert::nl_convert_rinf_t c; c.convert(contents); result = c.result(); } - /* present result */ - pout.write(result); + // present result + std_out.write(result); } -/*------------------------------------------------- - main - primary entry point --------------------------------------------------*/ +// ------------------------------------------------- +// main - primary entry point +// ------------------------------------------------- #if 0 static const pstring pmf_verbose[] = @@ -793,55 +1333,58 @@ static const pstring pmf_verbose[] = pstring tool_app_t::usage() { return help( - "nltool serves as the Swiss Army knife to run, test and convert netlists.", - "nltool [options]"); + "nltool serves as the Swiss Army knife to run, test and convert netlists.\n\n" + "Commands may accept one or more files depending on the functionality.\n" + "If no file is provided, standard input is used.", + "nltool [option]... [files]..."); } int tool_app_t::execute() { tool_app_t opts; - /* make SIGFPE actually deliver signals on supoorted platforms */ - plib::fpsignalenabler::global_enable(true); - plib::fpsignalenabler sigen(plib::FP_ALL & ~plib::FP_INEXACT & ~plib::FP_UNDERFLOW); - if (opt_help()) { - pout(plib::pfmt("{:10.3}\n").f(20.0)); - //pout(plib::pfmt("{10.3}\n").f(20)); - pout(usage()); + std_out(usage()); return 0; } if (opt_version()) { - pout( - "nltool (netlist) " PSTRINGIFY(NLTOOL_VERSION) "\n" - "Copyright (C) 2019 Couriersud\n" - "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.\n" + std_out( + "nltool (netlist) {1}\n" + "Copyright (C) 2021 Couriersud\n" + "License BSD-3-Clause\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n\n" - "Written by Couriersud.\n"); + "Written by Couriersud.\n", netlist::netlist_state_t::version()); if (opt_verb()) { std::vector<std::pair<pstring, pstring>> defs; netlist::netlist_state_t::compile_defines(defs); - pout("\nCompile defines:\n"); + std_out("\nCompile defines:\n"); for (auto &x : defs) - pout("{1:-30} = {2}\n", x.first, x.second); + std_out("{1:-30} = {2}\n", x.first, x.second); } return 0; } - m_options = opt_defines(); - m_options.emplace_back("NLTOOL_VERSION=" PSTRINGIFY(NLTOOL_VERSION)); + m_defines = opt_defines(); + m_defines.emplace_back("NLTOOL_VERSION=" + netlist::netlist_state_t::version()); + if (opt_pre_pro()) + m_defines.emplace_back("__PREPROCESSOR_DEBUG__=1"); try { + plib::fp_signal_enabler::global_enable(opt_fp_error()); + plib::fp_signal_enabler fp_protect(plib::FP_DIVBYZERO | plib::FP_UNDERFLOW | plib::FP_OVERFLOW | plib::FP_INVALID); + pstring cmd = opt_cmd.as_string(); - if (cmd == "listdevices") - listdevices(); + if (cmd == "list-devices") + list_devices(); + else if (cmd == "list-models") + list_models(); else if (cmd == "run") run(); else if (cmd == "validate") @@ -850,28 +1393,30 @@ int tool_app_t::execute() static_compile(); else if (cmd == "header") create_header(); - else if (cmd == "docheader") - create_docheader(); + else if (cmd == "doc-header") + create_doc_header(); else if (cmd == "convert") convert(); + else if (cmd == "tests") + { + return PRUN_ALL_TESTS(opt_verb() ? ::plib::testing::loglevel::INFO + : opt_quiet() ? ::plib::testing::loglevel::ERROR + : ::plib::testing::loglevel::WARNING); + } else { - perr("Unknown command {}\n", cmd.c_str()); + std_err("Unknown command {}\n", cmd.c_str()); //FIXME: usage_short - perr(usage()); + std_err(usage()); return 1; } } - catch (netlist::nl_exception &e) - { - perr("Netlist exception caught: {}\n", e.text()); - return 2; - } catch (plib::pexception &e) { - perr("plib exception caught: {}\n", e.text()); + std_err("Exception caught: {}\n", e.text()); return 2; } + #if 0 std::cout.imbue(std::locale("de_DE.utf8")); std::cout.imbue(std::locale("C.UTF-8")); diff --git a/src/lib/netlist/prg/nlwav.cpp b/src/lib/netlist/prg/nlwav.cpp index 3974dde1f3a..7c47b2a5ddc 100644 --- a/src/lib/netlist/prg/nlwav.cpp +++ b/src/lib/netlist/prg/nlwav.cpp @@ -1,34 +1,57 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud #include "plib/pstring.h" -#include "netlist/nl_setup.h" -#include "plib/plists.h" #include "plib/pmain.h" #include "plib/ppmf.h" #include "plib/pstream.h" +#include "plib/pstrutil.h" #include <cstdio> -/* From: https://ffmpeg.org/pipermail/ffmpeg-devel/2007-October/038122.html - * The most compatible way to make a wav header for unknown length is to put - * 0xffffffff in the header. 0 as the RIFF length and 0 as the data chunk length - * is a common agreement in serious recording applications while - * still recording the file. So a playback application can determine that the - * given file is still being recorded. As soon as the recording application - * finishes the ongoing recording, it writes the correct values for RIFF lenth - * and data chunk length to the file. - */ -/* http://de.wikipedia.org/wiki/RIFF_WAVE */ +// FIXME: These are either defined in other parts or have more complex consequences +// spell-checker: words nlconst, rpad, pfmt, pexception, pbinary, dynlib, pstring, psplit, putf, pmfp +// +// Specific technical terms +// spell-checker: words vcda, vcdd + +// FIXME: see below - this belongs somewhere else! +#ifdef _WIN32 +#include <stdio.h> +#include <fcntl.h> +#include <io.h> +#endif + +// From: https://ffmpeg.org/pipermail/ffmpeg-devel/2007-October/038122.html +// The most compatible way to make a wav header for unknown length is to put +// 0xffffffff in the header. 0 as the RIFF length and 0 as the data chunk length +// is a common agreement in serious recording applications while +// still recording the file. So a playback application can determine that the +// given file is still being recorded. As soon as the recording application +// finishes the ongoing recording, it writes the correct values for RIFF length +// and data chunk length to the file. +// +// http://de.wikipedia.org/wiki/RIFF_WAVE +// + +using arena = plib::aligned_arena<>; class wav_t { public: - // XXNOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) - wav_t(std::ostream &strm, bool is_seekable, std::size_t sr, std::size_t channels) + + enum format + { + s16, + s32, + f32 + }; + + wav_t(std::ostream &strm, bool is_seekable, format fmt, std::size_t sr, std::size_t channels) : m_f(strm) , m_stream_is_seekable(is_seekable) - /* force "play" to play and warn about eof instead of being silent */ - , m_fmt(static_cast<std::uint16_t>(channels), static_cast<std::uint32_t>(sr)) + , m_format(fmt) + // force "play" to play and warn about eof instead of being silent + , m_fmt(static_cast<std::uint16_t>(channels), static_cast<std::uint32_t>(sr), fmt) , m_data(is_seekable ? 0 : 0xffffffff) { @@ -37,13 +60,13 @@ public: write(m_data); } - COPYASSIGNMOVE(wav_t, delete) + PCOPYASSIGNMOVE(wav_t, delete) ~wav_t() { if (m_stream_is_seekable) { - m_fh.filelen = m_data.len + sizeof(m_data) + sizeof(m_fh) + sizeof(m_fmt) - 8; + m_fh.file_len = m_data.len + sizeof(m_data) + sizeof(m_fh) + sizeof(m_fmt) - 8; m_f.seekp(0); write(m_fh); write(m_fmt); @@ -53,62 +76,103 @@ public: } } - std::size_t channels() { return m_fmt.channels; } - std::size_t sample_rate() { return m_fmt.sample_rate; } + std::size_t channels() const { return m_fmt.channels; } + std::size_t sample_rate() const { return m_fmt.sample_rate; } template <typename T> void write(const T &val) { - m_f.write(reinterpret_cast<const std::ostream::char_type *>(&val), sizeof(T)); + plib::ostream_write(m_f, &val, 1); + } + + template <typename T> + void write_sample_int(double sample) + { + constexpr auto type_max(static_cast<double>(plib::numeric_limits<T>::max())); + constexpr auto type_min(static_cast<double>(plib::numeric_limits<T>::min())); + + sample *= type_max; + sample = std::max(type_min, sample); + sample = std::min(type_max, sample); + const T dest(static_cast<T>(sample)); + write(dest); } - void write_sample(int *sample) + // expects normalized samples between -1.0 to 1.0 for s16 and s32 + void write_samples(double *sample) { m_data.len += m_fmt.block_align; for (std::size_t i = 0; i < channels(); i++) { - auto ps = static_cast<int16_t>(sample[i]); /* 16 bit sample, FIXME: Endianess? */ - write(ps); + switch (m_format) + { + case s16: + write_sample_int<int16_t>(sample[i]); + break; + case s32: + write_sample_int<int32_t>(sample[i]); + break; + case f32: + const auto df32(static_cast<float>(sample[i])); + write(df32); + break; + } } } private: struct riff_chunk_t { - uint8_t group_id[4] = {'R','I','F','F'}; - uint32_t filelen = 0; - uint8_t rifftype[4] = {'W','A','V','E'}; + std::array<uint8_t, 4> group_id = {{'R','I','F','F'}}; + uint32_t file_len = 0; + std::array<uint8_t, 4> riff_type = {{'W','A','V','E'}}; }; struct riff_format_t { - riff_format_t(uint16_t achannels, uint32_t asample_rate) + riff_format_t(uint16_t num_channels, uint32_t a_sample_rate, format fm) { - channels = achannels; - sample_rate = asample_rate; + switch (fm) + { + case s16: + format_tag = 0x0001; // PCM + bits_sample = 16; + break; + case s32: + format_tag = 0x0001; // PCM + bits_sample = 32; + break; + case f32: + format_tag = 0x0003; // FLOAT + bits_sample = 32; + break; + } + channels = num_channels; + sample_rate = a_sample_rate; block_align = channels * ((bits_sample + 7) / 8); bytes_per_second = sample_rate * block_align; } - uint8_t signature[4] = {'f','m','t',' '}; + std::array<uint8_t, 4> signature = {{'f','m','t',' '}}; uint32_t fmt_length = 16; - uint16_t format_tag = 0x0001; // PCM + uint16_t format_tag; uint16_t channels; uint32_t sample_rate; uint32_t bytes_per_second; uint16_t block_align; - uint16_t bits_sample = 16; + uint16_t bits_sample; }; struct riff_data_t { - riff_data_t(uint32_t alen) : len(alen) {} - uint8_t signature[4] = {'d','a','t','a'}; + explicit riff_data_t(uint32_t alen) : len(alen) {} + std::array<uint8_t, 4> signature = {{'d','a','t','a'}}; uint32_t len; // data follows }; std::ostream &m_f; bool m_stream_is_seekable; + format m_format; riff_chunk_t m_fh; riff_format_t m_fmt; @@ -119,7 +183,7 @@ private: class log_processor { public: - using callback_type = plib::pmfp<void, std::size_t, double, double>; + using callback_type = plib::pmfp<void (std::size_t, double, double)>; struct elem { @@ -135,20 +199,21 @@ public: , m_e(channels) { } - bool readmore(std::vector<plib::putf8_reader> &r) + bool read_more(std::vector<plib::putf8_reader> &r) { bool success = false; for (std::size_t i = 0; i< r.size(); i++) { if (m_e[i].need_more) { - pstring line; - m_e[i].eof = !r[i].readline(line); + putf8string line; + m_e[i].eof = !r[i].read_line(line); if (!m_e[i].eof) { // sscanf is very fast ... // NOLINTNEXTLINE(cppcoreguidelines-pro-type-vararg) - std::sscanf(line.c_str(), "%lf %lf", &m_e[i].t, &m_e[i].v); + if (2 != std::sscanf(line.c_str(), "%lf %lf", &m_e[i].t, &m_e[i].v)) + fprintf(stderr, "arg: <%s>\n", line.c_str()); m_e[i].need_more = false; } } @@ -157,7 +222,7 @@ public: return success; } - void process(std::vector<plib::unique_ptr<std::istream>> &is) + void process(std::vector<std::unique_ptr<std::istream>> &is) { std::vector<plib::putf8_reader> readers; for (auto &i : is) @@ -167,7 +232,7 @@ public: } pstring line; - bool more = readmore(readers); + bool more = read_more(readers); while (more) { @@ -185,10 +250,11 @@ public: m_e[mini].need_more = true; m_cb(mini, mint, m_e[mini].v); - more = readmore(readers); + more = read_more(readers); } } + private: callback_type m_cb; std::vector<elem> m_e; @@ -196,7 +262,7 @@ private: struct aggregator { - using callback_type = plib::pmfp<void, std::size_t, double, double>; + using callback_type = plib::pmfp<void (std::size_t, double, double)>; aggregator(std::size_t channels, double quantum, callback_type cb) : m_channels(channels) @@ -204,27 +270,27 @@ struct aggregator , m_cb(cb) , ct(0.0) , lt(0.0) - , outsam(channels, 0.0) - , cursam(channels, 0.0) + , output_samples(channels, 0.0) + , current_samples(channels, 0.0) { } void process(std::size_t chan, double time, double val) { while (time >= ct + m_quantum) { + ct += m_quantum; for (std::size_t i=0; i< m_channels; i++) { - outsam[i] += (ct - lt) * cursam[i]; - outsam[i] = outsam[i] / m_quantum; - m_cb(i, ct, outsam[i]); - outsam[i] = 0.0; + output_samples[i] += (ct - lt) * current_samples[i]; + output_samples[i] = output_samples[i] / m_quantum; + m_cb(i, ct, output_samples[i]); + output_samples[i] = 0.0; } lt = ct; - ct += m_quantum; } for (std::size_t i=0; i< m_channels; i++) - outsam[i] += (time-lt)*cursam[i]; + output_samples[i] += (time-lt)*current_samples[i]; lt = time; - cursam[chan] = val; + current_samples[chan] = val; } private: @@ -233,60 +299,134 @@ private: callback_type m_cb; double ct; double lt; - std::vector<double> outsam; - std::vector<double> cursam; + std::vector<double> output_samples; + std::vector<double> current_samples; +}; + +struct filter_hp +{ + using callback_type = plib::pmfp<void (std::size_t, double, double)>; + + filter_hp(double freq, bool boost, std::size_t channels, callback_type cb) + : m_cb(cb) + , m_hp_omega(plib::constants<double>::two() * plib::constants<double>::pi() * freq) + , m_boost(boost) + , m_lt(channels, 0.0) + , m_in(channels, 0.0) + , m_cap(channels, 0.0) + { } + void process(std::size_t chan, double time, double val) + { + // based on CR filter + auto dt(time - m_lt[chan]); + + double omega = ((m_boost && (time < 1.0/m_hp_omega)) ? 1e12 : m_hp_omega); + auto m(1.0 - plib::exp(-dt * omega)); + m_cap[chan] += m * (m_in[chan] - m_cap[chan]); + // out = in - vcap + m_cb(chan, time, m_in[chan] - m_cap[chan]); + + m_in[chan] = val; + m_lt[chan] = time; + } + +private: + callback_type m_cb; + double m_hp_omega; + bool m_boost; + std::vector<double> m_lt; + std::vector<double> m_in; + std::vector<double> m_cap; +}; + +struct filter_lp +{ + using callback_type = plib::pmfp<void (std::size_t, double, double)>; + + filter_lp(double freq, std::size_t channels, callback_type cb) + : m_cb(cb) + , m_lp_omega(plib::constants<double>::two() * plib::constants<double>::pi() * freq) + , m_lt(channels, 0.0) + , m_in(channels, 0.0) // lp filter + , m_cap(channels, 0.0) // hp filter + { } + void process(std::size_t chan, double time, double val) + { + // based on RC filter + auto dt(time - m_lt[chan]); + + auto m(1.0 - plib::exp(-dt * m_lp_omega)); + + m_cap[chan] += m * (m_in[chan] - m_cap[chan]); + // out = vcap + m_cb(chan, time, m_cap[chan]); + + m_in[chan] = val; + m_lt[chan] = time; + } + +private: + callback_type m_cb; + double m_lp_omega; + std::vector<double> m_lt; + std::vector<double> m_in; + std::vector<double> m_cap; }; -class wavwriter +class wav_writer { public: - wavwriter(std::ostream &fo, bool is_seekable, std::size_t channels, std::size_t sample_rate, double ampa) - : mean(channels, 0.0) - , means(channels, 0.0) - , maxsam(channels, -1e9) - , minsam(channels, 1e9) + wav_writer(std::ostream &fo, bool is_seekable, wav_t::format fmt, + std::size_t channels, std::size_t sample_rate, double amplification) + : max_samples(channels, -1e9) + , min_samples(channels, 1e9) , m_n(channels, 0) , m_samples(channels, 0) , m_last_time(0) , m_fo(fo) - , m_amp(ampa) - , m_wo(m_fo, is_seekable, sample_rate, channels) + , m_amp(amplification <= 0.0 ? 1.0e6 : amplification) + , m_auto(amplification <= 0.0) + , m_wo(m_fo, is_seekable, fmt, sample_rate, channels) { } - void process(std::size_t chan, double time, double outsam) + void process(std::size_t chan, double time, double sample) { if (time > m_last_time) - m_wo.write_sample(m_samples.data()); + m_wo.write_samples(m_samples.data()); m_last_time = time; - means[chan] += outsam; - maxsam[chan] = std::max(maxsam[chan], outsam); - minsam[chan] = std::min(minsam[chan], outsam); + max_samples[chan] = std::max(max_samples[chan], sample); + min_samples[chan] = std::min(min_samples[chan], sample); m_n[chan]++; - //mean = means / (double) m_n; - mean[chan] += 5.0 / static_cast<double>(m_wo.sample_rate()) * (outsam - mean[chan]); - outsam = (outsam - mean[chan]) * m_amp; - outsam = std::max(-32000.0, outsam); - outsam = std::min(32000.0, outsam); - m_samples[chan] = static_cast<int>(outsam); + auto val(sample * m_amp); + if (m_auto && plib::abs(val) > 1.0) + { + do + { + m_amp /= 2.0; + val = sample * m_amp; + } while (plib::abs(val) > 1.0); + // FIXME: log this in state and provide on verbose output + //printf("dynamic amplification adjusted to %f at %f\n", m_amp, time); + } + m_samples[chan] = val; } - std::vector<double> mean; - std::vector<double> means; - std::vector<double> maxsam; - std::vector<double> minsam; + std::vector<double> max_samples; + std::vector<double> min_samples; std::vector<std::size_t> m_n; - std::vector<int> m_samples; + std::vector<double> m_samples; double m_last_time; private: std::ostream &m_fo; double m_amp; + bool m_auto; wav_t m_wo; }; -class vcdwriter +class vcd_writer { public: @@ -296,7 +436,7 @@ public: ANALOG }; - vcdwriter(std::ostream &fo, const std::vector<pstring> &channels, + vcd_writer(std::ostream &fo, const std::vector<pstring> &channels, format_e format, double high_level = 2.0, double low_level = 1.0) : m_channels(channels.size()) , m_last_time(0) @@ -318,9 +458,9 @@ public: { // $var real 64 N1X1 N1X1 $end if (format == ANALOG) - write(pstring("$var real 64 ") + m_ids[i++] + " " + ch + " $end\n"); + write("$var real 64 " + m_ids[i++] + " " + ch + " $end\n"); else if (format == DIGITAL) - write(pstring("$var wire 1 ") + m_ids[i++] + " " + ch + " $end\n"); + write("$var wire 1 " + m_ids[i++] + " " + ch + " $end\n"); } write("$enddefinitions $end\n"); if (format == ANALOG) @@ -328,36 +468,37 @@ public: write("$dumpvars\n"); //r0.0 N1X1 for (i = 0; i < channels.size(); i++) - write(pstring("r0.0 ") + m_ids[i] + "\n"); + write("r0.0 " + m_ids[i] + "\n"); write("$end\n"); } } - void process(std::size_t chan, double time, double outsam) + void process(std::size_t chan, double time, double sample) { if (time > m_last_time) { - write(pstring("#") + plib::to_string(static_cast<std::int64_t>(m_last_time * 1e9)) + " "); + write("#" + plib::to_string(static_cast<std::int64_t>(m_last_time * 1e9)) + " "); write(m_buf + "\n"); m_buf = ""; m_last_time = time; } if (m_format == ANALOG) - m_buf += "r" + plib::to_string(outsam)+ " " + m_ids[chan] + " "; + m_buf += "r" + plib::to_string(sample)+ " " + m_ids[chan] + " "; else { - if (outsam >= m_high_level) - m_buf += pstring("1") + m_ids[chan] + " "; - else if (outsam <= m_low_level) - m_buf += pstring("0") + m_ids[chan] + " "; + if (sample >= m_high_level) + m_buf += "1" + m_ids[chan] + " "; + else if (sample <= m_low_level) + m_buf += "0" + m_ids[chan] + " "; } } private: void write(const pstring &line) { - m_fo.write(line.c_str(), static_cast<std::streamsize>(plib::strlen(line.c_str()))); + const putf8string u8line(line); + m_fo.write(u8line.c_str(), static_cast<std::streamsize>(plib::strlen(u8line.c_str()))); } std::size_t m_channels; @@ -371,23 +512,99 @@ private: format_e m_format; }; +class tab_writer +{ +public: + + enum format_e + { + DIGITAL, + ANALOG + }; + + tab_writer(std::ostream &fo, const std::vector<pstring> &channels, + double start, double inc, std::size_t samples) + : m_last_time(0) + , m_next_time(start) + , m_fo(fo) + , m_inc(inc) + , m_samples(samples) + , m_buf(channels.size()) + , m_n(0) + { + } + + void process(std::size_t chan, double time, double sample) + { + if (time > m_last_time) + { + if (m_n < m_samples) + { + while (m_next_time < time && m_n < m_samples) + { + pstring o; + for (auto &e : m_buf) + { + o += pstring(",") + plib::to_string(e); // FIXME: locale!! + } + write(o.substr(1) + "\n"); + m_n++; + m_next_time += m_inc; + } + } + m_last_time = time; + } + m_buf[chan] = sample; + } + +private: + void write(const pstring &line) + { + const putf8string u8line(line); + m_fo.write(u8line.c_str(), static_cast<std::streamsize>(plib::strlen(u8line.c_str()))); + } + + double m_last_time; + double m_next_time; + + std::ostream &m_fo; + std::vector<pstring> m_ids; + double m_inc; + std::size_t m_samples; + std::vector<double> m_buf; + std::size_t m_n; +}; + class nlwav_app : public plib::app { public: nlwav_app() : plib::app(), - opt_fmt(*this, "f", "format", 0, std::vector<pstring>({"wav","vcda","vcdd"}), - "output format. Available options are wav|vcda|vcdd." - " wav : multichannel wav output" - " vcda : analog VCD output" - " vcdd : digital VCD output" + opt_fmt(*this, "f", "format", 0, std::vector<pstring>({"wav16s","wav32s","wav32f","vcda","vcdd", "tab"}), + "output format. Available options are wav16s|wav32s|wav32f|vcda|vcdd|tab.\n" + " wav16s : multichannel wav output 16 bit signed\n" + " wav32s : multichannel wav output 32 bit signed\n" + " wav32f : multichannel wav output 32 bit float\n" + " vcda : analog VCD output\n" + " vcdd : digital VCD output\n" + " tab : sampled output\n" " Digital signals are created using the --high and --low options" ), opt_out(*this, "o", "output", "-", "output file"), + opt_grp1(*this, "wav options", "These options apply to wav output only"), opt_rate(*this, "r", "rate", 48000, "sample rate of output file"), - opt_amp(*this, "a", "amp", 10000.0, "amplification after mean correction (wav only)"), - opt_high(*this, "u", "high", 2.0, "minimum input for high level (vcdd only)"), - opt_low(*this, "l", "low", 1.0, "maximum input for low level (vcdd only)"), + opt_amp(*this, "a", "amp", 10000.0, "amplification after mean correction"), + opt_lowpass(*this, "", "lowpass", 20000.0, "lowpass filter frequency.\nDefault {1:.0} Hz."), + opt_highpass(*this, "", "highpass", 20.0, "highpass filter frequency.\nDefault is {1:.0} Hz."), + opt_hp_boost(*this, "", "hp-boost", "enable highpass boost to filter out initial click."), + opt_grp2(*this, "vcdd options", "These options apply to vcdd output only"), + opt_high(*this, "u", "high", 2.0, "minimum input for high level"), + opt_low(*this, "l", "low", 1.0, "maximum input for low level"), + opt_grp3(*this, "tab options", "These options apply to sampled output only"), + opt_start(*this, "s", "start", 0.0, "time when sampling starts"), + opt_inc(*this, "i", "increment", 0.001, "time between samples"), + opt_samples(*this, "n", "samples", 1000000,"number of samples"), + opt_grp4(*this, "General options", "These options always apply"), opt_verb(*this, "v", "verbose", "be verbose - this produces lots of output"), opt_quiet(*this,"q", "quiet", "be quiet - no warnings"), opt_args(*this, "input file(s)"), @@ -395,24 +612,39 @@ public: opt_help(*this, "h", "help", "display help and exit"), opt_ex1(*this, "./nlwav -f vcdd -o x.vcd log_V*", "convert all files starting with \"log_V\" into a digital vcd file"), - opt_ex2(*this, "./nlwav -f wav -o x.wav log_V*", - "convert all files starting with \"log_V\" into a multichannel wav file"), - m_outstrm(nullptr) + opt_ex2(*this, "./nlwav -f wav16s -o x.wav log_V*", + "convert all files starting with \"log_V\" into a multichannel wav file (16bit, signed)"), + opt_ex3(*this, "./nlwav -f tab -o x.tab -s 0.0000005 -i 0.000001 -n 256 log_BLUE.log", + "convert file log_BLUE.log to sampled output. First sample at 500ns " + "followed by 255 samples every micro-second.") {} int execute() override; pstring usage() override; private: - void convert_wav(); - void convert_vcd(vcdwriter::format_e format); + void convert_wav(std::ostream &output, wav_t::format fmt); + void convert_vcd(std::ostream &output, vcd_writer::format_e format); + void convert_tab(std::ostream &output); + void convert(const pstring &output_file); plib::option_str_limit<unsigned> opt_fmt; plib::option_str opt_out; + plib::option_group opt_grp1; plib::option_num<std::size_t> opt_rate; plib::option_num<double> opt_amp; + plib::option_num<double> opt_lowpass; + plib::option_num<double> opt_highpass; + plib::option_bool opt_hp_boost; + plib::option_group opt_grp2; plib::option_num<double> opt_high; plib::option_num<double> opt_low; + plib::option_group opt_grp3; + plib::option_num<double> opt_start; + plib::option_num<double> opt_inc; + plib::option_num<std::size_t> opt_samples; + + plib::option_group opt_grp4; plib::option_bool opt_verb; plib::option_bool opt_quiet; plib::option_args opt_args; @@ -420,145 +652,205 @@ private: plib::option_bool opt_help; plib::option_example opt_ex1; plib::option_example opt_ex2; - std::vector<plib::unique_ptr<std::istream>> m_instrms; - std::ostream *m_outstrm; + plib::option_example opt_ex3; + std::vector<std::unique_ptr<std::istream>> m_in_streams; }; -void nlwav_app::convert_wav() +void nlwav_app::convert_wav(std::ostream &output, wav_t::format fmt) { - double dt = 1.0 / static_cast<double>(opt_rate()); + double dt = plib::reciprocal(static_cast<double>(opt_rate())); + auto num_channels = m_in_streams.size(); - plib::unique_ptr<wavwriter> wo = plib::make_unique<wavwriter>(*m_outstrm, opt_out() != "-", m_instrms.size(), opt_rate(), opt_amp()); - plib::unique_ptr<aggregator> ago = plib::make_unique<aggregator>(m_instrms.size(), dt, aggregator::callback_type(&wavwriter::process, wo.get())); - aggregator::callback_type agcb = log_processor::callback_type(&aggregator::process, ago.get()); + auto wo = plib::make_unique<wav_writer, arena>(output, opt_out() != "-", fmt, num_channels, opt_rate(), opt_amp()); + auto ago = plib::make_unique<aggregator, arena>(num_channels, dt, aggregator::callback_type(&wav_writer::process, wo.get())); + auto fgo_hp = plib::make_unique<filter_hp, arena>(opt_highpass(), opt_hp_boost(), num_channels, filter_hp::callback_type(&aggregator::process, ago.get())); + auto fgo_lp = plib::make_unique<filter_lp, arena>(opt_lowpass(), num_channels, filter_lp::callback_type(&filter_hp::process, fgo_hp.get())); - log_processor lp(m_instrms.size(), agcb); + auto top_cb = log_processor::callback_type(&filter_lp::process, fgo_lp.get()); - lp.process(m_instrms); + log_processor lp(num_channels, top_cb); + + lp.process(m_in_streams); if (!opt_quiet()) { #if 0 - perr("Mean (low freq filter): {}\n", wo->mean); - perr("Mean (static): {}\n", wo->means / static_cast<double>(wo->m_n)); - perr("Amp + {}\n", 32000.0 / (wo->maxsam - wo->mean)); - perr("Amp - {}\n", -32000.0 / (wo->minsam - wo->mean)); + std_err("Mean (low freq filter): {}\n", wo->mean); + std_err("Mean (static): {}\n", wo->means / static_cast<double>(wo->m_n)); + std_err("Amp + {}\n", 32000.0 / (wo->max_samples - wo->mean)); + std_err("Amp - {}\n", -32000.0 / (wo->min_samples - wo->mean)); #endif } } -void nlwav_app::convert_vcd(vcdwriter::format_e format) +void nlwav_app::convert_vcd(std::ostream &output, vcd_writer::format_e format) { - plib::unique_ptr<vcdwriter> wo = plib::make_unique<vcdwriter>(*m_outstrm, opt_args(), + arena::unique_ptr<vcd_writer> wo = plib::make_unique<vcd_writer, arena>(output, opt_args(), format, opt_high(), opt_low()); - log_processor::callback_type agcb = log_processor::callback_type(&vcdwriter::process, wo.get()); + log_processor::callback_type agcb = log_processor::callback_type(&vcd_writer::process, wo.get()); - log_processor lp(m_instrms.size(), agcb); + log_processor lp(m_in_streams.size(), agcb); - lp.process(m_instrms); + lp.process(m_in_streams); if (!opt_quiet()) { #if 0 - perr("Mean (low freq filter): {}\n", wo->mean); - perr("Mean (static): {}\n", wo->means / static_cast<double>(wo->m_n)); - perr("Amp + {}\n", 32000.0 / (wo->maxsam - wo->mean)); - perr("Amp - {}\n", -32000.0 / (wo->minsam - wo->mean)); + std_err("Mean (low freq filter): {}\n", wo->mean); + std_err("Mean (static): {}\n", wo->means / static_cast<double>(wo->m_n)); + std_err("Amp + {}\n", 32000.0 / (wo->max_samples - wo->mean)); + std_err("Amp - {}\n", -32000.0 / (wo->min_samples - wo->mean)); #endif } } +void nlwav_app::convert_tab(std::ostream &output) +{ + + auto wo = plib::make_unique<tab_writer, arena>(output, opt_args(), + opt_start(), opt_inc(), opt_samples()); + log_processor::callback_type agcb = log_processor::callback_type(&tab_writer::process, wo.get()); + + log_processor lp(m_in_streams.size(), agcb); + + lp.process(m_in_streams); + +} + + pstring nlwav_app::usage() { return help("Convert netlist log files into wav files.\n", "nlwav [OPTION] ... [FILE] ..."); } +template <typename F> +static void open_ostream_and_exec(const pstring &fname, bool binary, F func) +{ + if (fname != "-") + { + // FIXME: binary depends on format! + plib::ofstream output_stream(plib::filesystem::u8path(fname), + binary ? (std::ios::out | std::ios::binary) : std::ios::out); + if (output_stream.fail()) + throw plib::file_open_e(fname); + output_stream.imbue(std::locale::classic()); + func(output_stream); + } + else + { + std::cout.imbue(std::locale::classic()); + // FIXME: switch to binary on windows +#ifdef _WIN32 + _setmode(_fileno(stdout), _O_BINARY); +#endif + func(std::cout); + } +} + +void nlwav_app::convert(const pstring &output_file) +{ + switch (opt_fmt()) + { + case 0: + open_ostream_and_exec(output_file, true, [this](std::ostream &output) { convert_wav(output, wav_t::s16); }); + break; + case 1: + open_ostream_and_exec(output_file, true, [this](std::ostream &output) { convert_wav(output, wav_t::s32); }); + break; + case 2: + open_ostream_and_exec(output_file, true, [this](std::ostream &output) { convert_wav(output, wav_t::f32); }); + break; + case 3: + open_ostream_and_exec(output_file, false, [this](std::ostream &output) { convert_vcd(output, vcd_writer::ANALOG); }); + break; + case 4: + open_ostream_and_exec(output_file, false, [this](std::ostream &output) { convert_vcd(output, vcd_writer::DIGITAL); }); + break; + case 5: + open_ostream_and_exec(output_file, false, [this](std::ostream &output) { convert_tab(output); }); + break; + default: + // tease compiler - can't happen + break; + } +} int nlwav_app::execute() { - for (auto &i : opt_args()) - pout(pstring("Hello : ") + i + "\n"); if (opt_help()) { - pout(usage()); + std_out(usage()); return 0; } if (opt_version()) { - pout( + std_out( "nlwav (netlist) 0.1\n" - "Copyright (C) 2019 Couriersud\n" - "License GPLv2+: GNU GPL version 2 or later <http://gnu.org/licenses/gpl.html>.\n" + "Copyright (C) 2021 Couriersud\n" + "License BSD-3-Clause\n" "This is free software: you are free to change and redistribute it.\n" "There is NO WARRANTY, to the extent permitted by law.\n\n" "Written by Couriersud.\n"); return 0; } - m_outstrm = (opt_out() == "-" ? &std::cout : plib::pnew<std::ofstream>(plib::filesystem::u8path(opt_out()))); - if (m_outstrm->fail()) - throw plib::file_open_e(opt_out()); - m_outstrm->imbue(std::locale::classic()); - - for (auto &oi: opt_args()) + try { - plib::unique_ptr<std::istream> fin; - - if (oi == "-") + for (const auto &oi: opt_args()) { - auto temp(plib::make_unique<std::stringstream>()); - plib::copystream(*temp, std::cin); - fin = std::move(temp); + std::unique_ptr<std::istream> fin; + if (oi == "-") + { + auto temp(std::make_unique<std::stringstream>()); + plib::copy_stream(*temp, std::cin); + fin = std::move(temp); + } + else + { + fin = std::make_unique<plib::ifstream>(plib::filesystem::u8path(oi), std::ios::in); + if (fin->fail()) + throw plib::file_open_e(oi); + } + fin->imbue(std::locale::classic()); + m_in_streams.push_back(std::move(fin)); } - else - fin = plib::make_unique<std::ifstream>(plib::filesystem::u8path(oi)); - fin->imbue(std::locale::classic()); - m_instrms.push_back(std::move(fin)); - } - switch (opt_fmt()) + convert(opt_out()); + } + catch (plib::pexception &e) { - case 0: - convert_wav(); break; - case 1: - convert_vcd(vcdwriter::ANALOG); break; - case 2: - convert_vcd(vcdwriter::DIGITAL); break; - default: - // tease compiler - can't happen - break; + std_err("Exception caught: {}\n", e.text()); + return 1; } - - if (opt_out() != "-") - plib::pdelete(m_outstrm); - return 0; } PMAIN(nlwav_app) -/* -Der Daten-Abschnitt enth??lt die Abtastwerte: -Offset L??nge Inhalt Beschreibung -36 (0x24) 4 'data' Header-Signatur -40 (0x28) 4 <length> L??nge des Datenblocks, max. <Dateigr????e>?????????44 - -0 (0x00) char 4 'RIFF' -4 (0x04) unsigned 4 <Dateigr????e>?????????8 -8 (0x08) char 4 'WAVE' - -Der fmt-Abschnitt (24 Byte) beschreibt das Format der einzelnen Abtastwerte: -Offset L??nge Inhalt Beschreibung -12 (0x0C) 4 'fmt ' Header-Signatur (folgendes Leerzeichen beachten) -16 (0x10) 4 <fmt length> L??nge des restlichen fmt-Headers (16 Bytes) -20 (0x14) 2 <format tag> Datenformat der Abtastwerte (siehe separate Tabelle weiter unten) -22 (0x16) 2 <channels> Anzahl der Kan??le: 1 = mono, 2 = stereo; mittlerweile sind auch mehr als 2 Kan??le (z. B. f??r Raumklang) m??glich.[2] -24 (0x18) 4 <sample rate> Samples pro Sekunde je Kanal (z. B. 44100) -28 (0x1C) 4 <bytes/second> Abtastrate????????Frame-Gr????e -32 (0x20) 2 <block align> Frame-Gr????e = <Anzahl der Kan??le>????????((<Bits/Sample (eines Kanals)>???+???7)???/???8) (Division ohne Rest) -34 (0x22) 2 <bits/sample> Anzahl der Datenbits pro Samplewert je Kanal (z. B. 12) -*/ +// spell-checker:disable +// +// Der Daten-Abschnitt enth??lt die Abtastwerte: +// Offset L??nge Inhalt Beschreibung +// 36 (0x24) 4 'data' Header-Signatur +// 40 (0x28) 4 <length> L??nge des Datenblocks, max. <Dateigr????e>?????????44 +// +// 0 (0x00) char 4 'RIFF' +// 4 (0x04) unsigned 4 <Dateigr????e>?????????8 +// 8 (0x08) char 4 'WAVE' +// +// Der fmt-Abschnitt (24 Byte) beschreibt das Format der einzelnen Abtastwerte: +// Offset L??nge Inhalt Beschreibung +// 12 (0x0C) 4 'fmt ' Header-Signatur (folgendes Leerzeichen beachten) +// 16 (0x10) 4 <fmt length> L??nge des restlichen fmt-Headers (16 Bytes) +// 20 (0x14) 2 <format tag> Datenformat der Abtastwerte (siehe separate Tabelle weiter unten) +// 22 (0x16) 2 <channels> Anzahl der Kan??le: 1 = mono, 2 = stereo; mittlerweile sind auch mehr als 2 Kan??le (z. B. f??r Raumklang) m??glich.[2] +// 24 (0x18) 4 <sample rate> Samples pro Sekunde je Kanal (z. B. 44100) +// 28 (0x1C) 4 <bytes/second> Abtastrate????????Frame-Gr????e +// 32 (0x20) 2 <block align> Frame-Gr????e = <Anzahl der Kan??le>????????((<Bits/Sample (eines Kanals)>???+???7)???/???8) (Division ohne Rest) +// 34 (0x22) 2 <bits/sample> Anzahl der Datenbits pro Samplewert je Kanal (z. B. 12) +// +// spell-checker:enable diff --git a/src/lib/netlist/solver/nld_matrix_solver.cpp b/src/lib/netlist/solver/nld_matrix_solver.cpp index 24acc8db576..d382da0f7d5 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.cpp +++ b/src/lib/netlist/solver/nld_matrix_solver.cpp @@ -1,37 +1,46 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_matrix_solver.cpp - * - */ + +// Names +// spell-checker: words Raphson, Seidel +// +// Specific technical terms +// spell-checker: words vsolver #include "nld_matrix_solver.h" -#include "plib/putil.h" -#include <cmath> // <<= needed by windows build +#include "nl_setup.h" +#include "nld_solver.h" -namespace netlist -{ -namespace devices +#include "core/setup.h" + +#include "plib/putil.h" + +namespace netlist::solver { - terms_for_net_t::terms_for_net_t() - : m_railstart(0) - , m_last_V(0.0) - , m_DD_n_m_1(0.0) - , m_h_n_m_1(1e-12) + terms_for_net_t::terms_for_net_t(arena_type &arena, analog_net_t *net) + : m_nz(arena) + , m_nzrd(arena) + , m_nzbd(arena) + , m_connected_net_idx(arena) + , m_terms(arena) + , m_net(net) + , m_rail_start(0) { } - void terms_for_net_t::add(terminal_t *term, int net_other, bool sorted) + void + terms_for_net_t::add_terminal(terminal_t *term, int net_other, bool sorted) { if (sorted) - for (std::size_t i=0; i < m_connected_net_idx.size(); i++) + for (std::size_t i = 0; i < m_connected_net_idx.size(); i++) { if (m_connected_net_idx[i] > net_other) { plib::container::insert_at(m_terms, i, term); - plib::container::insert_at(m_connected_net_idx, i, net_other); + plib::container::insert_at(m_connected_net_idx, i, + net_other); return; } } @@ -43,265 +52,326 @@ namespace devices // matrix_solver // ---------------------------------------------------------------------------------------- - matrix_solver_t::matrix_solver_t(netlist_state_t &anetlist, const pstring &name, - const eSortType sort, const solver_parameters_t *params) - : device_t(anetlist, name) - , m_params(*params) - , m_stat_calculations(*this, "m_stat_calculations", 0) - , m_stat_newton_raphson(*this, "m_stat_newton_raphson", 0) - , m_stat_vsolver_calls(*this, "m_stat_vsolver_calls", 0) - , m_iterative_fail(*this, "m_iterative_fail", 0) - , m_iterative_total(*this, "m_iterative_total", 0) - , m_last_step(*this, "m_last_step", netlist_time::zero()) - , m_fb_sync(*this, "FB_sync") - , m_Q_sync(*this, "Q_sync") - , m_ops(0) - , m_sort(sort) + matrix_solver_t::matrix_solver_t(devices::nld_solver &main_solver, + const pstring &name, + const net_list_t &nets, + const solver::solver_parameters_t *params) + //: device_t(static_cast<device_t &>(main_solver), name) + : device_t( + device_data_t{main_solver.state(), main_solver.name() + "." + name}) + , m_params(*params) + , m_gonn(m_arena) + , m_gtn(m_arena) + , m_Idrn(m_arena) + , m_connected_net_Vn(m_arena) + , m_iterative_fail(*this, "m_iterative_fail", 0) + , m_iterative_total(*this, "m_iterative_total", 0) + , m_main_solver(main_solver) + , m_stat_calculations(*this, "m_stat_calculations", 0) + , m_stat_newton_raphson(*this, "m_stat_newton_raphson", 0) + , m_stat_newton_raphson_fail(*this, "m_stat_newton_raphson_fail", 0) + , m_stat_vsolver_calls(*this, "m_stat_vsolver_calls", 0) + , m_last_step(*this, "m_last_step", netlist_time_ext::zero()) + , m_step_funcs(m_arena) + , m_dynamic_funcs(m_arena) + , m_inputs(m_arena) + , m_ops(0) + { + setup_base(this->state().setup(), nets); + + // now setup the matrix + setup_matrix(); + // printf("Freq: %f\n", m_params.m_freq()); + } + + analog_net_t *matrix_solver_t::get_connected_net(terminal_t *term) { - connect_post_start(m_fb_sync, m_Q_sync); + return &state().setup().get_connected_terminal(*term)->net(); } - void matrix_solver_t::setup_base(analog_net_t::list_t &nets) + void matrix_solver_t::reschedule(netlist_time ts) { + m_main_solver.reschedule(this, ts); + } + void matrix_solver_t::setup_base([[maybe_unused]] setup_t &setup, + const net_list_t &nets) + { log().debug("New solver setup\n"); + std::vector<core_device_t *> step_devices; + std::vector<core_device_t *> dynamic_devices; - m_nets.clear(); m_terms.clear(); - for (auto & net : nets) + for (const auto &net : nets) { - m_nets.push_back(net); - m_terms.push_back(plib::make_unique<terms_for_net_t>()); - m_rails_temp.push_back(plib::make_unique<terms_for_net_t>()); + m_terms.emplace_back(m_arena, net); + m_rails_temp.emplace_back(m_arena); } for (std::size_t k = 0; k < nets.size(); k++) { - analog_net_t *net = nets[k]; + std::vector<detail::core_terminal_t *> temp; + + analog_net_t &net = *nets[k]; - log().debug("setting up net\n"); + // FIXME: add size() to list + // log().debug("adding net with {1} populated connections\n", + // net.core_terms().size()); - net->set_solver(this); + net.set_solver(this); - for (auto &p : net->core_terms()) + for (detail::core_terminal_t *p : net.core_terms_copy()) { - log().debug("{1} {2} {3}\n", p->name(), net->name(), net->isRailNet()); + nl_assert_always(&p->net() == &net, "Net integrity violated"); + + log().debug("{1} {2} {3}\n", p->name(), net.name(), + net.is_rail_net()); switch (p->type()) { case detail::terminal_type::TERMINAL: - if (p->device().is_timestep()) - if (!plib::container::contains(m_step_devices, &p->device())) - m_step_devices.push_back(&p->device()); + if (p->device().is_time_step()) + if (!plib::container::contains(step_devices, + &p->device())) + step_devices.push_back(&p->device()); if (p->device().is_dynamic()) - if (!plib::container::contains(m_dynamic_devices, &p->device())) - m_dynamic_devices.push_back(&p->device()); + if (!plib::container::contains(dynamic_devices, + &p->device())) + dynamic_devices.push_back(&p->device()); { - auto *pterm = dynamic_cast<terminal_t *>(p); - add_term(k, pterm); + auto pterm = plib::dynamic_downcast<terminal_t *>( + p); + nl_assert_always(bool(pterm), + "cast to terminal_t * failed"); + add_term(k, *pterm); } log().debug("Added terminal {1}\n", p->name()); break; case detail::terminal_type::INPUT: - { - proxied_analog_output_t *net_proxy_output = nullptr; - for (auto & input : m_inps) - if (input->proxied_net() == &p->net()) - { - net_proxy_output = input.get(); - break; - } - - if (net_proxy_output == nullptr) + { + proxied_analog_output_t *net_proxy_output = nullptr; + for (auto &input : m_inputs) + if (input->proxied_net() == &p->net()) { - pstring nname = this->name() + "." + pstring(plib::pfmt("m{1}")(m_inps.size())); - nl_assert(p->net().is_analog()); - auto net_proxy_output_u = pool().make_poolptr<proxied_analog_output_t>(*this, nname, static_cast<analog_net_t *>(&p->net())); - net_proxy_output = net_proxy_output_u.get(); - m_inps.push_back(std::move(net_proxy_output_u)); + net_proxy_output = input.get(); + break; } - net_proxy_output->net().add_terminal(*p); - // FIXME: repeated calling - kind of brute force - net_proxy_output->net().rebuild_list(); - log().debug("Added input\n"); + + if (net_proxy_output == nullptr) + { + pstring new_name( + this->name() + "." + + pstring(plib::pfmt("m{1}")(m_inputs.size()))); + auto proxied_net = plib::dynamic_downcast< + analog_net_t *>(p->net()); + nl_assert_always(proxied_net, + "Net is not an analog net"); + auto net_proxy_output_u + = state() + .make_pool_object< + proxied_analog_output_t>( + *this, new_name, *proxied_net); + net_proxy_output = net_proxy_output_u.get(); + m_inputs.emplace_back( + std::move(net_proxy_output_u)); } - break; + net.remove_terminal(*p); + net_proxy_output->net().add_terminal(*p); + // FIXME: repeated calling - kind of brute force + net_proxy_output->net().rebuild_list(); + log().debug("Added input {1}", + net_proxy_output->name()); + } + break; case detail::terminal_type::OUTPUT: log().fatal(MF_UNHANDLED_ELEMENT_1_FOUND(p->name())); - break; + throw nl_exception( + MF_UNHANDLED_ELEMENT_1_FOUND(p->name())); } } - log().debug("added net with {1} populated connections\n", net->core_terms().size()); + net.rebuild_list(); } - - /* now setup the matrix */ - setup_matrix(); + for (auto &d : step_devices) + m_step_funcs.emplace_back( + nl_delegate_ts(&core_device_t::time_step, d)); + for (auto &d : dynamic_devices) + m_dynamic_funcs.emplace_back( + nl_delegate_dyn(&core_device_t::update_terminals, d)); } - void matrix_solver_t::sort_terms(eSortType sort) + /// \brief Sort terminals + /// + /// @param sort Sort algorithm to use. + /// + /// Sort in descending order by number of connected matrix voltages. + /// The idea is, that for Gauss-Seidel algorithm the first voltage computed + /// depends on the greatest number of previous voltages thus taking into + /// account the maximum amount of information. + /// + /// This actually improves performance on popeye slightly. Average + /// GS computations reduce from 2.509 to 2.370 + /// + /// Smallest to largest : 2.613 + /// Unsorted : 2.509 + /// Largest to smallest : 2.370 + // + /// Sorting as a general matrix pre-conditioning is mentioned in + /// literature but I have found no articles about Gauss Seidel. + /// + /// For Gaussian Elimination however increasing order is better suited. + /// NOTE: Even better would be to sort on elements right of the matrix + /// diagonal. + /// FIXME: This entry needs an update. + /// + void matrix_solver_t::sort_terms(matrix_sort_type_e sort) { - /* Sort in descending order by number of connected matrix voltages. - * The idea is, that for Gauss-Seidel algo the first voltage computed - * depends on the greatest number of previous voltages thus taking into - * account the maximum amout of information. - * - * This actually improves performance on popeye slightly. Average - * GS computations reduce from 2.509 to 2.370 - * - * Smallest to largest : 2.613 - * Unsorted : 2.509 - * Largest to smallest : 2.370 - * - * Sorting as a general matrix pre-conditioning is mentioned in - * literature but I have found no articles about Gauss Seidel. - * - * For Gaussian Elimination however increasing order is better suited. - * NOTE: Even better would be to sort on elements right of the matrix diagonal. - * - */ - - const std::size_t iN = m_nets.size(); + const std::size_t iN = m_terms.size(); switch (sort) { - case PREFER_BAND_MATRIX: + case matrix_sort_type_e::PREFER_BAND_MATRIX: + { + for (std::size_t k = 0; k < iN - 1; k++) { - for (std::size_t k = 0; k < iN - 1; k++) + auto pk = get_weight_around_diagonal(k, k); + for (std::size_t i = k + 1; i < iN; i++) { - auto pk = get_weight_around_diag(k,k); - for (std::size_t i = k+1; i < iN; i++) + auto pi = get_weight_around_diagonal(i, k); + if (pi < pk) { - auto pi = get_weight_around_diag(i,k); - if (pi < pk) - { - std::swap(m_terms[i], m_terms[k]); - std::swap(m_nets[i], m_nets[k]); - pk = get_weight_around_diag(k,k); - } + std::swap(m_terms[i], m_terms[k]); + pk = get_weight_around_diagonal(k, k); } } } - break; - case PREFER_IDENTITY_TOP_LEFT: + } + break; + case matrix_sort_type_e::PREFER_IDENTITY_TOP_LEFT: + { + for (std::size_t k = 0; k < iN - 1; k++) { - for (std::size_t k = 0; k < iN - 1; k++) + auto pk = get_left_right_of_diagonal(k, k); + for (std::size_t i = k + 1; i < iN; i++) { - auto pk = get_left_right_of_diag(k,k); - for (std::size_t i = k+1; i < iN; i++) + auto pi = get_left_right_of_diagonal(i, k); + if (pi.first <= pk.first && pi.second >= pk.second) { - auto pi = get_left_right_of_diag(i,k); - if (pi.first <= pk.first && pi.second >= pk.second) - { - std::swap(m_terms[i], m_terms[k]); - std::swap(m_nets[i], m_nets[k]); - pk = get_left_right_of_diag(k,k); - } + std::swap(m_terms[i], m_terms[k]); + pk = get_left_right_of_diagonal(k, k); } } } - break; - case ASCENDING: - case DESCENDING: - { - int sort_order = (m_sort == DESCENDING ? 1 : -1); + } + break; + case matrix_sort_type_e::ASCENDING: + case matrix_sort_type_e::DESCENDING: + { + int sort_order = (sort == matrix_sort_type_e::DESCENDING ? 1 + : -1); - for (std::size_t k = 0; k < iN - 1; k++) - for (std::size_t i = k+1; i < iN; i++) + for (std::size_t k = 0; k < iN - 1; k++) + for (std::size_t i = k + 1; i < iN; i++) + { + if ((static_cast<int>(m_terms[k].rail_start()) + - static_cast<int>(m_terms[i].rail_start())) + * sort_order + < 0) { - if ((static_cast<int>(m_terms[k]->m_railstart) - static_cast<int>(m_terms[i]->m_railstart)) * sort_order < 0) - { - std::swap(m_terms[i], m_terms[k]); - std::swap(m_nets[i], m_nets[k]); - } + std::swap(m_terms[i], m_terms[k]); } - } - break; - case NOSORT: - break; + } + } + break; + case matrix_sort_type_e::NOSORT: break; } - /* rebuild */ + // rebuild for (auto &term : m_terms) { - int *other = term->m_connected_net_idx.data(); - for (std::size_t i = 0; i < term->count(); i++) - //FIXME: this is weird - if (other[i] != -1) - other[i] = get_net_idx(&term->terms()[i]->connected_terminal()->net()); + // int *other = term.m_connected_net_idx.data(); + for (std::size_t i = 0; i < term.count(); i++) + // FIXME: this is weird + if (term.m_connected_net_idx[i] != -1) + term.m_connected_net_idx[i] = get_net_idx( + get_connected_net(term.terms()[i])); } } void matrix_solver_t::setup_matrix() { - const std::size_t iN = m_nets.size(); + const std::size_t iN = m_terms.size(); for (std::size_t k = 0; k < iN; k++) { - m_terms[k]->m_railstart = m_terms[k]->count(); - for (std::size_t i = 0; i < m_rails_temp[k]->count(); i++) - this->m_terms[k]->add(m_rails_temp[k]->terms()[i], m_rails_temp[k]->m_connected_net_idx.data()[i], false); + m_terms[k].set_rail_start(m_terms[k].count()); + for (std::size_t i = 0; i < m_rails_temp[k].count(); i++) + this->m_terms[k].add_terminal( + m_rails_temp[k].terms()[i], + m_rails_temp[k].m_connected_net_idx.data()[i], false); } // free all - no longer needed m_rails_temp.clear(); - sort_terms(m_sort); + sort_terms(m_params.m_sort_type); this->set_pointers(); - /* create a list of non zero elements. */ + // create a list of non zero elements. for (unsigned k = 0; k < iN; k++) { - terms_for_net_t * t = m_terms[k].get(); - /* pretty brutal */ - int *other = t->m_connected_net_idx.data(); + terms_for_net_t &t = m_terms[k]; + // pretty brutal + int *other = t.m_connected_net_idx.data(); - t->m_nz.clear(); + t.m_nz.clear(); - for (std::size_t i = 0; i < t->m_railstart; i++) - if (!plib::container::contains(t->m_nz, static_cast<unsigned>(other[i]))) - t->m_nz.push_back(static_cast<unsigned>(other[i])); + for (std::size_t i = 0; i < t.rail_start(); i++) + if (!plib::container::contains(t.m_nz, + static_cast<unsigned>(other[i]))) + t.m_nz.push_back(static_cast<unsigned>(other[i])); - t->m_nz.push_back(k); // add diagonal + t.m_nz.push_back(k); // add diagonal - /* and sort */ - std::sort(t->m_nz.begin(), t->m_nz.end()); + // and sort + std::sort(t.m_nz.begin(), t.m_nz.end()); } - /* create a list of non zero elements right of the diagonal - * These list anticipate the population of array elements by - * Gaussian elimination. - */ + // create a list of non zero elements right of the diagonal + // These list anticipate the population of array elements by + // Gaussian elimination. + for (std::size_t k = 0; k < iN; k++) { - terms_for_net_t * t = m_terms[k].get(); - /* pretty brutal */ - int *other = t->m_connected_net_idx.data(); + terms_for_net_t &t = m_terms[k]; + // pretty brutal + int *other = t.m_connected_net_idx.data(); - if (k==0) - t->m_nzrd.clear(); + if (k == 0) + t.m_nzrd.clear(); else { - t->m_nzrd = m_terms[k-1]->m_nzrd; - for (auto j = t->m_nzrd.begin(); j != t->m_nzrd.end(); ) + t.m_nzrd = m_terms[k - 1].m_nzrd; + for (auto j = t.m_nzrd.begin(); j != t.m_nzrd.end();) { if (*j < k + 1) - j = t->m_nzrd.erase(j); + j = t.m_nzrd.erase(j); else ++j; } } - for (std::size_t i = 0; i < t->m_railstart; i++) - if (!plib::container::contains(t->m_nzrd, static_cast<unsigned>(other[i])) && other[i] >= static_cast<int>(k + 1)) - t->m_nzrd.push_back(static_cast<unsigned>(other[i])); + for (std::size_t i = 0; i < t.rail_start(); i++) + if (!plib::container::contains(t.m_nzrd, + static_cast<unsigned>(other[i])) + && other[i] >= static_cast<int>(k + 1)) + t.m_nzrd.push_back(static_cast<unsigned>(other[i])); - /* and sort */ - std::sort(t->m_nzrd.begin(), t->m_nzrd.end()); + // and sort + std::sort(t.m_nzrd.begin(), t.m_nzrd.end()); } - /* create a list of non zero elements below diagonal k - * This should reduce cache misses ... - */ + // create a list of non zero elements below diagonal k + // This should reduce cache misses ... std::vector<std::vector<bool>> touched(iN, std::vector<bool>(iN)); @@ -309,8 +379,8 @@ namespace devices { for (std::size_t j = 0; j < iN; j++) touched[k][j] = false; - for (std::size_t j = 0; j < m_terms[k]->m_nz.size(); j++) - touched[k][m_terms[k]->m_nz[j]] = true; + for (std::size_t j = 0; j < m_terms[k].m_nz.size(); j++) + touched[k][m_terms[k].m_nz[j]] = true; } m_ops = 0; @@ -322,8 +392,8 @@ namespace devices if (touched[row][k]) { m_ops++; - if (!plib::container::contains(m_terms[k]->m_nzbd, row)) - m_terms[k]->m_nzbd.push_back(row); + if (!plib::container::contains(m_terms[k].m_nzbd, row)) + m_terms[k].m_nzbd.push_back(row); for (std::size_t col = k + 1; col < iN; col++) if (touched[k][col]) { @@ -333,152 +403,246 @@ namespace devices } } } - log().verbose("Number of mults/adds for {1}: {2}", name(), m_ops); + log().verbose("Number of multiplications/additions for {1}: {2}", + name(), m_ops); + // Dumps non zero elements right of diagonal -> to much output, disabled + // NOLINTNEXTLINE(readability-simplify-boolean-expr) if ((false)) for (std::size_t k = 0; k < iN; k++) { pstring line = plib::pfmt("{1:3}")(k); - for (const auto & nzrd : m_terms[k]->m_nzrd) + for (const auto &nzrd : m_terms[k].m_nzrd) line += plib::pfmt(" {1:3}")(nzrd); log().verbose("{1}", line); } - /* - * save states - */ + // + // save states + // + for (std::size_t k = 0; k < iN; k++) { pstring num = plib::pfmt("{1}")(k); - state().save(*this, m_terms[k]->m_last_V, this->name(), "lastV." + num); - state().save(*this, m_terms[k]->m_DD_n_m_1, this->name(), "m_DD_n_m_1." + num); - state().save(*this, m_terms[k]->m_h_n_m_1, this->name(), "m_h_n_m_1." + num); + state().save(*this, m_gonn[k], "GO" + num, this->name(), + m_terms[k].count()); + state().save(*this, m_gtn[k], "GT" + num, this->name(), + m_terms[k].count()); + state().save(*this, m_Idrn[k], "IDR" + num, this->name(), + m_terms[k].count()); + } + } + + void matrix_solver_t::set_pointers() + { + const std::size_t iN = this->m_terms.size(); + + std::size_t max_count = 0; + std::size_t max_rail = 0; + for (std::size_t k = 0; k < iN; k++) + { + max_count = std::max(max_count, m_terms[k].count()); + max_rail = std::max(max_rail, m_terms[k].rail_start()); + } + + m_gtn.resize(iN, max_count); + m_gonn.resize(iN, max_count); + m_Idrn.resize(iN, max_count); + m_connected_net_Vn.resize(iN, max_count); - // FIXME: This shouldn't be necessary, recalculate on each entry ... - state().save(*this, m_gonn[k],"GO" + num, this->name(), m_terms[k]->count()); - state().save(*this, m_gtn[k],"GT" + num, this->name(), m_terms[k]->count()); - state().save(*this, m_Idrn[k],"IDR" + num, this->name(), m_terms[k]->count()); + // Initialize arrays to 0 (in case the vrl one is used + for (std::size_t k = 0; k < iN; k++) + for (std::size_t j = 0; j < m_terms[k].count(); j++) + { + m_gtn.set(k, j, nlconst::zero()); + m_gonn.set(k, j, nlconst::zero()); + m_Idrn.set(k, j, nlconst::zero()); + m_connected_net_Vn.set(k, j, nullptr); + } + + for (std::size_t k = 0; k < iN; k++) + { + auto count = m_terms[k].count(); + for (std::size_t i = 0; i < count; i++) + { + m_terms[k].terms()[i]->set_ptrs(&m_gtn[k][i], &m_gonn[k][i], + &m_Idrn[k][i]); + m_connected_net_Vn[k][i] = get_connected_net( + m_terms[k].terms()[i]) + ->Q_Analog_state_ptr(); + } } } void matrix_solver_t::update_inputs() { // avoid recursive calls. Inputs are updated outside this call - for (auto &inp : m_inps) + for (auto &inp : m_inputs) inp->push(inp->proxied_net()->Q_Analog()); } - void matrix_solver_t::update_dynamic() + void matrix_solver_t::update_dynamic() noexcept { - /* update all non-linear devices */ - for (auto &dyn : m_dynamic_devices) - dyn->update_terminals(); + // update all non-linear devices + for (auto &dyn : m_dynamic_funcs) + dyn(); } void matrix_solver_t::reset() { - m_last_step = netlist_time::zero(); + // m_last_step = netlist_time_ext::zero(); } - void matrix_solver_t::update() NL_NOEXCEPT + void matrix_solver_t::step(detail::time_step_type ts_type, + netlist_time delta) noexcept { - const netlist_time new_timestep = solve(exec().time()); - update_inputs(); + const auto dd(delta.as_fp<fptype>()); + for (auto &d : m_step_funcs) + d(ts_type, dd); + } - if (m_params.m_dynamic_ts && has_timestep_devices() && new_timestep > netlist_time::zero()) + bool matrix_solver_t::solve_nr_base() + { + bool this_resched(false); + std::size_t newton_loops = 0; + do { - m_Q_sync.net().toggle_and_push_to_queue(new_timestep); - } + update_dynamic(); + // Gauss-Seidel will revert to Gaussian elimination if steps + // exceeded. + this->m_stat_calculations++; + this->upstream_solve_non_dynamic(); + this_resched = this->check_err(); + this->store(); + newton_loops++; + } while (this_resched && newton_loops < m_params.m_nr_loops); + + m_stat_newton_raphson += newton_loops; + if (this_resched) + m_stat_newton_raphson_fail++; + return this_resched; } - /* update_forced is called from within param_update - * - * this should only occur outside of execution and thus - * using time should be safe. - * - */ - void matrix_solver_t::update_forced() + netlist_time matrix_solver_t::newton_loops_exceeded(netlist_time delta) { - const netlist_time new_timestep = solve(exec().time()); - plib::unused_var(new_timestep); + netlist_time next_time_step; + bool resched(false); - update_inputs(); + restore(); + step(detail::time_step_type::RESTORE, delta); - if (m_params.m_dynamic_ts && has_timestep_devices()) + for (std::size_t i = 0; i < 10; i++) { - m_Q_sync.net().toggle_and_push_to_queue(netlist_time::from_double(m_params.m_min_timestep)); + backup(); + step(detail::time_step_type::FORWARD, + netlist_time::from_fp(m_params.m_min_ts_ts())); + resched = solve_nr_base(); + // update time step calculation + next_time_step = compute_next_time_step(m_params.m_min_ts_ts(), + m_params.m_min_ts_ts(), + m_params.m_max_time_step); + delta -= netlist_time::from_fp(m_params.m_min_ts_ts()); + } + // try remaining time using compute_next_time step + while (delta > netlist_time::zero()) + { + if (next_time_step > delta) + next_time_step = delta; + backup(); + step(detail::time_step_type::FORWARD, next_time_step); + delta -= next_time_step; + resched = solve_nr_base(); + next_time_step = compute_next_time_step( + next_time_step.as_fp<nl_fptype>(), m_params.m_min_ts_ts(), + m_params.m_max_time_step); } - } - void matrix_solver_t::step(const netlist_time &delta) - { - const nl_double dd = delta.as_double(); - for (auto &d : m_step_devices) - d->timestep(dd); - } + if (m_stat_newton_raphson % 100 == 0) + log().warning(MW_NEWTON_LOOPS_EXCEEDED_INVOCATION_3( + 100, this->name(), exec().time().as_double() * 1e6)); - void matrix_solver_t::solve_base() - { - ++m_stat_vsolver_calls; - if (has_dynamic_devices()) + if (resched) { - std::size_t this_resched; - std::size_t newton_loops = 0; - do - { - update_dynamic(); - // Gauss-Seidel will revert to Gaussian elemination if steps exceeded. - this_resched = this->vsolve_non_dynamic(true); - newton_loops++; - } while (this_resched > 1 && newton_loops < m_params.m_nr_loops); - - m_stat_newton_raphson += newton_loops; // reschedule .... - if (this_resched > 1 && !m_Q_sync.net().is_queued()) - { - log().warning(MW_NEWTON_LOOPS_EXCEEDED_ON_NET_1(this->name())); - m_Q_sync.net().toggle_and_push_to_queue(m_params.m_nr_recalc_delay); - } - } - else - { - this->vsolve_non_dynamic(false); + log().warning(MW_NEWTON_LOOPS_EXCEEDED_ON_NET_2( + this->name(), exec().time().as_double() * 1e6)); + return netlist_time::from_fp(m_params.m_nr_recalc_delay()); } + if (m_params.m_dynamic_ts) + return next_time_step; + + return netlist_time::from_fp(m_params.m_max_time_step); } - const netlist_time matrix_solver_t::solve(netlist_time now) + netlist_time matrix_solver_t::solve(netlist_time_ext now, + [[maybe_unused]] const char *source) { - const netlist_time delta = now - m_last_step; + auto delta = static_cast<netlist_time>(now - m_last_step()); + PFDEBUG(printf("solve %.10f\n", delta.as_double());) // We are already up to date. Avoid oscillations. // FIXME: Make this a parameter! if (delta < netlist_time::quantum()) - return netlist_time::zero(); + { + // printf("solve return %s at %f\n", source, now.as_double()); + return time_step_device_count() > 0 + ? netlist_time::from_fp(m_params.m_min_time_step) + : netlist_time::zero(); + } - /* update all terminals for new time step */ + backup(); // save voltages for backup and time step calculation + // update all terminals for new time step m_last_step = now; - step(delta); - solve_base(); - const netlist_time next_time_step = compute_next_timestep(delta.as_double()); - return next_time_step; + ++m_stat_vsolver_calls; + if (dynamic_device_count() != 0) + { + step(detail::time_step_type::FORWARD, delta); + const auto resched = solve_nr_base(); + + if (resched) + return newton_loops_exceeded(delta); + } + else + { + step(detail::time_step_type::FORWARD, delta); + this->m_stat_calculations++; + this->upstream_solve_non_dynamic(); + this->store(); + } + + if (m_params.m_dynamic_ts) + { + if (time_step_device_count() > 0) + return compute_next_time_step(delta.as_fp<nl_fptype>(), + m_params.m_min_time_step, + m_params.m_max_time_step); + } + + if (time_step_device_count() > 0) + return netlist_time::from_fp(m_params.m_max_time_step); + + return netlist_time::zero(); } - int matrix_solver_t::get_net_idx(detail::net_t *net) + int matrix_solver_t::get_net_idx(const analog_net_t *net) const noexcept { - for (std::size_t k = 0; k < m_nets.size(); k++) - if (m_nets[k] == net) + for (std::size_t k = 0; k < m_terms.size(); k++) + if (m_terms[k].is_net(net)) return static_cast<int>(k); return -1; } - std::pair<int, int> matrix_solver_t::get_left_right_of_diag(std::size_t irow, std::size_t idiag) + std::pair<int, int> + matrix_solver_t::get_left_right_of_diagonal(std::size_t irow, + std::size_t idiag) { - /* - * return the maximum column left of the diagonal (-1 if no cols found) - * return the minimum column right of the diagonal (999999 if no cols found) - */ + // + // return the maximum column left of the diagonal (-1 if no cols found) + // return the minimum column right of the diagonal (999999 if no cols + // found) + // const auto row = static_cast<int>(irow); const auto diag = static_cast<int>(idiag); @@ -488,13 +652,15 @@ namespace devices auto &term = m_terms[irow]; - for (std::size_t i = 0; i < term->count(); i++) + for (std::size_t i = 0; i < term.count(); i++) { - auto col = get_net_idx(&term->terms()[i]->connected_terminal()->net()); + auto col = get_net_idx(get_connected_net(term.terms()[i])); if (col != -1) { - if (col==row) col = diag; - else if (col==diag) col = row; + if (col == row) + col = diag; + else if (col == diag) + col = row; if (col > diag && col < colmin) colmin = col; @@ -505,125 +671,92 @@ namespace devices return {colmax, colmin}; } - double matrix_solver_t::get_weight_around_diag(std::size_t row, std::size_t diag) + matrix_solver_t::fptype + matrix_solver_t::get_weight_around_diagonal(std::size_t row, + std::size_t diag) { { - /* - * return average absolute distance - */ + // + // return average absolute distance + // std::vector<bool> touched(1024, false); // FIXME! - double weight = 0.0; - auto &term = m_terms[row]; - for (std::size_t i = 0; i < term->count(); i++) + fptype weight = nlconst::zero(); + auto &term = m_terms[row]; + for (std::size_t i = 0; i < term.count(); i++) { - auto col = get_net_idx(&term->terms()[i]->connected_terminal()->net()); + auto col = get_net_idx(get_connected_net(term.terms()[i])); if (col >= 0) { auto colu = static_cast<std::size_t>(col); if (!touched[colu]) { - if (colu==row) colu = static_cast<unsigned>(diag); - else if (colu==diag) colu = static_cast<unsigned>(row); - - weight = weight + std::abs(static_cast<double>(colu) - static_cast<double>(diag)); + if (colu == row) + colu = static_cast<unsigned>(diag); + else if (colu == diag) + colu = static_cast<unsigned>(row); + + weight = weight + + plib::abs(static_cast<fptype>(colu) + - static_cast<fptype>(diag)); touched[colu] = true; } } } - return weight; // / static_cast<double>(term->m_railstart); + return weight; } } - void matrix_solver_t::add_term(std::size_t k, terminal_t *term) + void matrix_solver_t::add_term(std::size_t net_idx, terminal_t *term) { - if (term->connected_terminal()->net().isRailNet()) + if (get_connected_net(term)->is_rail_net()) { - m_rails_temp[k]->add(term, -1, false); + m_rails_temp[net_idx].add_terminal(term, -1, false); } else { - int ot = get_net_idx(&term->connected_terminal()->net()); - if (ot>=0) + int ot = get_net_idx(get_connected_net(term)); + if (ot >= 0) { - m_terms[k]->add(term, ot, true); + m_terms[net_idx].add_terminal(term, ot, true); } - /* Should this be allowed ? */ - else // if (ot<0) + else { - m_rails_temp[k]->add(term, ot, true); log().fatal(MF_FOUND_TERM_WITH_MISSING_OTHERNET(term->name())); + throw nl_exception( + MF_FOUND_TERM_WITH_MISSING_OTHERNET(term->name())); } } } - netlist_time matrix_solver_t::compute_next_timestep(const double cur_ts) - { - nl_double new_solver_timestep = m_params.m_max_timestep; - - if (m_params.m_dynamic_ts) - { - for (std::size_t k = 0, iN=m_terms.size(); k < iN; k++) - { - analog_net_t *n = m_nets[k]; - terms_for_net_t *t = m_terms[k].get(); - - //const nl_double DD_n = (n->Q_Analog() - t->m_last_V); - // avoid floating point exceptions - const nl_double DD_n = std::max(-1e100, std::min(1e100,(n->Q_Analog() - t->m_last_V))); - const nl_double hn = cur_ts; - - //printf("%g %g %g %g\n", DD_n, hn, t->m_DD_n_m_1, t->m_h_n_m_1); - nl_double DD2 = (DD_n / hn - t->m_DD_n_m_1 / t->m_h_n_m_1) / (hn + t->m_h_n_m_1); - nl_double new_net_timestep; - - t->m_h_n_m_1 = hn; - t->m_DD_n_m_1 = DD_n; - if (std::fabs(DD2) > plib::constants<nl_double>::cast(1e-60)) // avoid div-by-zero - new_net_timestep = std::sqrt(m_params.m_dynamic_lte / std::fabs(plib::constants<nl_double>::cast(0.5)*DD2)); - else - new_net_timestep = m_params.m_max_timestep; - - if (new_net_timestep < new_solver_timestep) - new_solver_timestep = new_net_timestep; - - t->m_last_V = n->Q_Analog(); - } - if (new_solver_timestep < m_params.m_min_timestep) - { - new_solver_timestep = m_params.m_min_timestep; - } - } - //if (new_solver_timestep > 10.0 * hn) - // new_solver_timestep = 10.0 * hn; - /* - * FIXME: Factor 2 below is important. Without, we get timing issues. This must be a bug elsewhere. - */ - return std::max(netlist_time::from_double(new_solver_timestep), netlist_time::quantum() * 2); - } - void matrix_solver_t::log_stats() { - if (this->m_stat_calculations != 0 && this->m_stat_vsolver_calls && log().verbose.is_enabled()) + if (this->m_stat_calculations != 0 && this->m_stat_vsolver_calls + && log().verbose.is_enabled()) { log().verbose("=============================================="); log().verbose("Solver {1}", this->name()); - log().verbose(" ==> {1} nets", this->m_nets.size()); //, (*(*groups[i].first())->m_core_terms.first())->name()); - log().verbose(" has {1} elements", this->has_dynamic_devices() ? "dynamic" : "no dynamic"); - log().verbose(" has {1} elements", this->has_timestep_devices() ? "timestep" : "no timestep"); - log().verbose(" {1:6.3} average newton raphson loops", - static_cast<double>(this->m_stat_newton_raphson) / static_cast<double>(this->m_stat_vsolver_calls)); - log().verbose(" {1:10} invocations ({2:6.0} Hz) {3:10} gs fails ({4:6.2} %) {5:6.3} average", - this->m_stat_calculations, - static_cast<double>(this->m_stat_calculations) / this->exec().time().as_double(), - this->m_iterative_fail, - 100.0 * static_cast<double>(this->m_iterative_fail) - / static_cast<double>(this->m_stat_calculations), - static_cast<double>(this->m_iterative_total) / static_cast<double>(this->m_stat_calculations)); + log().verbose(" ==> {1} nets", this->m_terms.size()); + log().verbose(" has {1} dynamic elements", + this->dynamic_device_count()); + log().verbose(" has {1} time step elements", + this->time_step_device_count()); + log().verbose( + " {1:6.3} average newton raphson loops", + static_cast<fptype>(this->m_stat_newton_raphson) + / static_cast<fptype>(this->m_stat_vsolver_calls)); + log().verbose( + " {1:10} invocations ({2:6.0} Hz) {3:10} gs fails ({4:6.2} %) {5:6.3} average", + this->m_stat_calculations, + static_cast<fptype>(this->m_stat_calculations) + / this->exec().time().as_fp<fptype>(), + this->m_iterative_fail, + nlconst::hundred() * static_cast<fptype>(this->m_iterative_fail) + / static_cast<fptype>(this->m_stat_calculations), + static_cast<fptype>(this->m_iterative_total) + / static_cast<fptype>(this->m_stat_calculations)); } } -} // namespace devices -} // namespace netlist - +} // namespace netlist::solver diff --git a/src/lib/netlist/solver/nld_matrix_solver.h b/src/lib/netlist/solver/nld_matrix_solver.h index 29017add8a9..c0b792fd597 100644 --- a/src/lib/netlist/solver/nld_matrix_solver.h +++ b/src/lib/netlist/solver/nld_matrix_solver.h @@ -1,375 +1,464 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_matrix_solver.h - * - */ #ifndef NLD_MATRIX_SOLVER_H_ #define NLD_MATRIX_SOLVER_H_ -#include "netlist/nl_base.h" -#include "netlist/nl_errstr.h" +// Names +// spell-checker: words Raphson, Seidel + +/// +/// \file nld_matrix_solver.h +/// + +#include "nl_errstr.h" +#include "nltypes.h" + +#include "../core/analog.h" +#include "../core/device.h" +#include "../core/device_macros.h" +#include "../core/param.h" + #include "plib/palloc.h" +#include "plib/penum.h" #include "plib/pmatrix2d.h" +#include "plib/pmatrix_cr.h" +#include "plib/pmempool.h" #include "plib/putil.h" #include "plib/vector_ops.h" -#include <cmath> +#include <numeric> -namespace netlist -{ -namespace devices +// FIXME: remove again + +#define PFDEBUG(x) + +namespace netlist::solver { - /* FIXME: these should become proper devices */ - struct solver_parameters_t + enum static_compile_target { - bool m_pivot; - nl_double m_accuracy; - nl_double m_dynamic_lte; - nl_double m_min_timestep; - nl_double m_max_timestep; - nl_double m_gs_sor; - bool m_dynamic_ts; - std::size_t m_gs_loops; - std::size_t m_nr_loops; - netlist_time m_nr_recalc_delay; - bool m_use_gabs; - bool m_use_linear_prediction; + CXX_EXTERNAL_C, + CXX_STATIC }; - - class terms_for_net_t : plib::nocopyassignmove + // clang-format off + + PENUM(matrix_sort_type_e, + NOSORT, + ASCENDING, + DESCENDING, + PREFER_IDENTITY_TOP_LEFT, + PREFER_BAND_MATRIX + ) + + PENUM(matrix_type_e, + SOR_MAT, + MAT_CR, + MAT, + SM, + W, + SOR, + GMRES + ) + + PENUM(matrix_fp_type_e, + FLOAT + , DOUBLE + , LONGDOUBLE + , FLOATQ128 + ) + + // clang-format on + + using arena_type = plib::mempool_arena<plib::aligned_arena<>, 1024>; + using static_compile_container = std::vector<std::pair<pstring, pstring>>; + + struct solver_parameter_defaults { - public: - terms_for_net_t(); - - void clear(); - - void add(terminal_t *term, int net_other, bool sorted); - - std::size_t count() const { return m_terms.size(); } - - terminal_t **terms() { return m_terms.data(); } + static constexpr nl_fptype m_freq() { return nlconst::magic(48000.0); } - std::size_t m_railstart; + // iteration parameters + static constexpr nl_fptype m_gs_sor() { return nlconst::magic(1.059); } + static constexpr matrix_type_e m_method() + { + return matrix_type_e::MAT_CR; + } + static constexpr matrix_fp_type_e m_fp_type() + { + return matrix_fp_type_e::DOUBLE; + } + static constexpr nl_fptype m_reltol() { return nlconst::magic(1e-3); } + static constexpr nl_fptype m_vntol() { return nlconst::magic(1e-7); } + static constexpr nl_fptype m_accuracy() { return nlconst::magic(1e-7); } + static constexpr std::size_t m_nr_loops() { return 250; } + static constexpr std::size_t m_gs_loops() { return 50; } + + // general parameters + static constexpr nl_fptype m_gmin() { return nlconst::magic(1e-9); } + static constexpr bool m_pivot() { return false; } + static constexpr nl_fptype m_nr_recalc_delay() + { + return netlist_time::quantum().as_fp<nl_fptype>(); + } + static constexpr int m_parallel() { return 0; } - std::vector<unsigned> m_nz; /* all non zero for multiplication */ - std::vector<unsigned> m_nzrd; /* non zero right of the diagonal for elimination, may include RHS element */ - std::vector<unsigned> m_nzbd; /* non zero below of the diagonal for elimination */ + static constexpr nl_fptype m_min_ts_ts() + { + return nlconst::magic(1e-9); + } + // automatic time step + static constexpr bool m_dynamic_ts() { return false; } + static constexpr nl_fptype m_dynamic_lte() + { + return nlconst::magic(1e-5); + } + static constexpr nl_fptype m_dynamic_min_ts() + { + return nlconst::magic(1e-6); + } - /* state */ - nl_double m_last_V; - nl_double m_DD_n_m_1; - nl_double m_h_n_m_1; + // matrix sorting + static constexpr matrix_sort_type_e m_sort_type() + { + return matrix_sort_type_e::PREFER_IDENTITY_TOP_LEFT; + } - std::vector<int> m_connected_net_idx; - private: - std::vector<terminal_t *> m_terms; + // special + static constexpr bool m_use_gabs() { return true; } + static solver_parameter_defaults &get_instance() + { + static solver_parameter_defaults s; + return s; + } }; - class proxied_analog_output_t : public analog_output_t + struct solver_parameters_t { - public: + template <typename D> + solver_parameters_t(device_t &parent, const pstring &prefix, + D &defaults) + : m_freq(parent, prefix + "FREQ", defaults.m_freq()) + + // iteration parameters + , m_gs_sor(parent, prefix + "SOR_FACTOR", defaults.m_gs_sor()) + , m_method(parent, prefix + "METHOD", defaults.m_method()) + , m_fp_type(parent, prefix + "FPTYPE", defaults.m_fp_type()) + , m_reltol(parent, prefix + "RELTOL", + defaults.m_reltol()) //!< SPICE RELTOL parameter + , m_vntol(parent, prefix + "VNTOL", defaults.m_vntol()) //!< SPICE VNTOL + //!< parameter + , m_accuracy(parent, prefix + "ACCURACY", + defaults.m_accuracy()) //!< Iterative solver accuracy + , m_nr_loops(parent, prefix + "NR_LOOPS", + defaults.m_nr_loops()) //!< Maximum number of + //!< Newton-Raphson loops + , m_gs_loops(parent, prefix + "GS_LOOPS", + defaults.m_gs_loops()) //!< Maximum number of Gauss-Seidel + //!< loops + + // general parameters + , m_gmin(parent, prefix + "GMIN", defaults.m_gmin()) + , m_pivot(parent, prefix + "PIVOT", defaults.m_pivot()) //!< use + //!< pivoting on + //!< supported + //!< solvers + , m_nr_recalc_delay(parent, prefix + "NR_RECALC_DELAY", + defaults.m_nr_recalc_delay()) //!< Delay to next + //!< solve attempt if + //!< nr loops exceeded + , m_parallel(parent, prefix + "PARALLEL", defaults.m_parallel()) + , m_min_ts_ts(parent, prefix + "MIN_TS_TS", + defaults.m_min_ts_ts()) //!< The minimum time step for + //!< solvers with time stepping + //!< devices. + + // automatic time step + , m_dynamic_ts(parent, prefix + "DYNAMIC_TS", + defaults.m_dynamic_ts()) //!< Use dynamic time stepping + , m_dynamic_lte(parent, prefix + "DYNAMIC_LTE", + defaults.m_dynamic_lte()) //!< dynamic time stepping + //!< slope + , m_dynamic_min_ts(parent, prefix + "DYNAMIC_MIN_TIMESTEP", + defaults.m_dynamic_min_ts()) //!< smallest time step + //!< allowed + + // matrix sorting + , m_sort_type(parent, prefix + "SORT_TYPE", defaults.m_sort_type()) + + // special + , m_use_gabs(parent, prefix + "USE_GABS", defaults.m_use_gabs()) + , m_min_time_step(m_dynamic_min_ts()) + { + m_max_time_step = netlist_time::from_fp(plib::reciprocal(m_freq())) + .as_fp<decltype(m_max_time_step)>(); - proxied_analog_output_t(core_device_t &dev, const pstring &aname, analog_net_t *pnet) - : analog_output_t(dev, aname) - , m_proxied_net(pnet) - { } + if (m_dynamic_ts) + { + m_max_time_step *= 1; // NL_FCONST(1000.0); + } + else + { + m_min_time_step = m_max_time_step; + } + } - analog_net_t *proxied_net() const { return m_proxied_net;} - private: - analog_net_t *m_proxied_net; // only for proxy nets in analog input logic + param_fp_t m_freq; + param_fp_t m_gs_sor; + param_enum_t<matrix_type_e> m_method; + param_enum_t<matrix_fp_type_e> m_fp_type; + param_fp_t m_reltol; + param_fp_t m_vntol; + param_fp_t m_accuracy; + param_num_t<std::size_t> m_nr_loops; + param_num_t<std::size_t> m_gs_loops; + param_fp_t m_gmin; + param_logic_t m_pivot; + param_fp_t m_nr_recalc_delay; + param_int_t m_parallel; + param_fp_t m_min_ts_ts; + param_logic_t m_dynamic_ts; + param_fp_t m_dynamic_lte; + param_fp_t m_dynamic_min_ts; + param_enum_t<matrix_sort_type_e> m_sort_type; + + param_logic_t m_use_gabs; + + nl_fptype m_min_time_step; + nl_fptype m_max_time_step; }; - class matrix_solver_t : public device_t + class terms_for_net_t { public: - using list_t = std::vector<matrix_solver_t *>; + terms_for_net_t(arena_type &arena, analog_net_t *net = nullptr); - enum eSortType - { - NOSORT, - ASCENDING, - DESCENDING, - PREFER_IDENTITY_TOP_LEFT, - PREFER_BAND_MATRIX - }; - - void setup(analog_net_t::list_t &nets) - { - vsetup(nets); - } - - void solve_base(); + void clear(); - /* after every call to solve, update inputs must be called. - * this can be done as well as a batch to ease parallel processing. - */ - const netlist_time solve(netlist_time now); - void update_inputs(); + void add_terminal(terminal_t *term, int net_other, bool sorted); - bool has_dynamic_devices() const { return m_dynamic_devices.size() > 0; } - bool has_timestep_devices() const { return m_step_devices.size() > 0; } + std::size_t count() const noexcept { return m_terms.size(); } - void update_forced(); - void update_after(const netlist_time after) - { - m_Q_sync.net().toggle_and_push_to_queue(after); - } + std::size_t rail_start() const noexcept { return m_rail_start; } - /* netdevice functions */ - NETLIB_UPDATEI(); - NETLIB_RESETI(); + terminal_t **terms() noexcept { return m_terms.data(); } - public: - int get_net_idx(detail::net_t *net); - std::pair<int, int> get_left_right_of_diag(std::size_t row, std::size_t diag); - double get_weight_around_diag(std::size_t row, std::size_t diag); + nl_fptype getV() const noexcept { return m_net->Q_Analog(); } - virtual void log_stats(); + void setV(nl_fptype v) noexcept { m_net->set_Q_Analog(v); } - virtual std::pair<pstring, pstring> create_solver_code() + bool is_net(const analog_net_t *net) const noexcept { - return std::pair<pstring, pstring>("", plib::pfmt("/* solver doesn't support static compile */\n\n")); + return net == m_net; } - /* return number of floating point operations for solve */ - std::size_t ops() { return m_ops; } + void set_rail_start(std::size_t val) noexcept { m_rail_start = val; } - protected: + PALIGNAS_VECTOROPT() + + plib::arena_vector<arena_type, unsigned> m_nz; //!< all non zero for + //!< multiplication + plib::arena_vector<arena_type, unsigned> m_nzrd; //!< non zero right of + //!< the diagonal for + //!< elimination, may + //!< include RHS + //!< element + plib::arena_vector<arena_type, unsigned> m_nzbd; //!< non zero below of + //!< the diagonal for + //!< elimination - matrix_solver_t(netlist_state_t &anetlist, const pstring &name, - eSortType sort, const solver_parameters_t *params); + plib::arena_vector<arena_type, int> m_connected_net_idx; - void sort_terms(eSortType sort); + private: + plib::arena_vector<arena_type, terminal_t *> m_terms; + analog_net_t *m_net; + std::size_t m_rail_start; + }; - void setup_base(analog_net_t::list_t &nets); - void update_dynamic(); + class proxied_analog_output_t : public analog_output_t + { + public: + proxied_analog_output_t(core_device_t &dev, const pstring &aname, + analog_net_t *pnet) + : analog_output_t(dev, aname) + , m_proxied_net(pnet) + { + } - virtual void vsetup(analog_net_t::list_t &nets) = 0; - virtual unsigned vsolve_non_dynamic(const bool newton_raphson) = 0; + analog_net_t *proxied_net() const { return m_proxied_net; } - netlist_time compute_next_timestep(const double cur_ts); - /* virtual */ void add_term(std::size_t net_idx, terminal_t *term); + private: + analog_net_t *m_proxied_net; // only for proxy nets in analog input + // logic + }; - template <typename T> - void store(const T & V); + class matrix_solver_t : public device_t + { + public: + using list_t = std::vector<matrix_solver_t *>; + using fptype = nl_fptype; + using net_list_t = std::vector<analog_net_t *>; - template <typename T> - auto delta(const T & V) -> typename std::decay<decltype(V[0])>::type; + // after every call to solve, update inputs must be called. + // this can be done as well as a batch to ease parallel processing. - template <typename T> - void build_LE_A(T &child); - template <typename T> - void build_LE_RHS(T &child); + netlist_time solve(netlist_time_ext now, const char *source); + void update_inputs(); - void set_pointers() + std::size_t dynamic_device_count() const noexcept { - const std::size_t iN = this->m_nets.size(); + return m_dynamic_funcs.size(); + } + std::size_t time_step_device_count() const noexcept + { + return m_step_funcs.size(); + } - std::size_t max_count = 0; - std::size_t max_rail = 0; - for (std::size_t k = 0; k < iN; k++) - { - max_count = std::max(max_count, m_terms[k]->count()); - max_rail = std::max(max_rail, m_terms[k]->m_railstart); - } + /// \brief reschedule solver execution + /// + /// Calls reschedule on main solver + /// + void reschedule(netlist_time ts); + + /// \brief Immediately solve system at current time + /// + /// This should only be called from update and update_param events. + /// It's purpose is to bring voltage values to the current time step. + /// This will be called BEFORE updating object properties. + void solve_now() + { + // this should only occur outside of execution and thus + // using time should be safe. - m_mat_ptr.resize(iN, max_rail+1); - m_gtn.resize(iN, max_count); - m_gonn.resize(iN, max_count); - m_Idrn.resize(iN, max_count); - m_connected_net_Vn.resize(iN, max_count); + [[maybe_unused]] const netlist_time new_time_step = solve( + exec().time(), "solve_now"); - for (std::size_t k = 0; k < iN; k++) - { - auto count = m_terms[k]->count(); + update_inputs(); - for (std::size_t i = 0; i < count; i++) - { - m_terms[k]->terms()[i]->set_ptrs(&m_gtn[k][i], &m_gonn[k][i], &m_Idrn[k][i]); - m_connected_net_Vn[k][i] = m_terms[k]->terms()[i]->connected_terminal()->net().Q_Analog_state_ptr(); - } + if (time_step_device_count() > 0) + { + this->reschedule(netlist_time::from_fp( + m_params.m_dynamic_ts ? m_params.m_min_time_step + : m_params.m_max_time_step)); } } - template <typename AP, typename FT> - void fill_matrix(std::size_t N, AP &tcr, FT &RHS) + template <typename F> + void change_state(F f) { - for (std::size_t k = 0; k < N; k++) + // We only need to update the net first if this is a time stepping + // net + if (time_step_device_count() > 0) { - auto *net = m_terms[k].get(); - auto **tcr_r = &(tcr[k][0]); - - const std::size_t term_count = net->count(); - const std::size_t railstart = net->m_railstart; - const auto &go = m_gonn[k]; - const auto > = m_gtn[k]; - const auto &Idr = m_Idrn[k]; - const auto &cnV = m_connected_net_Vn[k]; - - for (std::size_t i = 0; i < railstart; i++) - *tcr_r[i] += go[i]; - - typename FT::value_type gtot_t = 0.0; - typename FT::value_type RHS_t = 0.0; - - for (std::size_t i = 0; i < term_count; i++) - { - gtot_t += gt[i]; - RHS_t += Idr[i]; - } - // FIXME: Code above is faster than vec_sum - Check this - #if 0 - auto gtot_t = plib::vec_sum<FT>(term_count, m_gt); - auto RHS_t = plib::vec_sum<FT>(term_count, m_Idr); - #endif - - for (std::size_t i = railstart; i < term_count; i++) - { - RHS_t += (/*m_Idr[i]*/ (- go[i]) * *cnV[i]); - } - - RHS[k] = RHS_t; - // update diagonal element ... - *tcr_r[railstart] += gtot_t; //mat.A[mat.diag[k]] += gtot_t; + [[maybe_unused]] const netlist_time new_time_step = solve( + exec().time(), "change_state"); + update_inputs(); } - + f(); + if (time_step_device_count() > 0) + { + PFDEBUG(printf("here2\n");) + this->reschedule(netlist_time::from_fp(m_params.m_min_ts_ts())); + } + else + this->reschedule(netlist_time::quantum()); } - template <typename T> - using aligned_alloc = plib::aligned_allocator<T, PALIGN_VECTOROPT>; + NETLIB_RESETI(); - plib::pmatrix2d<nl_double, aligned_alloc<nl_double>> m_gonn; - plib::pmatrix2d<nl_double, aligned_alloc<nl_double>> m_gtn; - plib::pmatrix2d<nl_double, aligned_alloc<nl_double>> m_Idrn; - plib::pmatrix2d<nl_double *, aligned_alloc<nl_double *>> m_mat_ptr; - plib::pmatrix2d<nl_double *, aligned_alloc<nl_double *>> m_connected_net_Vn; + virtual void log_stats(); - plib::pmatrix2d<nl_double> m_test; + virtual std::pair<pstring, pstring> create_solver_code( + [[maybe_unused]] solver::static_compile_target target) + { + return {"", + plib::pfmt("// solver doesn't support static compile\n\n")}; + } - std::vector<plib::unique_ptr<terms_for_net_t>> m_terms; - std::vector<analog_net_t *> m_nets; - std::vector<pool_owned_ptr<proxied_analog_output_t>> m_inps; + // return number of floating point operations for solve + constexpr std::size_t ops() const { return m_ops; } - std::vector<plib::unique_ptr<terms_for_net_t>> m_rails_temp; + protected: + matrix_solver_t(devices::nld_solver &main_solver, const pstring &name, + const net_list_t &nets, + const solver_parameters_t *params); + + virtual void upstream_solve_non_dynamic() = 0; + virtual netlist_time + compute_next_time_step(fptype cur_ts, fptype min_ts, fptype max_ts) + = 0; + virtual bool check_err() const = 0; + virtual void store() = 0; + virtual void backup() = 0; + virtual void restore() = 0; + + std::size_t max_rail_start() const noexcept + { + std::size_t max_rail = 0; + for (const auto &term : m_terms) + max_rail = std::max(max_rail, term.rail_start()); + return max_rail; + } const solver_parameters_t &m_params; + arena_type m_arena; - state_var<int> m_stat_calculations; - state_var<int> m_stat_newton_raphson; - state_var<int> m_stat_vsolver_calls; - state_var<int> m_iterative_fail; - state_var<int> m_iterative_total; - - private: + plib::pmatrix2d_vrl<arena_type, fptype> m_gonn; + plib::pmatrix2d_vrl<arena_type, fptype> m_gtn; + plib::pmatrix2d_vrl<arena_type, fptype> m_Idrn; + plib::pmatrix2d_vrl<arena_type, fptype *> m_connected_net_Vn; - state_var<netlist_time> m_last_step; - std::vector<core_device_t *> m_step_devices; - std::vector<core_device_t *> m_dynamic_devices; + state_var<std::size_t> m_iterative_fail; + state_var<std::size_t> m_iterative_total; - logic_input_t m_fb_sync; - logic_output_t m_Q_sync; + std::vector<terms_for_net_t> m_terms; // setup only - /* calculate matrix */ - void setup_matrix(); - - void step(const netlist_time &delta); - - std::size_t m_ops; - const eSortType m_sort; - }; - - template <typename T> - auto matrix_solver_t::delta(const T & V) -> typename std::decay<decltype(V[0])>::type - { - /* NOTE: Ideally we should also include currents (RHS) here. This would - * need a reevaluation of the right hand side after voltages have been updated - * and thus belong into a different calculation. This applies to all solvers. - */ - - const std::size_t iN = this->m_terms.size(); - typename std::decay<decltype(V[0])>::type cerr = 0; - for (std::size_t i = 0; i < iN; i++) - cerr = std::max(cerr, std::abs(V[i] - this->m_nets[i]->Q_Analog())); - return cerr; - } - - template <typename T> - void matrix_solver_t::store(const T & V) - { - const std::size_t iN = this->m_terms.size(); - for (std::size_t i = 0; i < iN; i++) - this->m_nets[i]->set_Q_Analog(V[i]); - } + private: + // base setup - called from constructor + void setup_base(setup_t &setup, const net_list_t &nets) noexcept(false); - template <typename T> - void matrix_solver_t::build_LE_A(T &child) - { - using float_type = typename T::float_type; - static_assert(std::is_base_of<matrix_solver_t, T>::value, "T must derive from matrix_solver_t"); + bool solve_nr_base(); + netlist_time newton_loops_exceeded(netlist_time delta); - const std::size_t iN = child.size(); - for (std::size_t k = 0; k < iN; k++) - { - terms_for_net_t *terms = m_terms[k].get(); - float_type * Ak = &child.A(k, 0ul); + void sort_terms(matrix_sort_type_e sort); - for (std::size_t i=0; i < iN; i++) - Ak[i] = 0.0; + void update_dynamic() noexcept; + void step(detail::time_step_type ts_type, netlist_time delta) noexcept; - const std::size_t terms_count = terms->count(); - const std::size_t railstart = terms->m_railstart; - const float_type * const gt = m_gtn[k]; + int get_net_idx(const analog_net_t *net) const noexcept; + std::pair<int, int> + get_left_right_of_diagonal(std::size_t irow, std::size_t idiag); + fptype get_weight_around_diagonal(std::size_t row, std::size_t diag); - { - float_type akk = 0.0; - for (std::size_t i = 0; i < terms_count; i++) - akk += gt[i]; - - Ak[k] = akk; - } + void add_term(std::size_t net_idx, terminal_t *term) noexcept(false); - const float_type * const go = m_gonn[k]; - int * net_other = terms->m_connected_net_idx.data(); + // calculate matrix + void setup_matrix(); - for (std::size_t i = 0; i < railstart; i++) - Ak[net_other[i]] += go[i]; - } - } + void set_pointers(); - template <typename T> - void matrix_solver_t::build_LE_RHS(T &child) - { - static_assert(std::is_base_of<matrix_solver_t, T>::value, "T must derive from matrix_solver_t"); - using float_type = typename T::float_type; + analog_net_t *get_connected_net(terminal_t *term); - const std::size_t iN = child.size(); - for (std::size_t k = 0; k < iN; k++) - { - float_type rhsk_a = 0.0; - float_type rhsk_b = 0.0; + devices::nld_solver &m_main_solver; - const std::size_t terms_count = m_terms[k]->count(); - const float_type * const go = m_gonn[k]; - const float_type * const Idr = m_Idrn[k]; - const float_type * const * other_cur_analog = m_connected_net_Vn[k]; + state_var<std::size_t> m_stat_calculations; + state_var<std::size_t> m_stat_newton_raphson; + state_var<std::size_t> m_stat_newton_raphson_fail; + state_var<std::size_t> m_stat_vsolver_calls; - for (std::size_t i = 0; i < terms_count; i++) - rhsk_a = rhsk_a + Idr[i]; + state_var<netlist_time_ext> m_last_step; + plib::arena_vector<arena_type, nl_delegate_ts> m_step_funcs; + plib::arena_vector<arena_type, nl_delegate_dyn> m_dynamic_funcs; + plib::arena_vector<arena_type, + device_arena::unique_ptr<proxied_analog_output_t>> + m_inputs; - for (std::size_t i = m_terms[k]->m_railstart; i < terms_count; i++) - //rhsk = rhsk + go[i] * terms[i]->m_otherterm->net().as_analog().Q_Analog(); - rhsk_b = rhsk_b - go[i] * *other_cur_analog[i]; + std::size_t m_ops; - child.RHS(k) = rhsk_a + rhsk_b; - } - } + std::vector<terms_for_net_t> m_rails_temp; // setup only + }; -} //namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_DIRECT_H_ */ +#endif // NLD_MS_DIRECT_H_ diff --git a/src/lib/netlist/solver/nld_matrix_solver_ext.h b/src/lib/netlist/solver/nld_matrix_solver_ext.h new file mode 100644 index 00000000000..3627c0b8e91 --- /dev/null +++ b/src/lib/netlist/solver/nld_matrix_solver_ext.h @@ -0,0 +1,288 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +#ifndef NLD_MATRIX_SOLVER_EXT_H_ +#define NLD_MATRIX_SOLVER_EXT_H_ + +/// +/// \file nld_matrix_solver.h +/// + +#include "nld_matrix_solver.h" + +#include <numeric> + +namespace netlist::solver +{ + + template <typename FT, int SIZE> + class matrix_solver_ext_t: public matrix_solver_t + { + public: + + using float_type = FT; + + matrix_solver_ext_t(devices::nld_solver &main_solver, const pstring &name, + const net_list_t &nets, + const solver::solver_parameters_t *params, const std::size_t size) + : matrix_solver_t(main_solver, name, nets, params) + , m_new_V(size) + , m_RHS(size) + , m_mat_ptr(m_arena, size, this->max_rail_start() + 1) + , m_last_V(size, nlconst::zero()) + , m_DD_n_m_1(size, nlconst::zero()) + , m_h_n_m_1(size, nlconst::magic(1e-6)) // we need a non zero value here + , m_dim(size) + { + // + // save states + // + state().save(*this, m_last_V.as_base(), this->name(), "m_last_V"); + state().save(*this, m_DD_n_m_1.as_base(), this->name(), "m_DD_n_m_1"); + state().save(*this, m_h_n_m_1.as_base(), this->name(), "m_h_n_m_1"); + } + + protected: + static constexpr const std::size_t SIZEABS = plib::parray<FT, SIZE>::SIZEABS(); + static constexpr const std::size_t m_pitch_ABS = (((SIZEABS + 0) + 7) / 8) * 8; + + //PALIGNAS_VECTOROPT() `parray` defines alignment already + plib::parray<float_type, SIZE> m_new_V; + //PALIGNAS_VECTOROPT() `parray` defines alignment already + plib::parray<float_type, SIZE> m_RHS; + + //PALIGNAS_VECTOROPT() `parray` defines alignment already + plib::pmatrix2d<arena_type, float_type *> m_mat_ptr; + + template <typename T, typename M> + void log_fill(const T &fill, [[maybe_unused]] M &mat) + { + const std::size_t iN = fill.size(); + + // FIXME: Not yet working, mat_cr.h needs some more work +#if 0 + auto mat_GE = plib::dynamic_downcast<plib::pGEmatrix_cr_t<typename M::base> *>(&mat); +#endif + std::vector<unsigned> levL(iN, 0); + std::vector<unsigned> levU(iN, 0); + + // parallel scheme for L x = y + for (std::size_t k = 0; k < iN; k++) + { + unsigned lm=0; + for (std::size_t j = 0; j<k; j++) + if (fill[k][j] < M::FILL_INFINITY) + lm = std::max(lm, levL[j]); + levL[k] = 1+lm; + } + + // parallel scheme for U x = y + for (std::size_t k = iN; k-- > 0; ) + { + unsigned lm=0; + for (std::size_t j = iN; --j > k; ) + if (fill[k][j] < M::FILL_INFINITY) + lm = std::max(lm, levU[j]); + levU[k] = 1+lm; + } + for (std::size_t k = 0; k < iN; k++) + { + unsigned fm = 0; + pstring ml = ""; + for (std::size_t j = 0; j < iN; j++) + { + ml += fill[k][j] == 0 ? 'X' : fill[k][j] < M::FILL_INFINITY ? '+' : '.'; + if (fill[k][j] < M::FILL_INFINITY) + if (fill[k][j] > fm) + fm = fill[k][j]; + } +#if 0 + this->log().verbose("{1:4} {2} {3:4} {4:4} {5:4} {6:4}", k, ml, + levL[k], levU[k], mat_GE ? mat_GE->get_parallel_level(k) : 0, fm); +#else + this->log().verbose("{1:4} {2} {3:4} {4:4} {5:4} {6:4}", k, ml, + levL[k], levU[k], 0, fm); +#endif + } + } + + constexpr std::size_t size() const noexcept + { + return (SIZE > 0) ? static_cast<std::size_t>(SIZE) : m_dim; + } + +#if 1 + void store() override + { + const std::size_t iN = size(); + for (std::size_t i = 0; i < iN; i++) + this->m_terms[i].setV(static_cast<fptype>(m_new_V[i])); + } +#else + // global tanh damping (4.197) + // partially cures the symptoms but not the cause + void store() override + { + const std::size_t iN = size(); + for (std::size_t i = 0; i < iN; i++) + { + auto oldV = this->m_terms[i].template getV<fptype>(); + this->m_terms[i].setV(oldV + 0.02 * plib::tanh((m_new_V[i]-oldV)*50.0)); + } + } +#endif + bool check_err() const override + { + // NOTE: Ideally we should also include currents (RHS) here. This would + // need a reevaluation of the right hand side after voltages have been updated + // and thus belong into a different calculation. This applies to all solvers. + + const std::size_t iN = size(); + const float_type reltol(static_cast<float_type>(m_params.m_reltol)); + const float_type vntol(static_cast<float_type>(m_params.m_vntol)); + for (std::size_t i = 0; i < iN; i++) + { + const float_type vold(static_cast<float_type>(this->m_terms[i].getV())); + const float_type vnew(m_new_V[i]); + const float_type tol(vntol + reltol * std::max(plib::abs(vnew),plib::abs(vold))); + if (plib::abs(vnew - vold) > tol) + return true; + } + return false; + } + + void backup() override + { + const std::size_t iN = size(); + for (std::size_t i = 0; i < iN; i++) + m_last_V[i] = gsl::narrow_cast<fptype>(this->m_terms[i].getV()); + } + + void restore() override + { + const std::size_t iN = size(); + for (std::size_t i = 0; i < iN; i++) + this->m_terms[i].setV(static_cast<nl_fptype>(m_last_V[i])); + } + + netlist_time compute_next_time_step(fptype cur_ts, fptype min_ts, fptype max_ts) override + { + fptype new_solver_time_step_sq(max_ts * max_ts); + + for (std::size_t k = 0; k < size(); k++) + { + const auto &t = m_terms[k]; + const auto v(static_cast<fptype>(t.getV())); + // avoid floating point exceptions + const fptype DD_n = std::max(-fp_constants<fptype>::TIMESTEP_MAXDIFF(), + std::min(+fp_constants<fptype>::TIMESTEP_MAXDIFF(),(v - m_last_V[k]))); + + //m_last_V[k] = v; + const fptype hn = cur_ts; + + fptype DD2 = (DD_n / hn - m_DD_n_m_1[k] / m_h_n_m_1[k]) / (hn + m_h_n_m_1[k]); + + m_h_n_m_1[k] = hn; + m_DD_n_m_1[k] = DD_n; + if (plib::abs(DD2) > fp_constants<fptype>::TIMESTEP_MINDIV()) // avoid div-by-zero + { + // save the sqrt for the end + const fptype new_net_time_step_sq = m_params.m_dynamic_lte / plib::abs(nlconst::half()*DD2); + new_solver_time_step_sq = std::min(new_net_time_step_sq, new_solver_time_step_sq); + } + } + + new_solver_time_step_sq = std::max(plib::sqrt(new_solver_time_step_sq), min_ts); + + // FIXME: Factor 2 below is important. Without, we get timing issues. This must be a bug elsewhere. + return std::max(netlist_time::from_fp(new_solver_time_step_sq), netlist_time::quantum() * 2); + } + + template <typename M> + void build_mat_ptr(M &mat) + { + const std::size_t iN = size(); + + for (std::size_t k=0; k<iN; k++) + { + std::size_t cnt(0); + // build pointers into the compressed row format matrix for each terminal + for (std::size_t j=0; j< this->m_terms[k].rail_start();j++) + { + int other = this->m_terms[k].m_connected_net_idx[j]; + if (other >= 0) + { + m_mat_ptr[k][j] = &(mat[k][static_cast<std::size_t>(other)]); + cnt++; + } + } + nl_assert_always(cnt == this->m_terms[k].rail_start(), "Count and rail start mismatch"); + m_mat_ptr[k][this->m_terms[k].rail_start()] = &(mat[k][k]); + } + } + + template <typename M> + void clear_square_mat(M &m) + { + const std::size_t n = size(); + for (std::size_t k=0; k < n; k++) + { + auto *p = &(m[k][0]); + using mat_elem_type = typename std::decay<decltype(*p)>::type; + for (std::size_t i=0; i < n; i++) + p[i] = plib::constants<mat_elem_type>::zero(); + } + } + + void fill_matrix_and_rhs() + { + const std::size_t N = size(); + + for (std::size_t k = 0; k < N; k++) + { + auto &net = m_terms[k]; + auto **tcr_r = &(m_mat_ptr[k][0]); + + using source_type = typename decltype(m_gtn)::value_type; + const std::size_t term_count = net.count(); + const std::size_t rail_start = net.rail_start(); + const auto &go = m_gonn[k]; + const auto > = m_gtn[k]; + const auto &Idr = m_Idrn[k]; + const auto &cnV = m_connected_net_Vn[k]; + + //# FIXME: gonn, gtn and Idr - which float types should they have? + + auto gtot_t = std::accumulate(gt, gt + term_count, plib::constants<source_type>::zero()); + + // update diagonal element ... + *tcr_r[rail_start] = static_cast<FT>(gtot_t); //# mat.A[mat.diag[k]] += gtot_t; + + for (std::size_t i = 0; i < rail_start; i++) + *tcr_r[i] += static_cast<FT>(go[i]); + + auto RHS_t = std::accumulate(Idr, Idr + term_count, plib::constants<source_type>::zero()); + + for (std::size_t i = rail_start; i < term_count; i++) + RHS_t += (- go[i]) * *cnV[i]; + + m_RHS[k] = static_cast<FT>(RHS_t); + } + } + + private: + // state - variable time_stepping + //PALIGNAS_VECTOROPT() `parray` defines alignment already + plib::parray<fptype, SIZE> m_last_V; + //PALIGNAS_VECTOROPT() `parray` defines alignment already + plib::parray<fptype, SIZE> m_DD_n_m_1; + // PALIGNAS_VECTOROPT() parrays define alignment already + plib::parray<fptype, SIZE> m_h_n_m_1; + + const std::size_t m_dim; + + }; + +} // namespace netlist::solver + +#endif // NLD_MATRIX_SOLVER_EXT_H_ diff --git a/src/lib/netlist/solver/nld_ms_direct.h b/src/lib/netlist/solver/nld_ms_direct.h index 2501742218d..a3e9b6345b5 100644 --- a/src/lib/netlist/solver/nld_ms_direct.h +++ b/src/lib/netlist/solver/nld_ms_direct.h @@ -1,63 +1,56 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_direct.h - * - */ #ifndef NLD_MS_DIRECT_H_ #define NLD_MS_DIRECT_H_ +/// +/// \file nld_ms_direct.h +/// + #include "nld_matrix_solver.h" #include "nld_solver.h" -#include "plib/mat_cr.h" +#include "plib/parray.h" #include "plib/vector_ops.h" +#include "nld_matrix_solver_ext.h" + #include <algorithm> -#include <cmath> -namespace netlist -{ -namespace devices +namespace netlist::solver { template <typename FT, int SIZE> - class matrix_solver_direct_t: public matrix_solver_t + class matrix_solver_direct_t: public matrix_solver_ext_t<FT, SIZE> { - friend class matrix_solver_t; public: using float_type = FT; - matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, const std::size_t size); - matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, const eSortType sort, const solver_parameters_t *params, const std::size_t size); + matrix_solver_direct_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver::solver_parameters_t *params, std::size_t size); - void vsetup(analog_net_t::list_t &nets) override; void reset() override { matrix_solver_t::reset(); } + private: + + const std::size_t m_pitch; + protected: - unsigned vsolve_non_dynamic(const bool newton_raphson) override; - unsigned solve_non_dynamic(const bool newton_raphson); + static constexpr const std::size_t SIZEABS = plib::parray<FT, SIZE>::SIZEABS(); + static constexpr const std::size_t m_pitch_ABS = (((SIZEABS + 0) + 7) / 8) * 8; - constexpr std::size_t size() const { return (SIZE > 0) ? static_cast<std::size_t>(SIZE) : m_dim; } + void upstream_solve_non_dynamic() override; + void solve_non_dynamic(); void LE_solve(); template <typename T> void LE_back_subst(T & x); - FT &A(std::size_t r, std::size_t c) { return m_A[r * m_pitch + c]; } - FT &RHS(std::size_t r) { return m_A[r * m_pitch + size()]; } - plib::parray<FT, SIZE> m_new_V; - - private: - static constexpr const std::size_t SIZEABS = plib::parray<FT, SIZE>::SIZEABS(); - static constexpr const std::size_t m_pitch_ABS = (((SIZEABS + 1) + 7) / 8) * 8; - - const std::size_t m_dim; - const std::size_t m_pitch; - plib::parray<FT, SIZE * int(m_pitch_ABS)> m_A; - + // PALIGNAS_VECTOROPT() `parray` defines alignment already + plib::parray2D<FT, SIZE, m_pitch_ABS> m_A; }; // ---------------------------------------------------------------------------------------- @@ -65,43 +58,26 @@ namespace devices // ---------------------------------------------------------------------------------------- template <typename FT, int SIZE> - void matrix_solver_direct_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets) - { - matrix_solver_t::setup_base(nets); - - /* add RHS element */ - for (std::size_t k = 0; k < size(); k++) - { - terms_for_net_t * t = m_terms[k].get(); - - if (!plib::container::contains(t->m_nzrd, static_cast<unsigned>(size()))) - t->m_nzrd.push_back(static_cast<unsigned>(size())); - } - - // FIXME: This shouldn't be necessary ... - for (std::size_t k = 0; k < size(); k++) - state().save(*this, RHS(k), this->name(), plib::pfmt("RHS.{1}")(k)); - } - - template <typename FT, int SIZE> void matrix_solver_direct_t<FT, SIZE>::LE_solve() { - const std::size_t kN = size(); - if (!m_params.m_pivot) + const std::size_t kN = this->size(); + if (!this->m_params.m_pivot) { for (std::size_t i = 0; i < kN; i++) { - /* FIXME: Singular matrix? */ - const FT f = 1.0 / A(i,i); - const auto &nzrd = m_terms[i]->m_nzrd; - const auto &nzbd = m_terms[i]->m_nzbd; + // FIXME: Singular matrix? + const auto &Ai = m_A[i]; + const FT f = plib::reciprocal(Ai[i]); + const auto &nzrd = this->m_terms[i].m_nzrd; + const auto &nzbd = this->m_terms[i].m_nzbd; - for (std::size_t j : nzbd) + for (auto &j : nzbd) { - const FT f1 = -f * A(j, i); - for (std::size_t k : nzrd) - A(j, k) += A(i, k) * f1; - //RHS(j) += RHS(i) * f1; + auto &Aj = m_A[j]; + const FT f1 = -f * Aj[i]; + for (auto &k : nzrd) + Aj[k] += Ai[k] * f1; + this->m_RHS[j] += this->m_RHS[i] * f1; } } } @@ -109,45 +85,47 @@ namespace devices { for (std::size_t i = 0; i < kN; i++) { - /* Find the row with the largest first value */ - std::size_t maxrow = i; + // Find the row with the largest first value + std::size_t max_row = i; for (std::size_t j = i + 1; j < kN; j++) { - //if (std::abs(m_A[j][i]) > std::abs(m_A[maxrow][i])) - if (A(j,i) * A(j,i) > A(maxrow,i) * A(maxrow,i)) - maxrow = j; + if (plib::abs(m_A[j][i]) > plib::abs(m_A[max_row][i])) + //#if (m_A[j][i] * m_A[j][i] > m_A[max_row][i] * m_A[max_row][i]) + max_row = j; } - if (maxrow != i) + if (max_row != i) { - /* Swap the maxrow and ith row */ - for (std::size_t k = 0; k < kN + 1; k++) { - std::swap(A(i,k), A(maxrow,k)); +#if 0 + // Swap the max_row and ith row + for (std::size_t k = 0; k < kN; k++) { + std::swap(m_A[i][k], m_A[max_row][k]); } - //std::swap(RHS(i), RHS(maxrow)); +#else + std::swap(m_A[i], m_A[max_row]); +#endif + std::swap(this->m_RHS[i], this->m_RHS[max_row]); } - /* FIXME: Singular matrix? */ - const FT f = 1.0 / A(i,i); + // FIXME: Singular matrix? + const auto &Ai = m_A[i]; + const FT f = plib::reciprocal(Ai[i]); - /* Eliminate column i from row j */ + // Eliminate column i from row j for (std::size_t j = i + 1; j < kN; j++) { - const FT f1 = - A(j,i) * f; + auto &Aj = m_A[j]; + const FT f1 = - m_A[j][i] * f; if (f1 != plib::constants<FT>::zero()) { - const FT * pi = &A(i,i+1); - FT * pj = &A(j,i+1); - #if 1 - plib::vec_add_mult_scalar_p(kN-i,pj, pi,f1); - #else - vec_add_mult_scalar_p1(kN-i-1,pj,pi,f1); + const FT * pi = &(Ai[i+1]); + FT * pj = &(Aj[i+1]); + plib::vec_add_mult_scalar_p(kN-i-1,pj,pi,f1); //for (unsigned k = i+1; k < kN; k++) // pj[k] = pj[k] + pi[k] * f1; //for (unsigned k = i+1; k < kN; k++) //A(j,k) += A(i,k) * f1; - RHS(j) += RHS(i) * f1; - #endif + this->m_RHS[j] += this->m_RHS[i] * f1; } } } @@ -159,77 +137,66 @@ namespace devices void matrix_solver_direct_t<FT, SIZE>::LE_back_subst( T & x) { - const std::size_t kN = size(); + const std::size_t kN = this->size(); - /* back substitution */ - if (m_params.m_pivot) + // back substitution + if (this->m_params.m_pivot) { for (std::size_t j = kN; j-- > 0; ) { - FT tmp = 0; + FT tmp(0); + const auto & Aj(m_A[j]); + for (std::size_t k = j+1; k < kN; k++) - tmp += A(j,k) * x[k]; - x[j] = (RHS(j) - tmp) / A(j,j); + tmp += Aj[k] * x[k]; + x[j] = (this->m_RHS[j] - tmp) / Aj[j]; } } else { for (std::size_t j = kN; j-- > 0; ) { - FT tmp = 0; - const auto &nzrd = m_terms[j]->m_nzrd; - const auto e = nzrd.size() - 1; /* exclude RHS element */ + FT tmp(0); + const auto &nzrd = this->m_terms[j].m_nzrd; + const auto & Aj(m_A[j]); + const auto e = nzrd.size(); + for ( std::size_t k = 0; k < e; k++) - tmp += A(j, nzrd[k]) * x[nzrd[k]]; - x[j] = (RHS(j) - tmp) / A(j,j); + tmp += Aj[nzrd[k]] * x[nzrd[k]]; + x[j] = (this->m_RHS[j] - tmp) / Aj[j]; } } } template <typename FT, int SIZE> - unsigned matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson) + void matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic() { this->LE_solve(); - this->LE_back_subst(m_new_V); - - const FT err = (newton_raphson ? delta(m_new_V) : 0.0); - store(m_new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; + this->LE_back_subst(this->m_new_V); } template <typename FT, int SIZE> - unsigned matrix_solver_direct_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + void matrix_solver_direct_t<FT, SIZE>::upstream_solve_non_dynamic() { - this->build_LE_A(*this); - this->build_LE_RHS(*this); + // populate matrix + this->clear_square_mat(m_A); + this->fill_matrix_and_rhs(); - this->m_stat_calculations++; - return this->solve_non_dynamic(newton_raphson); - } - - template <typename FT, int SIZE> - matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, - const solver_parameters_t *params, const std::size_t size) - : matrix_solver_t(anetlist, name, ASCENDING, params) - , m_new_V(size) - , m_dim(size) - , m_pitch(m_pitch_ABS ? m_pitch_ABS : (((m_dim + 1) + 7) / 8) * 8) - , m_A(size * m_pitch) - { + this->solve_non_dynamic(); } template <typename FT, int SIZE> - matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(netlist_state_t &anetlist, const pstring &name, - const eSortType sort, const solver_parameters_t *params, const std::size_t size) - : matrix_solver_t(anetlist, name, sort, params) - , m_new_V(size) - , m_dim(size) - , m_pitch(m_pitch_ABS ? m_pitch_ABS : (((m_dim + 1) + 7) / 8) * 8) - , m_A(size * m_pitch) + matrix_solver_direct_t<FT, SIZE>::matrix_solver_direct_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver::solver_parameters_t *params, + std::size_t size) + : matrix_solver_ext_t<FT, SIZE>(main_solver, name, nets, params, size) + , m_pitch(m_pitch_ABS ? m_pitch_ABS : (((size + 0) + 7) / 8) * 8) + , m_A(size, m_pitch) { + this->build_mat_ptr(m_A); } -} // namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_DIRECT_H_ */ +#endif // NLD_MS_DIRECT_H_ diff --git a/src/lib/netlist/solver/nld_ms_direct1.h b/src/lib/netlist/solver/nld_ms_direct1.h index fbbb8ecb098..899dcdf7b91 100644 --- a/src/lib/netlist/solver/nld_ms_direct1.h +++ b/src/lib/netlist/solver/nld_ms_direct1.h @@ -1,19 +1,18 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_direct1.h - * - */ #ifndef NLD_MS_DIRECT1_H_ #define NLD_MS_DIRECT1_H_ +/// +/// \file nld_ms_direct1.h +/// + +#include "nld_matrix_solver_ext.h" #include "nld_ms_direct.h" #include "nld_solver.h" -namespace netlist -{ -namespace devices +namespace netlist::solver { template <typename FT> class matrix_solver_direct1_t: public matrix_solver_direct_t<FT, 1> @@ -23,32 +22,26 @@ namespace devices using float_type = FT; using base_type = matrix_solver_direct_t<FT, 1>; - matrix_solver_direct1_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params) - : matrix_solver_direct_t<FT, 1>(anetlist, name, params, 1) + matrix_solver_direct1_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver::solver_parameters_t *params) + : matrix_solver_direct_t<FT, 1>(main_solver, name, nets, params, 1) {} // ---------------------------------------------------------------------------------------- // matrix_solver - Direct1 // ---------------------------------------------------------------------------------------- - unsigned vsolve_non_dynamic(const bool newton_raphson) override + void upstream_solve_non_dynamic() override { - this->build_LE_A(*this); - this->build_LE_RHS(*this); - //NL_VERBOSE_OUT(("{1} {2}\n", new_val, m_RHS[0] / m_A[0][0]); - - std::array<FT, 1> new_V = { this->RHS(0) / this->A(0,0) }; + this->clear_square_mat(this->m_A); + this->fill_matrix_and_rhs(); - const FT err = (newton_raphson ? this->delta(new_V) : 0.0); - this->store(new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; + this->m_new_V[0] = this->m_RHS[0] / this->m_A[0][0]; } - }; - -} //namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_DIRECT1_H_ */ +#endif // NLD_MS_DIRECT1_H_ diff --git a/src/lib/netlist/solver/nld_ms_direct2.h b/src/lib/netlist/solver/nld_ms_direct2.h index 01f77c3bc3c..0f4702ce84b 100644 --- a/src/lib/netlist/solver/nld_ms_direct2.h +++ b/src/lib/netlist/solver/nld_ms_direct2.h @@ -1,19 +1,18 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_direct1.h - * - */ #ifndef NLD_MS_DIRECT2_H_ #define NLD_MS_DIRECT2_H_ +/// +/// \file nld_ms_direct2.h +/// + +#include "nld_matrix_solver_ext.h" #include "nld_ms_direct.h" #include "nld_solver.h" -namespace netlist -{ -namespace devices +namespace netlist::solver { // ---------------------------------------------------------------------------------------- @@ -27,32 +26,29 @@ namespace devices using float_type = FT; - matrix_solver_direct2_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params) - : matrix_solver_direct_t<double, 2>(anetlist, name, params, 2) - {} - unsigned vsolve_non_dynamic(const bool newton_raphson) override + matrix_solver_direct2_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver::solver_parameters_t *params) + : matrix_solver_direct_t<FT, 2>(main_solver, name, nets, params, 2) + {} + void upstream_solve_non_dynamic() override { - this->build_LE_A(*this); - this->build_LE_RHS(*this); - - const float_type a = this->A(0,0); - const float_type b = this->A(0,1); - const float_type c = this->A(1,0); - const float_type d = this->A(1,1); - - const float_type v1 = (a * this->RHS(1) - c * this->RHS(0)) / (a * d - b * c); - const float_type v0 = (this->RHS(0) - b * v1) / a; - std::array<float_type, 2> new_V = {v0, v1}; - - this->m_stat_calculations++; - const float_type err = (newton_raphson ? this->delta(new_V) : 0.0); - this->store(new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; + this->clear_square_mat(this->m_A); + this->fill_matrix_and_rhs(); + + const float_type a = this->m_A[0][0]; + const float_type b = this->m_A[0][1]; + const float_type c = this->m_A[1][0]; + const float_type d = this->m_A[1][1]; + + const float_type v1 = (a * this->m_RHS[1] - c * this->m_RHS[0]) / (a * d - b * c); + const float_type v0 = (this->m_RHS[0] - b * v1) / a; + this->m_new_V[0] = v0; + this->m_new_V[1] = v1; } }; -} //namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_DIRECT2_H_ */ +#endif // NLD_MS_DIRECT2_H_ diff --git a/src/lib/netlist/solver/nld_ms_direct_lu.h b/src/lib/netlist/solver/nld_ms_direct_lu.h index e7cedc1dd29..c51ccac4da5 100644 --- a/src/lib/netlist/solver/nld_ms_direct_lu.h +++ b/src/lib/netlist/solver/nld_ms_direct_lu.h @@ -1,13 +1,18 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_direct.h - * - */ + +/// +/// \file nld_ms_direct.h +/// +/// #if 0 #ifndef NLD_MS_DIRECT_H_ #define NLD_MS_DIRECT_H_ +// Names +// spell-checker: words Seidel,Crout + + #include "solver/nld_solver.h" #include "solver/nld_matrix_solver.h" @@ -38,12 +43,12 @@ public: unsigned N() const { if (m_N == 0) return m_dim; else return m_N; } - int vsolve_non_dynamic(const bool newton_raphson); + int upstream_solve_non_dynamic(bool newton_raphson); protected: virtual void add_term(int net_idx, terminal_t *term) override; - int solve_non_dynamic(const bool newton_raphson); + int solve_non_dynamic(bool newton_raphson); void build_LE_A(); void build_LE_RHS(nl_double * RESTRICT rhs); @@ -132,11 +137,11 @@ protected: nl_double delta(const nl_double * RESTRICT V); void store(const nl_double * RESTRICT V); - /* bring the whole system to the current time - * Don't schedule a new calculation time. The recalculation has to be - * triggered by the caller after the netlist element was changed. - */ - nl_double compute_next_timestep(); + // bring the whole system to the current time + // Don't schedule a new calculation time. The recalculation has to be + // triggered by the caller after the netlist element was changed. + + nl_double compute_next_time_step(); template <typename T1, typename T2> nl_ext_double &A(const T1 r, const T2 c) { return m_A[r][c]; } @@ -164,65 +169,64 @@ matrix_solver_direct_t<m_N, storage_N>::~matrix_solver_direct_t() } template <unsigned m_N, unsigned storage_N> -nl_double matrix_solver_direct_t<m_N, storage_N>::compute_next_timestep() +nl_double matrix_solver_direct_t<m_N, storage_N>::compute_next_time_step() { - nl_double new_solver_timestep = m_params.m_max_timestep; + nl_double new_solver_time_step = m_params.m_max_time_step; if (m_params.m_dynamic_ts) { - /* - * FIXME: We should extend the logic to use either all nets or - * only output nets. - */ + // + // FIXME: We should extend the logic to use either all nets or + // only output nets. for (unsigned k = 0, iN=N(); k < iN; k++) { analog_net_t *n = m_nets[k]; const nl_double DD_n = (n->Q_Analog() - m_last_V[k]); - const nl_double hn = current_timestep(); + const nl_double hn = current_time_step(); nl_double DD2 = (DD_n / hn - n->m_DD_n_m_1 / n->m_h_n_m_1) / (hn + n->m_h_n_m_1); - nl_double new_net_timestep; + nl_double new_net_time_step; n->m_h_n_m_1 = hn; n->m_DD_n_m_1 = DD_n; - if (std::abs(DD2) > NL_FCONST(1e-30)) // avoid div-by-zero - new_net_timestep = std::sqrt(m_params.m_dynamic_lte / std::abs(NL_FCONST(0.5)*DD2)); + if (plib::abs(DD2) > NL_FCONST(1e-30)) // avoid div-by-zero + new_net_time_step = std::sqrt(m_params.m_dynamic_lte / plib::abs(NL_FCONST(0.5)*DD2)); else - new_net_timestep = m_params.m_max_timestep; + new_net_time_step = m_params.m_max_time_step; - if (new_net_timestep < new_solver_timestep) - new_solver_timestep = new_net_timestep; + if (new_net_time_step < new_solver_time_step) + new_solver_time_step = new_net_time_step; } - if (new_solver_timestep < m_params.m_min_timestep) - new_solver_timestep = m_params.m_min_timestep; - if (new_solver_timestep > m_params.m_max_timestep) - new_solver_timestep = m_params.m_max_timestep; + if (new_solver_time_step < m_params.m_min_time_step) + new_solver_time_step = m_params.m_min_time_step; + if (new_solver_time_step > m_params.m_max_time_step) + new_solver_time_step = m_params.m_max_time_step; } - //if (new_solver_timestep > 10.0 * hn) - // new_solver_timestep = 10.0 * hn; - return new_solver_timestep; + //#if (new_solver_time_step > 10.0 * hn) + //# new_solver_time_step = 10.0 * hn; + return new_solver_time_step; } template <unsigned m_N, unsigned storage_N> void matrix_solver_direct_t<m_N, storage_N>::add_term(int k, terminal_t *term) { - if (term->m_otherterm->net().isRailNet()) + if (term->m_other_terminal->net().isRailNet()) { m_rails_temp[k].add(term, -1, false); } else { - int ot = get_net_idx(&term->m_otherterm->net()); + int ot = get_net_idx(&term->m_other_terminal->net()); if (ot>=0) { m_terms[k]->add(term, ot, true); } - /* Should this be allowed ? */ + // Should this be allowed ? else // if (ot<0) { m_rails_temp[k].add(term, ot, true); - netlist().error("found term with missing othernet {1}\n", term->name()); + netlist().error("found term with missing other net {1}\n", term->name()); } } } @@ -244,7 +248,7 @@ void matrix_solver_direct_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) for (unsigned k = 0; k < N(); k++) { - m_terms[k]->m_railstart = m_terms[k]->count(); + m_terms[k]->m_rail_start = m_terms[k]->count(); for (unsigned i = 0; i < m_rails_temp[k].count(); i++) this->m_terms[k]->add(m_rails_temp[k].terms()[i], m_rails_temp[k].connected_net_idx()[i], false); @@ -254,32 +258,32 @@ void matrix_solver_direct_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) #if 1 - /* Sort in descending order by number of connected matrix voltages. - * The idea is, that for Gauss-Seidel algo the first voltage computed - * depends on the greatest number of previous voltages thus taking into - * account the maximum amout of information. - * - * This actually improves performance on popeye slightly. Average - * GS computations reduce from 2.509 to 2.370 - * - * Smallest to largest : 2.613 - * Unsorted : 2.509 - * Largest to smallest : 2.370 - * - * Sorting as a general matrix pre-conditioning is mentioned in - * literature but I have found no articles about Gauss Seidel. - * - * For Gaussian Elimination however increasing order is better suited. - * FIXME: Even better would be to sort on elements right of the matrix diagonal. - * - */ + // Sort in descending order by number of connected matrix voltages. + // The idea is, that for Gauss-Seidel algo the first voltage computed + // depends on the greatest number of previous voltages thus taking into + // account the maximum amount of information. + // + // This actually improves performance on popeye slightly. Average + // GS computations reduce from 2.509 to 2.370 + // + // Smallest to largest : 2.613 + // Unsorted : 2.509 + // Largest to smallest : 2.370 + // + // Sorting as a general matrix pre-conditioning is mentioned in + // literature but I have found no articles about Gauss Seidel. + // + // For Gaussian Elimination however increasing order is better suited. + // FIXME: Even better would be to sort on elements right of the matrix diagonal. + // + // int sort_order = (type() == GAUSS_SEIDEL ? 1 : -1); for (unsigned k = 0; k < N() / 2; k++) for (unsigned i = 0; i < N() - 1; i++) { - if ((m_terms[i]->m_railstart - m_terms[i+1]->m_railstart) * sort_order < 0) + if ((m_terms[i]->m_rail_start - m_terms[i+1]->m_rail_start) * sort_order < 0) { std::swap(m_terms[i],m_terms[i+1]); std::swap(m_nets[i], m_nets[i+1]); @@ -291,19 +295,18 @@ void matrix_solver_direct_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) int *other = m_terms[k]->connected_net_idx(); for (unsigned i = 0; i < m_terms[k]->count(); i++) if (other[i] != -1) - other[i] = get_net_idx(&m_terms[k]->terms()[i]->m_otherterm->net()); + other[i] = get_net_idx(&m_terms[k]->terms()[i]->m_other_terminal->net()); } #endif - /* create a list of non zero elements right of the diagonal - * These list anticipate the population of array elements by - * Gaussian elimination. - */ + // create a list of non zero elements right of the diagonal + // These list anticipate the population of array elements by + // Gaussian elimination. + for (unsigned k = 0; k < N(); k++) { terms_for_net_t * t = m_terms[k]; - /* pretty brutal */ int *other = t->connected_net_idx(); t->m_nz.clear(); @@ -325,7 +328,7 @@ void matrix_solver_direct_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) for (unsigned j = 0; j < N(); j++) { - for (unsigned i = 0; i < t->m_railstart; i++) + for (unsigned i = 0; i < t->m_rail_start; i++) { if (!t->m_nzrd.contains(other[i]) && other[i] >= (int) (k + 1)) t->m_nzrd.add(other[i]); @@ -349,9 +352,10 @@ void matrix_solver_direct_t<m_N, storage_N>::vsetup(analog_net_t::list_t &nets) log("\n"); } - /* - * save states - */ + // + // save states + // + save(NLNAME(m_RHS)); save(NLNAME(m_last_V)); @@ -378,7 +382,7 @@ void matrix_solver_direct_t<m_N, storage_N>::build_LE_A() nl_double akk = 0.0; const unsigned terms_count = m_terms[k]->count(); - const unsigned railstart = m_terms[k]->m_railstart; + const unsigned rail_start = m_terms[k]->m_rail_start; const nl_double * RESTRICT gt = m_terms[k]->gt(); const nl_double * RESTRICT go = m_terms[k]->go(); const int * RESTRICT net_other = m_terms[k]->connected_net_idx(); @@ -388,7 +392,7 @@ void matrix_solver_direct_t<m_N, storage_N>::build_LE_A() A(k,k) += akk; - for (unsigned i = 0; i < railstart; i++) + for (unsigned i = 0; i < rail_start; i++) A(k, net_other[i]) -= go[i]; } } @@ -410,8 +414,8 @@ void matrix_solver_direct_t<m_N, storage_N>::build_LE_RHS(nl_double * RESTRICT r for (int i = 0; i < terms_count; i++) rhsk_a = rhsk_a + Idr[i]; - for (int i = m_terms[k]->m_railstart; i < terms_count; i++) - //rhsk = rhsk + go[i] * terms[i]->m_otherterm->net().as_analog().Q_Analog(); + for (int i = m_terms[k]->m_rail_start; i < terms_count; i++) + //#rhsk = rhsk + go[i] * terms[i]->m_other_terminal->net().as_analog().Q_Analog(); rhsk_b = rhsk_b + go[i] * *other_cur_analog[i]; rhs[k] = rhsk_a + rhsk_b; @@ -426,8 +430,8 @@ void matrix_solver_direct_t<m_N, storage_N>::LE_solve() { const unsigned kN = N(); - ATTR_UNUSED int imax; - ATTR_UNUSED double big,temp; + [[maybe_unused]] int imax; + [[maybe_unused]] double big,temp; #if 0 double vv[storage_N]; @@ -438,7 +442,7 @@ void matrix_solver_direct_t<m_N, storage_N>::LE_solve() for (j=0;j<kN;j++) if ((temp=fabs(m_A[i][j])) > big) big=temp; - //if (big == 0.0) nrerror("Singular matrix in routine LUDCMP"); + //#if (big == 0.0) nrerror("Singular matrix in routine LUDCMP"); vv[i]=1.0/big; } #endif @@ -489,7 +493,6 @@ void matrix_solver_direct_t<m_N, storage_N>::LE_solve() m_A[imax][k]=m_A[j][k]; m_A[j][k]=dum; } - //*d = -(*d); vv[imax]=vv[j]; } indx[j]=imax; @@ -509,7 +512,7 @@ void matrix_solver_direct_t<m_N, storage_N>::LE_back_subst( { const unsigned kN = N(); - /* back substitution */ + // back substitution // int ip; // ii=-1 @@ -541,15 +544,14 @@ template <unsigned m_N, unsigned storage_N> nl_double matrix_solver_direct_t<m_N, storage_N>::delta( const nl_double * RESTRICT V) { - /* FIXME: Ideally we should also include currents (RHS) here. This would - * need a revaluation of the right hand side after voltages have been updated - * and thus belong into a different calculation. This applies to all solvers. - */ + // FIXME: Ideally we should also include currents (RHS) here. This would + // need a revaluation of the right hand side after voltages have been updated + // and thus belong into a different calculation. This applies to all solvers. const unsigned iN = this->N(); nl_double cerr = 0; for (unsigned i = 0; i < iN; i++) - cerr = std::fmax(cerr, std::abs(V[i] - this->m_nets[i]->m_cur_Analog)); + cerr = std::fmax(cerr, plib::abs(V[i] - this->m_nets[i]->m_cur_Analog)); return cerr; } @@ -565,7 +567,7 @@ void matrix_solver_direct_t<m_N, storage_N>::store( template <unsigned m_N, unsigned storage_N> -unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool newton_raphson) +unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(bool newton_raphson) { nl_double new_V[storage_N]; // = { 0.0 }; @@ -587,7 +589,7 @@ unsigned matrix_solver_direct_t<m_N, storage_N>::solve_non_dynamic(const bool ne } template <unsigned m_N, unsigned storage_N> -int matrix_solver_direct_t<m_N, storage_N>::vsolve_non_dynamic(const bool newton_raphson) +int matrix_solver_direct_t<m_N, storage_N>::upstream_solve_non_dynamic(bool newton_raphson) { this->build_LE_A(); this->build_LE_RHS(m_RHS); @@ -621,5 +623,5 @@ matrix_solver_direct_t<m_N, storage_N>::matrix_solver_direct_t(const eSolverType } //namespace devices } // namespace netlist -#endif /* NLD_MS_DIRECT_H_ */ +#endif // NLD_MS_DIRECT_H_ #endif diff --git a/src/lib/netlist/solver/nld_ms_gcr.h b/src/lib/netlist/solver/nld_ms_gcr.h index e227802c1a2..a2c5d284c43 100644 --- a/src/lib/netlist/solver/nld_ms_gcr.h +++ b/src/lib/netlist/solver/nld_ms_gcr.h @@ -1,75 +1,134 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_gcr.h - * - * Gaussian elimination using compressed row format. - * - */ #ifndef NLD_MS_GCR_H_ #define NLD_MS_GCR_H_ -#include "plib/mat_cr.h" +/// +/// \file nld_ms_gcr.h +/// +/// Gaussian elimination using compressed row format. +/// -#include "nld_ms_direct.h" +#include "nld_matrix_solver_ext.h" #include "nld_solver.h" #include "plib/pdynlib.h" +#include "plib/pmatrix_cr.h" #include "plib/pstream.h" #include "plib/vector_ops.h" #include <algorithm> -namespace netlist -{ -namespace devices +namespace netlist::solver { template <typename FT, int SIZE> - class matrix_solver_GCR_t: public matrix_solver_t + class matrix_solver_GCR_t: public matrix_solver_ext_t<FT, SIZE> { public: - using mat_type = plib::matrix_compressed_rows_t<FT, SIZE>; - // FIXME: dirty hack to make this compile - static constexpr const std::size_t storage_N = 100; - - matrix_solver_GCR_t(netlist_state_t &anetlist, const pstring &name, - const solver_parameters_t *params, const std::size_t size) - : matrix_solver_t(anetlist, name, matrix_solver_t::PREFER_IDENTITY_TOP_LEFT, params) - , m_dim(size) - , RHS(size) - , new_V(size) - , mat(static_cast<typename mat_type::index_type>(size)) - , m_proc() + using mat_type = plib::pGEmatrix_cr<plib::pmatrix_cr<arena_type, FT, SIZE>>; + using base_type = matrix_solver_ext_t<FT, SIZE>; + using fptype = typename base_type::fptype; + + matrix_solver_GCR_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver::solver_parameters_t *params, const std::size_t size) + : matrix_solver_ext_t<FT, SIZE>(main_solver, name, nets, params, size) + , mat(this->m_arena, static_cast<typename mat_type::index_type>(size)) + , m_proc() + { + const std::size_t iN = this->size(); + + // build the final matrix + + std::vector<std::vector<unsigned>> fill(iN); + + std::size_t raw_elements = 0; + + for (std::size_t k = 0; k < iN; k++) { + fill[k].resize(iN, decltype(mat)::FILL_INFINITY); + for (auto &j : this->m_terms[k].m_nz) + { + fill[k][j] = 0; + raw_elements++; + } + } - constexpr std::size_t N() const { return m_dim; } + auto gr = mat.gaussian_extend_fill_mat(fill); + + this->log_fill(fill, mat); + + mat.build_from_fill_mat(fill); - void vsetup(analog_net_t::list_t &nets) override; - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + for (mat_index_type k=0; k<iN; k++) + { + std::size_t cnt(0); + // build pointers into the compressed row format matrix for each terminal + for (std::size_t j=0; j< this->m_terms[k].rail_start();j++) + { + int other = this->m_terms[k].m_connected_net_idx[j]; + for (auto i = mat.row_idx[k]; i < mat.row_idx[k+1]; i++) + if (other == static_cast<int>(mat.col_idx[i])) + { + this->m_mat_ptr[k][j] = &mat.A[i]; + cnt++; + break; + } + } + nl_assert(cnt == this->m_terms[k].rail_start()); + this->m_mat_ptr[k][this->m_terms[k].rail_start()] = &mat.A[mat.diagonal[k]]; + } + + this->state().log().verbose("maximum fill: {1}", gr.first); + this->state().log().verbose("Post elimination occupancy ratio: {2} Ops: {1}", gr.second, + static_cast<fptype>(mat.nz_num) / static_cast<fptype>(iN * iN)); + this->state().log().verbose(" Pre elimination occupancy ratio: {1}", + static_cast<fptype>(raw_elements) / static_cast<fptype>(iN * iN)); - std::pair<pstring, pstring> create_solver_code() override; + // FIXME: Move me + // + + if (this->state().static_solver_lib().isLoaded()) + { + pstring symname = static_compile_name(); + m_proc.load(this->state().static_solver_lib(), symname); + if (m_proc.resolved()) + { + this->state().log().info("External static solver {1} found ...", symname); + } + else + { + this->state().log().warning("External static solver {1} not found ...", symname); + } + } + } + + void upstream_solve_non_dynamic() override; + + std::pair<pstring, pstring> create_solver_code(static_compile_target target) override; private: - using mat_index_type = typename plib::matrix_compressed_rows_t<FT, SIZE>::index_type; + using mat_index_type = typename plib::pmatrix_cr<arena_type, FT, SIZE>::index_type; - void csc_private(plib::putf8_fmt_writer &strm); + template <typename T> + void stream_if_not_yet_done(plib::putf8_fmt_writer &strm, T &A, std::size_t i) + { + const pstring fptype(fp_constants<FT>::name()); + if (!A[i].empty()) + strm("\t{1} m_A{2} = {3};\n", fptype, i, A[i]); + A[i] = ""; + } - using extsolver = void (*)(double * m_A, double * RHS, double * V); + void generate_code(plib::putf8_fmt_writer &strm); pstring static_compile_name(); - const std::size_t m_dim; - plib::parray<FT, SIZE> RHS; - plib::parray<FT, SIZE> new_V; - mat_type mat; - - //extsolver m_proc; - plib::dynproc<void, double * , double * , double * > m_proc; + plib::dynamic_library::function<void, FT *, fptype *, fptype *, fptype *, fptype ** > m_proc; }; @@ -77,149 +136,116 @@ namespace devices // matrix_solver - GCR // ---------------------------------------------------------------------------------------- - // FIXME: namespace or static class member - template <typename V> - std::size_t inline get_level(const V &v, std::size_t k) - { - for (std::size_t i = 0; i < v.size(); i++) - if (plib::container::contains(v[i], k)) - return i; - throw plib::pexception("Error in get_level"); - } +#define COMPRESSED 0 template <typename FT, int SIZE> - void matrix_solver_GCR_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets) + void matrix_solver_GCR_t<FT, SIZE>::generate_code(plib::putf8_fmt_writer &strm) { - setup_base(nets); - - const std::size_t iN = this->N(); - - /* build the final matrix */ - - std::vector<std::vector<unsigned>> fill(iN); + const std::size_t iN = this->size(); + const pstring fptype(fp_constants<FT>::name()); + const pstring fp_suffix(fp_constants<FT>::suffix()); + std::vector<pstring> A(this->mat.nz_num); - std::size_t raw_elements = 0; + // avoid unused variable warnings + strm("\tplib::unused_var({1});\n", "cnV"); +#if !COMPRESSED + for (std::size_t i = 0; i < mat.nz_num; i++) + strm("\t{1} m_A{2}(0.0);\n", fptype, i, i); +#endif for (std::size_t k = 0; k < iN; k++) { - fill[k].resize(iN, decltype(mat)::FILL_INFINITY); - for (auto &j : this->m_terms[k]->m_nz) + auto &net = this->m_terms[k]; + + //# FIXME: gonn, gtn and Idr - which float types should they have? + + //# auto gtot_t = std::accumulate(gt, gt + term_count, plib::constants<FT>::zero()); + //# *tcr_r[railstart] = static_cast<FT>(gtot_t); //mat.A[mat.diag[k]] += gtot_t; + std::size_t pd = std::size_t(this->m_mat_ptr[k][net.rail_start()] - &this->mat.A[0]); + +#if COMPRESSED + //pstring terms = plib::pfmt("m_A{1} = gt[{2}]")(pd, this->m_gtn.didx(k,0)); + pstring terms = plib::pfmt("gt[{2}]")(pd, this->m_gtn.didx(k,0)); + for (std::size_t i=1; i < net.count(); i++) + terms += plib::pfmt(" + gt[{1}]")(this->m_gtn.didx(k,i)); + + A[pd] = terms; //strm("\t{1};\n", terms); + //auto RHS_t(std::accumulate(Idr, Idr + term_count, plib::constants<FT>::zero())); + terms = plib::pfmt("{1} RHS{2} = Idr[{3}]")(fptype, k, this->m_Idrn.didx(k,0)); + for (std::size_t i=1; i < net.count(); i++) + terms += plib::pfmt(" + Idr[{1}]")(this->m_Idrn.didx(k,i)); + //for (std::size_t i = rail_start; i < term_count; i++) + // RHS_t += (- go[i]) * *cnV[i]; + + for (std::size_t i = net.rail_start(); i < net.count(); i++) + terms += plib::pfmt(" - go[{1}] * *cnV[{2}]")(this->m_gonn.didx(k,i), this->m_connected_net_Vn.didx(k,i)); + + strm("\t{1};\n", terms); +#else + for (std::size_t i=0; i < net.count(); i++) + strm("\tm_A{1} += gt[{2}];\n", pd, this->m_gtn.didx(k,i)); + //for (std::size_t i = 0; i < rail_start; i++) + // *tcr_r[i] += static_cast<FT>(go[i]); + for (std::size_t i = 0; i < net.rail_start(); i++) { - fill[k][j] = 0; - raw_elements++; + auto p = this->m_mat_ptr[k][i] - &this->mat.A[0]; + strm("\tm_A{1} += go[{2}];\n", p, this->m_gonn.didx(k,i)); } + //auto RHS_t(std::accumulate(Idr, Idr + term_count, plib::constants<FT>::zero())); + strm("\t{1} RHS{2} = Idr[{3}];\n", fptype, k, this->m_Idrn.didx(k,0)); + for (std::size_t i=1; i < net.count(); i++) + strm("\tRHS{1} += Idr[{2}];\n", k, this->m_Idrn.didx(k,i)); + //for (std::size_t i = rail_start; i < term_count; i++) + // RHS_t += (- go[i]) * *cnV[i]; - } - - auto gr = mat.gaussian_extend_fill_mat(fill); + for (std::size_t i = net.rail_start(); i < net.count(); i++) + strm("\tRHS{1} -= go[{2}] * *cnV[{3}];\n", k, this->m_gonn.didx(k,i), this->m_connected_net_Vn.didx(k,i)); - /* FIXME: move this to the cr matrix class and use computed - * parallel ordering once it makes sense. - */ - - std::vector<unsigned> levL(iN, 0); - std::vector<unsigned> levU(iN, 0); - - // parallel scheme for L x = y - for (std::size_t k = 0; k < iN; k++) - { - unsigned lm=0; - for (std::size_t j = 0; j<k; j++) - if (fill[k][j] < decltype(mat)::FILL_INFINITY) - lm = std::max(lm, levL[j]); - levL[k] = 1+lm; +#endif } - - // parallel scheme for U x = y - for (std::size_t k = iN; k-- > 0; ) - { - unsigned lm=0; - for (std::size_t j = iN; --j > k; ) - if (fill[k][j] < decltype(mat)::FILL_INFINITY) - lm = std::max(lm, levU[j]); - levU[k] = 1+lm; - } - - +#if COMPRESSED for (std::size_t k = 0; k < iN; k++) { - unsigned fm = 0; - pstring ml = ""; - for (std::size_t j = 0; j < iN; j++) - { - ml += fill[k][j] == 0 ? "X" : fill[k][j] < decltype(mat)::FILL_INFINITY ? "+" : "."; - if (fill[k][j] < decltype(mat)::FILL_INFINITY) - if (fill[k][j] > fm) - fm = fill[k][j]; - } - this->log().verbose("{1:4} {2} {3:4} {4:4} {5:4} {6:4}", k, ml, levL[k], levU[k], get_level(mat.m_ge_par, k), fm); - } - - - mat.build_from_fill_mat(fill); - - for (mat_index_type k=0; k<iN; k++) - { - std::size_t cnt(0); - /* build pointers into the compressed row format matrix for each terminal */ - for (std::size_t j=0; j< this->m_terms[k]->m_railstart;j++) + auto &net = this->m_terms[k]; + for (std::size_t i = 0; i < net.rail_start(); i++) { - int other = this->m_terms[k]->m_connected_net_idx[j]; - for (auto i = mat.row_idx[k]; i < mat.row_idx[k+1]; i++) - if (other == static_cast<int>(mat.col_idx[i])) - { - m_mat_ptr[k][j] = &mat.A[i]; - cnt++; - break; - } + std::size_t p = std::size_t(this->m_mat_ptr[k][i] - &this->mat.A[0]); + if (!A[p].empty()) + A[p] += " + "; + A[p] += plib::pfmt("go[{1}]")(this->m_gonn.didx(k,i)); } - nl_assert(cnt == this->m_terms[k]->m_railstart); - m_mat_ptr[k][this->m_terms[k]->m_railstart] = &mat.A[mat.diag[k]]; } - - this->log().verbose("maximum fill: {1}", gr.first); - this->log().verbose("Post elimination occupancy ratio: {2} Ops: {1}", gr.second, - static_cast<double>(mat.nz_num) / static_cast<double>(iN * iN)); - this->log().verbose(" Pre elimination occupancy ratio: {2}", - static_cast<double>(raw_elements) / static_cast<double>(iN * iN)); - - // FIXME: Move me - - if (state().lib().isLoaded()) + for (std::size_t i = 0; i < mat.nz_num; i++) { - pstring symname = static_compile_name(); - m_proc.load(this->state().lib(), symname); - if (m_proc.resolved()) - this->log().info("External static solver {1} found ...", symname); - else - this->log().warning("External static solver {1} not found ...", symname); + if (A[i].empty()) + A[i] = plib::pfmt("0.0{1}")(fp_suffix); + //strm("\t{1} m_A{2} = {3};\n", fptype, i, A[i]); } - } - - template <typename FT, int SIZE> - void matrix_solver_GCR_t<FT, SIZE>::csc_private(plib::putf8_fmt_writer &strm) - { - const std::size_t iN = N(); - - for (std::size_t i = 0; i < mat.nz_num; i++) - strm("double m_A{1} = m_A[{2}];\n", i, i); +#endif for (std::size_t i = 0; i < iN - 1; i++) { - const auto &nzbd = this->m_terms[i]->m_nzbd; + //#const auto &nzbd = this->m_terms[i].m_nzbd; + const auto *nzbd = mat.nzbd(i); + const auto nzbd_count = mat.nzbd_count(i); - if (nzbd.size() > 0) + if (nzbd_count > 0) { - std::size_t pi = mat.diag[i]; + std::size_t pi = mat.diagonal[i]; //const FT f = 1.0 / m_A[pi++]; - strm("const double f{1} = 1.0 / m_A{2};\n", i, pi); + if ((!COMPRESSED) || nzbd_count > 1) // keep code comparable to previous versions + { + stream_if_not_yet_done(strm, A, pi); + strm("\tconst {1} f{2} = 1.0{3} / m_A{4};\n", fptype, i, fp_suffix, pi); + } pi++; const std::size_t piie = mat.row_idx[i+1]; //for (auto & j : nzbd) - for (std::size_t j : nzbd) + for (std::size_t jj = 0; jj < nzbd_count; jj++) { + std::size_t j = nzbd[jj]; // proceed to column i std::size_t pj = mat.row_idx[j]; @@ -227,100 +253,135 @@ namespace devices pj++; //const FT f1 = - m_A[pj++] * f; - strm("\tconst double f{1}_{2} = -f{3} * m_A{4};\n", i, j, i, pj); + stream_if_not_yet_done(strm, A, pi - 1); + stream_if_not_yet_done(strm, A, pj); + + if ((!COMPRESSED) || nzbd_count > 1) // keep code comparable to previous versions + strm("\tconst {1} f{2}_{3} = -f{4} * m_A{5};\n", fptype, i, j, i, pj); + else + strm("\tconst {1} f{2}_{3} = - m_A{4} / m_A{5};\n", fptype, i, j, pj, pi-1); pj++; - // subtract row i from j */ + // subtract row i from j for (std::size_t pii = pi; pii<piie; ) { while (mat.col_idx[pj] < mat.col_idx[pii]) pj++; //m_A[pj++] += m_A[pii++] * f1; + + stream_if_not_yet_done(strm, A, pj); + stream_if_not_yet_done(strm, A, pii); + strm("\tm_A{1} += m_A{2} * f{3}_{4};\n", pj, pii, i, j); pj++; pii++; } //RHS[j] += f1 * RHS[i]; - strm("\tRHS[{1}] += f{2}_{3} * RHS[{4}];\n", j, i, j, i); + strm("\tRHS{1} += f{2}_{3} * RHS{4};\n", j, i, j, i); } } } - //new_V[iN - 1] = RHS[iN - 1] / mat.A[mat.diag[iN - 1]]; - strm("\tV[{1}] = RHS[{2}] / m_A{3};\n", iN - 1, iN - 1, mat.diag[iN - 1]); + //#new_V[iN - 1] = RHS[iN - 1] / mat.A[mat.diag[iN - 1]]; + stream_if_not_yet_done(strm, A, mat.diagonal[iN - 1]); + strm("\tV[{1}] = RHS{2} / m_A{3};\n", iN - 1, iN - 1, mat.diagonal[iN - 1]); for (std::size_t j = iN - 1; j-- > 0;) { - strm("\tdouble tmp{1} = 0.0;\n", j); +#if COMPRESSED + pstring tmp; + const std::size_t e = mat.row_idx[j+1]; + for (std::size_t pk = mat.diagonal[j] + 1; pk < e; pk++) + { + stream_if_not_yet_done(strm, A, pk); + tmp = tmp + plib::pfmt(" + m_A{2} * V[{3}]")(j, pk, mat.col_idx[pk]); + } + + stream_if_not_yet_done(strm, A, mat.diagonal[j]); + if (tmp.empty()) + { + strm("\tV[{1}] = RHS{1} / m_A{2};\n", j, mat.diagonal[j]); + } + else + { + //strm("\tconst {1} tmp{2} = {3};\n", fptype, j, tmp.substr(3)); + //strm("\tV[{1}] = (RHS{1} - tmp{1}) / m_A{2};\n", j, mat.diag[j]); + strm("\tV[{1}] = (RHS{1} - ({2})) / m_A{3};\n", j, tmp.substr(3), mat.diagonal[j]); + } +#else + strm("\t{1} tmp{2} = 0.0{3};\n", fptype, j, fp_suffix); const std::size_t e = mat.row_idx[j+1]; - for (std::size_t pk = mat.diag[j] + 1; pk < e; pk++) + for (std::size_t pk = mat.diagonal[j] + 1; pk < e; pk++) { strm("\ttmp{1} += m_A{2} * V[{3}];\n", j, pk, mat.col_idx[pk]); } - strm("\tV[{1}] = (RHS[{1}] - tmp{1}) / m_A{4};\n", j, j, j, mat.diag[j]); + strm("\tV[{1}] = (RHS{1} - tmp{1}) / m_A{4};\n", j, j, j, mat.diagonal[j]); +#endif } } template <typename FT, int SIZE> pstring matrix_solver_GCR_t<FT, SIZE>::static_compile_name() { + pstring str_floattype(fp_constants<FT>::name()); + pstring str_fptype(fp_constants<fptype>::name()); std::stringstream t; t.imbue(std::locale::classic()); plib::putf8_fmt_writer w(&t); - csc_private(w); - std::hash<typename std::remove_const<std::remove_reference<decltype(t.str())>::type>::type> h; - - return plib::pfmt("nl_gcr_{1:x}_{2}")(h( t.str() ))(mat.nz_num); + generate_code(w); + //#std::hash<typename std::remove_const<std::remove_reference<decltype(t.str())>::type>::type> h; + return plib::pfmt("nl_gcr_{1}_{2}_{3}_{4:x}")(mat.nz_num)(str_fptype)(str_floattype)(plib::hash<uint64_t>( t.str().c_str(), t.str().size() )); } template <typename FT, int SIZE> - std::pair<pstring, pstring> matrix_solver_GCR_t<FT, SIZE>::create_solver_code() + std::pair<pstring, pstring> matrix_solver_GCR_t<FT, SIZE>::create_solver_code(static_compile_target target) { std::stringstream t; t.imbue(std::locale::classic()); plib::putf8_fmt_writer strm(&t); pstring name = static_compile_name(); - - strm.writeline(plib::pfmt("extern \"C\" void {1}(double * __restrict m_A, double * __restrict RHS, double * __restrict V)\n")(name)); - strm.writeline("{\n"); - csc_private(strm); - strm.writeline("}\n"); - return std::pair<pstring, pstring>(name, pstring(t.str())); + pstring str_float_type(fp_constants<FT>::name()); + pstring str_fptype(fp_constants<fptype>::name()); + + pstring external_qualifier; + if (target == CXX_EXTERNAL_C) + external_qualifier = "extern \"C\""; + else if (target == CXX_STATIC) + external_qualifier = "static"; + strm.write_line(plib::pfmt("{1} void {2}({3} * __restrict V, " + "const {4} * __restrict go, const {4} * __restrict gt, " + "const {4} * __restrict Idr, const {4} * const * __restrict cnV)\n")(external_qualifier, name, str_float_type, str_fptype)); + strm.write_line("{\n"); + generate_code(strm); + strm.write_line("}\n"); + // some compilers (_WIN32, _WIN64, mac osx) need an explicit cast + return { name, putf8string(t.str()) }; } template <typename FT, int SIZE> - unsigned matrix_solver_GCR_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + void matrix_solver_GCR_t<FT, SIZE>::upstream_solve_non_dynamic() { - const std::size_t iN = this->N(); - - mat.set_scalar(0.0); - - /* populate matrix */ - - this->fill_matrix(iN, m_mat_ptr, RHS); - - /* now solve it */ - - //if (m_proc != nullptr) if (m_proc.resolved()) { - //static_solver(m_A, RHS); - m_proc(&mat.A[0], &RHS[0], &new_V[0]); + m_proc(&this->m_new_V[0], + this->m_gonn.data(), this->m_gtn.data(), this->m_Idrn.data(), + this->m_connected_net_Vn.data()); } else { - // mat.gaussian_elimination_parallel(RHS); - mat.gaussian_elimination(RHS); - /* backward substitution */ - mat.gaussian_back_substitution(new_V, RHS); - } + // clear matrix + mat.set_scalar(plib::constants<FT>::zero()); - this->m_stat_calculations++; + // populate matrix + this->fill_matrix_and_rhs(); - const FT err = (newton_raphson ? delta(new_V) : 0.0); - store(new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; + // now solve it + // parallel is slow -- very slow + // mat.gaussian_elimination_parallel(RHS); + mat.gaussian_elimination(this->m_RHS); + // backward substitution + mat.gaussian_back_substitution(this->m_new_V, this->m_RHS); + } } -} // namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_GCR_H_ */ +#endif // NLD_MS_GCR_H_ diff --git a/src/lib/netlist/solver/nld_ms_gmres.h b/src/lib/netlist/solver/nld_ms_gmres.h index 2ff515ebda7..836f6e61cbb 100644 --- a/src/lib/netlist/solver/nld_ms_gmres.h +++ b/src/lib/netlist/solver/nld_ms_gmres.h @@ -1,27 +1,24 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_gmres.h - * - */ #ifndef NLD_MS_GMRES_H_ #define NLD_MS_GMRES_H_ +/// +/// \file nld_ms_gmres.h +/// + +#include "nld_matrix_solver_ext.h" #include "nld_ms_direct.h" #include "nld_solver.h" #include "plib/gmres.h" -#include "plib/mat_cr.h" #include "plib/parray.h" +#include "plib/pmatrix_cr.h" #include "plib/vector_ops.h" #include <algorithm> -#include <cmath> - -namespace netlist -{ -namespace devices +namespace netlist::solver { template <typename FT, int SIZE> @@ -31,26 +28,64 @@ namespace devices using float_type = FT; - /* Sort rows in ascending order. This should minimize fill-in and thus - * maximize the efficiency of the incomplete LUT. - * This is already preconditioning. - */ - matrix_solver_GMRES_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, const std::size_t size) - : matrix_solver_direct_t<FT, SIZE>(anetlist, name, matrix_solver_t::PREFER_BAND_MATRIX, params, size) - //, m_ops(size, 2) - , m_ops(size, 4) + // Sort rows in ascending order. This should minimize fill-in and thus + // maximize the efficiency of the incomplete LUT. + // This is already preconditioning. + + matrix_solver_GMRES_t(devices::nld_solver &main_solver, const pstring &name, + matrix_solver_t::net_list_t &nets, + const solver::solver_parameters_t *params, + const std::size_t size) + : matrix_solver_direct_t<FT, SIZE>(main_solver, name, nets, params, size) + , m_ops(this->m_arena, size, 0) , m_gmres(size) { + const std::size_t iN = this->size(); + + std::vector<std::vector<unsigned>> fill(iN); + + for (std::size_t k=0; k<iN; k++) + { + fill[k].resize(iN, decltype(m_ops.m_mat)::FILL_INFINITY); + terms_for_net_t & row = this->m_terms[k]; + for (const auto &nz_j : row.m_nz) + { + fill[k][static_cast<matrix_type>(nz_j)] = 0; + } } - void vsetup(analog_net_t::list_t &nets) override; - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + m_ops.build(fill); + this->log_fill(fill, m_ops.m_mat); + + // build pointers into the compressed row format matrix for each terminal + + for (std::size_t k=0; k<iN; k++) + { + std::size_t cnt = 0; + for (std::size_t j=0; j< this->m_terms[k].rail_start();j++) + { + for (std::size_t i = m_ops.m_mat.row_idx[k]; i<m_ops.m_mat.row_idx[k+1]; i++) + if (this->m_terms[k].m_connected_net_idx[j] == static_cast<int>(m_ops.m_mat.col_idx[i])) + { + this->m_mat_ptr[k][j] = &m_ops.m_mat.A[i]; + cnt++; + break; + } + } + nl_assert(cnt == this->m_terms[k].rail_start()); + this->m_mat_ptr[k][this->m_terms[k].rail_start()] = &m_ops.m_mat.A[m_ops.m_mat.diagonal[k]]; + } + } + + void upstream_solve_non_dynamic() override; private: - using mattype = typename plib::matrix_compressed_rows_t<FT, SIZE>::index_type; + using matrix_type = typename plib::pmatrix_cr<arena_type, FT, SIZE>::index_type; - plib::mat_precondition_ILU<FT, SIZE> m_ops; + //plib::mat_precondition_none<FT, SIZE> m_ops; + plib::mat_precondition_ILU<arena_type, FT, SIZE> m_ops; + //plib::mat_precondition_diag<FT, SIZE> m_ops; plib::gmres_t<FT, SIZE> m_gmres; }; @@ -59,87 +94,38 @@ namespace devices // ---------------------------------------------------------------------------------------- template <typename FT, int SIZE> - void matrix_solver_GMRES_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets) + void matrix_solver_GMRES_t<FT, SIZE>::upstream_solve_non_dynamic() { - matrix_solver_direct_t<FT, SIZE>::vsetup(nets); - const std::size_t iN = this->size(); - std::vector<std::vector<unsigned>> fill(iN); - - for (std::size_t k=0; k<iN; k++) - { - fill[k].resize(iN, decltype(m_ops.m_mat)::FILL_INFINITY); - terms_for_net_t * row = this->m_terms[k].get(); - for (const auto &nz_j : row->m_nz) - { - fill[k][static_cast<mattype>(nz_j)] = 0; - } - } - - m_ops.build(fill); - - /* build pointers into the compressed row format matrix for each terminal */ - - for (std::size_t k=0; k<iN; k++) - { - std::size_t cnt = 0; - for (std::size_t j=0; j< this->m_terms[k]->m_railstart;j++) - { - for (std::size_t i = m_ops.m_mat.row_idx[k]; i<m_ops.m_mat.row_idx[k+1]; i++) - if (this->m_terms[k]->m_connected_net_idx[j] == static_cast<int>(m_ops.m_mat.col_idx[i])) - { - this->m_mat_ptr[k][j] = &m_ops.m_mat.A[i]; - cnt++; - break; - } - } - nl_assert(cnt == this->m_terms[k]->m_railstart); - this->m_mat_ptr[k][this->m_terms[k]->m_railstart] = &m_ops.m_mat.A[m_ops.m_mat.diag[k]]; - } - } - - template <typename FT, int SIZE> - unsigned matrix_solver_GMRES_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) - { - const std::size_t iN = this->size(); - - plib::parray<FT, SIZE> RHS(iN); - //float_type new_V[storage_N]; - - m_ops.m_mat.set_scalar(0.0); + m_ops.m_mat.set_scalar(plib::constants<FT>::zero()); - /* populate matrix and V for first estimate */ - this->fill_matrix(iN, this->m_mat_ptr, RHS); + // populate matrix and V for first estimate + this->fill_matrix_and_rhs(); for (std::size_t k = 0; k < iN; k++) { - this->m_new_V[k] = this->m_nets[k]->Q_Analog(); + this->m_new_V[k] = static_cast<float_type>(this->m_terms[k].getV()); } - const float_type accuracy = this->m_params.m_accuracy; + const float_type accuracy(static_cast<float_type>(this->m_params.m_accuracy)); - auto iter = std::max(plib::constants<std::size_t>::one(), this->m_params.m_gs_loops); - auto gsl = m_gmres.solve(m_ops, this->m_new_V, RHS, iter, accuracy); + auto iter = std::max(plib::constants<std::size_t>::one(), this->m_params.m_gs_loops()); + auto gsl = m_gmres.solve(m_ops, this->m_new_V, this->m_RHS, iter, accuracy); this->m_iterative_total += gsl; - this->m_stat_calculations++; if (gsl > iter) { this->m_iterative_fail++; - return matrix_solver_direct_t<FT, SIZE>::vsolve_non_dynamic(newton_raphson); + matrix_solver_direct_t<FT, SIZE>::upstream_solve_non_dynamic(); } - const float_type err = (newton_raphson ? this->delta(this->m_new_V) : 0.0); - this->store(this->m_new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; } -} // namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_GMRES_H_ */ +#endif // NLD_MS_GMRES_H_ diff --git a/src/lib/netlist/solver/nld_ms_sm.h b/src/lib/netlist/solver/nld_ms_sm.h index 5b59effecf8..8a0b67f18ce 100644 --- a/src/lib/netlist/solver/nld_ms_sm.h +++ b/src/lib/netlist/solver/nld_ms_sm.h @@ -1,54 +1,50 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_direct.h - * - * - * Sherman-Morrison Solver - * - * Computes the updated inverse of A given that the change in A is - * - * A <- A + (u x v) u,v vectors - * - * In this specific implementation, u is a unit vector specifying the row which - * changed. Thus v contains the changed column. - * - * Than z = A^-1 u , w = transpose(A^-1) v , lambda = v z - * - * A^-1 <- 1.0 / (1.0 + lambda) * (z x w) - * - * The approach is iterative and applied for each row changed. - * - * The performance for a typical circuit like kidniki compared to Gaussian - * elimination is poor: - * - * a) The code needs to be run for each row change. - * b) The inverse of A typically is fully occupied. - * - * It may have advantages for circuits with a high number of elements and only - * few dynamic/active components. - * - */ #ifndef NLD_MS_SM_H_ #define NLD_MS_SM_H_ +/// +/// \file nld_ms_sm.h +/// +/// Sherman-Morrison Solver +/// +/// Computes the updated inverse of A given that the change in A is +/// +/// A <- A + (u x v) u,v vectors +/// +/// In this specific implementation, u is a unit vector specifying the row which +/// changed. Thus v contains the changed column. +/// +/// Than z = A^-1 u , w = transpose(A^-1) v , lambda = v z +/// +/// A^-1 <- 1.0 / (1.0 + lambda) * (z x w) +/// +/// The approach is iterative and applied for each row changed. +/// +/// The performance for a typical circuit like `kidniki` compared to Gaussian +/// elimination is poor: +/// +/// a) The code needs to be run for each row change. +/// b) The inverse of A typically is fully occupied. +/// +/// It may have advantages for circuits with a high number of elements and only +/// few dynamic/active components. +/// + #include "nld_matrix_solver.h" +#include "nld_matrix_solver_ext.h" #include "nld_solver.h" #include "plib/vector_ops.h" #include <algorithm> -namespace netlist -{ -namespace devices +namespace netlist::solver { template <typename FT, int SIZE> - class matrix_solver_sm_t: public matrix_solver_t + class matrix_solver_sm_t: public matrix_solver_ext_t<FT, SIZE> { - friend class matrix_solver_t; - public: using float_ext_type = FT; @@ -56,17 +52,20 @@ namespace devices // FIXME: dirty hack to make this compile static constexpr const std::size_t storage_N = 100; - matrix_solver_sm_t(netlist_state_t &anetlist, const pstring &name, - const solver_parameters_t *params, const std::size_t size); + matrix_solver_sm_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver_parameters_t *params, const std::size_t size) + : matrix_solver_ext_t<FT, SIZE>(main_solver, name, nets, params, size) + , m_cnt(0) + { + this->build_mat_ptr(m_A); + } - void vsetup(analog_net_t::list_t &nets) override; void reset() override { matrix_solver_t::reset(); } protected: - unsigned vsolve_non_dynamic(const bool newton_raphson) override; - unsigned solve_non_dynamic(const bool newton_raphson); - - constexpr std::size_t size() const { return m_dim; } + void upstream_solve_non_dynamic() override; + void solve_non_dynamic(); void LE_invert(); @@ -81,7 +80,7 @@ namespace devices template <typename T1, typename T2> float_ext_type &Ainv(const T1 &r, const T2 &c) { return m_Ainv[r][c]; } template <typename T1> - float_ext_type &RHS(const T1 &r) { return m_RHS[r]; } + float_ext_type &RHS(const T1 &r) { return this->m_RHS[r]; } template <typename T1, typename T2> @@ -90,18 +89,18 @@ namespace devices float_ext_type &lAinv(const T1 &r, const T2 &c) { return m_lAinv[r][c]; } private: + template <typename T, std::size_t N, std::size_t M> + using array2D = std::array<std::array<T, M>, N>; static constexpr std::size_t m_pitch = ((( storage_N) + 7) / 8) * 8; - float_ext_type m_A[storage_N][m_pitch]; - float_ext_type m_Ainv[storage_N][m_pitch]; - float_ext_type m_W[storage_N][m_pitch]; - std::array<float_ext_type, storage_N> m_RHS; // right hand side - contains currents + array2D<float_ext_type, storage_N, m_pitch> m_A; + array2D<float_ext_type, storage_N, m_pitch> m_Ainv; + array2D<float_ext_type, storage_N, m_pitch> m_W; - float_ext_type m_lA[storage_N][m_pitch]; - float_ext_type m_lAinv[storage_N][m_pitch]; + array2D<float_ext_type, storage_N, m_pitch> m_lA; + array2D<float_ext_type, storage_N, m_pitch> m_lAinv; //float_ext_type m_RHSx[storage_N]; - const std::size_t m_dim; std::size_t m_cnt; }; @@ -111,46 +110,37 @@ namespace devices // ---------------------------------------------------------------------------------------- template <typename FT, int SIZE> - void matrix_solver_sm_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets) - { - matrix_solver_t::setup_base(nets); - - /* FIXME: Shouldn't be necessary */ - for (std::size_t k = 0; k < size(); k++) - state().save(*this, RHS(k), this->name(), plib::pfmt("RHS.{1}")(k)); - } - - template <typename FT, int SIZE> void matrix_solver_sm_t<FT, SIZE>::LE_invert() { - const std::size_t kN = size(); + const std::size_t kN = this->size(); for (std::size_t i = 0; i < kN; i++) { for (std::size_t j = 0; j < kN; j++) { W(i,j) = lA(i,j) = A(i,j); - Ainv(i,j) = 0.0; + Ainv(i,j) = plib::constants<FT>::zero(); } - Ainv(i,i) = 1.0; + Ainv(i,i) = plib::constants<FT>::one(); } - /* down */ + // down for (std::size_t i = 0; i < kN; i++) { - /* FIXME: Singular matrix? */ - const float_type f = 1.0 / W(i,i); - const auto * const p = m_terms[i]->m_nzrd.data(); - const std::size_t e = m_terms[i]->m_nzrd.size(); + // FIXME: Singular matrix? + const float_type f = plib::reciprocal(W(i,i)); + const auto * const p = this->m_terms[i].m_nzrd.data(); + const std::size_t e = this->m_terms[i].m_nzrd.size(); - /* Eliminate column i from row j */ + // Eliminate column i from row j - const auto * const pb = m_terms[i]->m_nzbd.data(); - const std::size_t eb = m_terms[i]->m_nzbd.size(); + const auto * const pb = this->m_terms[i].m_nzbd.data(); + const std::size_t eb = this->m_terms[i].m_nzbd.size(); for (std::size_t jb = 0; jb < eb; jb++) { const unsigned j = pb[jb]; const float_type f1 = - W(j,i) * f; - if (f1 != 0.0) + // FIXME: comparison to zero + if (f1 != plib::constants<float_type>::zero()) { for (std::size_t k = 0; k < e; k++) W(j,p[k]) += W(i,p[k]) * f1; @@ -159,15 +149,16 @@ namespace devices } } } - /* up */ + // up for (std::size_t i = kN; i-- > 0; ) { - /* FIXME: Singular matrix? */ - const float_type f = 1.0 / W(i,i); + // FIXME: Singular matrix? + const float_type f = plib::reciprocal(W(i,i)); for (std::size_t j = i; j-- > 0; ) { const float_type f1 = - W(j,i) * f; - if (f1 != 0.0) + // FIXME: comparison to zero + if (f1 != plib::constants<float_type>::zero()) { for (std::size_t k = i; k < kN; k++) W(j,k) += W(i,k) * f1; @@ -188,10 +179,10 @@ namespace devices void matrix_solver_sm_t<FT, SIZE>::LE_compute_x( T & x) { - const std::size_t kN = size(); + const std::size_t kN = this->size(); for (std::size_t i=0; i<kN; i++) - x[i] = 0.0; + x[i] = plib::constants<FT>::zero(); for (std::size_t k=0; k<kN; k++) { @@ -203,16 +194,21 @@ namespace devices } template <typename FT, int SIZE> - unsigned matrix_solver_sm_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson) + void matrix_solver_sm_t<FT, SIZE>::solve_non_dynamic() { static constexpr const bool incremental = true; - const std::size_t iN = size(); + const std::size_t iN = this->size(); - std::array<float_type, storage_N> new_V; // = { 0.0 }; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) + std::array<float_type, m_pitch> v; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) + std::array<std::size_t, m_pitch> cols; + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) + std::array<float_type, m_pitch> z; if ((m_cnt % 50) == 0) { - /* complete calculation */ + // complete calculation this->LE_invert(); } else @@ -225,46 +221,45 @@ namespace devices } for (std::size_t row = 0; row < iN; row ++) { - std::array<float_type, m_pitch> v = {0}; - std::array<std::size_t, m_pitch> cols; - std::size_t colcount = 0; + std::size_t col_count = 0; - auto &nz = m_terms[row]->m_nz; + auto &nz = this->m_terms[row].m_nz; for (unsigned & col : nz) { v[col] = A(row,col) - lA(row,col); if (incremental) lA(row,col) = A(row,col); - if (v[col] != 0.0) - cols[colcount++] = col; + // FIXME: comparison to zero + if (v[col] != plib::constants<float_type>::zero()) + cols[col_count++] = col; } - if (colcount > 0) + if (col_count > 0) { - float_type lamba = 0.0; + auto lambda(plib::constants<FT>::zero()); std::array<float_type, m_pitch> w = {0}; - std::array<float_type, m_pitch> z; - /* compute w and lamba */ + // compute w and lambda for (std::size_t i = 0; i < iN; i++) - z[i] = Ainv(i, row); /* u is row'th column */ + z[i] = Ainv(i, row); // u is row'th column - for (std::size_t j = 0; j < colcount; j++) - lamba += v[cols[j]] * z[cols[j]]; + for (std::size_t j = 0; j < col_count; j++) + lambda += v[cols[j]] * z[cols[j]]; - for (std::size_t j=0; j<colcount; j++) + for (std::size_t j=0; j<col_count; j++) { std::size_t col = cols[j]; float_type f = v[col]; for (std::size_t k = 0; k < iN; k++) - w[k] += Ainv(col,k) * f; /* Transpose(Ainv) * v */ + w[k] += Ainv(col,k) * f; //# Transpose(Ainv) * v } - lamba = -1.0 / (1.0 + lamba); + lambda = -plib::reciprocal(plib::constants<float_type>::one() + lambda); for (std::size_t i=0; i<iN; i++) { - const float_type f = lamba * z[i]; - if (f != 0.0) + const float_type f = lambda * z[i]; + // FIXME: comparison to zero + if (f != plib::constants<float_type>::zero()) for (std::size_t k = 0; k < iN; k++) Ainv(i,k) += f * w[k]; } @@ -275,33 +270,20 @@ namespace devices m_cnt++; - this->LE_compute_x(new_V); - - const float_type err = (newton_raphson ? delta(new_V) : 0.0); - store(new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; + this->LE_compute_x(this->m_new_V); } template <typename FT, int SIZE> - unsigned matrix_solver_sm_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + void matrix_solver_sm_t<FT, SIZE>::upstream_solve_non_dynamic() { - this->build_LE_A(*this); - this->build_LE_RHS(*this); - this->m_stat_calculations++; - return this->solve_non_dynamic(newton_raphson); - } + this->clear_square_mat(this->m_A); + this->fill_matrix_and_rhs(); - template <typename FT, int SIZE> - matrix_solver_sm_t<FT, SIZE>::matrix_solver_sm_t(netlist_state_t &anetlist, const pstring &name, - const solver_parameters_t *params, const std::size_t size) - : matrix_solver_t(anetlist, name, NOSORT, params) - , m_dim(size) - , m_cnt(0) - { + this->solve_non_dynamic(); } -} // namespace devices -} // namespace netlist -#endif /* NLD_MS_DIRECT_H_ */ +} // namespace netlist::solver + +#endif // NLD_MS_SM_H_ diff --git a/src/lib/netlist/solver/nld_ms_sor.h b/src/lib/netlist/solver/nld_ms_sor.h index c31aaa6d46a..ca5a4839ce3 100644 --- a/src/lib/netlist/solver/nld_ms_sor.h +++ b/src/lib/netlist/solver/nld_ms_sor.h @@ -1,175 +1,164 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_sor.h - * - * Generic successive over relaxation solver. - * - * Fow w==1 we will do the classic Gauss-Seidel approach - * - */ #ifndef NLD_MS_SOR_H_ #define NLD_MS_SOR_H_ +// Names +// spell-checker: words Seidel + +/// +/// \file nld_ms_sor.h +/// +/// Generic successive over relaxation solver. +/// +/// Fow w==1 we will do the classic Gauss-Seidel approach. +/// + +#include "nld_matrix_solver_ext.h" #include "nld_ms_direct.h" -#include "nld_solver.h" #include <algorithm> -namespace netlist -{ - namespace devices -{ - -template <typename FT, int SIZE> -class matrix_solver_SOR_t: public matrix_solver_direct_t<FT, SIZE> +namespace netlist::solver { -public: - using float_type = FT; - - matrix_solver_SOR_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, const std::size_t size) - : matrix_solver_direct_t<FT, SIZE>(anetlist, name, matrix_solver_t::ASCENDING, params, size) - , m_lp_fact(*this, "m_lp_fact", 0) - , w(size, 0.0) - , one_m_w(size, 0.0) - , RHS(size, 0.0) - //, new_V(size, 0.0) - { - } + template <typename FT, int SIZE> + class matrix_solver_SOR_t: public matrix_solver_direct_t<FT, SIZE> + { + public: - void vsetup(analog_net_t::list_t &nets) override; - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + using float_type = FT; -private: - state_var<float_type> m_lp_fact; - std::vector<float_type> w; - std::vector<float_type> one_m_w; - std::vector<float_type> RHS; - //std::vector<float_type> new_V; -}; + matrix_solver_SOR_t(devices::nld_solver &main_solver, const pstring &name, + matrix_solver_t::net_list_t &nets, + const solver_parameters_t *params, const std::size_t size) + : matrix_solver_direct_t<FT, SIZE>(main_solver, name, nets, params, size) + , m_lp_fact(*this, "m_lp_fact", 0) + , w(size, plib::constants<FT>::zero()) + , one_m_w(size, plib::constants<FT>::zero()) + { + } -// ---------------------------------------------------------------------------------------- -// matrix_solver - Gauss - Seidel -// ---------------------------------------------------------------------------------------- + void upstream_solve_non_dynamic() override; + private: + state_var<float_type> m_lp_fact; + std::vector<float_type> w; + std::vector<float_type> one_m_w; + }; -template <typename FT, int SIZE> -void matrix_solver_SOR_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets) -{ - matrix_solver_direct_t<FT, SIZE>::vsetup(nets); -} + /// + /// \brief Gauss - Seidel matrix_solver + /// + /// + template <typename FT, int SIZE> + void matrix_solver_SOR_t<FT, SIZE>::upstream_solve_non_dynamic() + { + const std::size_t iN = this->size(); + bool resched = false; + unsigned resched_cnt = 0; -template <typename FT, int SIZE> -unsigned matrix_solver_SOR_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) -{ - const std::size_t iN = this->size(); - bool resched = false; - unsigned resched_cnt = 0; + // ideally, we could get an estimate for the spectral radius of + // Inv(D - L) * U + // + // and estimate using + // + // omega = 2.0 / (1.0 + std::sqrt(1-rho)) + // - /* ideally, we could get an estimate for the spectral radius of - * Inv(D - L) * U - * - * and estimate using - * - * omega = 2.0 / (1.0 + std::sqrt(1-rho)) - */ + const auto ws(static_cast<float_type>(this->m_params.m_gs_sor)); - const float_type ws = this->m_params.m_gs_sor; + for (std::size_t k = 0; k < iN; k++) + { - for (std::size_t k = 0; k < iN; k++) - { - float_type gtot_t = 0.0; - float_type gabs_t = 0.0; - float_type RHS_t = 0.0; + const std::size_t term_count = this->m_terms[k].count(); + const auto * const gt = this->m_gtn[k]; + const auto * const go = this->m_gonn[k]; + const auto * const Idr = this->m_Idrn[k]; + auto other_cur_analog = this->m_connected_net_Vn[k]; - const std::size_t term_count = this->m_terms[k]->count(); - const float_type * const gt = this->m_gtn[k]; - const float_type * const go = this->m_gonn[k]; - const float_type * const Idr = this->m_Idrn[k]; - auto other_cur_analog = this->m_connected_net_Vn[k]; + using fpaggtype = std::remove_reference_t<std::remove_cv_t<decltype(this->m_gtn[0][0])>>; - this->m_new_V[k] = this->m_nets[k]->Q_Analog(); + fpaggtype gtot_t = nlconst_base<fpaggtype>::zero(); + fpaggtype gabs_t = nlconst_base<fpaggtype>::zero(); + fpaggtype RHS_t = nlconst_base<fpaggtype>::zero(); - for (std::size_t i = 0; i < term_count; i++) - { - gtot_t = gtot_t + gt[i]; - RHS_t = RHS_t + Idr[i]; - } + this->m_new_V[k] = static_cast<float_type>(this->m_terms[k].getV()); - for (std::size_t i = this->m_terms[k]->m_railstart; i < term_count; i++) - RHS_t = RHS_t - go[i] * *other_cur_analog[i]; + for (std::size_t i = 0; i < term_count; i++) + { + gtot_t = gtot_t + gt[i]; + RHS_t = RHS_t + Idr[i]; + } - RHS[k] = RHS_t; + for (std::size_t i = this->m_terms[k].rail_start(); i < term_count; i++) + RHS_t = RHS_t - go[i] * *other_cur_analog[i]; - if (this->m_params.m_use_gabs) - { - for (std::size_t i = 0; i < term_count; i++) - gabs_t = gabs_t + std::abs(go[i]); + this->m_RHS[k] = static_cast<float_type>(RHS_t); - gabs_t *= plib::constants<nl_double>::cast(0.5); // derived by try and error - if (gabs_t <= gtot_t) + if (this->m_params.m_use_gabs) { - w[k] = ws / gtot_t; - one_m_w[k] = plib::constants<FT>::one() - ws; + for (std::size_t i = 0; i < term_count; i++) + gabs_t = gabs_t + plib::abs(go[i]); + + gabs_t *= nlconst::half(); // derived by try and error + if (gabs_t <= gtot_t) + { + w[k] = ws / static_cast<float_type>(gtot_t); + one_m_w[k] = plib::constants<FT>::one() - ws; + } + else + { + w[k] = plib::reciprocal(static_cast<float_type>(gtot_t + gabs_t)); + one_m_w[k] = plib::constants<FT>::one() - plib::constants<FT>::one() * static_cast<FT>(gtot_t / (gtot_t + gabs_t)); + } } else { - w[k] = plib::constants<FT>::one() / (gtot_t + gabs_t); - one_m_w[k] = plib::constants<FT>::one() - plib::constants<FT>::one() * gtot_t / (gtot_t + gabs_t); + w[k] = ws / static_cast<float_type>(gtot_t); + one_m_w[k] = plib::constants<FT>::one() - ws; } } - else - { - w[k] = ws / gtot_t; - one_m_w[k] = plib::constants<FT>::one() - ws; - } - } - const float_type accuracy = this->m_params.m_accuracy; + const auto accuracy(static_cast<float_type>(this->m_params.m_accuracy)); - do { - resched = false; - float_type err = 0; - for (std::size_t k = 0; k < iN; k++) - { - const int * net_other = this->m_terms[k]->m_connected_net_idx.data(); - const std::size_t railstart = this->m_terms[k]->m_railstart; - const float_type * go = this->m_gonn[k]; + do { + resched = false; + float_type err = 0; + for (std::size_t k = 0; k < iN; k++) + { + const int * net_other = this->m_terms[k].m_connected_net_idx.data(); + const std::size_t rail_start = this->m_terms[k].rail_start(); + const auto * go = this->m_gonn[k]; - float_type Idrive = 0.0; - for (std::size_t i = 0; i < railstart; i++) - Idrive = Idrive - go[i] * this->m_new_V[static_cast<std::size_t>(net_other[i])]; + float_type Idrive = plib::constants<float_type>::zero(); + for (std::size_t i = 0; i < rail_start; i++) + Idrive = Idrive - static_cast<float_type>(go[i]) * this->m_new_V[static_cast<std::size_t>(net_other[i])]; - const float_type new_val = this->m_new_V[k] * one_m_w[k] + (Idrive + RHS[k]) * w[k]; + const float_type new_val = this->m_new_V[k] * one_m_w[k] + (Idrive + this->m_RHS[k]) * w[k]; - err = std::max(std::abs(new_val - this->m_new_V[k]), err); - this->m_new_V[k] = new_val; - } + err = std::max(plib::abs(new_val - this->m_new_V[k]), err); + this->m_new_V[k] = new_val; + } - if (err > accuracy) - resched = true; + if (err > accuracy) + resched = true; - resched_cnt++; - } while (resched && (resched_cnt < this->m_params.m_gs_loops)); + resched_cnt++; + } while (resched && (resched_cnt < this->m_params.m_gs_loops)); - this->m_iterative_total += resched_cnt; - this->m_stat_calculations++; + this->m_iterative_total += resched_cnt; - if (resched) - { - // Fallback to direct solver ... - this->m_iterative_fail++; - return matrix_solver_direct_t<FT, SIZE>::vsolve_non_dynamic(newton_raphson); - } + if (resched) + { + // Fallback to direct solver ... + this->m_iterative_fail++; + matrix_solver_direct_t<FT, SIZE>::upstream_solve_non_dynamic(); + } - const float_type err = (newton_raphson ? this->delta(this->m_new_V) : 0.0); - this->store(this->m_new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; -} + } - } //namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_SOR_H_ */ +#endif // NLD_MS_SOR_H_ diff --git a/src/lib/netlist/solver/nld_ms_sor_mat.h b/src/lib/netlist/solver/nld_ms_sor_mat.h index cdcd2e48847..dd370da4df9 100644 --- a/src/lib/netlist/solver/nld_ms_sor_mat.h +++ b/src/lib/netlist/solver/nld_ms_sor_mat.h @@ -1,56 +1,48 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_sor.h - * - * Generic successive over relaxation solver. - * - * Fow w==1 we will do the classic Gauss-Seidel approach - * - */ #ifndef NLD_MS_SOR_MAT_H_ #define NLD_MS_SOR_MAT_H_ -#include "nld_matrix_solver.h" +// Names +// spell-checker: words Seidel, +// + +/// +/// \file nld_ms_sor.h +/// +/// Generic successive over relaxation solver. +/// +/// For w==1 we will do the classic Gauss-Seidel approach +/// + +#include "nld_matrix_solver_ext.h" #include "nld_ms_direct.h" -#include "nld_solver.h" #include <algorithm> -namespace netlist -{ -namespace devices +namespace netlist::solver { template <typename FT, int SIZE> class matrix_solver_SOR_mat_t: public matrix_solver_direct_t<FT, SIZE> { - friend class matrix_solver_t; - public: using float_type = FT; - matrix_solver_SOR_mat_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, std::size_t size) - : matrix_solver_direct_t<FT, SIZE>(anetlist, name, matrix_solver_t::ASCENDING, params, size) - , m_Vdelta(*this, "m_Vdelta", std::vector<float_type>(size)) - , m_omega(*this, "m_omega", params->m_gs_sor) - , m_lp_fact(*this, "m_lp_fact", 0) + matrix_solver_SOR_mat_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver_parameters_t *params, std::size_t size) + : matrix_solver_direct_t<FT, SIZE>(main_solver, name, nets, params, size) + , m_omega(*this, "m_omega", static_cast<float_type>(params->m_gs_sor)) { } - void vsetup(analog_net_t::list_t &nets) override; - - unsigned vsolve_non_dynamic(const bool newton_raphson) override; + void upstream_solve_non_dynamic() override; private: - //state_var<float_type[storage_N]> m_Vdelta; - state_var<std::vector<float_type>> m_Vdelta; - state_var<float_type> m_omega; - state_var<float_type> m_lp_fact; - }; // ---------------------------------------------------------------------------------------- @@ -58,79 +50,21 @@ namespace devices // ---------------------------------------------------------------------------------------- template <typename FT, int SIZE> - void matrix_solver_SOR_mat_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets) - { - matrix_solver_direct_t<FT, SIZE>::vsetup(nets); - } - - #if 0 - //FIXME: move to solve_base - template <unsigned m_N, unsigned storage_N> - float_type matrix_solver_SOR_mat_t<m_N, storage_N>::vsolve() - { - /* - * enable linear prediction on first newton pass - */ - - if (this->m_params->use_linear_prediction) - for (unsigned k = 0; k < this->size(); k++) - { - this->m_last_V[k] = this->m_nets[k]->m_cur_Analog; - this->m_nets[k]->m_cur_Analog = this->m_nets[k]->m_cur_Analog + this->m_Vdelta[k] * this->current_timestep() * m_lp_fact; - } - else - for (unsigned k = 0; k < this->size(); k++) - { - this->m_last_V[k] = this->m_nets[k]->m_cur_Analog; - } - - this->solve_base(this); - - if (this->m_params->use_linear_prediction) - { - float_type sq = 0; - float_type sqo = 0; - const float_type rez_cts = 1.0 / this->current_timestep(); - for (unsigned k = 0; k < this->size(); k++) - { - const analog_net_t *n = this->m_nets[k]; - const float_type nv = (n->Q_Analog() - this->m_last_V[k]) * rez_cts ; - sq += nv * nv; - sqo += this->m_Vdelta[k] * this->m_Vdelta[k]; - this->m_Vdelta[k] = nv; - } - - // FIXME: used to be 1e90, but this would not be compatible with float - if (sqo > NL_FCONST(1e-20)) - m_lp_fact = std::min(std::sqrt(sq/sqo), (float_type) 2.0); - else - m_lp_fact = NL_FCONST(0.0); - } - - - return this->compute_next_timestep(); - } - #endif - - template <typename FT, int SIZE> - unsigned matrix_solver_SOR_mat_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) + void matrix_solver_SOR_mat_t<FT, SIZE>::upstream_solve_non_dynamic() { - /* The matrix based code looks a lot nicer but actually is 30% slower than - * the optimized code which works directly on the data structures. - * Need something like that for gaussian elimination as well. - */ - + // The matrix based code looks a lot nicer but actually is 30% slower than + // the optimized code which works directly on the data structures. + // Need something like that for gaussian elimination as well. const std::size_t iN = this->size(); - this->build_LE_A(*this); - this->build_LE_RHS(*this); + this->clear_square_mat(this->m_A); + this->fill_matrix_and_rhs(); bool resched = false; unsigned resched_cnt = 0; - #if 0 static int ws_cnt = 0; ws_cnt++; @@ -142,16 +76,16 @@ namespace devices for (int k = 0; k < iN; k++) { #if 0 - float_type akk = std::abs(this->m_A[k][k]); + float_type akk = plib::abs(this->m_A[k][k]); if ( akk > lambdaN) lambdaN = akk; if (akk < lambda1) lambda1 = akk; #else - float_type akk = std::abs(this->m_A[k][k]); + float_type akk = plib::abs(this->m_A[k][k]); float_type s = 0.0; for (int i=0; i<iN; i++) - s = s + std::abs(this->m_A[k][i]); + s = s + plib::abs(this->m_A[k][i]); akk = s / akk - 1.0; if ( akk > lambdaN) lambdaN = akk; @@ -166,65 +100,58 @@ namespace devices #endif for (std::size_t k = 0; k < iN; k++) - this->m_new_V[k] = this->m_nets[k]->Q_Analog(); + this->m_new_V[k] = static_cast<float_type>(this->m_terms[k].getV()); do { resched = false; - float_type cerr = 0.0; + FT cerr = plib::constants<FT>::zero(); for (std::size_t k = 0; k < iN; k++) { float_type Idrive = 0; - const auto *p = this->m_terms[k]->m_nz.data(); - const std::size_t e = this->m_terms[k]->m_nz.size(); + const auto *p = this->m_terms[k].m_nz.data(); + const std::size_t e = this->m_terms[k].m_nz.size(); for (std::size_t i = 0; i < e; i++) - Idrive = Idrive + this->A(k,p[i]) * this->m_new_V[p[i]]; + Idrive = Idrive + this->m_A[k][p[i]] * this->m_new_V[p[i]]; - FT w = m_omega / this->A(k,k); + FT w = m_omega / this->m_A[k][k]; if (this->m_params.m_use_gabs) { - FT gabs_t = 0.0; + FT gabs_t = plib::constants<FT>::zero(); for (std::size_t i = 0; i < e; i++) if (p[i] != k) - gabs_t = gabs_t + std::abs(this->A(k,p[i])); + gabs_t = gabs_t + plib::abs(this->m_A[k][p[i]]); gabs_t *= plib::constants<FT>::one(); // derived by try and error - if (gabs_t > this->A(k,k)) + if (gabs_t > this->m_A[k][k]) { - w = plib::constants<FT>::one() / (this->A(k,k) + gabs_t); + w = plib::constants<FT>::one() / (this->m_A[k][k] + gabs_t); } } - const float_type delta = w * (this->RHS(k) - Idrive) ; - cerr = std::max(cerr, std::abs(delta)); + const float_type delta = w * (this->m_RHS[k] - Idrive) ; + cerr = std::max(cerr, plib::abs(delta)); this->m_new_V[k] += delta; } - if (cerr > this->m_params.m_accuracy) + if (cerr > static_cast<float_type>(this->m_params.m_accuracy)) { resched = true; } resched_cnt++; } while (resched && (resched_cnt < this->m_params.m_gs_loops)); - this->m_stat_calculations++; this->m_iterative_total += resched_cnt; if (resched) { this->m_iterative_fail++; - return matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(newton_raphson); + matrix_solver_direct_t<FT, SIZE>::solve_non_dynamic(); } - - const float_type err = (newton_raphson ? this->delta(this->m_new_V) : 0.0); - this->store(this->m_new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; - } -} // namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_GAUSS_SEIDEL_H_ */ +#endif // NLD_MS_SOR_MAT_ diff --git a/src/lib/netlist/solver/nld_ms_w.h b/src/lib/netlist/solver/nld_ms_w.h index a01fc239938..b5b58f4ebe7 100644 --- a/src/lib/netlist/solver/nld_ms_w.h +++ b/src/lib/netlist/solver/nld_ms_w.h @@ -1,379 +1,360 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_ms_direct.h - * - * - * Woodbury Solver - * - * Computes the updated solution of A given that the change in A is - * - * A <- A + (U x transpose(V)) U,V matrices - * - * The approach is describes in "Numerical Recipes in C", Second edition, Page 75ff - * - * Whilst the book proposes to invert the matrix R=(I+transpose(V)*Z) we define - * - * w = transpose(V)*y - * a = R^-1 * w - * - * and consequently - * - * R * a = w - * - * And solve for a using Gaussian elimination. This is a lot faster. - * - * One fact omitted in the book is the fact that actually the matrix Z which contains - * in it's columns the solutions of - * - * A * zk = uk - * - * for uk being unit vectors for full rank (max(k) == n) is identical to the - * inverse of A. - * - * The approach performs relatively well for matrices up to n ~ 40 (kidniki using frontiers). - * Kidniki without frontiers has n==88. Here, the average number of Newton-Raphson - * loops increase to 20. It looks like that the approach for larger matrices - * introduces numerical instability. - */ #ifndef NLD_MS_W_H_ #define NLD_MS_W_H_ -#include "nld_matrix_solver.h" -#include "nld_solver.h" +// Names +// spell-checker: words Woodbury, Raphson, +// +// Specific technical terms +// spell-checker: words Cgso, Cgdo, Cgbo, Cjsw, Mjsw, Ucrit, Uexp, Utra, Neff, Tnom, capval, Udsat, Utst + + +/// +/// \file nld_ms_direct.h +/// +/// Woodbury Solver +/// +/// Computes the updated solution of A given that the change in A is +/// +/// A <- A + (U x transpose(V)) U,V matrices +/// +/// The approach is describes in "Numerical Recipes in C", Second edition, Page 75ff +/// +/// Whilst the book proposes to invert the matrix R=(I+transpose(V)*Z) we define +/// +/// w = transpose(V)*y +/// a = R^-1 * w +/// +/// and consequently +/// +/// R * a = w +/// +/// And solve for a using Gaussian elimination. This is a lot faster. +/// +/// One fact omitted in the book is the fact that actually the matrix Z which contains +/// in it's columns the solutions of +/// +/// A * zk = uk +/// +/// for uk being unit vectors for full rank (max(k) == n) is identical to the +/// inverse of A. +/// +/// The approach performs relatively well for matrices up to n ~ 40 (`kidniki` using frontiers). +/// `Kidniki` without frontiers has n==88. Here, the average number of Newton-Raphson +/// loops increase to 20. It looks like that the approach for larger matrices +/// introduces numerical instability. +/// + +#include "nld_matrix_solver_ext.h" #include "plib/vector_ops.h" #include <algorithm> -namespace netlist +namespace netlist::solver { - namespace devices - { - -template <typename FT, int SIZE> -class matrix_solver_w_t: public matrix_solver_t -{ - friend class matrix_solver_t; - -public: - using float_ext_type = FT; - using float_type = FT; - - // FIXME: dirty hack to make this compile - static constexpr const std::size_t storage_N = 100; - - matrix_solver_w_t(netlist_state_t &anetlist, const pstring &name, const solver_parameters_t *params, const std::size_t size); - - void vsetup(analog_net_t::list_t &nets) override; - void reset() override { matrix_solver_t::reset(); } - -protected: - unsigned vsolve_non_dynamic(const bool newton_raphson) override; - unsigned solve_non_dynamic(const bool newton_raphson); - - constexpr std::size_t size() const { return m_dim; } - - void LE_invert(); - - template <typename T> - void LE_compute_x(T & x); - - - template <typename T1, typename T2> - float_ext_type &A(const T1 &r, const T2 &c) { return m_A[r][c]; } - template <typename T1, typename T2> - float_ext_type &W(const T1 &r, const T2 &c) { return m_W[r][c]; } - - /* access to Ainv for fixed columns over row, there store transposed */ - template <typename T1, typename T2> - float_ext_type &Ainv(const T1 &r, const T2 &c) { return m_Ainv[c][r]; } - template <typename T1> - float_ext_type &RHS(const T1 &r) { return m_RHS[r]; } + template <typename FT, int SIZE> + class matrix_solver_w_t: public matrix_solver_ext_t<FT, SIZE> + { + public: + using float_ext_type = FT; + using float_type = FT; + + // FIXME: dirty hack to make this compile + static constexpr const std::size_t storage_N = 100; + + matrix_solver_w_t(devices::nld_solver &main_solver, const pstring &name, + const matrix_solver_t::net_list_t &nets, + const solver_parameters_t *params, const std::size_t size) + : matrix_solver_ext_t<FT, SIZE>(main_solver, name, nets, params, size) + , m_cnt(0) + { + this->build_mat_ptr(m_A); + } - template <typename T1, typename T2> - float_ext_type &lA(const T1 &r, const T2 &c) { return m_lA[r][c]; } + void reset() override { matrix_solver_t::reset(); } + protected: + void upstream_solve_non_dynamic() override; -private: - static constexpr std::size_t m_pitch = ((( storage_N) + 7) / 8) * 8; - float_ext_type m_A[storage_N][m_pitch]; - float_ext_type m_Ainv[storage_N][m_pitch]; - float_ext_type m_W[storage_N][m_pitch]; - std::array<float_ext_type, storage_N> m_RHS; // right hand side - contains currents + void LE_invert(); - float_ext_type m_lA[storage_N][m_pitch]; + template <typename T> + void LE_compute_x(T & x); - /* temporary */ - float_type H[storage_N][m_pitch] ; - std::array<unsigned, storage_N> rows; - unsigned cols[storage_N][m_pitch]; - std::array<unsigned, storage_N> colcount; + template <typename T1, typename T2> + float_ext_type &A(const T1 &r, const T2 &c) { return m_A[r][c]; } + template <typename T1, typename T2> + float_ext_type &W(const T1 &r, const T2 &c) { return m_W[r][c]; } - unsigned m_cnt; + // access to the inverted matrix for fixed columns over row, values stored transposed + template <typename T1, typename T2> + float_ext_type &Ainv(const T1 &r, const T2 &c) { return m_Ainv[c][r]; } + template <typename T1> + float_ext_type &RHS(const T1 &r) { return this->m_RHS[r]; } - //float_ext_type m_RHSx[storage_N]; - const std::size_t m_dim; + template <typename T1, typename T2> + float_ext_type &lA(const T1 &r, const T2 &c) { return m_lA[r][c]; } -}; -// ---------------------------------------------------------------------------------------- -// matrix_solver_direct -// ---------------------------------------------------------------------------------------- + private: + void solve_non_dynamic(); -template <typename FT, int SIZE> -void matrix_solver_w_t<FT, SIZE>::vsetup(analog_net_t::list_t &nets) -{ - matrix_solver_t::setup_base(nets); + template <typename T, std::size_t N, std::size_t M> + using array2D = std::array<std::array<T, M>, N>; + static constexpr std::size_t m_pitch = ((( storage_N) + 7) / 8) * 8; + array2D<float_ext_type, storage_N, m_pitch> m_A; + array2D<float_ext_type, storage_N, m_pitch> m_Ainv; + array2D<float_ext_type, storage_N, m_pitch> m_W; - // FIXME: This shouldn't be necessary, recalculate on each entry ... - for (std::size_t k = 0; k < size(); k++) - state().save(*this, RHS(k), this->name(), plib::pfmt("RHS.{1}")(k)); -} + array2D<float_ext_type, storage_N, m_pitch> m_lA; + // temporary + array2D<float_ext_type, storage_N, m_pitch> H; + std::array<unsigned, storage_N> rows; + array2D<unsigned, storage_N, m_pitch> cols; + std::array<unsigned, storage_N> col_count; + unsigned m_cnt; + }; -template <typename FT, int SIZE> -void matrix_solver_w_t<FT, SIZE>::LE_invert() -{ - const std::size_t kN = size(); + // ---------------------------------------------------------------------------------------- + // matrix_solver_direct + // ---------------------------------------------------------------------------------------- - for (std::size_t i = 0; i < kN; i++) + template <typename FT, int SIZE> + void matrix_solver_w_t<FT, SIZE>::LE_invert() { - for (std::size_t j = 0; j < kN; j++) - { - W(i,j) = lA(i,j) = A(i,j); - Ainv(i,j) = 0.0; - } - Ainv(i,i) = 1.0; - } - /* down */ - for (std::size_t i = 0; i < kN; i++) - { - /* FIXME: Singular matrix? */ - const float_type f = 1.0 / W(i,i); - const auto * const p = m_terms[i]->m_nzrd.data(); - const size_t e = m_terms[i]->m_nzrd.size(); - - /* Eliminate column i from row j */ + const std::size_t kN = this->size(); - const auto * const pb = m_terms[i]->m_nzbd.data(); - const size_t eb = m_terms[i]->m_nzbd.size(); - for (std::size_t jb = 0; jb < eb; jb++) + for (std::size_t i = 0; i < kN; i++) { - const auto j = pb[jb]; - const float_type f1 = - W(j,i) * f; - if (f1 != 0.0) + for (std::size_t j = 0; j < kN; j++) { - for (std::size_t k = 0; k < e; k++) - W(j,p[k]) += W(i,p[k]) * f1; - for (std::size_t k = 0; k <= i; k ++) - Ainv(j,k) += Ainv(i,k) * f1; + W(i,j) = lA(i,j) = A(i,j); + Ainv(i,j) = plib::constants<FT>::zero(); } + Ainv(i,i) = plib::constants<FT>::one(); } - } - /* up */ - for (std::size_t i = kN; i-- > 0; ) - { - /* FIXME: Singular matrix? */ - const float_type f = 1.0 / W(i,i); - for (std::size_t j = i; j-- > 0; ) + // down + for (std::size_t i = 0; i < kN; i++) { - const float_type f1 = - W(j,i) * f; - if (f1 != 0.0) + // FIXME: Singular matrix? + const float_type f = plib::reciprocal(W(i,i)); + const auto * const p = this->m_terms[i].m_nzrd.data(); + const size_t e = this->m_terms[i].m_nzrd.size(); + + // Eliminate column i from row j + + const auto * const pb = this->m_terms[i].m_nzbd.data(); + const size_t eb = this->m_terms[i].m_nzbd.size(); + for (std::size_t jb = 0; jb < eb; jb++) { - for (std::size_t k = i; k < kN; k++) - W(j,k) += W(i,k) * f1; - for (std::size_t k = 0; k < kN; k++) - Ainv(j,k) += Ainv(i,k) * f1; + const auto j = pb[jb]; + const float_type f1 = - W(j,i) * f; + // FIXME: comparison to zero + if (f1 != plib::constants<float_type>::zero()) + { + for (std::size_t k = 0; k < e; k++) + W(j,p[k]) += W(i,p[k]) * f1; + for (std::size_t k = 0; k <= i; k ++) + Ainv(j,k) += Ainv(i,k) * f1; + } } } - for (std::size_t k = 0; k < kN; k++) + // up + for (std::size_t i = kN; i-- > 0; ) { - Ainv(i,k) *= f; + // FIXME: Singular matrix? + const float_type f = plib::reciprocal(W(i,i)); + for (std::size_t j = i; j-- > 0; ) + { + const float_type f1 = - W(j,i) * f; + // FIXME: comparison to zero + if (f1 != plib::constants<float_type>::zero()) + { + for (std::size_t k = i; k < kN; k++) + W(j,k) += W(i,k) * f1; + for (std::size_t k = 0; k < kN; k++) + Ainv(j,k) += Ainv(i,k) * f1; + } + } + for (std::size_t k = 0; k < kN; k++) + { + Ainv(i,k) *= f; + } } } -} - -template <typename FT, int SIZE> -template <typename T> -void matrix_solver_w_t<FT, SIZE>::LE_compute_x( - T & x) -{ - const std::size_t kN = size(); - - for (std::size_t i=0; i<kN; i++) - x[i] = 0.0; - for (std::size_t k=0; k<kN; k++) + template <typename FT, int SIZE> + template <typename T> + void matrix_solver_w_t<FT, SIZE>::LE_compute_x( + T & x) { - const float_type f = RHS(k); + const std::size_t kN = this->size(); for (std::size_t i=0; i<kN; i++) - x[i] += Ainv(i,k) * f; - } -} + x[i] = plib::constants<FT>::zero(); + for (std::size_t k=0; k<kN; k++) + { + const float_type f = RHS(k); -template <typename FT, int SIZE> -unsigned matrix_solver_w_t<FT, SIZE>::solve_non_dynamic(const bool newton_raphson) -{ - const auto iN = size(); + for (std::size_t i=0; i<kN; i++) + x[i] += Ainv(i,k) * f; + } + } - std::array<float_type, storage_N> new_V; // = { 0.0 }; - if ((m_cnt % 50) == 0) + template <typename FT, int SIZE> + void matrix_solver_w_t<FT, SIZE>::solve_non_dynamic() { - /* complete calculation */ - this->LE_invert(); - this->LE_compute_x(new_V); - } - else - { - /* Solve Ay = b for y */ - this->LE_compute_x(new_V); - - /* determine changed rows */ + const auto iN = this->size(); - unsigned rowcount=0; - #define VT(r,c) (A(r,c) - lA(r,c)) + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) + std::array<float_type, storage_N> t; // FIXME: convert to member + // NOLINTNEXTLINE(cppcoreguidelines-pro-type-member-init) + std::array<float_type, storage_N> w; - for (unsigned row = 0; row < iN; row ++) + if ((m_cnt % 50) == 0) { - unsigned cc=0; - auto &nz = m_terms[row]->m_nz; - for (auto & col : nz) - { - if (A(row,col) != lA(row,col)) - cols[rowcount][cc++] = col; - } - if (cc > 0) - { - colcount[rowcount] = cc; - rows[rowcount++] = row; - } + // complete calculation + this->LE_invert(); + this->LE_compute_x(this->m_new_V); } - if (rowcount > 0) + else { - /* construct w = transform(V) * y - * dim: rowcount x iN - * */ - std::array<float_type, storage_N> w; - for (unsigned i = 0; i < rowcount; i++) + // Solve Ay = b for y + this->LE_compute_x(this->m_new_V); + + // determine changed rows + + unsigned row_count=0; + #define VT(r,c) (A(r,c) - lA(r,c)) + + for (unsigned row = 0; row < iN; row ++) { - const unsigned r = rows[i]; - double tmp = 0.0; - for (unsigned k = 0; k < iN; k++) - tmp += VT(r,k) * new_V[k]; - w[i] = tmp; + unsigned cc=0; + auto &nz = this->m_terms[row].m_nz; + for (auto & col : nz) + { + if (A(row,col) != lA(row,col)) + cols[row_count][cc++] = col; + } + if (cc > 0) + { + col_count[row_count] = cc; + rows[row_count++] = row; + } } + if (row_count > 0) + { + // construct w = transform(V) * y + // dim: row_count x iN + // + for (unsigned i = 0; i < row_count; i++) + { + const unsigned r = rows[i]; + FT tmp = plib::constants<FT>::zero(); + for (unsigned k = 0; k < iN; k++) + tmp += VT(r,k) * this->m_new_V[k]; + w[i] = tmp; + } + + for (unsigned i = 0; i < row_count; i++) + for (unsigned k=0; k< row_count; k++) + H[i][k] = plib::constants<FT>::zero(); - for (unsigned i = 0; i < rowcount; i++) - for (unsigned k=0; k< rowcount; k++) - H[i][k] = 0.0; + for (unsigned i = 0; i < row_count; i++) + H[i][i] = plib::constants<FT>::one(); + // Construct H = (I + VT*Z) + for (unsigned i = 0; i < row_count; i++) + for (unsigned k=0; k< col_count[i]; k++) + { + const unsigned col = cols[i][k]; + float_type f = VT(rows[i],col); + // FIXME: comparison to zero + if (f != plib::constants<float_type>::zero()) + for (unsigned j= 0; j < row_count; j++) + H[i][j] += f * Ainv(col,rows[j]); + } - for (unsigned i = 0; i < rowcount; i++) - H[i][i] = 1.0; - /* Construct H = (I + VT*Z) */ - for (unsigned i = 0; i < rowcount; i++) - for (unsigned k=0; k< colcount[i]; k++) + // Gaussian elimination of H + for (unsigned i = 0; i < row_count; i++) { - const unsigned col = cols[i][k]; - float_type f = VT(rows[i],col); - if (f!=0.0) - for (unsigned j= 0; j < rowcount; j++) - H[i][j] += f * Ainv(col,rows[j]); + // FIXME: comparison to zero + if (H[i][i] == plib::constants<float_type>::zero()) + plib::perrlogger("{} H singular\n", this->name()); + const float_type f = plib::reciprocal(H[i][i]); + for (unsigned j = i+1; j < row_count; j++) + { + const float_type f1 = - f * H[j][i]; + + // FIXME: comparison to zero + if (f1 != plib::constants<float_type>::zero()) + { + float_type *pj = &H[j][i+1]; + const float_type *pi = &H[i][i+1]; + for (unsigned k = 0; k < row_count-i-1; k++) + pj[k] += f1 * pi[k]; + //H[j][k] += f1 * H[i][k]; + w[j] += f1 * w[i]; + } + } } - - /* Gaussian elimination of H */ - for (unsigned i = 0; i < rowcount; i++) - { - if (H[i][i] == 0.0) - plib::perrlogger("{} H singular\n", this->name()); - const float_type f = 1.0 / H[i][i]; - for (unsigned j = i+1; j < rowcount; j++) + // Back substitution + //inv(H) w = t w = H t + for (unsigned j = row_count; j-- > 0; ) { - const float_type f1 = - f * H[j][i]; + float_type tmp = 0; + const float_type *pj = &H[j][j+1]; + const float_type *tj = &t[j+1]; + for (unsigned k = 0; k < row_count-j-1; k++) + tmp += pj[k] * tj[k]; + //tmp += H[j][k] * t[k]; + t[j] = (w[j] - tmp) / H[j][j]; + } - if (f1!=0.0) + // x = y - Zt + for (unsigned i=0; i<iN; i++) + { + float_type tmp = plib::constants<FT>::zero(); + for (unsigned j=0; j<row_count;j++) { - float_type *pj = &H[j][i+1]; - const float_type *pi = &H[i][i+1]; - for (unsigned k = 0; k < rowcount-i-1; k++) - pj[k] += f1 * pi[k]; - //H[j][k] += f1 * H[i][k]; - w[j] += f1 * w[i]; + const unsigned row = rows[j]; + tmp += Ainv(i,row) * t[j]; } + this->m_new_V[i] -= tmp; } } - /* Back substitution */ - //inv(H) w = t w = H t - std::array<float_type, storage_N> t; // FIXME: convert to member - for (unsigned j = rowcount; j-- > 0; ) - { - float_type tmp = 0; - const float_type *pj = &H[j][j+1]; - const float_type *tj = &t[j+1]; - for (unsigned k = 0; k < rowcount-j-1; k++) - tmp += pj[k] * tj[k]; - //tmp += H[j][k] * t[k]; - t[j] = (w[j] - tmp) / H[j][j]; - } + } + m_cnt++; - /* x = y - Zt */ + if (false) // NOLINT for (unsigned i=0; i<iN; i++) { - float_type tmp = 0.0; - for (unsigned j=0; j<rowcount;j++) + float_type tmp = plib::constants<FT>::zero(); + for (unsigned j=0; j<iN; j++) { - const unsigned row = rows[j]; - tmp += Ainv(i,row) * t[j]; + tmp += A(i,j) * this->m_new_V[j]; } - new_V[i] -= tmp; + if (plib::abs(tmp-RHS(i)) > static_cast<float_type>(1e-6)) + plib::perrlogger("{} failed on row {}: {} RHS: {}\n", this->name(), i, plib::abs(tmp-RHS(i)), RHS(i)); } - } } - m_cnt++; - - if (false) - for (unsigned i=0; i<iN; i++) - { - float_type tmp = 0.0; - for (unsigned j=0; j<iN; j++) - { - tmp += A(i,j) * new_V[j]; - } - if (std::abs(tmp-RHS(i)) > 1e-6) - plib::perrlogger("{} failed on row {}: {} RHS: {}\n", this->name(), i, std::abs(tmp-RHS(i)), RHS(i)); - } - const float_type err = (newton_raphson ? delta(new_V) : 0.0); - store(new_V); - return (err > this->m_params.m_accuracy) ? 2 : 1; -} + template <typename FT, int SIZE> + void matrix_solver_w_t<FT, SIZE>::upstream_solve_non_dynamic() + { + this->clear_square_mat(this->m_A); + this->fill_matrix_and_rhs(); -template <typename FT, int SIZE> -unsigned matrix_solver_w_t<FT, SIZE>::vsolve_non_dynamic(const bool newton_raphson) -{ - this->build_LE_A(*this); - this->build_LE_RHS(*this); - - this->m_stat_calculations++; - return this->solve_non_dynamic(newton_raphson); -} - -template <typename FT, int SIZE> -matrix_solver_w_t<FT, SIZE>::matrix_solver_w_t(netlist_state_t &anetlist, const pstring &name, - const solver_parameters_t *params, const std::size_t size) - : matrix_solver_t(anetlist, name, NOSORT, params) - , m_cnt(0) - , m_dim(size) -{ -} + this->solve_non_dynamic(); + } - } //namespace devices -} // namespace netlist +} // namespace netlist::solver -#endif /* NLD_MS_DIRECT_H_ */ +#endif // NLD_MS_DIRECT_H_ diff --git a/src/lib/netlist/solver/nld_solver.cpp b/src/lib/netlist/solver/nld_solver.cpp index 0aa7e6f584c..d7381cc813a 100644 --- a/src/lib/netlist/solver/nld_solver.cpp +++ b/src/lib/netlist/solver/nld_solver.cpp @@ -1,38 +1,14 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_solver.c - * - */ - -/* Commented out for now. Relatively low number of terminals / nets make - * the vectorizations fast-math enables pretty expensive - */ - -#if 0 -#pragma GCC optimize "-ftree-vectorize" -#pragma GCC optimize "-ffast-math" -#pragma GCC optimize "-funsafe-math-optimizations" -#pragma GCC optimize "-funroll-loops" -#pragma GCC optimize "-funswitch-loops" -#pragma GCC optimize "-fstrict-aliasing" -#pragma GCC optimize "tree-vectorizer-verbose=7" -#pragma GCC optimize "opt-info-vec" -#pragma GCC optimize "opt-info-vec-missed" -//#pragma GCC optimize "tree-parallelize-loops=4" -#pragma GCC optimize "variable-expansion-in-unroller" -#pragma GCC optimize "unsafe-loop-optimizations" -#pragma GCC optimize "vect-cost-model" -#pragma GCC optimize "variable-expansion-in-unroller" -#pragma GCC optimize "tree-loop-if-convert-stores" -#pragma GCC optimize "tree-loop-distribution" -#pragma GCC optimize "tree-loop-im" -#pragma GCC optimize "tree-loop-ivcanon" -#pragma GCC optimize "ivopts" -#endif -#include "netlist/nl_lists.h" -#include "netlist/nl_factory.h" +// Names +// spell-checker: words Woodbury, + +#include "nld_solver.h" + +#include "nl_errstr.h" +#include "nl_factory.h" +#include "nl_setup.h" // FIXME: only needed for splitter code #include "nld_matrix_solver.h" #include "nld_ms_direct.h" #include "nld_ms_direct1.h" @@ -43,25 +19,48 @@ #include "nld_ms_sor.h" #include "nld_ms_sor_mat.h" #include "nld_ms_w.h" -#include "nld_solver.h" + +#include "core/setup.h" + #include "plib/pomp.h" +#include "plib/ptimed_queue.h" #include <algorithm> -#include <cmath> +#include <type_traits> -namespace netlist -{ -namespace devices +namespace netlist::devices { - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- // solver - // ---------------------------------------------------------------------------------------- + // ------------------------------------------------------------------------- + + nld_solver::nld_solver(constructor_param_t data) + : device_t(data) + , m_fb_step(*this, "FB_step", NETLIB_DELEGATE(fb_step<false>)) + , m_Q_step(*this, "Q_step") + , m_params(*this, "", solver::solver_parameter_defaults::get_instance()) + , m_queue( + this->state().pool(), config::max_solver_queue_size(), + queue_type::id_delegate(&NETLIB_NAME(solver)::get_solver_id, this), + queue_type::obj_delegate(&NETLIB_NAME(solver)::solver_by_id, this)) + { + // internal stuff + state().save(*this, + static_cast<plib::state_manager_t::callback_t &>(m_queue), + this->name(), "m_queue"); + + connect("FB_step", "Q_step"); + } NETLIB_RESET(solver) { + if (exec().stats_enabled()) + m_fb_step.set_delegate(NETLIB_DELEGATE(fb_step<true>)); for (auto &s : m_mat_solvers) s->reset(); + for (auto &s : m_mat_solvers) + m_queue.push<false>({netlist_time_ext::zero(), s.get()}); } void NETLIB_NAME(solver)::stop() @@ -70,352 +69,541 @@ namespace devices s->log_stats(); } - NETLIB_UPDATE(solver) +#if 1 + + template <bool KEEP_STATS> + NETLIB_HANDLER(solver, fb_step) + { + const netlist_time_ext now(exec().time()); + const std::size_t nthreads = m_params.m_parallel() < 2 + ? 1 + : std::min( + static_cast<std::size_t>( + m_params.m_parallel()), + plib::omp::get_max_threads()); + const netlist_time_ext sched( + now + + (nthreads <= 1 ? netlist_time_ext::zero() + : netlist_time_ext::from_nsec(100))); + plib::uninitialised_array<solver::matrix_solver_t *, + config::max_solver_queue_size::value> + tmp; // NOLINT + plib::uninitialised_array<netlist_time, + config::max_solver_queue_size::value> + nt; // NOLINT + std::size_t p = 0; + + while (!m_queue.empty()) + { + const auto t = m_queue.top().exec_time(); + auto * o = m_queue.top().object(); + if (t != now) + if (t > sched) + break; + tmp[p++] = o; + m_queue.pop(); + } + + // FIXME: Disabled for now since parallel processing will decrease + // performance + // for tested applications. More testing required here + if (true || nthreads < 2) + { + if (!KEEP_STATS) + { + for (std::size_t i = 0; i < p; i++) + nt[i] = tmp[i]->solve(now, "no-parallel"); + } + else + { + stats()->m_stat_total_time.stop(); + for (std::size_t i = 0; i < p; i++) + { + tmp[i]->stats()->m_stat_call_count.inc(); + auto g(tmp[i]->stats()->m_stat_total_time.guard()); + nt[i] = tmp[i]->solve(now, "no-parallel"); + } + stats()->m_stat_total_time.start(); + } + + for (std::size_t i = 0; i < p; i++) + { + if (nt[i] != netlist_time::zero()) + m_queue.push<false>({now + nt[i], tmp[i]}); + tmp[i]->update_inputs(); + } + } + else + { + plib::omp::set_num_threads(nthreads); + plib::omp::for_static(static_cast<std::size_t>(0), p, + [&tmp, &nt, now](std::size_t i) + { nt[i] = tmp[i]->solve(now, "parallel"); }); + for (std::size_t i = 0; i < p; i++) + { + if (nt[i] != netlist_time::zero()) + m_queue.push<false>({now + nt[i], tmp[i]}); + tmp[i]->update_inputs(); + } + } + if (!m_queue.empty()) + m_Q_step.net().toggle_and_push_to_queue( + static_cast<netlist_time>(m_queue.top().exec_time() - now)); + } + + void NETLIB_NAME(solver)::reschedule(solver::matrix_solver_t *solv, + netlist_time ts) + { + const netlist_time_ext now(exec().time()); + const netlist_time_ext sched(now + ts); + m_queue.remove<false>(solv); + m_queue.push<false>({sched, solv}); + + if (m_Q_step.net().is_queued()) + { + if (m_Q_step.net().next_scheduled_time() > sched) + m_Q_step.net().toggle_and_push_to_queue(ts); + } + else + m_Q_step.net().toggle_and_push_to_queue(ts); + } +#else + NETLIB_HANDLER(solver, fb_step) { if (m_params.m_dynamic_ts) return; - netlist_time now(exec().time()); - /* force solving during start up if there are no time-step devices */ - /* FIXME: Needs a more elegant solution */ - bool force_solve = (now < netlist_time::from_double(2 * m_params.m_max_timestep)); + netlist_time_ext now(exec().time()); + // force solving during start up if there are no time-step devices + // FIXME: Needs a more elegant solution + bool force_solve = (now < netlist_time_ext::from_fp< + decltype(m_params.m_max_time_step)>( + 2 * m_params.m_max_time_step)); - std::size_t nthreads = std::min(static_cast<std::size_t>(m_parallel()), plib::omp::get_max_threads()); + std::size_t nthreads = std::min( + static_cast<std::size_t>(m_params.m_parallel()), + plib::omp::get_max_threads()); - std::vector<matrix_solver_t *> &solvers = (force_solve ? m_mat_solvers_all : m_mat_solvers_timestepping); + std::vector<solver_entry *> + &solvers = (force_solve ? m_mat_solvers_all + : m_mat_solvers_time_stepping); if (nthreads > 1 && solvers.size() > 1) { plib::omp::set_num_threads(nthreads); - plib::omp::for_static(static_cast<std::size_t>(0), solvers.size(), [&solvers, now](std::size_t i) - { - const netlist_time ts = solvers[i]->solve(now); - plib::unused_var(ts); + plib::omp::for_static( + static_cast<std::size_t>(0), solvers.size(), + [&solvers, now](std::size_t i) { + [[maybe_unused]] const netlist_time ts = solvers[i] + ->ptr->solve( + now); }); } else - for (auto & solver : solvers) + for (auto &solver : solvers) { - const netlist_time ts = solver->solve(now); - plib::unused_var(ts); + [[maybe_unused]] const netlist_time ts = solver->ptr->solve( + now); } - for (auto & solver : solvers) - solver->update_inputs(); + for (auto &solver : solvers) + solver->ptr->update_inputs(); - /* step circuit */ + // step circuit if (!m_Q_step.net().is_queued()) { - m_Q_step.net().toggle_and_push_to_queue(netlist_time::from_double(m_params.m_max_timestep)); + m_Q_step.net().toggle_and_push_to_queue( + netlist_time::from_fp(m_params.m_max_time_step)); } } +#endif - template <class C> - pool_owned_ptr<matrix_solver_t> create_it(netlist_state_t &nl, pstring name, solver_parameters_t ¶ms, std::size_t size) + // FIXME: should be created in device space + template <class C, class A> + NETLIB_NAME(solver)::solver_ptr + create_it(A &arena, NETLIB_NAME(solver) &main_solver, pstring name, + NETLIB_NAME(solver)::net_list_t & nets, + const solver::solver_parameters_t *params, std::size_t size) { - return pool().make_poolptr<C>(nl, name, ¶ms, size); + return plib::make_unique<C>(arena, main_solver, name, nets, params, + size); } template <typename FT, int SIZE> - pool_owned_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver(std::size_t size, const pstring &solvername) + NETLIB_NAME(solver)::solver_ptr NETLIB_NAME(solver)::create_solver( + std::size_t size, const pstring &solver_name, + const solver::solver_parameters_t *params, + NETLIB_NAME(solver)::net_list_t & nets) { - if (m_method() == "SOR_MAT") - { - return create_it<matrix_solver_SOR_mat_t<FT, SIZE>>(state(), solvername, m_params, size); - //typedef matrix_solver_SOR_mat_t<m_N,storage_N> solver_sor_mat; - //return plib::make_unique<solver_sor_mat>(state(), solvername, &m_params, size); - } - else if (m_method() == "MAT_CR") - { - if (size > 0) // GCR always outperforms MAT solver - { - return create_it<matrix_solver_GCR_t<FT, SIZE>>(state(), solvername, m_params, size); - } - else - { - return create_it<matrix_solver_direct_t<FT, SIZE>>(state(), solvername, m_params, size); - } - } - else if (m_method() == "MAT") - { - return create_it<matrix_solver_direct_t<FT, SIZE>>(state(), solvername, m_params, size); - } - else if (m_method() == "SM") - { - /* Sherman-Morrison Formula */ - return create_it<matrix_solver_sm_t<FT, SIZE>>(state(), solvername, m_params, size); - } - else if (m_method() == "W") - { - /* Woodbury Formula */ - return create_it<matrix_solver_w_t<FT, SIZE>>(state(), solvername, m_params, size); - } - else if (m_method() == "SOR") - { - return create_it<matrix_solver_SOR_t<FT, SIZE>>(state(), solvername, m_params, size); - } - else if (m_method() == "GMRES") - { - return create_it<matrix_solver_GMRES_t<FT, SIZE>>(state(), solvername, m_params, size); - } - else + switch (params->m_method()) { - log().fatal(MF_UNKNOWN_SOLVER_TYPE(m_method())); - return pool_owned_ptr<matrix_solver_t>(); + case solver::matrix_type_e::MAT_CR: + return create_it<solver::matrix_solver_GCR_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); + case solver::matrix_type_e::MAT: + return create_it<solver::matrix_solver_direct_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); + case solver::matrix_type_e::GMRES: + return create_it<solver::matrix_solver_GMRES_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); +#if (NL_USE_ACADEMIC_SOLVERS) + case solver::matrix_type_e::SOR: + return create_it<solver::matrix_solver_SOR_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); + case solver::matrix_type_e::SOR_MAT: + return create_it<solver::matrix_solver_SOR_mat_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); + case solver::matrix_type_e::SM: + // Sherman-Morrison Formula + return create_it<solver::matrix_solver_sm_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); + case solver::matrix_type_e::W: + // Woodbury Formula + return create_it<solver::matrix_solver_w_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); +#else + // case solver::matrix_type_e::GMRES: + case solver::matrix_type_e::SOR: + case solver::matrix_type_e::SOR_MAT: + case solver::matrix_type_e::SM: + case solver::matrix_type_e::W: + state().log().warning(MW_SOLVER_METHOD_NOT_SUPPORTED( + params->m_method().name(), "MAT_CR")); + return create_it<solver::matrix_solver_GCR_t<FT, SIZE>>( + state().pool(), *this, solver_name, nets, params, size); +#endif } + return solver_ptr(); } - template <typename FT, int SIZE> - pool_owned_ptr<matrix_solver_t> NETLIB_NAME(solver)::create_solver_x(std::size_t size, const pstring &solvername) + template <typename FT> + NETLIB_NAME(solver)::solver_ptr NETLIB_NAME(solver)::create_solvers( + const pstring &sname, const solver::solver_parameters_t *params, + net_list_t &nets) { - if (SIZE > 0) - { - if (size == SIZE) - return create_solver<FT, SIZE>(size, solvername); - else - return this->create_solver_x<FT, SIZE-1>(size, solvername); - } - else + std::size_t net_count = nets.size(); + switch (net_count) { - if (size * 2 > -SIZE ) - return create_solver<FT, SIZE>(size, solvername); - else - return this->create_solver_x<FT, SIZE / 2>(size, solvername); +#if !defined(__EMSCRIPTEN__) + case 1: + return plib::make_unique<solver::matrix_solver_direct1_t<FT>>( + state().pool(), *this, sname, nets, params); + case 2: + return plib::make_unique<solver::matrix_solver_direct2_t<FT>>( + state().pool(), *this, sname, nets, params); + case 3: return create_solver<FT, 3>(3, sname, params, nets); + case 4: return create_solver<FT, 4>(4, sname, params, nets); + case 5: return create_solver<FT, 5>(5, sname, params, nets); + case 6: return create_solver<FT, 6>(6, sname, params, nets); + case 7: return create_solver<FT, 7>(7, sname, params, nets); + case 8: return create_solver<FT, 8>(8, sname, params, nets); +#endif + default: + log().info(MI_NO_SPECIFIC_SOLVER(net_count)); + if (net_count <= 16) + { + return create_solver<FT, -16>(net_count, sname, params, + nets); + } + if (net_count <= 32) + { + return create_solver<FT, -32>(net_count, sname, params, + nets); + } + if (net_count <= 64) + { + return create_solver<FT, -64>(net_count, sname, params, + nets); + } + if (net_count <= 128) + { + return create_solver<FT, -128>(net_count, sname, params, + nets); + } + if (net_count <= 256) + { + return create_solver<FT, -256>(net_count, sname, params, + nets); + } + if (net_count <= 512) + { + return create_solver<FT, -512>(net_count, sname, params, + nets); + } + return create_solver<FT, 0>(net_count, sname, params, nets); } } struct net_splitter { + void run(netlist_state_t &nl_state) + { + for (auto &net : nl_state.nets()) + { + nl_state.log().verbose("processing {1}", net->name()); + if (!net->is_rail_net() && !net->core_terms_empty()) + { + nl_state.log().verbose(" ==> not a rail net"); + // Must be an analog net + auto n = plib::dynamic_downcast<analog_net_t *>(net.get()); + nl_assert_always(bool(n), + "Unable to cast to analog_net_t &"); + if (!already_processed(*(*n))) + { + groupspre.emplace_back( + NETLIB_NAME(solver)::net_list_t()); + process_net(nl_state, *(*n)); + } + } + } + for (auto &g : groupspre) + if (!g.empty()) + groups.push_back(g); + } + + std::vector<NETLIB_NAME(solver)::net_list_t> groups; + private: bool already_processed(const analog_net_t &n) const { - /* no need to process rail nets - these are known variables */ - if (n.isRailNet()) + // no need to process rail nets - these are known variables + if (n.is_rail_net()) return true; - /* if it's already processed - no need to continue */ - for (auto & grp : groups) + // if it's already processed - no need to continue + for (const auto &grp : groups) if (plib::container::contains(grp, &n)) return true; return false; } - void process_net(analog_net_t &n) + bool check_if_processed_and_join(const analog_net_t &n) { - /* ignore empty nets. FIXME: print a warning message */ - if (n.num_cons() == 0) - return; - /* add the net */ - groups.back().push_back(&n); - /* process all terminals connected to this net */ - for (auto &term : n.core_terms()) + // no need to process rail nets - these are known variables + if (n.is_rail_net()) + return true; + // First check if it is in a previous group. + // In this case we need to merge this group into the current group + if (groupspre.size() > 1) { - /* only process analog terminals */ - if (term->is_type(detail::terminal_type::TERMINAL)) - { - auto *pt = static_cast<terminal_t *>(term); - /* check the connected terminal */ - analog_net_t &connected_net = pt->connected_terminal()->net(); - if (!already_processed(connected_net)) - process_net(connected_net); - } + for (std::size_t i = 0; i < groupspre.size() - 1; i++) + if (plib::container::contains(groupspre[i], &n)) + { + // copy all nets + for (auto &cn : groupspre[i]) + if (!plib::container::contains(groupspre.back(), + cn)) + groupspre.back().push_back(cn); + // clear + groupspre[i].clear(); + return true; + } } + // if it's already processed - no need to continue + if (!groupspre.empty() + && plib::container::contains(groupspre.back(), &n)) + return true; + return false; } - void run(netlist_state_t &netlist) + // NOLINTNEXTLINE(misc-no-recursion) + void process_net(netlist_state_t &nl_state, analog_net_t &n) { - for (auto & net : netlist.nets()) + // ignore empty nets. FIXME: print a warning message + nl_state.log().verbose("Net {}", n.name()); + auto terminals(n.core_terms_copy()); + + if (!terminals.empty()) { - netlist.log().debug("processing {1}\n", net->name()); - if (!net->isRailNet() && net->num_cons() > 0) + // add the net + groupspre.back().push_back(&n); + // process all terminals connected to this net + for (detail::core_terminal_t *term : terminals) { - netlist.log().debug(" ==> not a rail net\n"); - /* Must be an analog net */ - auto &n = *static_cast<analog_net_t *>(net.get()); - if (!already_processed(n)) + nl_state.log().verbose("Term {} {}", term->name(), + static_cast<int>(term->type())); + // only process analog terminals + if (term->is_type(detail::terminal_type::TERMINAL)) { - groups.emplace_back(analog_net_t::list_t()); - process_net(n); + auto pt = plib::dynamic_downcast<terminal_t *>(term); + nl_assert_always(bool(pt), + "Error casting *term to terminal_t &"); + // check the connected terminal + const auto *const connected_terminals + = nl_state.setup().get_connected_terminals(*(*pt)); + // NOLINTNEXTLINE proposal does not work for VS + for (auto ct = connected_terminals->begin(); + *ct != nullptr; ct++) + { + analog_net_t &connected_net = (*ct)->net(); + nl_state.log().verbose(" Connected net {}", + connected_net.name()); + if (!check_if_processed_and_join(connected_net)) + process_net(nl_state, connected_net); + } } } } } - std::vector<analog_net_t::list_t> groups; + std::vector<NETLIB_NAME(solver)::net_list_t> groupspre; }; void NETLIB_NAME(solver)::post_start() { - m_params.m_pivot = m_pivot(); - m_params.m_accuracy = m_accuracy(); - /* FIXME: Throw when negative */ - m_params.m_gs_loops = static_cast<unsigned>(m_gs_loops()); - m_params.m_nr_loops = static_cast<unsigned>(m_nr_loops()); - m_params.m_nr_recalc_delay = netlist_time::from_double(m_nr_recalc_delay()); - m_params.m_dynamic_lte = m_dynamic_lte(); - m_params.m_gs_sor = m_gs_sor(); - - m_params.m_min_timestep = m_dynamic_min_ts(); - m_params.m_dynamic_ts = (m_dynamic_ts() == 1 ? true : false); - m_params.m_max_timestep = netlist_time::from_double(1.0 / m_freq()).as_double(); - - m_params.m_use_gabs = m_use_gabs(); - m_params.m_use_linear_prediction = m_use_linear_prediction(); - - - if (m_params.m_dynamic_ts) - { - m_params.m_max_timestep *= 1;//NL_FCONST(1000.0); - } - else - { - m_params.m_min_timestep = m_params.m_max_timestep; - } - - //m_params.m_max_timestep = std::max(m_params.m_max_timestep, m_params.m_max_timestep::) - log().verbose("Scanning net groups ..."); // determine net groups net_splitter splitter; splitter.run(state()); + log().verbose("Found {1} net groups in {2} nets\n", + splitter.groups.size(), state().nets().size()); - // setup the solvers - log().verbose("Found {1} net groups in {2} nets\n", splitter.groups.size(), state().nets().size()); - for (auto & grp : splitter.groups) - { - pool_owned_ptr<matrix_solver_t> ms; - std::size_t net_count = grp.size(); - pstring sname = plib::pfmt("Solver_{1}")(m_mat_solvers.size()); + int num_errors = 0; - switch (net_count) + log().verbose("checking net consistency ..."); + for (const auto &grp : splitter.groups) + { + int rail_terminals = 0; + pstring nets_in_grp; + for (const auto &n : grp) { - #if 1 - case 1: - ms = pool().make_poolptr<matrix_solver_direct1_t<double>>(state(), sname, &m_params); - break; - case 2: - ms = pool().make_poolptr<matrix_solver_direct2_t<double>>(state(), sname, &m_params); - break; - case 3: - ms = create_solver<double, 3>(3, sname); - break; - case 4: - ms = create_solver<double, 4>(4, sname); - break; - case 5: - ms = create_solver<double, 5>(5, sname); - break; - case 6: - ms = create_solver<double, 6>(6, sname); - break; - case 7: - ms = create_solver<double, 7>(7, sname); - break; - case 8: - ms = create_solver<double, 8>(8, sname); - break; - case 9: - ms = create_solver<double, 9>(9, sname); - break; - case 10: - ms = create_solver<double, 10>(10, sname); - break; - #if 0 - case 11: - ms = create_solver<double, 11>(11, sname); - break; - case 12: - ms = create_solver<double, 12>(12, sname); - break; - case 15: - ms = create_solver<double, 15>(15, sname); - break; - case 31: - ms = create_solver<double, 31>(31, sname); - break; - case 35: - ms = create_solver<double, 35>(35, sname); - break; - case 43: - ms = create_solver<double, 43>(43, sname); - break; - case 49: - ms = create_solver<double, 49>(49, sname); - break; - #endif - #if 1 - case 86: - ms = create_solver<double,86>(86, sname); - break; - #endif - #endif - default: - log().info(MI_NO_SPECIFIC_SOLVER(net_count)); - if (net_count <= 8) - { - ms = create_solver<double, -8>(net_count, sname); - } - else if (net_count <= 16) - { - ms = create_solver<double, -16>(net_count, sname); - } - else if (net_count <= 32) - { - ms = create_solver<double, -32>(net_count, sname); - } - else - if (net_count <= 64) - { - ms = create_solver<double, -64>(net_count, sname); - } - else - if (net_count <= 128) + nets_in_grp += (n->name() + " "); + if (!n->is_analog()) + { + state().log().error( + ME_SOLVER_CONSISTENCY_NOT_ANALOG_NET(n->name())); + num_errors++; + } + if (n->is_rail_net()) + { + state().log().error( + ME_SOLVER_CONSISTENCY_RAIL_NET(n->name())); + num_errors++; + } + for (detail::core_terminal_t *t : n->core_terms_copy()) + { + if (!t->has_net()) { - ms = create_solver<double, -128>(net_count, sname); + state().log().error( + ME_SOLVER_TERMINAL_NO_NET(t->name())); + num_errors++; } else { - log().fatal(MF_NETGROUP_SIZE_EXCEEDED_1(128)); - return; /* tease compilers */ + if (auto other_terminal = plib::dynamic_downcast< + terminal_t *>(t)) + if (state() + .setup() + .get_connected_terminal(*(*other_terminal)) + ->net() + .is_rail_net()) + rail_terminals++; } + } + } + if (rail_terminals == 0) + { + state().log().error(ME_SOLVER_NO_RAIL_TERMINAL(nets_in_grp)); + num_errors++; + } + } + if (num_errors > 0) + throw nl_exception(MF_SOLVER_CONSISTENCY_ERRORS(num_errors)); + + // setup the solvers + for (auto &grp : splitter.groups) + { + solver_ptr ms; + pstring sname = plib::pfmt("Solver_{1}")(m_mat_solvers.size()); + params_uptr params = plib::make_unique<solver::solver_parameters_t>( + state().pool(), *this, sname + ".", m_params); + + switch (params->m_fp_type()) + { + case solver::matrix_fp_type_e::FLOAT: + if (!config::use_float_matrix::value) + log().info("FPTYPE {1} not supported. Using DOUBLE", + params->m_fp_type().name()); + ms = create_solvers<std::conditional_t< + config::use_float_matrix::value, float, double>>( + sname, params.get(), grp); + break; + case solver::matrix_fp_type_e::DOUBLE: + ms = create_solvers<double>(sname, params.get(), grp); + break; + case solver::matrix_fp_type_e::LONGDOUBLE: + if (!config::use_long_double_matrix::value) + log().info("FPTYPE {1} not supported. Using DOUBLE", + params->m_fp_type().name()); + ms = create_solvers<std::conditional_t< + config::use_long_double_matrix::value, long double, + double>>(sname, params.get(), grp); + break; + case solver::matrix_fp_type_e::FLOATQ128: +#if (NL_USE_FLOAT128) + ms = create_solvers<FLOAT128>(sname, params.get(), grp); +#else + log().info("FPTYPE {1} not supported. Using DOUBLE", + params->m_fp_type().name()); + ms = create_solvers<double>(sname, params.get(), grp); +#endif break; } - // FIXME ... - ms->setup(grp); + state().register_device( + ms->name(), + device_arena::owned_ptr<core_device_t>(ms.get(), false)); log().verbose("Solver {1}", ms->name()); log().verbose(" ==> {1} nets", grp.size()); - log().verbose(" has {1} elements", ms->has_dynamic_devices() ? "dynamic" : "no dynamic"); - log().verbose(" has {1} elements", ms->has_timestep_devices() ? "timestep" : "no timestep"); + log().verbose(" has {1} dynamic elements", + ms->dynamic_device_count()); + log().verbose(" has {1} time step elements", + ms->time_step_device_count()); for (auto &n : grp) { log().verbose("Net {1}", n->name()); - for (const auto &pcore : n->core_terms()) + for (const detail::core_terminal_t *t : n->core_terms_copy()) { - log().verbose(" {1}", pcore->name()); + log().verbose(" {1}", t->name()); } } - m_mat_solvers_all.push_back(ms.get()); - if (ms->has_timestep_devices()) - m_mat_solvers_timestepping.push_back(ms.get()); - - m_mat_solvers.emplace_back(std::move(ms)); + m_mat_params.push_back(std::move(params)); + m_mat_solvers.push_back(std::move(ms)); } } - void NETLIB_NAME(solver)::create_solver_code(std::map<pstring, pstring> &mp) + solver::static_compile_container NETLIB_NAME(solver)::create_solver_code( + solver::static_compile_target target) { - for (auto & s : m_mat_solvers) + solver::static_compile_container mp; + for (auto &s : m_mat_solvers) { - auto r = s->create_solver_code(); - mp[r.first] = r.second; // automatically overwrites identical names + auto r = s->create_solver_code(target); + if (!r.first.empty()) // ignore solvers not supporting static + // compile + mp.push_back(r); } + return mp; + } + + std::size_t NETLIB_NAME(solver)::get_solver_id( + const solver::matrix_solver_t *net) const + { + for (std::size_t i = 0; i < m_mat_solvers.size(); i++) + if (m_mat_solvers[i].get() == net) + return i; + return std::numeric_limits<std::size_t>::max(); + } + + solver::matrix_solver_t *NETLIB_NAME(solver)::solver_by_id( + std::size_t id) const + { + return m_mat_solvers[id].get(); } NETLIB_DEVICE_IMPL(solver, "SOLVER", "FREQ") -} // namespace devices -} // namespace netlist +} // namespace netlist::devices diff --git a/src/lib/netlist/solver/nld_solver.h b/src/lib/netlist/solver/nld_solver.h index 99937f72812..c4f6c2e5bf1 100644 --- a/src/lib/netlist/solver/nld_solver.h +++ b/src/lib/netlist/solver/nld_solver.h @@ -1,118 +1,91 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nld_solver.h - * - */ #ifndef NLD_SOLVER_H_ #define NLD_SOLVER_H_ -#include "netlist/nl_base.h" +/// +/// \file nld_solver.h +/// + #include "nld_matrix_solver.h" -#include "plib/pstream.h" + +#include "core/core_device.h" +#include "core/logic.h" +#include "core/state_var.h" + +#include "../plib/pstream.h" #include <map> #include <memory> #include <vector> -//#define ATTR_ALIGNED(N) __attribute__((aligned(N))) -#define ATTR_ALIGNED(N) ATTR_ALIGN - -// ---------------------------------------------------------------------------------------- -// solver -// ---------------------------------------------------------------------------------------- - -namespace netlist +namespace netlist::devices { -namespace devices -{ - class NETLIB_NAME(solver); - - class matrix_solver_t; + // ------------------------------------------------------------------------- + // solver + // ------------------------------------------------------------------------- - NETLIB_OBJECT(solver) + class nld_solver : public device_t { - NETLIB_CONSTRUCTOR(solver) - , m_fb_step(*this, "FB_step") - , m_Q_step(*this, "Q_step") - , m_freq(*this, "FREQ", 48000.0) - - /* iteration parameters */ - , m_gs_sor(*this, "SOR_FACTOR", 1.059) - , m_method(*this, "METHOD", "MAT_CR") - , m_accuracy(*this, "ACCURACY", 1e-7) - , m_gs_loops(*this, "GS_LOOPS", 9) // Gauss-Seidel loops - - /* general parameters */ - , m_gmin(*this, "GMIN", 1e-9) - , m_pivot(*this, "PIVOT", false) // use pivoting - on supported solvers - , m_nr_loops(*this, "NR_LOOPS", 250) // Newton-Raphson loops - , m_nr_recalc_delay(*this, "NR_RECALC_DELAY", netlist_time::quantum().as_double()) // Delay to next solve attempt if nr loops exceeded - , m_parallel(*this, "PARALLEL", 0) - - /* automatic time step */ - , m_dynamic_ts(*this, "DYNAMIC_TS", false) - , m_dynamic_lte(*this, "DYNAMIC_LTE", 1e-5) // diff/timestep - , m_dynamic_min_ts(*this, "DYNAMIC_MIN_TIMESTEP", 1e-6) // nl_double timestep resolution - - /* special */ - , m_use_gabs(*this, "USE_GABS", true) - , m_use_linear_prediction(*this, "USE_LINEAR_PREDICTION", false) // // savings are eaten up by effort - - , m_params() - { - // internal staff + public: + using solver_arena = device_arena; + using queue_type = detail::queue_base<solver_arena, + solver::matrix_solver_t>; - connect(m_fb_step, m_Q_step); - } + nld_solver(constructor_param_t data); void post_start(); void stop(); - nl_double gmin() const { return m_gmin(); } + auto gmin() const -> decltype(solver::solver_parameters_t::m_gmin()) + { + return m_params.m_gmin(); + } - void create_solver_code(std::map<pstring, pstring> &mp); + solver::static_compile_container + create_solver_code(solver::static_compile_target target); - NETLIB_UPDATEI(); NETLIB_RESETI(); // NETLIB_UPDATE_PARAMI(); + using solver_ptr = solver_arena::unique_ptr<solver::matrix_solver_t>; + + using net_list_t = solver::matrix_solver_t::net_list_t; + + void reschedule(solver::matrix_solver_t *solv, netlist_time ts); + private: - logic_input_t m_fb_step; + using params_uptr = solver_arena::unique_ptr< + solver::solver_parameters_t>; + + template <bool KEEP_STATS> + NETLIB_HANDLERI(fb_step); + + logic_input_t m_fb_step; logic_output_t m_Q_step; - param_double_t m_freq; - param_double_t m_gs_sor; - param_str_t m_method; - param_double_t m_accuracy; - param_int_t m_gs_loops; - param_double_t m_gmin; - param_logic_t m_pivot; - param_int_t m_nr_loops; - param_double_t m_nr_recalc_delay; - param_int_t m_parallel; - param_logic_t m_dynamic_ts; - param_double_t m_dynamic_lte; - param_double_t m_dynamic_min_ts; - - param_logic_t m_use_gabs; - param_logic_t m_use_linear_prediction; - - std::vector<pool_owned_ptr<matrix_solver_t>> m_mat_solvers; - std::vector<matrix_solver_t *> m_mat_solvers_all; - std::vector<matrix_solver_t *> m_mat_solvers_timestepping; - - solver_parameters_t m_params; + // FIXME: these should be created in device space + std::vector<params_uptr> m_mat_params; + std::vector<solver_ptr> m_mat_solvers; - template <typename FT, int SIZE> - pool_owned_ptr<matrix_solver_t> create_solver(std::size_t size, const pstring &solvername); + solver::solver_parameters_t m_params; + queue_type m_queue; template <typename FT, int SIZE> - pool_owned_ptr<matrix_solver_t> create_solver_x(std::size_t size, const pstring &solvername); + solver_ptr create_solver(std::size_t size, const pstring &solver_name, + const solver::solver_parameters_t *params, + net_list_t & nets); + + template <typename FT> + solver_ptr create_solvers(const pstring & sname, + const solver::solver_parameters_t *params, + net_list_t & nets); + + std::size_t get_solver_id(const solver::matrix_solver_t *net) const; + solver::matrix_solver_t *solver_by_id(std::size_t id) const; }; -} //namespace devices -} // namespace netlist +} // namespace netlist::devices -#endif /* NLD_SOLVER_H_ */ +#endif // NLD_SOLVER_H_ diff --git a/src/lib/netlist/tests/test_penum.cpp b/src/lib/netlist/tests/test_penum.cpp new file mode 100644 index 00000000000..6347a41d027 --- /dev/null +++ b/src/lib/netlist/tests/test_penum.cpp @@ -0,0 +1,254 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file test_penum.cpp +/// +/// tests for penum +/// + +#include "plib/putil.h" + +#include "plib/pexception.h" +#include "plib/pstring.h" + +#include <string> +#include <type_traits> +#include <string_view> + +#if 0 +namespace plib +{ + template <typename E> + struct functor { using is_defined = std::false_type; }; + template <std::size_t N, typename E> + struct functor_base + { + public: + using is_defined = std::true_type; + using size = std::integral_constant<std::size_t, N>; + constexpr operator E () const noexcept { return m_v; } + constexpr functor_base(const E v) noexcept : m_v(v) { }; + protected: + constexpr functor_base(const char *s, const char * const vals[size::value]) noexcept : m_v(E::PENUM_UNKNOWN) + { for (std::size_t i = 0; i < size::value; i++) if (vals[i] == s) { m_v = static_cast<E>(i); return; } } + E m_v; + private: + //static constexpr const char *m_str[PNARGS(__VA_ARGS__)] = { PSTRINGIFY_VA(__VA_ARGS__) }; + }; + +} // namespace plib + +#define PENUM(ename, ...) \ + enum class ename { __VA_ARGS__ , PENUM_UNKNOWN }; \ + PENUM_FUNCTOR(ename, __VA_ARGS__) + +#define PENUM_NS(ns, ename, ...) \ + namespace ns { enum class ename { __VA_ARGS__ , PENUM_UNKNOWN }; } \ + PENUM_FUNCTOR(ns :: ename, __VA_ARGS__) + +#define PENUM_FUNCTOR(ename, ...) \ + template <> struct plib::functor<ename> : plib::functor_base<PNARGS(__VA_ARGS__), ename> \ + { \ + public: \ + using plib::functor_base<size::value, ename>::functor_base; \ + constexpr functor(const char *s) noexcept : functor_base(s, m_str) { } \ + constexpr operator const char * () const noexcept { return m_str[static_cast<std::size_t>(m_v)]; } \ + private: \ + static constexpr const char *m_str[3] = { PSTRINGIFY_VA(__VA_ARGS__) }; \ + }; + +#else +#if 1 +namespace plib::enum_static +{ + template <typename E> + struct functor_static + { + using is_defined = std::false_type; + using size = std::integral_constant<std::size_t, 0>; + static constexpr const char *m_str[1] = { "" }; + }; +} // namespace plib::enum_static + +#endif +namespace plib +{ + template <typename E> + struct functor + { + public: + using staticf = enum_static::functor_static<E>; + using is_defined = typename staticf::is_defined; + using size = typename staticf::size; + constexpr functor(const E v) noexcept : m_v(v) { } + constexpr functor(const char *s) noexcept : m_v(E::PENUM_UNKNOWN) + { + for (std::size_t i = 0; i < size::value; i++) + if (staticf::m_str[i] == s) + { + m_v = static_cast<E>(i); + return; + } + } + constexpr operator const char * () const noexcept { return staticf::m_str[static_cast<std::size_t>(m_v)]; } + constexpr operator E () const noexcept { return m_v; } + protected: + E m_v; + private: + //static constexpr const char *m_str[PNARGS(__VA_ARGS__)] = { PSTRINGIFY_VA(__VA_ARGS__) }; + }; + + // template deduction guide + template<typename E> functor(E) -> functor<E>; + + template<typename E> + static inline typename std::enable_if<plib::enum_static::functor_static<E>::is_defined::value, const char *>::type + penum_to_string(E e) + { + using staticf = enum_static::functor_static<E>; + return staticf::m_str[static_cast<std::size_t>(e)]; + } + + template<typename E> + static inline typename std::enable_if<plib::enum_static::functor_static<E>::is_defined::value, E>::type + string_to_penum(const char *s) + { + using staticf = enum_static::functor_static<E>; + for (std::size_t i = 0; i < staticf::size::value; i++) + if (staticf::m_str[i] == s) + return static_cast<E>(i); + return E::PENUM_UNKNOWN; + } + +} // namespace plib + +#define PENUM(ename, ...) \ + enum class ename { __VA_ARGS__ , PENUM_UNKNOWN }; \ + PENUM_FUNCTOR(ename, __VA_ARGS__) + +#define PENUM_NS(ns, ename, ...) \ + namespace ns { enum class ename { __VA_ARGS__ , PENUM_UNKNOWN }; } \ + PENUM_FUNCTOR(ns :: ename, __VA_ARGS__) + +#define PENUM_FUNCTOR(ename, ...) \ + namespace plib::enum_static { \ + template <> struct functor_static<ename> \ + { \ + public: \ + using is_defined = std::true_type; \ + using size = std::integral_constant<std::size_t, PNARGS(__VA_ARGS__) >; \ + static constexpr const char *m_str[size::value] = { PSTRINGIFY_VA(__VA_ARGS__) }; \ + }; \ + } // namespace plib::enum_static + +#endif + +template <class O, class E> +typename std::enable_if<!plib::has_ostream_operator<O, E>::value && plib::enum_static::functor_static<E>::is_defined::value, O&>::type +operator << (O& os, const E &p) +{ + os << static_cast<const char *>(plib::functor<E>(p)); + return os; +} + +#if 1 +template <typename E> +inline typename std::enable_if<plib::enum_static::functor_static<E>::is_defined::value, bool>::type +operator == (const char * lhs, const E &rhs) +{ + return lhs == plib::functor<E>(rhs); +} +template <typename E> +inline typename std::enable_if<plib::enum_static::functor_static<E>::is_defined::value, bool>::type +operator == (const E &lhs, const char * rhs) +{ + return lhs == plib::functor<E>(rhs); +} +#endif + +// --------------------------------------- + +template <typename T> +struct ret_t +{ + bool success; + T value; +}; + +template <typename T, T BASE> +constexpr ret_t<T> stl_h(std::string_view sv) +{ + T r(0); + for (const auto &c : sv) + { + if (c >= '0' && c < '0' + std::min(10,BASE)) + { + r = r * BASE + (c - '0'); + } + else if (c >= 'A' && c < ('A' + BASE - 10)) + { + r = r * BASE + (10 + c - 'A'); + } + else if (c >= 'a' && c < ('a' + BASE - 10)) + { + r = r * BASE + (10 + c - 'a'); + } + else + return { false, T(0) }; + } + return { true, r }; +} + +template <typename T, T BASE = 0> +constexpr ret_t<T> stl(std::string_view sv) +{ + if constexpr (BASE == 0) + { + if (sv.size() > 2) + { + if (sv.substr(0,2) == "0x" || sv.substr(0,2) == "0X") + return stl_h<T,16>(sv.substr(2)); + if (sv.substr(0,2) == "0b") + return stl_h<T,2>(sv.substr(2)); + } + if (sv.size() > 1 && sv.substr(0,1) == "0" ) + return stl_h<T,8>(sv.substr(1)); + return stl_h<T, 10>(sv); + } + return stl_h<T, BASE>(sv); +} + +#include "plib/ptests.h" + +//PENUM_NS(plibx, teste, A, B, C) + +namespace plibx { enum class teste; } +PENUM(plibx::teste, A, B, C) + +enum class pure { X, Y }; + +PENUM(testf, A, B, C) + +PTEST(penum, conversion) +{ + static_assert(stl<int,0>("0xa0bc").success,"no"); + static_assert(stl<int,0>("0xa0bc").value==0xa0bc,"no"); + static_assert(stl<int,0>("0b1010").value==0b1010,"no"); + static_assert(stl<int,0>("0123").value==0123,"no"); + //const auto x(stl<int,0>("123")); + //static_assert(x.value==123,"no"); + + plibx::teste x = plib::functor<plibx::teste>("A"); + PEXPECT_NE(x, plibx::teste::B); + PEXPECT_NE(plib::functor<plibx::teste>("A"), plibx::teste::B); + PEXPECT_NE(plib::functor<testf>("A"), testf::B); + //PEXPECT_EQ(plib::functor("A"), testf::B); + PEXPECT_EQ(testf::B, "B"); + PEXPECT_EQ("A", testf::A); + PEXPECT_NE(plib::functor(testf::A), "B"); + PEXPECT_FALSE(plib::functor<pure>::is_defined::value); + PEXPECT_EQ(plib::penum_to_string(testf::B), "B"); + PEXPECT_NE(plib::string_to_penum<testf>("B"), testf::A); + //PEXPECT_EQ(pure::X, pure::Y); +} diff --git a/src/lib/netlist/tests/test_pfunction.cpp b/src/lib/netlist/tests/test_pfunction.cpp new file mode 100644 index 00000000000..fa100e7edb2 --- /dev/null +++ b/src/lib/netlist/tests/test_pfunction.cpp @@ -0,0 +1,60 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file test_pfunction.cpp +/// +/// tests for `pfunction` class +/// + +#include "plib/ptests.h" + +#include "plib/pexception.h" +#include "plib/pfunction.h" + +#define PFUNCEXPECT(formula, val) \ + PEXPECT_EQ(val, plib::pfunction<double>(formula)()) + +PTEST(pfunction, operators) +{ + PFUNCEXPECT("1==1", 1.0); + PFUNCEXPECT("1 *0 == 2-1-1", 1.0); + PFUNCEXPECT("0!=1", 1.0); + PFUNCEXPECT("0<1", 1.0); + PFUNCEXPECT("1>0", 1.0); + PFUNCEXPECT("0<=1", 1.0); + PFUNCEXPECT("1>=0", 1.0); + PFUNCEXPECT("1<=1", 1.0); + PFUNCEXPECT("1>=1", 1.0); + PEXPECT_EQ(1.0, plib::pfunction<double>("0!=a", {"a"})({1.0})); +} + +PTEST(pfunction, func_if) +{ + PFUNCEXPECT("if(1>0, 2, 0)", 2.0); + PFUNCEXPECT("if(0>1, 2, 3)", 3.0); + PFUNCEXPECT("if(sin(1)>0, 2, 3)", 2.0); // fail + PEXPECT_EQ( 1.0, plib::pfunction<double>("if(A2>2.5, 0-A1, (0.07-(0.005*A1))*if(A0>2.5,1,0-1))", {"A0","A1","A2"})({1.0,-1.0,3.0})); + PEXPECT_EQ(-0.065, plib::pfunction<double>("if(A2>2.5, 0-A1, (0.07-(0.005*A1))*if(A0>2.5,1,0-1))", {"A0","A1","A2"})({1.0,1.0,1.0})); + PEXPECT_EQ( 0.065, plib::pfunction<double>("if(A2>2.5, 0-A1, (0.07-(0.005*A1))*if(A0>2.5,1,0-1))", {"A0","A1","A2"})({3.0,1.0,1.0})); + PEXPECT_TRUE(1.0 == plib::pfunction<double>("0!=a", {"a"})({1.0})); +} + +PTEST(pfunction, unary_minus) +{ + PFUNCEXPECT("-1>-2", 1.0); + PFUNCEXPECT("(-3)*(-4)", 12.0); + PFUNCEXPECT("(-3)*-4", 12.0); + PFUNCEXPECT("-3*-4", 12.0); + PEXPECT_EQ( -3.0, plib::pfunction<double>("-A0", {"A0"})({3.0})); + PFUNCEXPECT("3*-trunc(3.2)", -9.0); + PFUNCEXPECT("3*-(3*2)", -18.0); + PFUNCEXPECT("3*-(2*1)^2", -12.0); + PEXPECT_NO_THROW(plib::pfunction<double>("(-3)")()); // fail +} +PTEST(pfunction, expect_throw) +{ + PEXPECT_THROW(plib::pfunction<double>("(3, 4)")(), plib::pexception); + PEXPECT_THROW(plib::pfunction<double>("((3)")(), plib::pexception); + PEXPECT_THROW(plib::pfunction<double>("(3))")(), plib::pexception); +} diff --git a/src/lib/netlist/tests/test_pmfp.cpp b/src/lib/netlist/tests/test_pmfp.cpp new file mode 100644 index 00000000000..c6c9bf70daa --- /dev/null +++ b/src/lib/netlist/tests/test_pmfp.cpp @@ -0,0 +1,77 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file test_pmfp.cpp +/// +/// tests for `plib::pmfp` class +/// + +#include "plib/ptests.h" + +#include "plib/pexception.h" +#include "plib/ppmf.h" + +#include <memory> +#include <utility> + +/// `plib::late_pmfp<plib::pmfp<void, pstring>> a(&nld_7493::printer);` +/// // Store the a object somewhere +/// +/// // After full construction ... +/// +/// ``` +/// auto dele = a(this); +/// dele(pstring("Hello World!")); +/// ``` + +class test_late_pmfp : public plib::testing::Test +{ +protected: + class late_pmfp_object + { + public: + void ap(int &r) { r = ax; } + int ax; + }; + +}; + +PTEST_F(test_late_pmfp, late_pmfp) +{ +#if !PPMF_USE_MAME_DELEGATES + plib::late_pmfp<plib::pmfp<void (int &)>> late(&late_pmfp_object::ap); + + late_pmfp_object a; + a.ax = 1; + auto mfp(late(&a)); + int r(0); + mfp(r); + PEXPECT_TRUE(r == 1); +#endif +} + +PTEST(test_compile, compile) +{ +#if !PPMF_USE_MAME_DELEGATES + plib::pmfp_base<plib::ppmf_type::PMF, void(int)> mfp_PPMF_TYPE_PMF; + plib::pmfp_base<plib::ppmf_type::INTERNAL_ITANIUM, void(int)> mfp_PPMF_TYPE_INTERNAL_ITANIUM; + plib::pmfp_base<plib::ppmf_type::INTERNAL_ARM, void(int)> mfp_PPMF_TYPE_INTERNAL_ARM; + plib::pmfp_base<plib::ppmf_type::INTERNAL_MSC, void(int)> mfp_PPMF_TYPE_INTERNAL_MSC; + PEXPECT_TRUE(mfp_PPMF_TYPE_PMF.isnull()); + PEXPECT_TRUE(mfp_PPMF_TYPE_INTERNAL_ITANIUM.isnull()); + PEXPECT_TRUE(mfp_PPMF_TYPE_INTERNAL_ARM.isnull()); + PEXPECT_TRUE(mfp_PPMF_TYPE_INTERNAL_MSC.isnull()); +#endif + // FIXME: clang on linux seems to support GNUC_PMF_CONV - test needed + // Need to check for clang-cl here. +#if defined(__GNUC__) && !defined(__clang__) && !defined(__NVCC__) + plib::pmfp_base<plib::ppmf_type::GNUC_PMF_CONV, void(int)> mfp_PPMF_TYPE_GNUC_PMF_CONV; + PEXPECT_TRUE(mfp_PPMF_TYPE_GNUC_PMF_CONV.isnull()); +#else + PEXPECT_NE("ppmf_type::GNUC_PMF_CONV not supported on this build", ""); +#endif +#if defined(__EMSCRIPTEN__) + PEXPECT_EQ(int(plib::ppmf_internal_selector::value), int(plib::ppmf_type::INTERNAL_ARM)); +#endif +} diff --git a/src/lib/netlist/tests/test_pmfp_multibase.cpp b/src/lib/netlist/tests/test_pmfp_multibase.cpp new file mode 100644 index 00000000000..8297792eae7 --- /dev/null +++ b/src/lib/netlist/tests/test_pmfp_multibase.cpp @@ -0,0 +1,451 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file test_pmfp_multibase.cpp +/// +/// tests for `plib::pmfp` +/// + +#include "plib/ptypes.h" +#include "plib/pexception.h" +#include "plib/ppmf.h" + +#include <iostream> +#include <memory> +#include <type_traits> +#include <typeinfo> +#include <utility> + +template <class F, class S> +typename std::enable_if_t<!plib::has_ostream_operator<std::basic_ostream<char>, std::pair<F, S>>::value, std::basic_ostream<char>&> +operator << (std::basic_ostream<char>& os, const std::pair<F, S> &p) +{ + os << "{ " << p.first << ", " << p.second << " }"; + return os; +} + +#include "plib/ptests.h" + +template <class T> +typename std::enable_if_t<!plib::has_ostream_operator<std::basic_ostream<char>, T>::value, std::basic_ostream<char>&> +operator << ([[maybe_unused]] std::basic_ostream<char>& os, [[maybe_unused]] const T &p) +{ + os << std::string(typeid(T).name()); + return os; +} + +class pmfp_test_complex_return : public plib::testing::Test +{ +protected: + using ret_t = std::pair<void *, int>; + + template <std::size_t N> + class tstruct + { + public: + struct r1type + { + char m[N]; + }; + + r1type f1(const char v) + { + r1type r; + for (std::size_t i=0; i<N; i++) r.m[i] = v; + return r; + } + + template <typename T> + T ft(const T v) + { + return v; + } + + template <typename T> + T run_ft(const T v) + { + using pf_t = plib::pmfp<T (const T)>; + pf_t pf(&tstruct::ft<T>, this); + return pf(v); + } + }; + + //using test_delegate1 = plib::pmfp<ret_t (int, int)>; + using test_delegate = plib::pmfp<ret_t ()>; + + class a + { + public: + ret_t ap() { return ret_t(static_cast<void *>(this), ax); } + int ax; + }; + + class b + { + public: + ret_t bp() { return ret_t(static_cast<void *>(this), bx); } + int bx; + }; + + class multibase : public a, public b + { + public: + }; + + + class vtb + { + public: + virtual ~vtb() = default; + virtual ret_t vp1() { return ret_t(static_cast<void *>(this), 1); } + virtual ret_t vp2() { return ret_t(static_cast<void *>(this), 2); } + }; + + class vti1 : public vtb + { + public: + virtual ret_t vp1() override { return ret_t(static_cast<void *>(this), 3); } + virtual ret_t vp2() override { return ret_t(static_cast<void *>(this), 4); } + }; + + class vti2 : public a, public vtb + { + public: + virtual ret_t vp1() override { return ret_t(static_cast<void *>(this), 13); } + virtual ret_t vp2() override { return ret_t(static_cast<void *>(this), 14); } + }; + + class forward; + + test_delegate make_forward_delegate(ret_t (forward::*func)(), forward *obj) + { + return test_delegate(func, obj); + } + + class vb + { + public: + ret_t xp() { return ret_t(static_cast<void *>(this), x); } + int x=10; + }; + + class vd1 : public virtual vb + { + public: + ret_t yp() { return ret_t(static_cast<void *>(this), y); } + int y; + }; + + class vd2 : public virtual vb + { + public: + ret_t zp() { return ret_t(static_cast<void *>(this), z); } + int z; + }; + + class forward : public vd1, public vd2 + { + public: + }; + +}; + +class pmfp_test_simple_return : public plib::testing::Test +{ +protected: + using ret_t = std::pair<void *, int>; + + //using test_delegate1 = plib::pmfp<ret_t (int, int)>; + using test_delegate = plib::pmfp<void (ret_t &)>; + + class a + { + public: + void ap(ret_t &r) { r = ret_t(static_cast<void *>(this), ax); } + int ax; + }; + + class b + { + public: + void bp(ret_t &r) { r = ret_t(static_cast<void *>(this), bx); } + int bx; + }; + + class multibase : public a, public b + { + public: + }; + + + class vtb + { + public: + virtual ~vtb() = default; + virtual void vp1(ret_t &r) { r = ret_t(static_cast<void *>(this), 1); } + virtual void vp2(ret_t &r) { r = ret_t(static_cast<void *>(this), 2); } + }; + + class vti1 : public vtb + { + public: + virtual void vp1(ret_t &r) override { r = ret_t(static_cast<void *>(this), 3); } + virtual void vp2(ret_t &r) override { r = ret_t(static_cast<void *>(this), 4); } + }; + + class vti2 : public a, public vtb + { + public: + virtual void vp1(ret_t &r) override { r = ret_t(static_cast<void *>(this), 13); } + virtual void vp2(ret_t &r) override { r = ret_t(static_cast<void *>(this), 14); } + }; + + class forward; + + test_delegate make_forward_delegate(void (forward::*func)(ret_t &), forward *obj) + { + return test_delegate(func, obj); + } + + class vb + { + public: + void xp(ret_t &r) { r = ret_t(static_cast<void *>(this), x); } + int x=10; + }; + + class vd1 : public virtual vb + { + public: + void yp(ret_t &r) { r = ret_t(static_cast<void *>(this), y); } + int y; + }; + + class vd2 : public virtual vb + { + public: + void zp(ret_t &r) { r = ret_t(static_cast<void *>(this), z); } + int z; + }; + + class forward : public vd1, public vd2 + { + public: + }; +}; + +PTEST_F(pmfp_test_complex_return, multibase_test) +{ + multibase obj; + obj.ax = 1; + obj.bx = 2; + test_delegate f(&multibase::ap, &obj); + test_delegate g(&multibase::bp, &obj); + + // a=0x63fbf8 + // b=0x63fbfc + // a=0x63fbf8(1) + // b=0x63fbfc(2) + // b=0x63fbfc(2) + // b=0x63fbfc(2) + PEXPECT_EQ(f(), ret_t(static_cast<void *>(static_cast<a *>(&obj)), 1)); + auto g_ret = g(); + PEXPECT_EQ(g_ret, ret_t(static_cast<void *>(static_cast<b *>(&obj)), 2)); + + test_delegate h = g; + PEXPECT_EQ(g_ret, h()); + f = g; + PEXPECT_EQ(g_ret, f()); + + //vti1=0xdf6fb0.vp1 + //vti1=0xdf6fb0.vp2 + + std::unique_ptr<vtb> ptr; + ptr.reset(new vti1); + f = test_delegate(&vtb::vp1, ptr.get()); + auto f1_ret = f(); + f = test_delegate(&vtb::vp2, ptr.get()); + auto f2_ret = f(); + PEXPECT_EQ(f1_ret.first, f2_ret.first); + PEXPECT_EQ(f1_ret.second, 3); + PEXPECT_EQ(f2_ret.second, 4); + + // vti2=0xdf6d50.vp1 + // vti2=0xdf6d50.vp2 + ptr.reset(new vti2); + f = test_delegate(&vtb::vp1, ptr.get()); + f1_ret = f(); + f = test_delegate(&vtb::vp2, ptr.get()); + f2_ret = f(); + PEXPECT_EQ(f1_ret.first, f2_ret.first); + PEXPECT_EQ(f1_ret.second, 13); + PEXPECT_EQ(f2_ret.second, 14); + + //vb=0x63fafc + //vd1=0x63fae0 + //vd2=0x63faf0 + //vd1=0x63fae0(8) + //vd2=0x63faf0(9) + + forward obj2; + obj2.x = 7; + obj2.y = 8; + obj2.z = 9; + PEXPECT_NE(static_cast<void *>(static_cast<vb *>(&obj2)), static_cast<void *>(static_cast<vd1 *>(&obj2))); + PEXPECT_NE(static_cast<void *>(static_cast<vb *>(&obj2)), static_cast<void *>(static_cast<vd2 *>(&obj2))); + +#if defined(_MSC_VER) && !defined(__clang__) + f = make_forward_delegate(&forward::xp, &obj2); + PEXPECT_TRUE(f().second == 7); + std::cout << f().second << " " << obj2.xp().second << "\n"; +#endif + f = make_forward_delegate(&forward::yp, &obj2); + PEXPECT_EQ(f().second, 8); + f = make_forward_delegate(&forward::zp, &obj2); + PEXPECT_EQ(f().second, 9); + //PEXPECT_EQ(plib::ppmf_internal::value, PPMF_TYPE_PMF); + + // test return size handling + + tstruct<3> ts3; + using pfmp3_t = plib::pmfp<tstruct<3>::r1type(char)>; + pfmp3_t pf3(&tstruct<3>::f1, &ts3); + auto r3 = pf3(3); + PEXPECT_EQ(static_cast<int>(r3.m[2]), 3); + PEXPECT_EQ(sizeof(r3), 3u); + + tstruct<5> ts5; + using pfmp5_t = plib::pmfp<tstruct<5>::r1type(char)>; + pfmp5_t pf5(&tstruct<5>::f1, &ts5); + auto r5 = pf5(5); + PEXPECT_EQ(static_cast<int>(r5.m[3]), 5); + PEXPECT_EQ(sizeof(r5), 5u); + + tstruct<8> ts8; + using pfmp8_t = plib::pmfp<tstruct<8>::r1type(char)>; + pfmp8_t pf8(&tstruct<8>::f1, &ts8); + auto r8 = pf8(8); + PEXPECT_EQ(static_cast<int>(r8.m[3]), 8); + PEXPECT_EQ(sizeof(r8), 8u); + + tstruct<9> ts9; + using pfmp9_t = plib::pmfp<tstruct<9>::r1type (char)>; + pfmp9_t pf9(&tstruct<9>::f1, &ts9); + auto r9=pf9(9); + PEXPECT_EQ(static_cast<int>(r9.m[3]), 9); + PEXPECT_EQ(sizeof(r9), 9u); + + tstruct<17> ts17; + using pfmp17_t = plib::pmfp<tstruct<17>::r1type(char)>; + pfmp17_t pf17(&tstruct<17>::f1, &ts17); + auto r17 = pf17(17); + PEXPECT_EQ(static_cast<int>(r17.m[3]), 17); + PEXPECT_EQ(sizeof(r17), 17u); + +#if !(defined(_MSC_VER) && !defined(__clang__)) + if constexpr (plib::compile_info::has_int128::value) + { + PEXPECT_EQ(static_cast<int>(ts17.run_ft<INT128>(17)), 17); // FIXME: no operator << for INT128 yet + PEXPECT_EQ(sizeof(INT128), 16u); + } +#endif + PEXPECT_EQ(ts17.run_ft<long double>(17), 17); + PEXPECT_EQ(ts17.run_ft<double>(17), 17); + PEXPECT_EQ(ts17.run_ft<int>(17), 17); + PEXPECT_EQ(ts17.run_ft<bool>(true), true); + PEXPECT_EQ(ts17.run_ft<std::size_t>(20), 20u); + + struct tt1_t { int a; int b; }; + tt1_t tt1 = { 8, 9 }; + auto tt1r = ts17.run_ft<tt1_t>(tt1); + PEXPECT_EQ(tt1.a, tt1r.a); + PEXPECT_EQ(tt1.b, tt1r.b); + + PEXPECT_EQ(sizeof(ret_t), 16u); + +} + +PTEST_F(pmfp_test_simple_return, multibase_test) +{ + multibase obj; + obj.ax = 1; + obj.bx = 2; + test_delegate f(&multibase::ap, &obj); + test_delegate g(&multibase::bp, &obj); + + // a=0x63fbf8 + // b=0x63fbfc + // a=0x63fbf8(1) + // b=0x63fbfc(2) + // b=0x63fbfc(2) + // b=0x63fbfc(2) + ret_t fr; + f(fr); + PEXPECT_EQ(fr, ret_t(static_cast<void *>(static_cast<a *>(&obj)), 1)); + ret_t gr; + g(gr); + PEXPECT_EQ(gr, ret_t(static_cast<void *>(static_cast<b *>(&obj)), 2)); + //PEXPECT_EQ(f, g); + + test_delegate h = g; + ret_t hr; + h(hr); + PEXPECT_EQ(gr, hr); + f = g; + f(fr); + PEXPECT_EQ(gr, fr); + + //vti1=0xdf6fb0.vp1 + //vti1=0xdf6fb0.vp2 + + std::unique_ptr<vtb> ptr; + ptr.reset(new vti1); + f = test_delegate(&vtb::vp1, ptr.get()); + ret_t f1_ret; + f(f1_ret); + f = test_delegate(&vtb::vp2, ptr.get()); + ret_t f2_ret; + f(f2_ret); + PEXPECT_EQ(f1_ret.first, f2_ret.first); + PEXPECT_EQ(f1_ret.second, 3); + PEXPECT_EQ(f2_ret.second, 4); + + // vti2=0xdf6d50.vp1 + // vti2=0xdf6d50.vp2 + ptr.reset(new vti2); + f = test_delegate(&vtb::vp1, ptr.get()); + f(f1_ret); + f = test_delegate(&vtb::vp2, ptr.get()); + f(f2_ret); + PEXPECT_EQ(f1_ret.first, f2_ret.first); + PEXPECT_EQ(f1_ret.second, 13); + PEXPECT_EQ(f2_ret.second, 14); + + //vb=0x63fafc + //vd1=0x63fae0 + //vd2=0x63faf0 + //vd1=0x63fae0(8) + //vd2=0x63faf0(9) + + forward obj2; + obj2.x = 7; + obj2.y = 8; + obj2.z = 9; + PEXPECT_NE(static_cast<void *>(static_cast<vb *>(&obj2)), static_cast<void *>(static_cast<vd1 *>(&obj2))); + PEXPECT_NE(static_cast<void *>(static_cast<vb *>(&obj2)), static_cast<void *>(static_cast<vd2 *>(&obj2))); + +#if defined(_MSC_VER) && !defined(__clang__) + f = make_forward_delegate(&forward::xp, &obj2); + f(fr); + PEXPECT_TRUE(fr.second == 7); + std::cout << fr.second << "\n"; +#endif + f = make_forward_delegate(&forward::yp, &obj2); + f(fr); + PEXPECT_EQ(fr.second, 8); + f = make_forward_delegate(&forward::zp, &obj2); + f(fr); + PEXPECT_EQ(fr.second, 9); + //PEXPECT_EQ(plib::ppmf_internal::value, PPMF_TYPE_INTERNAL_MSC); +} diff --git a/src/lib/netlist/tests/test_precommit.cpp b/src/lib/netlist/tests/test_precommit.cpp new file mode 100644 index 00000000000..6faf8029c0b --- /dev/null +++ b/src/lib/netlist/tests/test_precommit.cpp @@ -0,0 +1,27 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file test_precommit.cpp +/// +/// tests to check for experimental code before commit +/// + +#include "nl_config.h" + +#include "plib/pconfig.h" +#include "plib/ppmf.h" +#include "plib/ptests.h" + +PTEST(test_precommit, precommit) +{ + PEXPECT_EQ(PPMF_EXPERIMENTAL, 0); + PEXPECT_EQ(PPMF_USE_MAME_DELEGATES, 0); + + PEXPECT_EQ(netlist::config::use_copy_instead_of_reference::value, false); + PEXPECT_EQ(NL_USE_BACKWARD_EULER, 1); + PEXPECT_EQ(PUSE_FLOAT128, 0); + PEXPECT_EQ(NL_USE_FLOAT128, PUSE_FLOAT128); + PEXPECT_EQ(NL_USE_INPLACE_CORE_TERMS, 0); + PEXPECT_EQ(netlist::config::avoid_noop_queue_pushes::value, false); +} diff --git a/src/lib/netlist/tests/test_pstring.cpp b/src/lib/netlist/tests/test_pstring.cpp new file mode 100644 index 00000000000..3196e634ea6 --- /dev/null +++ b/src/lib/netlist/tests/test_pstring.cpp @@ -0,0 +1,19 @@ +// license:BSD-3-Clause +// copyright-holders:Couriersud + +/// +/// \file test_pstring.cpp +/// +/// tests for pstring +/// + +#include "plib/ptests.h" + +#include "plib/pexception.h" +#include "plib/pstring.h" + +PTEST(pstring, conversion) +{ + PEXPECT_EQ( putf8string("Общая ком"), putf8string(putf16string(putf8string("Общая ком")))); + PEXPECT_EQ( putf8string("Общая ком"), putf8string(putf16string("Общая ком"))); +} diff --git a/src/lib/netlist/tools/nl_convert.cpp b/src/lib/netlist/tools/nl_convert.cpp index 3e705910bf4..2859034c166 100644 --- a/src/lib/netlist/tools/nl_convert.cpp +++ b/src/lib/netlist/tools/nl_convert.cpp @@ -1,24 +1,29 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_convert.c - * - */ #include "plib/palloc.h" -#include "nl_convert.h" +#include "plib/pstonum.h" +#include "plib/pstrutil.h" #include "plib/putil.h" +#include "nl_convert.h" + +#include <cstdio> #include <algorithm> -#include <cmath> #include <unordered_map> +#include <vector> + +namespace netlist::convert +{ -/* FIXME: temporarily defined here - should be in a file */ -/* FIXME: family logic in netlist is convoluted, create - * define a model param on core device - */ -/* Format: external name,netlist device,model */ -static const char * s_lib_map = +// FIXME: temporarily defined here - should be in a file +// FIXME: family logic in netlist is convoluted, create +// define a model param on core device + +// Format: external name,netlist device,model + +// NOLINTNEXTLINE(cppcoreguidelines-avoid-c-arrays,modernize-avoid-c-arrays) +static constexpr const char s_lib_map[] = "SN74LS00D, TTL_7400_DIP, 74LSXX\n" "SN74LS04D, TTL_7404_DIP, 74LSXX\n" "SN74ALS08D, TTL_7408_DIP, 74ALSXX\n" @@ -43,47 +48,57 @@ using lib_map_t = std::unordered_map<pstring, lib_map_entry>; static lib_map_t read_lib_map(const pstring &lm) { - auto reader = plib::putf8_reader(std::istringstream(lm)); + auto reader = plib::putf8_reader(std::make_unique<std::istringstream>(putf8string(lm))); reader.stream().imbue(std::locale::classic()); lib_map_t m; - pstring line; - while (reader.readline(line)) + putf8string line; + while (reader.read_line(line)) { - std::vector<pstring> split(plib::psplit(line, ",")); + std::vector<pstring> split(plib::psplit(pstring(line), ',')); m[plib::trim(split[0])] = { plib::trim(split[1]), plib::trim(split[2]) }; } return m; } -/*------------------------------------------------- - convert - convert a spice netlist --------------------------------------------------*/ +// ------------------------------------------------- +// convert - convert a spice netlist +// ------------------------------------------------- nl_convert_base_t::nl_convert_base_t() : out(&m_buf) - , m_numberchars("0123456789-+e.") + , m_number_chars("0123456789-+Ee.") { m_buf.imbue(std::locale::classic()); m_units = { - {"T", "", 1.0e12 }, - {"G", "", 1.0e9 }, - {"MEG", "RES_M({1})", 1.0e6 }, - {"k", "RES_K({1})", 1.0e3 }, /* eagle */ - {"K", "RES_K({1})", 1.0e3 }, - {"", "{1}", 1.0e0 }, - {"M", "CAP_M({1})", 1.0e-3 }, - {"u", "CAP_U({1})", 1.0e-6 }, /* eagle */ - {"U", "CAP_U({1})", 1.0e-6 }, - {"μ", "CAP_U({1})", 1.0e-6 }, - {"µ", "CAP_U({1})", 1.0e-6 }, - {"N", "CAP_N({1})", 1.0e-9 }, - {"pF", "CAP_P({1})", 1.0e-12}, - {"P", "CAP_P({1})", 1.0e-12}, - {"F", "{1}e-15", 1.0e-15}, - - {"MIL", "{1}", 25.4e-6} + {"T", "{1}e12", 1.0e12 }, // NOLINT + {"G", "{1}e9", 1.0e9 }, // NOLINT + {"MEG", "RES_M({1})", 1.0e6 }, // NOLINT + {"k", "RES_K({1})", 1.0e3 }, // NOLINT: eagle + {"K", "RES_K({1})", 1.0e3 }, // NOLINT + {"", "{1}", 1.0e0 }, // NOLINT + {"M", "{1}e-3", 1.0e-3 }, // NOLINT + {"u", "CAP_U({1})", 1.0e-6 }, // NOLINT: eagle + {"U", "CAP_U({1})", 1.0e-6 }, // NOLINT + {"μ", "CAP_U({1})", 1.0e-6 }, // NOLINT + {"N", "CAP_N({1})", 1.0e-9 }, // NOLINT + {"pF", "CAP_P({1})", 1.0e-12}, // NOLINT + {"P", "CAP_P({1})", 1.0e-12}, // NOLINT + {"F", "{1}e-15", 1.0e-15}, // NOLINT + + {"MIL", "{1}", 25.4e-6} // NOLINT }; + dev_map = + { + { "VCCS", {"OP", "ON", "IP", "IN"} }, + { "VCVS", {"OP", "ON", "IP", "IN"} }, + { "CCCS", {"OP", "ON", "IP", "IN"} }, + { "CCVS", {"OP", "ON", "IP", "IN"} }, + { "VS", {"1", "2"} }, + { "TTL_INPUT", {"Q", "VCC", "GND"} }, + { "DIODE", {"A", "K"} }, + { "POT", {"1", "2", "3"} }, + }; } nl_convert_base_t::~nl_convert_base_t() @@ -96,15 +111,20 @@ nl_convert_base_t::~nl_convert_base_t() void nl_convert_base_t::add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias) { pstring pname = devname + "." + name; - m_pins.emplace(pname, plib::make_unique<pin_alias_t>(pname, devname + "." + alias)); + m_pins.emplace(pname, plib::make_unique<pin_alias_t, arena>(pname, devname + "." + alias)); } void nl_convert_base_t::add_ext_alias(const pstring &alias) { - m_ext_alias.push_back(alias); + m_ext_alias.emplace_back(alias, alias); } -void nl_convert_base_t::add_device(plib::unique_ptr<dev_t> dev) +void nl_convert_base_t::add_ext_alias(const pstring &alias, const pstring &net) +{ + m_ext_alias.emplace_back(alias, net); +} + +void nl_convert_base_t::add_device(arena::unique_ptr<dev_t> dev) { for (auto & d : m_devs) if (d->name() == dev->name()) @@ -117,31 +137,35 @@ void nl_convert_base_t::add_device(plib::unique_ptr<dev_t> dev) void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, const pstring &amodel) { - add_device(plib::make_unique<dev_t>(atype, aname, amodel)); + add_device(plib::make_unique<dev_t, arena>(atype, aname, amodel)); } void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname, double aval) { - add_device(plib::make_unique<dev_t>(atype, aname, aval)); + add_device(plib::make_unique<dev_t, arena>(atype, aname, aval)); } void nl_convert_base_t::add_device(const pstring &atype, const pstring &aname) { - add_device(plib::make_unique<dev_t>(atype, aname)); + add_device(plib::make_unique<dev_t, arena>(atype, aname)); } void nl_convert_base_t::add_term(const pstring &netname, const pstring &termname) { + // Ignore NC nets! + if (plib::startsWith(netname,"NC_")) + return; + net_t * net = nullptr; auto idx = m_nets.find(netname); if (idx != m_nets.end()) net = m_nets[netname].get(); else { - auto nets = plib::make_unique<net_t>(netname); + auto nets = plib::make_unique<net_t, arena>(netname); net = nets.get(); m_nets.emplace(netname, std::move(nets)); } - /* if there is a pin alias, translate ... */ + // if there is a pin alias, translate ... pin_alias_t *alias = m_pins[termname].get(); if (alias != nullptr) @@ -150,19 +174,77 @@ void nl_convert_base_t::add_term(const pstring &netname, const pstring &termname net->terminals().push_back(termname); } +void nl_convert_base_t::add_term(const pstring &netname, const pstring &devname, unsigned term) +{ + auto e = dev_map.find(get_device(devname)->type()); + if (e == dev_map.end()) + out("// ERROR: No terminals found for device {}\n", devname); + else + { + if (term >= e->second.size()) + out("// ERROR: {} : Term {} exceeds number of terminals {}\n", netname, devname, term); + else + add_term(netname, devname + "." + e->second[term]); + } +} + +void nl_convert_base_t::add_device_extra_s(const pstring &devname, const pstring &extra) +{ + auto *dev = get_device(devname); + if (dev == nullptr) + out("// ERROR: Device {} not found\n", devname); + else + { + dev->add_extra(extra); + } +} + + + void nl_convert_base_t::dump_nl() { + // do replacements + for (auto &r : m_replace) + { + // Get the device entry + auto *d = get_device(r.m_ce); + if (d == nullptr) + { + out("ERROR: Can not find <{}>\n", r.m_ce); + continue; + } + + auto e = dev_map.find(d->type()); + if (e == dev_map.end()) + { + out("ERROR: Can not find type {}\n", d->type()); + continue; + } + pstring term1 = r.m_ce + "." + e->second[0]; + // scan all nets + for (auto &n : m_nets) + { + for (auto &t : n.second->terminals()) + { + if (t == term1) + t = r.m_repterm; + } + } + add_term(r.m_net, term1); + } + for (auto & alias : m_ext_alias) { - net_t *net = m_nets[alias].get(); + net_t *net = m_nets[alias.second].get(); // use the first terminal ... - out("ALIAS({}, {})\n", alias.c_str(), net->terminals()[0].c_str()); + out("ALIAS({}, {})\n", alias.first, net->terminals()[0]); // if the aliased net only has this one terminal connected ==> don't dump if (net->terminals().size() == 1) net->set_no_export(); } std::vector<size_t> sorted; + sorted.reserve(m_devs.size()); for (size_t i=0; i < m_devs.size(); i++) sorted.push_back(i); std::sort(sorted.begin(), sorted.end(), @@ -173,48 +255,63 @@ void nl_convert_base_t::dump_nl() std::size_t j = sorted[i]; if (m_devs[j]->has_value()) - out("{}({}, {})\n", m_devs[j]->type().c_str(), - m_devs[j]->name().c_str(), get_nl_val(m_devs[j]->value()).c_str()); + { + pstring t = m_devs[j]->type(); + pstring vals = (t == "RES" || t == "CAP") ? get_nl_val(m_devs[j]->value()) : plib::pfmt("{1:g}")(m_devs[j]->value()); + out("{}({}, {})\n", t, m_devs[j]->name(), vals); + } else if (m_devs[j]->has_model()) - out("{}({}, \"{}\")\n", m_devs[j]->type().c_str(), - m_devs[j]->name().c_str(), m_devs[j]->model().c_str()); + out("{}({}, \"{}\")\n", m_devs[j]->type(), + m_devs[j]->name(), m_devs[j]->model()); else - out("{}({})\n", m_devs[j]->type().c_str(), - m_devs[j]->name().c_str()); + out("{}({})\n", m_devs[j]->type(), + m_devs[j]->name()); + for (const auto &e : m_devs[j]->extra()) + out("{}\n", e); + } // print nets for (auto & i : m_nets) { net_t * net = i.second.get(); - if (!net->is_no_export()) + if (!net->is_no_export() && !(net->terminals().size() == 1 && net->terminals()[0] == "GND" )) { - out("NET_C({}", net->terminals()[0].c_str() ); + out("NET_C({}", net->terminals()[0] ); for (std::size_t j=1; j<net->terminals().size(); j++) { - out(", {}", net->terminals()[j].c_str() ); + out(", {}", net->terminals()[j] ); } out(")\n"); } } + m_replace.clear(); m_devs.clear(); m_nets.clear(); m_pins.clear(); m_ext_alias.clear(); } -const pstring nl_convert_base_t::get_nl_val(const double val) +pstring nl_convert_base_t::get_nl_val(double val) const { - for (auto &e : m_units) + for (const auto &e : m_units) { - if (e.m_mult <= std::abs(val)) - return plib::pfmt(e.m_func)(val / e.m_mult); + if (e.m_mult <= plib::abs(val)) + { + double v = val / e.m_mult; + if (plib::abs(v - std::round(v)) <= 1e-6) + return plib::pfmt(e.m_func)(static_cast<int>(std::round(v))); + return plib::pfmt(e.m_func)(v); + } } + + if (plib::abs(val - std::round(val)) <= 1e-6) + return plib::pfmt("{1}")(static_cast<int>(std::round(val))); return plib::pfmt("{1}")(val); } -double nl_convert_base_t::get_sp_unit(const pstring &unit) +double nl_convert_base_t::get_sp_unit(const pstring &unit) const { - for (auto &e : m_units) + for (const auto &e : m_units) { if (e.m_unit == unit) return e.m_mult; @@ -223,10 +320,10 @@ double nl_convert_base_t::get_sp_unit(const pstring &unit) return 0.0; } -double nl_convert_base_t::get_sp_val(const pstring &sin) +double nl_convert_base_t::get_sp_val(const pstring &sin) const { std::size_t p = 0; - while (p < sin.length() && (m_numberchars.find(sin.substr(p, 1)) != pstring::npos)) + while (p < sin.length() && (m_number_chars.find(sin.substr(p, 1)) != pstring::npos)) ++p; pstring val = plib::left(sin, p); pstring unit = sin.substr(p); @@ -234,40 +331,38 @@ double nl_convert_base_t::get_sp_val(const pstring &sin) return ret; } -#if 0 -std::vector<nl_convert_base_t::unit_t> nl_convert_base_t::m_units = { - {"T", "", 1.0e12 }, - {"G", "", 1.0e9 }, - {"MEG", "RES_M({1})", 1.0e6 }, - {"k", "RES_K({1})", 1.0e3 }, /* eagle */ - {"K", "RES_K({1})", 1.0e3 }, - {"", "{1}", 1.0e0 }, - {"M", "CAP_M({1})", 1.0e-3 }, - {"u", "CAP_U({1})", 1.0e-6 }, /* eagle */ - {"U", "CAP_U({1})", 1.0e-6 }, - {"μ", "CAP_U({1})", 1.0e-6 }, - {"µ", "CAP_U({1})", 1.0e-6 }, - {"N", "CAP_N({1})", 1.0e-9 }, - {"pF", "CAP_P({1})", 1.0e-12}, - {"P", "CAP_P({1})", 1.0e-12}, - {"F", "{1}e-15", 1.0e-15}, - - {"MIL", "{1}", 25.4e-6} -}; -#endif +void nl_convert_spice_t::convert_block(const str_list &contents) +{ + int linenumber = 1; + for (const auto &line : contents) + { + try + { + process_line(line); + } + catch ([[maybe_unused]] const plib::pexception &e) + { + fprintf(stderr, "Error on line: <%d>\n", linenumber); + throw; + } + linenumber++; + } +} + void nl_convert_spice_t::convert(const pstring &contents) { - std::vector<pstring> spnl(plib::psplit(contents, "\n")); + std::vector<pstring> spnl(plib::psplit(contents, '\n')); + std::vector<pstring> after_line_continuation; // Add gnd net // FIXME: Parameter - out("NETLIST_START(dummy)\n"); - add_term("0", "GND"); pstring line = ""; + // process line continuation + for (const auto &i : spnl) { // Basic preprocessing @@ -276,14 +371,56 @@ void nl_convert_spice_t::convert(const pstring &contents) line += inl.substr(1); else { - process_line(line); + after_line_continuation.push_back(line); line = inl; } } - process_line(line); + after_line_continuation.push_back(line); + spnl.clear(); // no longer needed + + // Process sub circuits + + std::vector<std::vector<pstring>> subckts; + std::vector<pstring> nl; + auto inp = after_line_continuation.begin(); + while (inp != after_line_continuation.end()) + { + if (plib::startsWith(*inp, ".SUBCKT")) + { + std::vector<pstring> sub; + while (inp != after_line_continuation.end()) + { + auto s(*inp); + sub.push_back(s); + inp++; + if (plib::startsWith(s, ".ENDS")) + break; + } + subckts.push_back(sub); + } + else + { + nl.push_back(*inp); + inp++; + } + } + + for (const auto &sub : subckts) + { + add_term("0", "GND"); + add_term("GND", "GND"); // For Kicad + convert_block(sub); + } + + out("NETLIST_START(dummy)\n"); + out("{\n"); + add_term("0", "GND"); + add_term("GND", "GND"); // For Kicad + + convert_block(nl); dump_nl(); // FIXME: Parameter - out("NETLIST_END()\n"); + out("}\n"); } static pstring rem(const std::vector<pstring> &vps, std::size_t start) @@ -294,58 +431,79 @@ static pstring rem(const std::vector<pstring> &vps, std::size_t start) return r; } +static int get_poly_count(const pstring &s) +{ + // Brute force + if (s=="POLY(1)") + return 1; + if (s=="POLY(2)") + return 2; + if (s=="POLY(3)") + return 3; + if (s=="POLY(4)") + return 4; + if (s=="POLY(5)") + return 5; + return -1; +} + void nl_convert_spice_t::process_line(const pstring &line) { - if (line != "") + if (!line.empty()) { //printf("// %s\n", line.c_str()); - std::vector<pstring> tt(plib::psplit(line, " ", true)); + std::vector<pstring> tt(plib::psplit(line, ' ', true)); double val = 0.0; switch (tt[0].at(0)) { case ';': - out("// {}\n", line.substr(1)); - break; case '*': - out("// {}\n", line.substr(1).c_str()); + out("// {}\n", line.substr(1)); break; case '.': if (tt[0] == ".SUBCKT") { m_subckt = tt[1] + "_"; out("NETLIST_START({})\n", tt[1]); + out("{\n"); for (std::size_t i=2; i<tt.size(); i++) add_ext_alias(tt[i]); } else if (tt[0] == ".ENDS") { dump_nl(); - out("NETLIST_END()\n"); + out("}\n"); m_subckt = ""; } else if (tt[0] == ".MODEL") { - out("NET_MODEL(\"{} {}\")\n", m_subckt + tt[1], rem(tt,2)); + pstring mod(rem(tt,2)); + // Filter out `ngspice` X=X model declarations + if (tt[1] != mod) + out("NET_MODEL(\"{} {}\")\n", m_subckt + tt[1], mod); + } + else if (tt[0] == ".TITLE" && tt[1] == "KICAD") + { + m_is_kicad = true; } else - out("// {}\n", line.c_str()); + out("// {}\n", line); break; case 'Q': { - /* check for fourth terminal ... should be numeric net - * including "0" or start with "N" (ltspice) - */ + // check for fourth terminal ... should be numeric net + // including "0" or start with "N" (`ltspice`) + pstring model; pstring pins ="CBE"; - bool err; - auto nval = plib::pstonum_ne<long, true>(tt[4], err); - plib::unused_var(nval); + bool err(false); + [[maybe_unused]] auto nval = plib::pstonum_ne<long>(tt[4], err); if ((!err || plib::startsWith(tt[4], "N")) && tt.size() > 5) model = tt[5]; else model = tt[4]; - std::vector<pstring> m(plib::psplit(model,"{")); + std::vector<pstring> m(plib::psplit(model, '{')); if (m.size() == 2) { if (m[1].length() != 4) @@ -367,6 +525,17 @@ void nl_convert_spice_t::process_line(const pstring &line) add_term(tt[2], tt[0] + ".2"); add_term(tt[3], tt[0] + ".3"); } + else if (plib::startsWith(tt[0], "RA")) + { + val = get_sp_val(tt.back()); + for (unsigned int res = 2; res < tt.size(); res++) + { + pstring devname = plib::pfmt("{}.{}")(tt[0], res); + add_device("RES", devname, val); + add_term(tt[1], devname); + add_term(tt[res], devname); + } + } else { val = get_sp_val(tt[3]); @@ -381,55 +550,117 @@ void nl_convert_spice_t::process_line(const pstring &line) add_term(tt[1], tt[0] + ".1"); add_term(tt[2], tt[0] + ".2"); break; - case 'B': // arbitrary behavioural current source - needs manual work afterwords + case 'B': // arbitrary behavioural current source - needs manual work afterwards add_device("CS", tt[0], "/*" + rem(tt, 3) + "*/"); add_term(tt[1], tt[0] + ".P"); add_term(tt[2], tt[0] + ".N"); break; case 'E': - add_device("VCVS", tt[0]); - add_term(tt[1], tt[0] + ".OP"); - add_term(tt[2], tt[0] + ".ON"); - add_term(tt[3], tt[0] + ".IP"); - add_term(tt[4], tt[0] + ".IN"); - out("PARAM({}, {})\n", tt[0] + ".G", tt[5]); - break; - case 'V': - // just simple Voltage sources .... - if (tt[2] == "0") + { + auto n=get_poly_count(tt[3]); + if (n<0) { - val = get_sp_val(tt[3]); - add_device("ANALOG_INPUT", tt[0], val); - add_term(tt[1], tt[0] + ".Q"); - //add_term(tt[2], tt[0] + ".2"); + add_device("VCVS", tt[0], get_sp_val(tt[5])); + add_term(tt[1], tt[0], 0); + add_term(tt[2], tt[0], 1); + add_term(tt[3], tt[0], 2); + add_term(tt[4], tt[0], 3); + //add_device_extra(tt[0], "PARAM({}, {})", tt[0] + ".G", tt[5]); } else - plib::perrlogger("Voltage Source {} not connected to GND\n", tt[0]); + { + unsigned sce(4); + auto scoeff(static_cast<unsigned>(5 + n)); + if ((tt.size() != 5 + 2 * static_cast<unsigned>(n)) || (tt[scoeff-1] != "0")) + { + out("// IGNORED {}: {}\n", tt[0], line); + break; + } + pstring last_net = tt[1]; + for (std::size_t i=0; i < static_cast<std::size_t>(n); i++) + { + pstring devname = plib::pfmt("{}{}")(tt[0], i); + pstring next_net = (i<static_cast<std::size_t>(n)-1) ? plib::pfmt("{}a{}")(tt[1], i) : tt[2]; + auto net2 = plib::psplit(plib::replace_all(plib::replace_all(tt[sce+i],")",""),"(",""),','); + add_device("VCVS", devname, get_sp_val(tt[scoeff+i])); + add_term(last_net, devname, 0); + add_term(next_net, devname, 1); + add_term(net2[0], devname, 2); + add_term(net2[1], devname, 3); + //# add_device_extra(devname, "PARAM({}, {})", devname + ".G", tt[scoeff+i]); + last_net = next_net; + } + } + } break; -#if 0 - // This is wrong ... Need to use something else for inputs! - case 'I': // Input pin special notation + case 'F': { - val = get_sp_val(tt[2]); - add_device("ANALOG_INPUT", tt[0], val); - add_term(tt[1], tt[0] + ".Q"); + auto n=get_poly_count(tt[3]); + unsigned sce(4); + unsigned scoeff(5 + static_cast<unsigned>(n)); + if (n<0) + { + sce = 3; + scoeff = 4; + n = 1; + } + else + { + if ((tt.size() != 5 + 2 * static_cast<unsigned>(n)) || (tt[scoeff-1] != "0")) + { + out("// IGNORED {}: {}\n", tt[0], line); + break; + } + } + for (std::size_t i=0; i < static_cast<std::size_t>(n); i++) + { + pstring devname = plib::pfmt("{}{}")(tt[0], i); + add_device("CCCS", devname, get_sp_val(tt[scoeff+i])); + add_term(tt[1], devname, 0); + add_term(tt[2], devname, 1); + + pstring extra_net_name = devname + "net"; + m_replace.push_back({tt[sce+i], devname + ".IP", extra_net_name }); + add_term(extra_net_name, devname + ".IN"); + //# add_device_extra(devname, "PARAM({}, {})", devname + ".G", tt[scoeff+i]); + } } break; -#else + case 'H': + add_device("CCVS", tt[0], get_sp_val(tt[4])); + add_term(tt[1], tt[0] + ".OP"); + add_term(tt[2], tt[0] + ".ON"); + m_replace.push_back({tt[3], tt[0] + ".IP", tt[2] + "a" }); + add_term(tt[2] + "a", tt[0] + ".IN"); + //add_device_extra(tt[0], "PARAM({}, {})", tt[0] + ".G", tt[4]); + break; + case 'G': + add_device("VCCS", tt[0], get_sp_val(tt[5])); + add_term(tt[1], tt[0], 0); + add_term(tt[2], tt[0], 1); + add_term(tt[3], tt[0], 2); + add_term(tt[4], tt[0], 3); + //add_device_extra(tt[0], "PARAM({}, {})", tt[0] + ".G", tt[5]); + break; + case 'V': + // only DC Voltage sources .... + val = get_sp_val(tt[3] == "DC" ? tt[4] : tt[3]); + add_device("VS", tt[0], val); + add_term(tt[1], tt[0] + ".1"); + add_term(tt[2], tt[0] + ".2"); + break; case 'I': { - val = get_sp_val(tt[3]); + val = get_sp_val(tt[3] == "DC" ? tt[4] : tt[3]); add_device("CS", tt[0], val); add_term(tt[1], tt[0] + ".1"); add_term(tt[2], tt[0] + ".2"); } break; -#endif case 'D': - add_device("DIODE", tt[0], tt[3]); - /* FIXME ==> does Kicad use different notation from LTSPICE */ - add_term(tt[1], tt[0] + ".K"); - add_term(tt[2], tt[0] + ".A"); + add_device("DIODE", tt[0], m_subckt + tt[3]); + add_term(tt[1], tt[0], 0); + add_term(tt[2], tt[0], 1); break; case 'U': case 'X': @@ -439,78 +670,149 @@ void nl_convert_spice_t::process_line(const pstring &line) // FIXME: Parameter pstring xname = plib::replace_all(tt[0], pstring("."), pstring("_")); - pstring tname = "TTL_" + tt[tt.size()-1] + "_DIP"; + // Extract parameters of form X=Y + std::vector<pstring> nets; + std::unordered_map<pstring, pstring> params; + for (std::size_t i=1; i < tt.size(); i++) + { + auto p = tt[i].find('='); + if (p != pstring::npos) + params.emplace(tt[i].substr(0,p), tt[i].substr(p+1)); + else + { + nets.push_back(tt[i]); + } + } + pstring modname = nets[nets.size()-1]; + pstring tname = modname; + if (plib::startsWith(modname, "7")) + tname = "TTL_" + modname + "_DIP"; + else if (plib::startsWith(modname, "4")) + tname = "CD" + modname + "_DIP"; + else if (modname == "ANALOG_INPUT" && params.size()== 1 && params.begin()->first == "V") + { + auto yname=pstring("I_") + tt[0].substr(1); + val = get_sp_val(params["V"]); + add_device(modname, yname, val); + add_term(nets[0], yname + ".Q"); + break; + } + else if (modname == "TTL_INPUT" && params.size()== 1 && params.begin()->first == "L") + { + auto yname=pstring("I_") + tt[0].substr(1); + val = get_sp_val(params["L"]); + add_device(modname, yname, val); + add_term(nets[0], yname, 0); + add_term(nets[1], yname, 1); + add_term(nets[2], yname, 2); + break; + } + else if (modname == "ALIAS" && nets.size() == 2 && params.empty()) + { + auto yname=tt[0].substr(1); + add_ext_alias(yname, nets[0]); + break; + } + else if (modname == "RPOT" && nets.size() == 4 && !params.empty()) + { + auto yname=tt[0]; + auto R = params.find("R"); + auto V = params.find("V"); + if (R != params.end()) + { + add_device("POT", yname, get_sp_val(R->second)); + add_term(nets[0], yname, 0); + add_term(nets[1], yname, 1); + add_term(nets[2], yname, 2); + if (V != params.end()) + add_device_extra(yname, "PARAM({}, {})", yname + ".DIAL", get_sp_val(V->second)); + } + else + out("// IGNORED {}: {}\n", tt[0], line); + break; + } + else + tname = modname + "_DIP"; + add_device(tname, xname); - for (std::size_t i=1; i < tt.size() - 1; i++) + for (std::size_t i=0; i < nets.size() - 1; i++) { - pstring term = plib::pfmt("{1}.{2}")(xname)(i); - add_term(tt[i], term); + // FIXME: + pstring term = plib::pfmt("{1}.{2}")(xname)(i+1); + add_term(nets[i], term); } break; } default: - out("// IGNORED {}: {}\n", tt[0].c_str(), line.c_str()); + out("// IGNORED {}: {}\n", tt[0], line); } } } -/*------------------------------------------------- - Eagle converter --------------------------------------------------*/ +//------------------------------------------------- +// Eagle converter +// ------------------------------------------------- -nl_convert_eagle_t::tokenizer::tokenizer(nl_convert_eagle_t &convert, plib::putf8_reader &&strm) - : plib::ptokenizer(std::move(strm)) +nl_convert_eagle_t::tokenizer::tokenizer(nl_convert_eagle_t &convert) + : plib::tokenizer_t() , m_convert(convert) { this->identifier_chars("abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_.-") .number_chars(".0123456789", "0123456789eE-.") //FIXME: processing of numbers .whitespace(pstring("") + ' ' + static_cast<char>(9) + static_cast<char>(10) + static_cast<char>(13)) - /* FIXME: gnetlist doesn't print comments */ + // FIXME: netlist doesn't print comments .comment("/*", "*/", "//") .string_char('\''); m_tok_ADD = register_token("ADD"); m_tok_VALUE = register_token("VALUE"); m_tok_SIGNAL = register_token("SIGNAL"); m_tok_SEMICOLON = register_token(";"); - /* currently not used, but required for parsing */ + // currently not used, but required for parsing register_token(")"); register_token("("); } -void nl_convert_eagle_t::tokenizer::verror(const pstring &msg, int line_num, const pstring &line) +void nl_convert_eagle_t::tokenizer::verror(const pstring &msg) { - m_convert.out("{} (line {}): {}\n", msg.c_str(), line_num, line.c_str()); + m_convert.out("{}\n", msg); } //FIXME: should accept a stream as well void nl_convert_eagle_t::convert(const pstring &contents) { - tokenizer tok(*this, plib::putf8_reader(std::istringstream(contents))); - tok.stream().stream().imbue(std::locale::classic()); + tokenizer tok(*this); + + tokenizer::token_store tokstor; + plib::putf8_reader u8reader(std::make_unique<std::istringstream>(putf8string(contents))); + + tok.append_to_store(&u8reader, tokstor); + tok.set_token_source(&tokstor); out("NETLIST_START(dummy)\n"); + out("{\n"); add_term("GND", "GND"); add_term("VCC", "VCC"); tokenizer::token_t token = tok.get_token(); while (true) { - if (token.is_type(tokenizer::ENDOFFILE)) + if (token.is_type(tokenizer::token_type::ENDOFFILE)) { dump_nl(); // FIXME: Parameter - out("NETLIST_END()\n"); + out("}\n"); return; } - else if (token.is(tok.m_tok_SEMICOLON)) + + if (token.is(tok.m_tok_SEMICOLON)) { - /* ignore empty statements */ + // ignore empty statements token = tok.get_token(); } else if (token.is(tok.m_tok_ADD)) { pstring name = tok.get_string(); - /* skip to semicolon */ + // skip to semicolon do { token = tok.get_token(); @@ -553,7 +855,7 @@ void nl_convert_eagle_t::convert(const pstring &contents) add_pin_alias(name, "1", "Q"); break; case 'D': - /* Pin 1 = Anode, Pin 2 = Cathode */ + // Pin 1 = Anode, Pin 2 = Cathode add_device("DIODE", name, sval); add_pin_alias(name, "1", "A"); add_pin_alias(name, "2", "K"); @@ -566,7 +868,7 @@ void nl_convert_eagle_t::convert(const pstring &contents) break; } default: - tok.error("// IGNORED " + name); + tok.error(plib::perrmsg("// IGNORED {1}", name)); } } @@ -576,7 +878,7 @@ void nl_convert_eagle_t::convert(const pstring &contents) token = tok.get_token(); while (!token.is(tok.m_tok_SEMICOLON)) { - /* fixme: should check for string */ + // fixme: should check for string pstring devname = token.str(); pstring pin = tok.get_string(); add_term(netname, devname + "." + pin); @@ -584,25 +886,25 @@ void nl_convert_eagle_t::convert(const pstring &contents) } else { - out("Unexpected {}\n", token.str().c_str()); + out("Unexpected {}\n", token.str()); return; } } } -/*------------------------------------------------- - RINF converter --------------------------------------------------*/ +// ------------------------------------------------- +// RINF converter +// ------------------------------------------------- -nl_convert_rinf_t::tokenizer::tokenizer(nl_convert_rinf_t &convert, plib::putf8_reader &&strm) - : plib::ptokenizer(std::move(strm)) +nl_convert_rinf_t::tokenizer::tokenizer(nl_convert_rinf_t &convert) + : plib::tokenizer_t() , m_convert(convert) { this->identifier_chars(".abcdefghijklmnopqrstuvwvxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890_-") .number_chars("0123456789", "0123456789eE-.") //FIXME: processing of numbers .whitespace(pstring("") + ' ' + static_cast<char>(9) + static_cast<char>(10) + static_cast<char>(13)) - /* FIXME: gnetlist doesn't print comments */ + // FIXME: netlist doesn't print comments .comment("","","//") // FIXME:needs to be confirmed .string_char('"'); m_tok_HEA = register_token(".HEA"); @@ -616,56 +918,62 @@ nl_convert_rinf_t::tokenizer::tokenizer(nl_convert_rinf_t &convert, plib::putf8_ m_tok_END = register_token(".END"); } -void nl_convert_rinf_t::tokenizer::verror(const pstring &msg, int line_num, const pstring &line) +void nl_convert_rinf_t::tokenizer::verror(const pstring &msg) { - m_convert.out("{} (line {}): {}\n", msg.c_str(), line_num, line.c_str()); + m_convert.out("{}\n", msg); } -/* token_id_t m_tok_HFA; - token_id_t m_tok_APP; - token_id_t m_tok_TIM; - token_id_t m_tok_TYP; - token_id_t m_tok_ADDC; - token_id_t m_tok_ATTC; - token_id_t m_tok_NET; - token_id_t m_tok_TER; - * - */ +// token_id_t m_tok_HFA; +// token_id_t m_tok_APP; +// token_id_t m_tok_TIM; +// token_id_t m_tok_TYP; +// token_id_t m_tok_ADDC; +// token_id_t m_tok_ATTC; +// token_id_t m_tok_NET; +// token_id_t m_tok_TER; void nl_convert_rinf_t::convert(const pstring &contents) { - tokenizer tok(*this, plib::putf8_reader(std::istringstream(contents))); - tok.stream().stream().imbue(std::locale::classic()); + tokenizer tok(*this); + + tokenizer::token_store tokstor; + plib::putf8_reader u8reader(std::make_unique<std::istringstream>(putf8string(contents))); + + tok.append_to_store(&u8reader, tokstor); + tok.set_token_source(&tokstor); + auto lm = read_lib_map(s_lib_map); out("NETLIST_START(dummy)\n"); + out("{\n"); add_term("GND", "GND"); add_term("VCC", "VCC"); tokenizer::token_t token = tok.get_token(); while (true) { - if (token.is_type(tokenizer::ENDOFFILE) || token.is(tok.m_tok_END)) + if (token.is_type(tokenizer::token_type::ENDOFFILE) || token.is(tok.m_tok_END)) { dump_nl(); // FIXME: Parameter - out("NETLIST_END()\n"); + out("}\n"); return; } - else if (token.is(tok.m_tok_HEA)) + + if (token.is(tok.m_tok_HEA)) { - /* seems to be start token - ignore */ + // seems to be start token - ignore token = tok.get_token(); } else if (token.is(tok.m_tok_APP)) { - /* version string */ + // version string pstring app = tok.get_string(); out("// APP: {}\n", app); token = tok.get_token(); } else if (token.is(tok.m_tok_TIM)) { - /* time */ + // time out("// TIM:"); for (int i=0; i<6; i++) { @@ -705,7 +1013,7 @@ void nl_convert_rinf_t::convert(const pstring &contents) pstring sim = attr["Simulation"]; pstring val = attr["Value"]; pstring com = attr["Comment"]; - if (val == "") + if (val.empty()) val = com; if (sim == "CAP") @@ -736,7 +1044,7 @@ void nl_convert_rinf_t::convert(const pstring &contents) if (token.is(tok.m_tok_TER)) { token = tok.get_token(); - while (token.is_type(plib::ptokenizer::IDENTIFIER)) + while (token.is_type(plib::token_reader_t::token_type::IDENTIFIER)) { pin = tok.get_identifier_or_number(); add_term(net, token.str() + "." + pin); @@ -746,7 +1054,7 @@ void nl_convert_rinf_t::convert(const pstring &contents) } #if 0 token = tok.get_token(); - /* skip to semicolon */ + // skip to semicolon do { token = tok.get_token(); @@ -789,7 +1097,7 @@ void nl_convert_rinf_t::convert(const pstring &contents) add_pin_alias(name, "1", "Q"); break; case 'D': - /* Pin 1 = Anode, Pin 2 = Cathode */ + // Pin 1 = Anode, Pin 2 = Cathode add_device("DIODE", name, sval); add_pin_alias(name, "1", "A"); add_pin_alias(name, "2", "K"); @@ -812,7 +1120,7 @@ void nl_convert_rinf_t::convert(const pstring &contents) token = tok.get_token(); while (!token.is(tok.m_tok_SEMICOLON)) { - /* fixme: should check for string */ + // fixme: should check for string pstring devname = token.str(); pstring pin = tok.get_string(); add_term(netname, devname + "." + pin); @@ -827,3 +1135,5 @@ void nl_convert_rinf_t::convert(const pstring &contents) } } + +} // namespace netlist::convert diff --git a/src/lib/netlist/tools/nl_convert.h b/src/lib/netlist/tools/nl_convert.h index e070514d5ed..0e36e85a253 100644 --- a/src/lib/netlist/tools/nl_convert.h +++ b/src/lib/netlist/tools/nl_convert.h @@ -1,35 +1,40 @@ -// license:GPL-2.0+ +// license:BSD-3-Clause // copyright-holders:Couriersud -/* - * nl_convert.h - * - */ - -#pragma once #ifndef NL_CONVERT_H_ #define NL_CONVERT_H_ -#include "plib/plists.h" -#include "plib/pparser.h" +/// +/// \file nl_convert.h +/// + +#include "plib/palloc.h" #include "plib/pstring.h" #include "plib/ptypes.h" #include <memory> -/*------------------------------------------------- - convert - convert a spice netlist --------------------------------------------------*/ +#include "../plib/ptokenizer.h" + +// ------------------------------------------------- +// convert - convert a spice netlist +// ------------------------------------------------- + +namespace netlist::convert +{ + +using arena = plib::aligned_arena<>; class nl_convert_base_t { public: + using str_list = std::vector<pstring>; - COPYASSIGNMOVE(nl_convert_base_t, delete) + PCOPYASSIGNMOVE(nl_convert_base_t, delete) virtual ~nl_convert_base_t(); - pstring result() { return pstring(m_buf.str()); } + pstring result() { return pstring(putf8string(m_buf.str())); } virtual void convert(const pstring &contents) = 0; @@ -39,21 +44,40 @@ protected: void add_pin_alias(const pstring &devname, const pstring &name, const pstring &alias); void add_ext_alias(const pstring &alias); + void add_ext_alias(const pstring &alias, const pstring &net); void add_device(const pstring &atype, const pstring &aname, const pstring &amodel); void add_device(const pstring &atype, const pstring &aname, double aval); void add_device(const pstring &atype, const pstring &aname); + void add_device_extra_s(const pstring &devname, const pstring &extra); + + template<typename... Args> + void add_device_extra(const pstring &devname, const pstring &fmt, Args&&... args) + { + add_device_extra_s(devname, plib::pfmt(fmt)(std::forward<Args>(args)...)); + } + void add_term(const pstring &netname, const pstring &termname); + void add_term(const pstring &netname, const pstring &devname, unsigned term); void dump_nl(); - const pstring get_nl_val(const double val); - double get_sp_unit(const pstring &unit); + pstring get_nl_val(double val) const; + double get_sp_unit(const pstring &unit) const; - double get_sp_val(const pstring &sin); + double get_sp_val(const pstring &sin) const; plib::putf8_fmt_writer out; + + struct replace_t + { + pstring m_ce; // controlling element - must be a two terminal element + pstring m_repterm; // replace with terminal + pstring m_net; // connect to net + }; + std::vector<replace_t> m_replace; + private: struct net_t @@ -62,10 +86,10 @@ private: explicit net_t(pstring aname) : m_name(std::move(aname)), m_no_export(false) {} - const pstring &name() { return m_name;} - std::vector<pstring> &terminals() { return m_terminals; } + const pstring &name() const { return m_name;} + std::vector<pstring> &terminals(){ return m_terminals; } void set_no_export() { m_no_export = true; } - bool is_no_export() { return m_no_export; } + bool is_no_export() const { return m_no_export; } private: pstring m_name; @@ -100,20 +124,23 @@ private: , m_has_val(false) {} - const pstring &name() { return m_name;} - const pstring &type() { return m_type;} - const pstring &model() { return m_model;} - const double &value() { return m_val;} + const pstring &name() const { return m_name;} + const pstring &type() const { return m_type;} + const pstring &model() const { return m_model;} + double value() const { return m_val;} + const str_list &extra() const { return m_extra;} - bool has_model() { return m_model != ""; } - bool has_value() { return m_has_val; } + bool has_model() const { return !m_model.empty(); } + bool has_value() const { return m_has_val; } + void add_extra(const pstring &s) { m_extra.push_back(s); } private: pstring m_type; pstring m_name; pstring m_model; double m_val; bool m_has_val; + str_list m_extra; }; struct unit_t { @@ -128,26 +155,33 @@ private: pin_alias_t(pstring name, pstring alias) : m_name(std::move(name)), m_alias(std::move(alias)) {} - const pstring &name() { return m_name; } - const pstring &alias() { return m_alias; } + const pstring &name() const { return m_name; } + const pstring &alias() const { return m_alias; } private: pstring m_name; pstring m_alias; }; -private: - - void add_device(plib::unique_ptr<dev_t> dev); + void add_device(arena::unique_ptr<dev_t> dev); + dev_t *get_device(const pstring &name) + { + for (auto &e : m_devs) + if (e->name() == name) + return e.get(); + return nullptr; + } std::stringstream m_buf; - std::vector<plib::unique_ptr<dev_t>> m_devs; - std::unordered_map<pstring, plib::unique_ptr<net_t> > m_nets; - std::vector<pstring> m_ext_alias; - std::unordered_map<pstring, plib::unique_ptr<pin_alias_t>> m_pins; + std::vector<arena::unique_ptr<dev_t>> m_devs; + std::unordered_map<pstring, arena::unique_ptr<net_t> > m_nets; + std::vector<std::pair<pstring, pstring>> m_ext_alias; + std::unordered_map<pstring, arena::unique_ptr<pin_alias_t>> m_pins; std::vector<unit_t> m_units; - pstring m_numberchars; + pstring m_number_chars; + + std::unordered_map<pstring, str_list> dev_map; }; @@ -155,37 +189,44 @@ class nl_convert_spice_t : public nl_convert_base_t { public: - nl_convert_spice_t() : nl_convert_base_t() {} + nl_convert_spice_t() : m_is_kicad(false) { } void convert(const pstring &contents) override; protected: + bool is_kicad() const { return m_is_kicad; } + void convert_block(const str_list &contents); void process_line(const pstring &line); private: pstring m_subckt; + bool m_is_kicad; }; class nl_convert_eagle_t : public nl_convert_base_t { public: - nl_convert_eagle_t() : nl_convert_base_t() {} + nl_convert_eagle_t() = default; - class tokenizer : public plib::ptokenizer + class tokenizer : public plib::tokenizer_t, public plib::token_reader_t { public: - tokenizer(nl_convert_eagle_t &convert, plib::putf8_reader &&strm); + using token_t = tokenizer_t::token_t; + using token_type = tokenizer_t::token_type; + using token_id_t = tokenizer_t::token_id_t; + using token_store = tokenizer_t::token_store_t; - token_id_t m_tok_ADD; - token_id_t m_tok_VALUE; - token_id_t m_tok_SIGNAL; - token_id_t m_tok_SEMICOLON; + tokenizer(nl_convert_eagle_t &convert); + token_id_t m_tok_ADD; // NOLINT + token_id_t m_tok_VALUE; // NOLINT + token_id_t m_tok_SIGNAL; // NOLINT + token_id_t m_tok_SEMICOLON; // NOLINT protected: - void verror(const pstring &msg, int line_num, const pstring &line) override; + void verror(const pstring &msg) override; private: nl_convert_eagle_t &m_convert; @@ -204,26 +245,29 @@ class nl_convert_rinf_t : public nl_convert_base_t { public: - nl_convert_rinf_t() : nl_convert_base_t() {} + nl_convert_rinf_t() = default; - class tokenizer : public plib::ptokenizer + class tokenizer : public plib::tokenizer_t, public plib::token_reader_t { public: - tokenizer(nl_convert_rinf_t &convert, plib::putf8_reader &&strm); - - token_id_t m_tok_HEA; - token_id_t m_tok_APP; - token_id_t m_tok_TIM; - token_id_t m_tok_TYP; - token_id_t m_tok_ADDC; - token_id_t m_tok_ATTC; - token_id_t m_tok_NET; - token_id_t m_tok_TER; - token_id_t m_tok_END; - + using token_t = tokenizer_t::token_t; + using token_type = tokenizer_t::token_type; + using token_id_t = tokenizer_t::token_id_t; + using token_store = tokenizer_t::token_store_t; + tokenizer(nl_convert_rinf_t &convert); + + token_id_t m_tok_HEA; // NOLINT + token_id_t m_tok_APP; // NOLINT + token_id_t m_tok_TIM; // NOLINT + token_id_t m_tok_TYP; // NOLINT + token_id_t m_tok_ADDC; // NOLINT + token_id_t m_tok_ATTC; // NOLINT + token_id_t m_tok_NET; // NOLINT + token_id_t m_tok_TER; // NOLINT + token_id_t m_tok_END; // NOLINT protected: - void verror(const pstring &msg, int line_num, const pstring &line) override; + void verror(const pstring &msg) override; private: nl_convert_rinf_t &m_convert; @@ -238,4 +282,6 @@ private: }; -#endif /* NL_CONVERT_H_ */ +} // namespace netlist::convert + +#endif // NL_CONVERT_H_ |