Checking if a list of vectors are all identical

Could you explain the idea in more detail?

The use of subscripts here is clever, I think. I never thought of doing that. And thanks for the suggestion on more idiomatic code.

The suggestion to use static arrays is much appreciated. I’ve only used them once, and that was just messing around. StaticArrays isn’t part of my arsenal yet…I should take some time for that. I like the notion of allocation-free, unrolled comparisons/subtractions of vectors.

Wanted to give all that responded a big thank you. :pray: Irrespective of the numerical questions surrounding ≈, I saw a couple of alternative ways of expressing my ideas that expanded my understanding. Thanks! I appreciated the suggestion to think about StaticArrays.jl. Time to do that!

As for the numerical question, my typical use case will not have point clouds that differ by a negligibly small displacement, but it’s important always to remember those kinds of things. And my problem has a well understood “scale” so I’ll be able to safely handle the “nearly zero” dangers.

Thanks again!

2 Likes