Re: node_t::map

al davis <[email protected]>
Newsgroups gmane.comp.gnu.gnucap.devel
Message-ID <[email protected]>
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.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.