|
From: <par...@us...> - 2011-12-09 21:49:22
|
Revision: 9350
http://octave.svn.sourceforge.net/octave/?rev=9350&view=rev
Author: paramaniac
Date: 2011-12-09 21:49:15 +0000 (Fri, 09 Dec 2011)
Log Message:
-----------
control-devel: convert to new error/warning format (2)
Modified Paths:
--------------
trunk/octave-forge/extra/control-devel/src/slsb16ad.cc
trunk/octave-forge/extra/control-devel/src/slsb16bd.cc
trunk/octave-forge/extra/control-devel/src/slsb16cd.cc
Modified: trunk/octave-forge/extra/control-devel/src/slsb16ad.cc
===================================================================
--- trunk/octave-forge/extra/control-devel/src/slsb16ad.cc 2011-12-09 21:35:20 UTC (rev 9349)
+++ trunk/octave-forge/extra/control-devel/src/slsb16ad.cc 2011-12-09 21:49:15 UTC (rev 9350)
@@ -263,71 +263,45 @@
if (f77_exception_encountered)
error ("conred: exception in SLICOT subroutine SB16AD");
-
- if (info != 0)
- {
- if (info < 0)
- error ("conred: the %d-th argument had an invalid value", info);
- else
- {
- switch (info)
- {
- case 1:
- error ("conred: 1: the closed-loop system is not well-posed; "
- "its feedthrough matrix is (numerically) singular");
- case 2:
- error ("conred: 2: the computation of the real Schur form of the "
- "closed-loop state matrix failed");
- case 3:
- error ("conred: 3: the closed-loop state matrix is not stable");
- case 4:
- error ("conred: 4: the solution of a symmetric eigenproblem failed");
- case 5:
- error ("conred: 5: the computation of the ordered real Schur form "
- "of Ac failed");
- case 6:
- error ("conred: 6: the separation of the ALPHA-stable/unstable "
- "diagonal blocks failed because of very close eigenvalues");
- case 7:
- error ("conred: 7: the computation of Hankel singular values failed");
- default:
- error ("conred: unknown error, info = %d", info);
- }
- }
- }
-
- if (iwarn != 0)
- {
- switch (iwarn)
- {
- case 1:
- warning ("conred: 1: with ORDSEL = 'F', the selected order NCR is greater "
- "than NSMIN, the sum of the order of the "
- "ALPHA-unstable part and the order of a minimal "
- "realization of the ALPHA-stable part of the given "
- "controller; in this case, the resulting NCR is set "
- "equal to NSMIN.");
- break;
- case 2:
- warning ("conred: 2: with ORDSEL = 'F', the selected order NCR "
- "corresponds to repeated singular values for the "
- "ALPHA-stable part of the controller, which are "
- "neither all included nor all excluded from the "
- "reduced model; in this case, the resulting NCR is "
- "automatically decreased to exclude all repeated "
- "singular values.");
- break;
- case 3:
- warning ("conred: 3: with ORDSEL = 'F', the selected order NCR is less "
- "than the order of the ALPHA-unstable part of the "
- "given controller. In this case NCR is set equal to "
- "the order of the ALPHA-unstable part.");
- break;
- default:
- warning ("conred: unknown warning, iwarn = %d", iwarn);
- }
- }
+ static const char* err_msg[] = {
+ "0: OK",
+ "1: the closed-loop system is not well-posed; "
+ "its feedthrough matrix is (numerically) singular",
+ "2: the computation of the real Schur form of the "
+ "closed-loop state matrix failed",
+ "3: the closed-loop state matrix is not stable",
+ "4: the solution of a symmetric eigenproblem failed",
+ "5: the computation of the ordered real Schur form "
+ "of Ac failed",
+ "6: the separation of the ALPHA-stable/unstable "
+ "diagonal blocks failed because of very close eigenvalues",
+ "7: the computation of Hankel singular values failed"};
+
+ static const char* warn_msg[] = {
+ "0: OK",
+ "1: with ORDSEL = 'F', the selected order NCR is greater "
+ "than NSMIN, the sum of the order of the "
+ "ALPHA-unstable part and the order of a minimal "
+ "realization of the ALPHA-stable part of the given "
+ "controller; in this case, the resulting NCR is set "
+ "equal to NSMIN.",
+ "2: with ORDSEL = 'F', the selected order NCR "
+ "corresponds to repeated singular values for the "
+ "ALPHA-stable part of the controller, which are "
+ "neither all included nor all excluded from the "
+ "reduced model; in this case, the resulting NCR is "
+ "automatically decreased to exclude all repeated "
+ "singular values.",
+ "3: with ORDSEL = 'F', the selected order NCR is less "
+ "than the order of the ALPHA-unstable part of the "
+ "given controller. In this case NCR is set equal to "
+ "the order of the ALPHA-unstable part."};
+
+ error_msg ("conred", info, 7, err_msg);
+ warning_msg ("conred", iwarn, 3, warn_msg);
+
+
// resize
ac.resize (ncr, ncr);
bc.resize (ncr, p); // p: number of plant outputs
Modified: trunk/octave-forge/extra/control-devel/src/slsb16bd.cc
===================================================================
--- trunk/octave-forge/extra/control-devel/src/slsb16bd.cc 2011-12-09 21:35:20 UTC (rev 9349)
+++ trunk/octave-forge/extra/control-devel/src/slsb16bd.cc 2011-12-09 21:49:15 UTC (rev 9350)
@@ -226,50 +226,30 @@
if (f77_exception_encountered)
- error ("conred: exception in SLICOT subroutine SB16BD");
-
- if (info != 0)
- {
- if (info < 0)
- error ("conred: the %d-th argument had an invalid value", info);
- else
- {
- switch (info)
- {
- case 1:
- error ("conred: 1: the reduction of A+G*C to a real Schur form "
- "failed");
- case 2:
- error ("conred: 2: the matrix A+G*C is not stable (if DICO = 'C'), "
- "or not convergent (if DICO = 'D')");
- case 3:
- error ("conred: 3: the computation of Hankel singular values failed");
- case 4:
- error ("conred: 4: the reduction of A+B*F to a real Schur form "
- "failed");
- case 5:
- error ("conred: 5: the matrix A+B*F is not stable (if DICO = 'C'), "
- "or not convergent (if DICO = 'D')");
- default:
- error ("conred: unknown error, info = %d", info);
- }
- }
- }
-
- if (iwarn != 0)
- {
- switch (iwarn)
- {
- case 1:
- warning ("conred: 1: with ORDSEL = 'F', the selected order NCR is "
- "greater than the order of a minimal "
- "realization of the controller.");
- break;
- default:
- warning ("conred: unknown warning, iwarn = %d", iwarn);
- }
- }
+ error ("cfconred: exception in SLICOT subroutine SB16BD");
+ static const char* err_msg[] = {
+ "0: OK",
+ "1: the reduction of A+G*C to a real Schur form "
+ "failed",
+ "2: the matrix A+G*C is not stable (if DICO = 'C'), "
+ "or not convergent (if DICO = 'D')",
+ "3: the computation of Hankel singular values failed",
+ "4: the reduction of A+B*F to a real Schur form "
+ "failed",
+ "5: the matrix A+B*F is not stable (if DICO = 'C'), "
+ "or not convergent (if DICO = 'D')"};
+
+ static const char* warn_msg[] = {
+ "0: OK",
+ "1: with ORDSEL = 'F', the selected order NCR is "
+ "greater than the order of a minimal "
+ "realization of the controller."};
+
+ error_msg ("cfconred", info, 5, err_msg);
+ warning_msg ("cfconred", iwarn, 1, warn_msg);
+
+
// resize
a.resize (ncr, ncr); // Ac
g.resize (ncr, p); // Bc
Modified: trunk/octave-forge/extra/control-devel/src/slsb16cd.cc
===================================================================
--- trunk/octave-forge/extra/control-devel/src/slsb16cd.cc 2011-12-09 21:35:20 UTC (rev 9349)
+++ trunk/octave-forge/extra/control-devel/src/slsb16cd.cc 2011-12-09 21:49:15 UTC (rev 9350)
@@ -191,58 +191,35 @@
if (f77_exception_encountered)
- error ("conred: exception in SLICOT subroutine SB16CD");
-
- if (info != 0)
- {
- if (info < 0)
- error ("conred: the %d-th argument had an invalid value", info);
- else
- {
- switch (info)
- {
- case 1:
- error ("conred: 1: eigenvalue computation failure");
- case 2:
- error ("conred: 2: the matrix A+G*C is not stable");
- case 3:
- error ("conred: 3: the matrix A+B*F is not stable");
- case 4:
- error ("conred: 4: the Lyapunov equation for computing the "
- "observability Grammian is (nearly) singular");
- case 5:
- error ("conred: 5: the Lyapunov equation for computing the "
- "controllability Grammian is (nearly) singular");
- case 6:
- error ("conred: 6: the computation of Hankel singular values failed");
- default:
- error ("conred: unknown error, info = %d", info);
- }
- }
- }
-
- if (iwarn != 0)
- {
- switch (iwarn)
- {
- case 1:
- warning ("conred: 1: with ORDSEL = 'F', the selected order NCR is "
- "greater than the order of a minimal realization "
- "of the controller.");
- break;
- case 2:
- warning ("conred: 2: with ORDSEL = 'F', the selected order NCR "
- "corresponds to repeated singular values, which are "
- "neither all included nor all excluded from the "
- "reduced controller. In this case, the resulting NCR "
- "is set automatically to the largest value such that "
- "HSV(NCR) > HSV(NCR+1).");
- break;
- default:
- warning ("conred: unknown warning, iwarn = %d", iwarn);
- }
- }
+ error ("fwcfconred: exception in SLICOT subroutine SB16CD");
+ static const char* err_msg[] = {
+ "0: OK",
+ "1: eigenvalue computation failure",
+ "2: the matrix A+G*C is not stable",
+ "3: the matrix A+B*F is not stable",
+ "4: the Lyapunov equation for computing the "
+ "observability Grammian is (nearly) singular",
+ "5: the Lyapunov equation for computing the "
+ "controllability Grammian is (nearly) singular",
+ "6: the computation of Hankel singular values failed"};
+
+ static const char* warn_msg[] = {
+ "0: OK",
+ "1: with ORDSEL = 'F', the selected order NCR is "
+ "greater than the order of a minimal realization "
+ "of the controller.",
+ "2: with ORDSEL = 'F', the selected order NCR "
+ "corresponds to repeated singular values, which are "
+ "neither all included nor all excluded from the "
+ "reduced controller. In this case, the resulting NCR "
+ "is set automatically to the largest value such that "
+ "HSV(NCR) > HSV(NCR+1)."};
+
+ error_msg ("fwcfconred", info, 6, err_msg);
+ warning_msg ("fwcfconred", iwarn, 2, warn_msg);
+
+
// resize
a.resize (ncr, ncr); // Ac
g.resize (ncr, p); // Bc
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
|