From: Paul Bignier Date: Thu, 24 Jul 2014 13:32:23 +0000 (+0200) Subject: * Bug #13531 fixed - Fixed sylv help page to include the real Sylester equation. X-Git-Tag: 5.5.2~53 X-Git-Url: http://gitweb.scilab.org/?p=scilab.git;a=commitdiff_plain;h=1e134f3b637372995148ae832cb352761f4101ac;hp=91ceb93c93edf78d1cc4331514ec5fab1b9ca318 * Bug #13531 fixed - Fixed sylv help page to include the real Sylester equation. Change-Id: I1f419cd66fd408b7e6e69cd4ff43c75c143df842 --- diff --git a/scilab/CHANGES_5.5.X b/scilab/CHANGES_5.5.X index dbac1cf..0594eb5 100644 --- a/scilab/CHANGES_5.5.X +++ b/scilab/CHANGES_5.5.X @@ -56,6 +56,8 @@ Scilab Bug Fixes * Bug #13372 fixed - xsetm should have been removed in Scilab 5.5.0. +* Bug #13531 fixed - sylv help page fixed to include the real Sylvester equation. + * Bug #13549 fixed - Slider uicontrols triggered three callbacks instead of one. * Bug #13586 fixed - Scilab compilation failed with recent versions of JoGL package. diff --git a/scilab/modules/cacsd/macros/sylv.sci b/scilab/modules/cacsd/macros/sylv.sci index 4eabad1..c1a51bc 100644 --- a/scilab/modules/cacsd/macros/sylv.sci +++ b/scilab/modules/cacsd/macros/sylv.sci @@ -8,7 +8,7 @@ // http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt function X = sylv(A,B,C,flag) - // solve A*X+X*B=C if flag=='c' or A*X*B-X=C if flag=='d' + // solve A*X+X*B=C if flag=='c' or A*X*B+X=C if flag=='d' if argn(2)<>4 then error(msprintf(gettext("%s: Wrong number of input argument(s): %d expected.\n"),"sylv",4)) end diff --git a/scilab/modules/cacsd/tests/unit_tests/sylv.dia.ref b/scilab/modules/cacsd/tests/unit_tests/sylv.dia.ref index 4efb106..dc28ac3 100644 --- a/scilab/modules/cacsd/tests/unit_tests/sylv.dia.ref +++ b/scilab/modules/cacsd/tests/unit_tests/sylv.dia.ref @@ -8,9 +8,12 @@ // Run with test_run('cacsd', 'sylv', ['no_check_error_output']); A = rand(4, 4); C = rand(4, 3); B = rand(3, 3); // Solve continuous-time Sylvester equation: A*X+X*B = C -X = sylv(A, B, C, 'c'); +X = sylv(A, B, C, "c"); expected_norm = 1.D-16; if norm(A*X+X*B-C)-expected_norm > 1.D-15 then bugmes();quit;end -// Solve discrete-time Sylvester equation: A*X*B+X = C -X = sylv(A, B, C, 'd'); +// Solve modified discrete-time Sylvester equation: A*X*B+X = C +X = sylv(A, B, C, "d"); if norm(A*X*B+X-C)-expected_norm > 1.D-15 then bugmes();quit;end +// Solve real discrete-time Sylvester equation: A*X*B+X = C +X = -sylv(-A, B, C, "d"); +if norm(A*X*B-X-C)-expected_norm > 1.D-15 then bugmes();quit;end diff --git a/scilab/modules/cacsd/tests/unit_tests/sylv.tst b/scilab/modules/cacsd/tests/unit_tests/sylv.tst index 6c7eecf..c89fcd0 100644 --- a/scilab/modules/cacsd/tests/unit_tests/sylv.tst +++ b/scilab/modules/cacsd/tests/unit_tests/sylv.tst @@ -12,13 +12,18 @@ A = rand(4, 4); C = rand(4, 3); B = rand(3, 3); // Solve continuous-time Sylvester equation: A*X+X*B = C -X = sylv(A, B, C, 'c'); +X = sylv(A, B, C, "c"); expected_norm = 1.D-16; if norm(A*X+X*B-C)-expected_norm > 1.D-15 then pause,end -// Solve discrete-time Sylvester equation: A*X*B+X = C -X = sylv(A, B, C, 'd'); +// Solve modified discrete-time Sylvester equation: A*X*B+X = C +X = sylv(A, B, C, "d"); if norm(A*X*B+X-C)-expected_norm > 1.D-15 then pause,end + +// Solve real discrete-time Sylvester equation: A*X*B+X = C +X = -sylv(-A, B, C, "d"); + +if norm(A*X*B-X-C)-expected_norm > 1.D-15 then pause,end diff --git a/scilab/modules/linear_algebra/help/en_US/pencil/sylv.xml b/scilab/modules/linear_algebra/help/en_US/pencil/sylv.xml index 229a116..4b6d859 100644 --- a/scilab/modules/linear_algebra/help/en_US/pencil/sylv.xml +++ b/scilab/modules/linear_algebra/help/en_US/pencil/sylv.xml @@ -2,11 +2,11 @@ @@ -49,19 +49,33 @@ A*X+X*B = C ]]> X=sylv(A, B, C, 'd') computes X, solution - of the "discrete time" Sylvester equation + of the modified "discrete time" Sylvester equation + + X=-sylv(-A, B, C, 'd') computes X, solution + of the real "discrete time" Sylvester equation + + Examples