equal operator for intArray

The engine.
Post Reply
nordic
Posts: 14
Joined: Wed Sep 25, 2013 5:16 pm

equal operator for intArray

Post by nordic »

hi,

i want to compare two int array's with the == operator, which i got returned from DSL_node::Parents(), I know that they got euqal parents, but the comparison doesn't say so. When i iterate over the intArray from 0, to DSL_intArray::NumItems() it behaves like expected, so now my question could it be that the == operator allways compares the vector version? Or what's wrong with my usage. Again the intArrays were returned from DSL_node::Parents() and i didn't modify anything.

Thanks in advance,
nordic
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: equal operator for intArray

Post by shooltz[BayesFusion] »

Unfortunately, the DSL_intArray::noperator== is broken. This is related to really old issue; I suggest that you write your own function iterating over elements from 0 to NumItems() - 1.
nordic
Posts: 14
Joined: Wed Sep 25, 2013 5:16 pm

Re: equal operator for intArray

Post by nordic »

Ahh, ok...
Thanks for the quick request, just like allways
nordic
Posts: 14
Joined: Wed Sep 25, 2013 5:16 pm

Re: equal operator for intArray

Post by nordic »

Am i right, with the assumption that the equaloperator is fully functional for every other array class, like for example DSL_doubleArray?
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: equal operator for intArray

Post by shooltz[BayesFusion] »

nordic wrote:Am i right, with the assumption that the equaloperator is fully functional for every other array class, like for example DSL_doubleArray?
Unfortunately, the issue with operator= is related to fundamental problem with DSL_xxxArray classes (the possibility of different returns from NumItems() and GetSize()).

What are the sources of DSL_doubleArrays you want to compare? Do they come from node definitons or values?
nordic
Posts: 14
Joined: Wed Sep 25, 2013 5:16 pm

Re: equal operator for intArray

Post by nordic »

ok, then i just iterate over the arrays by myself... I'm using it in my unit-tests, so principal they could come from anywhere =)..
shooltz[BayesFusion]
Site Admin
Posts: 1417
Joined: Mon Nov 26, 2007 5:51 pm

Re: equal operator for intArray

Post by shooltz[BayesFusion] »

nordic wrote:ok, then i just iterate over the arrays by myself... I'm using it in my unit-tests, so principal they could come from anywhere =)..
That's the core of the problem with DSL_xxxArray object coming from anywhere - you won't be able to decide between NumItems() and GetSize() when choosing the iteration count.
Post Reply