annotate liboctave/dbleSVD.cc @ 8920:eb63fbe60fab

update copyright notices
author John W. Eaton <jwe@octave.org>
date Sat, 07 Mar 2009 10:41:27 -0500
parents 82be108cc558
children 4c0cdbe0acca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
1 /*
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
2
7017
a1dbe9d80eee [project @ 2007-10-12 21:27:11 by jwe]
jwe
parents: 7016
diff changeset
3 Copyright (C) 1994, 1995, 1996, 1997, 1999, 2000, 2002, 2003, 2004,
8920
eb63fbe60fab update copyright notices
John W. Eaton <jwe@octave.org>
parents: 7789
diff changeset
4 2005, 2007, 2008 John W. Eaton
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
5
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
7
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
9 under the terms of the GNU General Public License as published by the
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
10 Free Software Foundation; either version 3 of the License, or (at your
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
11 option) any later version.
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
12
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
16 for more details.
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
17
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
18 You should have received a copy of the GNU General Public License
7016
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
19 along with Octave; see the file COPYING. If not, see
93c65f2a5668 [project @ 2007-10-12 06:40:56 by jwe]
jwe
parents: 5307
diff changeset
20 <http://www.gnu.org/licenses/>.
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
21
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
22 */
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
23
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
24 #ifdef HAVE_CONFIG_H
1192
b6360f2d4fa6 [project @ 1995-03-30 21:38:35 by jwe]
jwe
parents: 1011
diff changeset
25 #include <config.h>
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
26 #endif
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
27
3503
d14c483b3c12 [project @ 2000-02-01 04:06:07 by jwe]
jwe
parents: 3336
diff changeset
28 #include <iostream>
1631
b0b22b6ce22f [project @ 1995-11-14 20:24:15 by jwe]
jwe
parents: 1545
diff changeset
29
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
30 #include "dbleSVD.h"
1847
2ffe49eb95a5 [project @ 1996-02-03 12:47:55 by jwe]
jwe
parents: 1631
diff changeset
31 #include "f77-fcn.h"
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
32
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
33 extern "C"
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
34 {
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
35 F77_RET_T
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
36 F77_FUNC (dgesvd, DGESVD) (F77_CONST_CHAR_ARG_DECL,
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
37 F77_CONST_CHAR_ARG_DECL,
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
38 const octave_idx_type&, const octave_idx_type&, double*,
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
39 const octave_idx_type&, double*, double*,
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
40 const octave_idx_type&, double*, const octave_idx_type&,
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
41 double*, const octave_idx_type&, octave_idx_type&
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
42 F77_CHAR_ARG_LEN_DECL
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
43 F77_CHAR_ARG_LEN_DECL);
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
44 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
45
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
46 Matrix
1545
8bdfa6fe5d69 [project @ 1995-10-06 06:13:28 by jwe]
jwe
parents: 1544
diff changeset
47 SVD::left_singular_matrix (void) const
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
48 {
1544
f1931fc63ce9 [project @ 1995-10-06 05:57:56 by jwe]
jwe
parents: 1543
diff changeset
49 if (type_computed == SVD::sigma_only)
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
50 {
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
51 (*current_liboctave_error_handler)
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7482
diff changeset
52 ("SVD: U not computed because type == SVD::sigma_only");
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
53 return Matrix ();
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
54 }
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
55 else
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
56 return left_sm;
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
57 }
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
58
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
59 Matrix
1545
8bdfa6fe5d69 [project @ 1995-10-06 06:13:28 by jwe]
jwe
parents: 1544
diff changeset
60 SVD::right_singular_matrix (void) const
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
61 {
1544
f1931fc63ce9 [project @ 1995-10-06 05:57:56 by jwe]
jwe
parents: 1543
diff changeset
62 if (type_computed == SVD::sigma_only)
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
63 {
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
64 (*current_liboctave_error_handler)
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents: 7482
diff changeset
65 ("SVD: V not computed because type == SVD::sigma_only");
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
66 return Matrix ();
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
67 }
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
68 else
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
69 return right_sm;
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
70 }
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
71
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
72 octave_idx_type
537
4ecbfd3c3710 [project @ 1994-07-21 22:30:34 by jwe]
jwe
parents: 457
diff changeset
73 SVD::init (const Matrix& a, SVD::type svd_type)
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
74 {
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
75 octave_idx_type info;
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
76
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
77 octave_idx_type m = a.rows ();
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
78 octave_idx_type n = a.cols ();
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
79
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
80 Matrix atmp = a;
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
81 double *tmp_data = atmp.fortran_vec ();
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
82
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
83 octave_idx_type min_mn = m < n ? m : n;
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
84
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
85 char jobu = 'A';
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
86 char jobv = 'A';
537
4ecbfd3c3710 [project @ 1994-07-21 22:30:34 by jwe]
jwe
parents: 457
diff changeset
87
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
88 octave_idx_type ncol_u = m;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
89 octave_idx_type nrow_vt = n;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
90 octave_idx_type nrow_s = m;
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
91 octave_idx_type ncol_s = n;
537
4ecbfd3c3710 [project @ 1994-07-21 22:30:34 by jwe]
jwe
parents: 457
diff changeset
92
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
93 switch (svd_type)
537
4ecbfd3c3710 [project @ 1994-07-21 22:30:34 by jwe]
jwe
parents: 457
diff changeset
94 {
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
95 case SVD::economy:
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
96 jobu = jobv = 'S';
537
4ecbfd3c3710 [project @ 1994-07-21 22:30:34 by jwe]
jwe
parents: 457
diff changeset
97 ncol_u = nrow_vt = nrow_s = ncol_s = min_mn;
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
98 break;
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
99
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
100 case SVD::sigma_only:
2621
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
101
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
102 // Note: for this case, both jobu and jobv should be 'N', but
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
103 // there seems to be a bug in dgesvd from Lapack V2.0. To
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
104 // demonstrate the bug, set both jobu and jobv to 'N' and find
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
105 // the singular values of [eye(3), eye(3)]. The result is
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
106 // [-sqrt(2), -sqrt(2), -sqrt(2)].
3335
f39b97e13cf2 [project @ 1999-11-03 21:05:01 by jwe]
jwe
parents: 2847
diff changeset
107 //
f39b97e13cf2 [project @ 1999-11-03 21:05:01 by jwe]
jwe
parents: 2847
diff changeset
108 // For Lapack 3.0, this problem seems to be fixed.
2621
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
109
3335
f39b97e13cf2 [project @ 1999-11-03 21:05:01 by jwe]
jwe
parents: 2847
diff changeset
110 jobu = 'N';
2621
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
111 jobv = 'N';
1545
8bdfa6fe5d69 [project @ 1995-10-06 06:13:28 by jwe]
jwe
parents: 1544
diff changeset
112 ncol_u = nrow_vt = 1;
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
113 break;
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
114
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
115 default:
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
116 break;
537
4ecbfd3c3710 [project @ 1994-07-21 22:30:34 by jwe]
jwe
parents: 457
diff changeset
117 }
4ecbfd3c3710 [project @ 1994-07-21 22:30:34 by jwe]
jwe
parents: 457
diff changeset
118
1544
f1931fc63ce9 [project @ 1995-10-06 05:57:56 by jwe]
jwe
parents: 1543
diff changeset
119 type_computed = svd_type;
f1931fc63ce9 [project @ 1995-10-06 05:57:56 by jwe]
jwe
parents: 1543
diff changeset
120
2621
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
121 if (! (jobu == 'N' || jobu == 'O'))
1931
c91f81d5f72c [project @ 1996-02-11 23:02:16 by jwe]
jwe
parents: 1930
diff changeset
122 left_sm.resize (m, ncol_u);
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
123
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
124 double *u = left_sm.fortran_vec ();
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
125
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
126 sigma.resize (nrow_s, ncol_s);
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
127 double *s_vec = sigma.fortran_vec ();
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
128
2621
337a09dd1c06 [project @ 1997-01-24 21:49:41 by jwe]
jwe
parents: 1993
diff changeset
129 if (! (jobv == 'N' || jobv == 'O'))
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
130 right_sm.resize (nrow_vt, n);
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
131
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
132 double *vt = right_sm.fortran_vec ();
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
133
3336
08ad797989f8 [project @ 1999-11-03 21:41:34 by jwe]
jwe
parents: 3335
diff changeset
134 // Ask DGESVD what the dimension of WORK should be.
1930
d20ab06301e8 [project @ 1996-02-11 22:30:18 by jwe]
jwe
parents: 1882
diff changeset
135
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
136 octave_idx_type lwork = -1;
3336
08ad797989f8 [project @ 1999-11-03 21:41:34 by jwe]
jwe
parents: 3335
diff changeset
137
08ad797989f8 [project @ 1999-11-03 21:41:34 by jwe]
jwe
parents: 3335
diff changeset
138 Array<double> work (1);
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
139
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
140 F77_XFCN (dgesvd, DGESVD, (F77_CONST_CHAR_ARG2 (&jobu, 1),
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
141 F77_CONST_CHAR_ARG2 (&jobv, 1),
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
142 m, n, tmp_data, m, s_vec, u, m, vt,
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
143 nrow_vt, work.fortran_vec (), lwork, info
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
144 F77_CHAR_ARG_LEN (1)
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4192
diff changeset
145 F77_CHAR_ARG_LEN (1)));
1543
d6e96e0bc681 [project @ 1995-10-06 05:49:21 by jwe]
jwe
parents: 1368
diff changeset
146
7482
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
147 lwork = static_cast<octave_idx_type> (work(0));
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
148 work.resize (lwork);
3336
08ad797989f8 [project @ 1999-11-03 21:41:34 by jwe]
jwe
parents: 3335
diff changeset
149
7482
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
150 F77_XFCN (dgesvd, DGESVD, (F77_CONST_CHAR_ARG2 (&jobu, 1),
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
151 F77_CONST_CHAR_ARG2 (&jobv, 1),
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
152 m, n, tmp_data, m, s_vec, u, m, vt,
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
153 nrow_vt, work.fortran_vec (), lwork, info
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
154 F77_CHAR_ARG_LEN (1)
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
155 F77_CHAR_ARG_LEN (1)));
3336
08ad797989f8 [project @ 1999-11-03 21:41:34 by jwe]
jwe
parents: 3335
diff changeset
156
7482
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
157 if (! (jobv == 'N' || jobv == 'O'))
29980c6b8604 don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents: 7017
diff changeset
158 right_sm = right_sm.transpose ();
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
159
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
160 return info;
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
161 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
162
3504
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3503
diff changeset
163 std::ostream&
5eef8a2294bd [project @ 2000-02-01 10:06:51 by jwe]
jwe
parents: 3503
diff changeset
164 operator << (std::ostream& os, const SVD& a)
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
165 {
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
166 os << a.left_singular_matrix () << "\n";
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
167 os << a.singular_values () << "\n";
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
168 os << a.right_singular_matrix () << "\n";
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
169
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
170 return os;
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
171 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
172
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
173 /*
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
174 ;;; Local Variables: ***
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
175 ;;; mode: C++ ***
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
176 ;;; End: ***
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
177 */