improved naming

This commit is contained in:
2025-09-18 18:38:07 +03:00
parent 2ec0e2f93f
commit 7750819e83

View File

@@ -377,12 +377,12 @@ namespace omath
cache_friendly_multiply_row_major(const Mat<Columns, OtherColumns, Type, MatStoreType::ROW_MAJOR>& other) const cache_friendly_multiply_row_major(const Mat<Columns, OtherColumns, Type, MatStoreType::ROW_MAJOR>& other) const
{ {
Mat<Rows, OtherColumns, Type, MatStoreType::ROW_MAJOR> result; Mat<Rows, OtherColumns, Type, MatStoreType::ROW_MAJOR> result;
for (std::size_t i = 0; i < Rows; ++i) for (std::size_t row_index = 0; row_index < Rows; ++row_index)
for (std::size_t k = 0; k < Columns; ++k) for (std::size_t column_index = 0; column_index < Columns; ++column_index)
{ {
const Type aik = at(i, k); const Type current_number = at(row_index, column_index);
for (std::size_t j = 0; j < OtherColumns; ++j) for (std::size_t other_column = 0; other_column < OtherColumns; ++other_column)
result.at(i, j) += aik * other.at(k, j); result.at(row_index, other_column) += current_number * other.at(column_index, other_column);
} }
return result; return result;
} }
@@ -392,12 +392,12 @@ namespace omath
const Mat<Columns, OtherColumns, Type, MatStoreType::COLUMN_MAJOR>& other) const const Mat<Columns, OtherColumns, Type, MatStoreType::COLUMN_MAJOR>& other) const
{ {
Mat<Rows, OtherColumns, Type, MatStoreType::COLUMN_MAJOR> result; Mat<Rows, OtherColumns, Type, MatStoreType::COLUMN_MAJOR> result;
for (std::size_t j = 0; j < OtherColumns; ++j) for (std::size_t other_column = 0; other_column < OtherColumns; ++other_column)
for (std::size_t k = 0; k < Columns; ++k) for (std::size_t column_index = 0; column_index < Columns; ++column_index)
{ {
const Type bkj = other.at(k, j); const Type current_number = other.at(column_index, other_column);
for (std::size_t i = 0; i < Rows; ++i) for (std::size_t row_index = 0; row_index < Rows; ++row_index)
result.at(i, j) += at(i, k) * bkj; result.at(row_index, other_column) += at(row_index, column_index) * current_number;
} }
return result; return result;
} }