From: <par...@us...> - 2010-05-14 09:50:52
|
Revision: 7303 http://octave.svn.sourceforge.net/octave/?rev=7303&view=rev Author: paramaniac Date: 2010-05-14 09:50:45 +0000 (Fri, 14 May 2010) Log Message: ----------- control: add warnings Modified Paths: -------------- trunk/octave-forge/main/control/inst/dlyap.m trunk/octave-forge/main/control/inst/lyap.m Modified: trunk/octave-forge/main/control/inst/dlyap.m =================================================================== --- trunk/octave-forge/main/control/inst/dlyap.m 2010-05-14 07:33:50 UTC (rev 7302) +++ trunk/octave-forge/main/control/inst/dlyap.m 2010-05-14 09:50:45 UTC (rev 7303) @@ -59,7 +59,11 @@ [x, scale] = slsb03md (a, -b, true); # AXA' - X = -B - x /= scale; # 0 < scale <= 1 + ## x /= scale; # 0 < scale <= 1 + + if (scale < 1) + warning ("dlyap: solution scaled by %g to prevent overflow", scale); + endif case 3 # Sylvester equation @@ -113,8 +117,12 @@ [x, scale] = slsg03ad (a, e, -b, true); # AXA' - EXE' = -B - x /= scale; # 0 < scale <= 1 + ## x /= scale; # 0 < scale <= 1 + if (scale < 1) + warning ("dlyap: solution scaled by %g to prevent overflow", scale); + endif + otherwise print_usage (); Modified: trunk/octave-forge/main/control/inst/lyap.m =================================================================== --- trunk/octave-forge/main/control/inst/lyap.m 2010-05-14 07:33:50 UTC (rev 7302) +++ trunk/octave-forge/main/control/inst/lyap.m 2010-05-14 09:50:45 UTC (rev 7303) @@ -59,7 +59,11 @@ [x, scale] = slsb03md (a, -b, false); # AX + XA' = -B - x /= scale; # 0 < scale <= 1 + ## x /= scale; # 0 < scale <= 1 + + if (scale < 1) + warning ("lyap: solution scaled by %g to prevent overflow", scale); + endif case 3 # Sylvester equation @@ -113,8 +117,12 @@ [x, scale] = slsg03ad (a, e, -b, false); # AXE' + EXA' = -B - x /= scale; # 0 < scale <= 1 + ## x /= scale; # 0 < scale <= 1 + if (scale < 1) + warning ("lyap: solution scaled by %g to prevent overflow", scale); + endif + otherwise print_usage (); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |