Mercurial > hg > octave-nkf
annotate scripts/deprecated/syl.m @ 20830:b65888ec820e draft default tip gccjit
dmalcom gcc jit import
author | Stefan Mahr <dac922@gmx.de> |
---|---|
date | Fri, 27 Feb 2015 16:59:36 +0100 |
parents | 4197fc428c7d |
children |
rev | line source |
---|---|
19898
4197fc428c7d
maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents:
19842
diff
changeset
|
1 ## Copyright (C) 2014-2015 John W. Eaton |
19257
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 ## |
19842
ebd27d8c63fd
update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents:
19794
diff
changeset
|
22 ## @code{syl} is deprecated and will be removed in Octave version 4.4. |
19257
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 |
19794
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19257
diff
changeset
|
32 ## |
19257
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 |
19794
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19257
diff
changeset
|
36 ## |
19257
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: |
19794
db92e7e28e1f
strip trailing whitespace from most source files
John W. Eaton <jwe@octave.org>
parents:
19257
diff
changeset
|
39 ## |
19257
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 |
19842
ebd27d8c63fd
update default branch to release as 4.0
John W. Eaton <jwe@octave.org>
parents:
19794
diff
changeset
|
48 ## Deprecated in version 4.0 |
19257
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 |