# Checking if a list of vectors are all identical

**URL:** <https://discourse.julialang.org/t/checking-if-a-list-of-vectors-are-all-identical/110215>\
**Category:** Performance\
**Tags:** arrays\
**Created:** [February 14, 2024, 5:33pm UTC](https://discourse.julialang.org/t/checking-if-a-list-of-vectors-are-all-identical/110215 "2024-02-14T17:33:13Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![rocco\_sprmnt21](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/rocco_sprmnt21/32/20127_2.png) [@rocco\_sprmnt21](https://discourse.julialang.org/u/rocco_sprmnt21)\
**Post date:** [February 15, 2024, 8:01am UTC](https://discourse.julialang.org/t/checking-if-a-list-of-vectors-are-all-identical/110215/21 "2024-02-15T08:01:23Z")

</div>

> [@mbauman](#):
>
> … and then there’s Linear Algebra fun to be had with linear dependencies

Could you explain the idea in more detail?

---

<div class="post-metadata">

**Author:** ![Gus\_Hart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gus_hart/32/6987_2.png) [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Post date:** [February 15, 2024, 10:18pm UTC](https://discourse.julialang.org/t/checking-if-a-list-of-vectors-are-all-identical/110215/22 "2024-02-15T22:18:38Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![Gus\_Hart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gus_hart/32/6987_2.png) [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Post date:** [February 15, 2024, 10:22pm UTC](https://discourse.julialang.org/t/checking-if-a-list-of-vectors-are-all-identical/110215/23 "2024-02-15T22:22:19Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![Gus\_Hart](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/gus_hart/32/6987_2.png) [@Gus\_Hart](https://discourse.julialang.org/u/Gus_Hart)\
**Post date:** [February 15, 2024, 10:35pm UTC](https://discourse.julialang.org/t/checking-if-a-list-of-vectors-are-all-identical/110215/24 "2024-02-15T22:35:06Z")

</div>

Wanted to give all that responded a big thank you. 🙏 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!

[Previous page](https://discourse.julialang.org/t/checking-if-a-list-of-vectors-are-all-identical/110215.md?page=1)
