[Pkg-electronics-commits] [gnucap] 22/49: fix some cosmetic/minor bugs, update dates and patchlev
felix salfelder
felix-guest at moszumanska.debian.org
Tue Feb 2 21:39:57 UTC 2016
This is an automated email from the git hooks/post-receive script.
felix-guest pushed a commit to branch wip
in repository gnucap.
commit e20cabfd205f765b7f1a9b09fcc8ee95b31ab470
Author: al davis <ad211 at freeelectron.net>
Date: Tue Nov 25 16:34:10 2014 -0500
fix some cosmetic/minor bugs, update dates and patchlev
The most important has to do with optional connections in modelgen.
---
apps/d_bjt.model | 4 ++--
include/d_dot.h | 9 +++++----
include/e_ccsrc.h | 4 ++--
include/e_node.h | 40 +++++++++++++++-------------------------
include/l_lib.h | 2 +-
include/m_matrix.h | 5 +++--
include/m_wave.h | 2 +-
include/patchlev.h | 2 +-
include/spice-wrapper.cc | 2 +-
modelgen/mg_out_dev.cc | 22 ++++++++++++++++------
10 files changed, 47 insertions(+), 45 deletions(-)
diff --git a/apps/d_bjt.model b/apps/d_bjt.model
index 31e0349..944fd31 100644
--- a/apps/d_bjt.model
+++ b/apps/d_bjt.model
@@ -1,4 +1,4 @@
-/* $Id: d_bjt.model,v 26.136 2009/12/08 02:03:49 al Exp $ -*- C++ -*-
+/* $Id: d_bjt.model 2014/11/23 al$ -*- C++ -*-
* Copyright (C) 2002 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -47,7 +47,7 @@ device BUILT_IN_BJT {
id_letter Q;
circuit {
sync;
- ports {c b e} {s};
+ ports {c b e} {s short_to=e};
local_nodes {
ic short_to=c short_if="!OPT::rstray || m->rc == 0.";
ib short_to=b
diff --git a/include/d_dot.h b/include/d_dot.h
index 1616c52..34543ca 100644
--- a/include/d_dot.h
+++ b/include/d_dot.h
@@ -1,4 +1,4 @@
-/*$Id: d_dot.h,v 26.81 2008/05/27 05:34:00 al Exp $ -*- C++ -*-
+/*$Id: d_dot.h 2014/11/23$ -*- C++ -*-
* Copyright (C) 2007 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -20,6 +20,7 @@
* 02110-1301, USA.
*------------------------------------------------------------------
*/
+//testing=script,sparse 2014.11.21
#ifndef D_DOT_H
#define D_DOT_H
#include "e_card.h"
@@ -27,17 +28,17 @@
class DEV_DOT : public CARD {
private:
std::string _s;
- explicit DEV_DOT(const DEV_DOT& p) :CARD(p), _s(p._s) {untested(); set_constant(true);}
+ explicit DEV_DOT(const DEV_DOT& p) :CARD(p), _s(p._s) {set_constant(true);}
public:
explicit DEV_DOT() :CARD() {set_constant(true);}
private: // override virtual
- std::string value_name()const {return "";}
+ std::string value_name()const {untested();return "";}
char id_letter()const {untested();return '\0';}
std::string dev_type()const {untested();return "dotcard";}
CARD* clone()const {return new DEV_DOT(*this);}
public:
void set(const std::string& S) {_s = S;}
- const std::string& s()const {return _s;}
+ const std::string& s()const {untested();return _s;}
};
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/include/e_ccsrc.h b/include/e_ccsrc.h
index fe98f4d..66b7147 100644
--- a/include/e_ccsrc.h
+++ b/include/e_ccsrc.h
@@ -1,4 +1,4 @@
-/*$Id: e_ccsrc.h,v 26.126 2009/10/16 05:29:28 al Exp $ -*- C++ -*-
+/*$Id: e_ccsrc.h 2014/11/23 al$ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -60,7 +60,7 @@ public:
COMMON_COMPONENT* Common, double Value,
const node_t& N0, const node_t& N1,
ELEMENT* Input);
-public: //BUG// for language plugin
+protected:
std::string _input_label;
const ELEMENT* _input;
};
diff --git a/include/e_node.h b/include/e_node.h
index 913ad31..e4f6729 100644
--- a/include/e_node.h
+++ b/include/e_node.h
@@ -1,4 +1,4 @@
-/*$Id: e_node.h,v 26.133 2009/11/26 04:58:04 al Exp $ -*- C++ -*-
+/*$Id: e_node.h 2014/11/23 al$ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -306,33 +306,23 @@ public:
public:
double v0()const {
- //assert(m_() >= 0);
- if (m_() >= 0) {
- assert(m_() <= NODE::_sim->_total_nodes);
- assert(n_());
- //assert(n_()->m_() == m_());
- //assert(n_()->v0() == NODE::_sim->_v0[m_()]);
- return NODE::_sim->_v0[m_()];
- }else{
- //BUG// in BJT model: should not get here but does.
- return 0.;
- }
+ assert(m_() >= 0);
+ assert(m_() <= NODE::_sim->_total_nodes);
+ assert(n_());
+ //assert(n_()->m_() == m_());
+ //assert(n_()->v0() == NODE::_sim->_v0[m_()]);
+ return NODE::_sim->_v0[m_()];
}
-
+
COMPLEX vac()const {
- //assert(m_() >= 0);
- if (m_() >= 0) {
- assert(m_() <= NODE::_sim->_total_nodes);
- assert(n_());
- //assert(n_()->m_() == m_());
- //assert(n_()->vac() == NODE::_ac[m_()]);
- return NODE::_sim->_ac[m_()];
- }else{untested();
- //BUG// assume v0 BUG applies here too.
- return 0.;
- }
+ assert(m_() >= 0);
+ assert(m_() <= NODE::_sim->_total_nodes);
+ assert(n_());
+ //assert(n_()->m_() == m_());
+ //assert(n_()->vac() == NODE::_ac[m_()]);
+ return NODE::_sim->_ac[m_()];
}
-
+
double& i() {
assert(m_() >= 0);
assert(m_() <= NODE::_sim->_total_nodes);
diff --git a/include/l_lib.h b/include/l_lib.h
index c9b5f02..d3f3f2a 100644
--- a/include/l_lib.h
+++ b/include/l_lib.h
@@ -1,4 +1,4 @@
-/*$Id: l_lib.h,v 26.81 2008/05/27 05:34:00 al Exp $ -*- C++ -*-
+/*$Id: l_lib.h 2014/11/23$ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
diff --git a/include/m_matrix.h b/include/m_matrix.h
index a5c7caa..b913978 100644
--- a/include/m_matrix.h
+++ b/include/m_matrix.h
@@ -1,4 +1,4 @@
-/*$Id: m_matrix.h,v 26.131 2009/11/20 08:22:10 al Exp $ -*- C++ -*-
+/*$Id: m_matrix.h 2014/11/23 al$ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -733,7 +733,8 @@ void BSMATRIX<T>::fbsub(T* x, const T* b, T* c) const
}
}
x[0] = 0.;
- //BUG// some things don't work unless there is a zero here.
+ // index starts at 1, but node 0 is ground
+ // x[0]==0 eliminates a lot of "if" statements
}
/*--------------------------------------------------------------------------*/
/*--------------------------------------------------------------------------*/
diff --git a/include/m_wave.h b/include/m_wave.h
index 9822478..0af9606 100644
--- a/include/m_wave.h
+++ b/include/m_wave.h
@@ -1,4 +1,4 @@
-/*$Id: m_wave.h,v 26.86 2008/07/07 22:31:11 al Exp $ -*- C++ -*-
+/*$Id: m_wave.h 2014/11/23$ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
diff --git a/include/patchlev.h b/include/patchlev.h
index 584aafa..4e06ead 100644
--- a/include/patchlev.h
+++ b/include/patchlev.h
@@ -1 +1 @@
-#define PATCHLEVEL "2014-07-08"
+#define PATCHLEVEL "2014-11-23"
diff --git a/include/spice-wrapper.cc b/include/spice-wrapper.cc
index ecc6a3f..ae315e3 100644
--- a/include/spice-wrapper.cc
+++ b/include/spice-wrapper.cc
@@ -1,4 +1,4 @@
-/* $Id: spice-wrapper.cc,v 26.138 2013/04/24 02:32:27 al Exp $ -*- C++ -*-
+/* $Id: spice-wrapper.cc 2014/11/23$ -*- C++ -*-
* Copyright (C) 2007 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
diff --git a/modelgen/mg_out_dev.cc b/modelgen/mg_out_dev.cc
index 4325b5b..098f2ca 100644
--- a/modelgen/mg_out_dev.cc
+++ b/modelgen/mg_out_dev.cc
@@ -1,4 +1,4 @@
-/*$Id: mg_out_dev.cc,v 26.134 2009/11/29 03:44:57 al Exp $ -*- C++ -*-
+/*$Id: mg_out_dev.cc 2014/11/23 al$ -*- C++ -*-
* Copyright (C) 2001 Albert Davis
* Author: Albert Davis <aldavis at gnu.org>
*
@@ -259,10 +259,13 @@ static void make_dev_expand_one_element(std::ofstream& out, const Element& e)
static void make_dev_allocate_local_nodes(std::ofstream& out, const Port& p)
{
make_tag();
- if (p.short_if().empty()) {untested();
- out <<
- " assert(!(_n[n_" << p.name() << "].n_()));\n"
- " _n[n_" << p.name() << "].new_model_node();\n";
+ if (p.short_if().empty()) {
+ out <<
+ " if (!(_n[n_" << p.name() << "].n_())) {\n"
+ " _n[n_" << p.name() << "] = _n[n_" << p.short_to() << "];\n"
+ " }else{\n"
+ " }\n";
+ //BUG// generates bad code if no short_to
}else{
out <<
" //assert(!(_n[n_" << p.name() << "].n_()));\n"
@@ -313,7 +316,14 @@ static void make_dev_expand(std::ofstream& out, const Device& d)
" if (_sim->is_first_expand()) {\n"
" precalc_first();\n"
" precalc_last();\n"
- " // local nodes\n";
+ " // optional nodes\n";
+ for (Port_List::const_iterator
+ p = d.circuit().opt_nodes().begin();
+ p != d.circuit().opt_nodes().end();
+ ++p) {
+ make_dev_allocate_local_nodes(out, **p);
+ }
+ out << " // local nodes\n";
for (Port_List::const_iterator
p = d.circuit().local_nodes().begin();
p != d.circuit().local_nodes().end();
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-electronics/gnucap.git
More information about the Pkg-electronics-commits
mailing list