Closed allshouse closed 7 years ago
This is a valid problem, but it already has issue #136 assigned to it. At this point, we decided to use size(l.coords,1)
to tell the number of loops stored, but this is not the most intuitive solution.
Yes, this is a longstanding and annoying issue. The reason for the current setup is that creating an actual array of loops loses the speed advantage of the C++ MEX files. i.e., a multiple loop object is better stored as a large 2D array wrapped inside a loop class, which the C++ routine can process rapidly. If it was an array of individual loops, they would need to be first packed into a 2D array, which would defeat the purpose. Or maybe it wouldn't make such a big difference.
It is possible to have multiple loops stored in the same variable.
l = braidlab.loop([1 0 0 0; 0 1 0 0]);
When typing
whos
, Matlab says that l is 1 x 1 regardless of the number of loops in the structure. The built in functionsize
gives the same result. Is it possible to create an internal functionl.size
which gives the number of loops contained in l?