Skip to content

Commit

Permalink
remove another conversion
Browse files Browse the repository at this point in the history
  • Loading branch information
niermann999 committed Mar 26, 2023
1 parent 545e6c5 commit 05ebfae
Showing 1 changed file with 15 additions and 16 deletions.
31 changes: 15 additions & 16 deletions math/vc_soa/include/algebra/math/impl/vc_soa_transform3.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,22 +97,22 @@ struct element_getter {

/// Get const access to a matrix element
ALGEBRA_HOST inline const auto &operator()(
const matrix44<scalar_t, array_t> &m, unsigned int row,
unsigned int col) const {
const matrix44<scalar_t, array_t> &m, std::size_t row,
std::size_t col) const {

// Make sure that the indices are valid.
assert(row < 4);
assert(col < 4);
assert(row < 4u);
assert(col < 4u);

// Return the selected element.
switch (col) {
case 0:
case 0u:
return m.x[row];
case 1:
case 1u:
return m.y[row];
case 2:
case 2u:
return m.z[row];
case 3:
case 3u:
return m.t[row];
default:
return m.x[0];
Expand All @@ -121,22 +121,21 @@ struct element_getter {

/// Get const access to a matrix element
ALGEBRA_HOST inline auto &operator()(matrix44<scalar_t, array_t> &m,
unsigned int row,
unsigned int col) const {
std::size_t row, std::size_t col) const {

// Make sure that the indices are valid.
assert(row < 4);
assert(col < 4);
assert(row < 4u);
assert(col < 4u);

// Return the selected element.
switch (col) {
case 0:
case 0u:
return m.x[row];
case 1:
case 1u:
return m.y[row];
case 2:
case 2u:
return m.z[row];
case 3:
case 3u:
return m.t[row];
default:
return m.x[0];
Expand Down

0 comments on commit 05ebfae

Please sign in to comment.