Skip to content

Commit

Permalink
Normalize determinants of random scaling matrices
Browse files Browse the repository at this point in the history
  • Loading branch information
unageek committed Aug 13, 2024
1 parent dff1568 commit 27e01a9
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,8 @@ polatory::geometry::matrixNd<Dim> random_scaling() {

Matrix scale = Matrix::Identity();
scale.diagonal().array() *= pow(10.0, 0.5 * Vector::Random().array());
// Normalize the determinant.
scale.diagonal() *= std::pow(scale.diagonal().prod(), -1.0 / Dim);

return scale;
}
Expand Down

0 comments on commit 27e01a9

Please sign in to comment.