Hot answers tagged

4

Certainly. There are a few things you have to define for your type that are listed on this page in the documentation: https://eigen.tuxfamily.org/dox/TopicCustomizing_CustomScalar.html It basically boils down to defining arithmetic operators appropriately for your type, plus specializing a traits template NumTraits that describes your type. The link above ...


2

Of course you can! The starting vector is completely arbitrary. You'll get breakdown at step 1 if you do though. Be sure to check what it entails. This will typically happen by a "happy accident" rather than by your explicit choice: if you already know an eigenvector then you don't need to run Lanczos to compute it (or you need to run it with a ...


2

What you're describing is also a critical step in the k-nearest-neighbours method. So no need to reinvent the wheel, we can just look how other people have sped up that algorithm. I don't know about any dictionary like structure that returns this directly, but you could use a k-d tree. If properly implemented, you can get the k closest vectors pretty quickly....


2

Easy: Decompose the polygons into (unoriented) line segments each of which is sorted by vertex index: $$ A = \{[1,2], [2,3], [3,4], [4,5], [1,5]\}, \\ B = \{ [1,6], [6,7],[7,8],[3,8], [2,3], [1,2] \}. $$ Then you want to want to consider the union of all of these edges, but removing the duplicated ones. So you need to form $$ (A \cup B) \setminus (A \...


Only top voted, non community-wiki answers of a minimum length are eligible