jeanluct / braidlab

Matlab package for analyzing data using braids
GNU General Public License v3.0
24 stars 10 forks source link

Multiplying empty braid #78

Closed jeanluct closed 9 years ago

jeanluct commented 9 years ago

When multiplying an empty braid by another braid there is an error in the assignment of "privaten." The initial multiplication is succesful, but analysis of the resulting braid results in an error.

#!matlab

>> b1 = braid([]);
>> b2 = braid([-2 1]);
>> b3 = b1*b2;
>> b3.n

This produces the following error

#!matlab

Error using max
Mixed inputs must either be single and double, or integer and
scalar double. All other combinations are no longer allowed.

Error in braidlab.braid/get.n (line 251)
      value = double(max(max(abs(obj.word))+1,obj.privaten));
jeanluct commented 9 years ago

From Jean-Luc Thiffeault on 2014-10-22 13:58:33+00:00

Interesting... thanks for uncovering this. "privaten" was introduced a while back for a very technical reason, and it had not cause any bugs. This had surprised me...

jeanluct commented 9 years ago

From Jean-Luc Thiffeault on 2014-10-22 14:00:29+00:00

Actually, this might be due to an upgrade in Matlab, since the error says: "All other combinations are no longer allowed".

jeanluct commented 9 years ago

From Jean-Luc Thiffeault on 2014-10-22 14:13:12+00:00

Check if empty in set.n. Resolves issue #78.

→ <<cset 57568cdb06bf>>