Skip to content

Potential bug fix for a corner case in find() and additional method#7

Open
aarpon wants to merge 2 commits intotinevez:masterfrom
aarpon:master
Open

Potential bug fix for a corner case in find() and additional method#7
aarpon wants to merge 2 commits intotinevez:masterfrom
aarpon:master

Conversation

@aarpon
Copy link

@aarpon aarpon commented Apr 9, 2018

Hi! I have been using your great @tree class for a while and I recently committed a small fix and new commodity method. (Sorry that I put them in the same pull request). Please feel free to keep or reject as you wish.

Bug fix in @tree/find

If a tree contains empty values in the Node property, the following will fail:

find(myTree == value)

since

val = [ obj.Node{:} ] ;

in @tree/find will cause the empty values to be dropped. The val array will be shorter than the original obj.Node array and the subsequent

I = find(val, varargin{:});

call will return indices that are not pointing to the correct values in the tree.

Commodity method @tree/findbranchpoints

A while ago I added a @tree/findbranchpoints method that comes in handy when you want to spot all branch points in the tree.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant