annotate scripts/deprecated/syl.m @ 19099:d20c81d3cd21

Deprecate syl, add new function sylvester. * sylvester.cc: New function * syl.cc: Remove syl C++ function. * scriptss/deprecated/syl.m: m-file to replace syl.cc * NEWS: Announce new sylvester function. Announce deprecation of syl. * linalg.txi: Replace reference to syl with sylvester. * libinterp/corefcn/module.mk: Add sylvester.cc to build system. * scripts/deprecated/module.mk: Add syl.m to build system. * CMatrix.cc (Sylvester), dMatrix.cc (Sylvester), fCMatrix.cc (Sylvester), fMatrix.cc (Sylvester): Return +C rather than -C to conform to changed definition of Sylvester equation.
author Rik <rik@octave.org>
date Sun, 31 Aug 2014 21:05:38 -0700
parents
children db92e7e28e1f
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
19099
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
1 ## Copyright (C) 2014 John W. Eaton
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
2 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
3 ## This file is part of Octave.
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
4 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
5 ## Octave is free software; you can redistribute it and/or modify it
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
6 ## under the terms of the GNU General Public License as published by
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
7 ## the Free Software Foundation; either version 3 of the License, or (at
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
8 ## your option) any later version.
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
9 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
10 ## Octave is distributed in the hope that it will be useful, but
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
11 ## WITHOUT ANY WARRANTY; without even the implied warranty of
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
12 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
13 ## General Public License for more details.
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
14 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
15 ## You should have received a copy of the GNU General Public License
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
16 ## along with Octave; see the file COPYING. If not, see
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
17 ## <http://www.gnu.org/licenses/>.
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
18
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
19 ## -*- texinfo -*-
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
20 ## @deftypefn {Built-in Function} {@var{x} =} syl (@var{A}, @var{B}, @var{C})
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
21 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
22 ## @code{syl} is deprecated and will be removed in Octave version 4.6.
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
23 ## Use @code{sylvester} for the equivalent functionality.
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
24 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
25 ## Solve the Sylvester equation
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
26 ## @tex
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
27 ## $$
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
28 ## A X + X B + C = 0
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
29 ## $$
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
30 ## @end tex
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
31 ## @ifnottex
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
32 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
33 ## @example
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
34 ## A X + X B + C = 0
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
35 ## @end example
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
36 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
37 ## @end ifnottex
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
38 ## using standard @sc{lapack} subroutines. For example:
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
39 ##
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
40 ## @example
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
41 ## @group
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
42 ## syl ([1, 2; 3, 4], [5, 6; 7, 8], [9, 10; 11, 12])
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
43 ## @result{} [ -0.50000, -0.66667; -0.66667, -0.50000 ]
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
44 ## @end group
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
45 ## @end example
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
46 ## @end deftypefn
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
47
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
48 ## Deprecated in version 4.2
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
49
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
50 function x = syl (A, B, C)
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
51
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
52 persistent warned = false;
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
53 if (! warned)
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
54 warned = true;
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
55 warning ("Octave:deprecated-function",
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
56 "syl is obsolete and will be removed from a future version of Octave, please use sylvester instead");
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
57 endif
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
58
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
59 if (nargin != 3 || nargout > 1)
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
60 print_usage ();
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
61 endif
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
62
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
63 x = -sylvester (A, B, C);
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
64
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
65 endfunction
d20c81d3cd21 Deprecate syl, add new function sylvester.
Rik <rik@octave.org>
parents:
diff changeset
66