Skip to content

Commit

Permalink
FIX: Replace isfinite(cn) with cn * eps() < 1 in solve_discrete_r…
Browse files Browse the repository at this point in the history
  • Loading branch information
oyamad committed Oct 25, 2017
1 parent 5246a7d commit 66ec2ec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/matrix_eqn.jl
Expand Up @@ -122,7 +122,7 @@ function solve_discrete_riccati(A::ScalarOrArray, B::ScalarOrArray,
for gamma in candidates
Z = getZ(R, gamma, BB)
cn = cond(Z)
if isfinite(cn)
if cn * eps() < 1
Q_tilde = -Q + N' * (Z \ (N + gamma .* BTA)) + gamma .* I
G0 = B * (Z \ B')
A0 = (I - gamma .* G0) * A - B * (Z \ N)
Expand Down

0 comments on commit 66ec2ec

Please sign in to comment.