[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Gnucap-devel] node_t::map
From: |
al davis |
Subject: |
Re: [Gnucap-devel] node_t::map |
Date: |
Sat, 15 Dec 2012 19:33:44 -0500 |
User-agent: |
KMail/1.13.5 (Linux/2.6.32-5-amd64; KDE/4.4.5; x86_64; ; ) |
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.
It is set in alloc_hold_vectors. Don't tamper with it.
> afaics (as of now) in node_t::map, e_() equals t_().
> node_t::map sets _m = to_internal(t_());
> to make collapses work, e_() should be used here.
> (if this is wrong, please tell me how i'm supposed to
> collapse nodes)
I think what you want is:
//============
_n[i] = _n[j];
//============
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.
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.
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.