Skip to content

Commit

Permalink
Avoid max({}) in Modelica.Math.Matrices.nullSpace
Browse files Browse the repository at this point in the history
See e.g. the use of this function in ModelicaTest.Math.TestMatrices3.
  • Loading branch information
rfranke committed Jul 12, 2021
1 parent 202251a commit 9a9017a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Modelica/Math/package.mo
Original file line number Diff line number Diff line change
Expand Up @@ -2949,9 +2949,9 @@ r = 3.162;
(sigma,,V) := Modelica.Math.Matrices.singularValues(A);
V := transpose(V);
// rank computation
eps := max(size(A, 1), size(A, 2))*max(sigma)*Modelica.Constants.eps;
rank := 0;
if n > 0 then
eps := max(size(A, 1), size(A, 2)) * max(sigma) * Modelica.Constants.eps;
while i > 0 loop
if sigma[i] > eps then
rank := i;
Expand Down

0 comments on commit 9a9017a

Please sign in to comment.