acts-project / algebra-plugins

Mozilla Public License 2.0
3 stars 10 forks source link

Eigen getter size type template parameter #85

Closed beomki-yeo closed 1 year ago

beomki-yeo commented 1 year ago

As we've discussed today...

stephenswat commented 1 year ago

I think having two separate type variables for the rows and columns is a bit excessive; maybe we can just use the same type for both?

beomki-yeo commented 1 year ago

That was what I tried at the very beginning. But two different types for index are used sometimes in detray:

// e_free_pos: std::size_t
matrix_operator().element(m_vector, e_free_pos0, 0) = pos[0];
stephenswat commented 1 year ago

We should also, I think, cast to Eigen::Index rather than int. Just to be safe!

beomki-yeo commented 1 year ago

@krasznaa Here is the example of errors from clang. It is not from macOS clang but it's the same error anyway..

/home/beomki/projects/detray/detray/tests/common/include/tests/common/coordinate_cartesian2.inl:98:45: error: implicit conversion loses integer precision: 'std::size_t' (aka 'unsigned long') to 'int' [-Werror,-Wshorten-64-to-32]
                EXPECT_NEAR(m.element(J, i, j), 1., isclose);