difference between numpy dot() and inner()

numpy.dot: For 2-D arrays it is equivalent to matrix multiplication, and for 1-D arrays to inner product of vectors (without complex conjugation). For N dimensions it is a sum product over the last axis of a and the second-to-last of b: numpy.inner: Ordinary inner product of vectors for 1-D arrays (without complex conjugation), in higher … Read more

Looking for an explanation of post/pre/set Translate (in Matrix object) and how to use them

The set-methods will replace the current Matrix with new values, disregarding whatever the Matrix contained before. The pre and post method will apply a new transformation before or after whatever the current Matrix contains. In this example, the rotation will be ignored since we are using the set method and the m will only contain … Read more

Convert Eigen Matrix to C array

You can use the data() member function of the Eigen Matrix class. The layout by default is column-major, not row-major as a multidimensional C array (the layout can be chosen when creating a Matrix object). For sparse matrices the preceding sentence obviously doesn’t apply. Example: ArrayXf v = ArrayXf::LinSpaced(11, 0.f, 10.f); // vc is the … Read more