[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnucap-devel] node_t::map
From: |
Felix Salfelder |
Subject: |
Re: [Gnucap-devel] node_t::map |
Date: |
Sun, 16 Dec 2012 12:09:37 +0100 |
User-agent: |
Mutt/1.5.20 (2009-06-14) |
Hi Al.
On Sat, Dec 15, 2012 at 07:33:44PM -0500, al davis wrote:
> On Saturday 15 December 2012, Felix Salfelder wrote:
> > as it seems, the call
> > _n[i].n_()->set_user_number(_n[j].e_())
> > from DEV::expand collapses the nodes i and j.
>
> No.
>
> [..]
>
> I think what you want is:
> //============
> _n[i] = _n[j];
> //============
hmmm. not really. if i do this in, say, NET::expand, it will just
connect that net to the same node twice (does it?)
> This is old code, originally written in "C", still really in
> "C".
>
> Think of node_t as a pointer, or like "NODE*". node_t should
> really be a NODE::iterator.
in a way, i did. a node_t is a "pointer" to the NODE (*n_()), which i
tried to collapse. (don't worry, it doesn't yet work the way i hoped ;)
> A "NODE" is the actual node. It stores info, and exists once
> for each, all in the _nstat array.
>
> Think of that "user_number" as an un-pointer, kind of like the
> "&" takes the address.
as it seems that is consistant with "user_number is the pointer to the
node/NODE/.. that actually should be used in the end".
> Making the whole _nstat array all LOGIC_NODE is really wasteful.
> and a throwback to the old C code. It is wasteful in the sense
> that analog only nodes carry digital baggage and digital only
> nodes carry analog baggage, just in case it is discovered later
> that you really need a mixed node. A side benefit of this is
> that you can put analog probes on a digital node or digital
> probes on an analog node, and get an answer.
a bit off topic:
hmm, currently node_t holds int _m to point to the node voltage,
probably another int should point to the logic value?
i don't see node_t replaced by NODE::iterators. woudnt that move NODE*
magic like polymorphism and pointer calculation to simulation time?
(havent tried, just a thought)
regards
felix