Skip to content

Commit

Permalink
format
Browse files Browse the repository at this point in the history
  • Loading branch information
igagis committed Jul 30, 2024
1 parent dfd253f commit 758469b
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
30 changes: 18 additions & 12 deletions src/r4/matrix.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -872,13 +872,15 @@ class matrix :
* @return reference to this matrix object.
*/
template <typename enable_type = component_type, size_t dimension>
matrix& translate(const vector<
std::enable_if_t<
((num_rows == 2 && num_columns == 3) ||
(num_rows == num_columns && (num_rows == 3 || num_rows == 4))) &&
(dimension == 2 || dimension == 3) && (dimension < num_columns),
enable_type>,
dimension>& t) noexcept
matrix& translate(
const vector<
std::enable_if_t<
((num_rows == 2 && num_columns == 3) || (num_rows == num_columns && (num_rows == 3 || num_rows == 4))
) && (dimension == 2 || dimension == 3) &&
(dimension < num_columns),
enable_type>,
dimension>& t
) noexcept
{
// only last column of the matrix changes
for (auto& r : *this) {
Expand Down Expand Up @@ -919,9 +921,11 @@ class matrix :
* @return reference to this matrix object.
*/
template <typename enable_type = component_type>
matrix& rotate(std::enable_if_t<
(num_rows == 2 && num_columns == 3) || (num_rows == num_columns && (num_rows == 3 || num_rows == 4)),
enable_type> a) noexcept
matrix& rotate(
std::enable_if_t<
(num_rows == 2 && num_columns == 3) || (num_rows == num_columns && (num_rows == 3 || num_rows == 4)),
enable_type> a
) noexcept
{
if constexpr (num_rows == num_columns) {
// square matrix
Expand Down Expand Up @@ -1090,8 +1094,10 @@ class matrix :
* @param col - index of the column to remove.
*/
template <typename enable_type = component_type>
std::enable_if_t<num_rows == num_columns && (num_rows >= 2), enable_type> minor(size_t row, size_t col)
const noexcept
std::enable_if_t<num_rows == num_columns && (num_rows >= 2), enable_type> minor(
size_t row,
size_t col
) const noexcept
{
return this->remove(row, col).det();
}
Expand Down
3 changes: 2 additions & 1 deletion src/r4/vector.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -693,7 +693,8 @@ class vector :
* @return Cross product of this vector by given vector.
*/
template <typename enable_type = std::conditional_t<dimension == 2, typename base_type::value_type, vector>>
std::enable_if_t<dimension == 2 || dimension == 3 || dimension == 4, enable_type> cross(const vector& vec
std::enable_if_t<dimension == 2 || dimension == 3 || dimension == 4, enable_type> cross(
const vector& vec
) const noexcept
{
if constexpr (dimension == 2) {
Expand Down

0 comments on commit 758469b

Please sign in to comment.