annotate liboctave/numeric/qrp.h @ 21280:ebdf74c15722

better use of templates for qrp classes * liboctave/numeric/qrp.h, liboctave/numeric/qrp.cc: New files for qrp classes generated from CmplxQRP.cc, CmplxQRP.h, dbleQRP.cc, dbleQRP.h, fCmplxQRP.cc, fCmplxQRP.h, floatQRP.cc, and floatQRP.h with classes converted to templates. * liboctave/numeric/module.mk: Update. * qr.cc, mx-defs.h: Use new classes.
author John W. Eaton <jwe@octave.org>
date Wed, 17 Feb 2016 02:54:00 -0500
parents liboctave/numeric/dbleQRP.h@eb1524b07fe3
children 6ca3acf5fad8
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
1 /*
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
2
19697
4197fc428c7d maint: Update copyright notices for 2015.
John W. Eaton <jwe@octave.org>
parents: 17822
diff changeset
3 Copyright (C) 1994-2015 John W. Eaton
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
4 Copyright (C) 2009 VZLU Prague
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
5
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
6 This file is part of Octave.
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
7
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
8 Octave is free software; you can redistribute it and/or modify it
8e134d3b21c9 [project @ 1994-07-21 22:40:04 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: 6108
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: 6108
diff changeset
11 option) any later version.
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
12
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
13 Octave is distributed in the hope that it will be useful, but WITHOUT
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
16 for more details.
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
17
8e134d3b21c9 [project @ 1994-07-21 22:40:04 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: 6108
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: 6108
diff changeset
20 <http://www.gnu.org/licenses/>.
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
21
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
22 */
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
23
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
24 #if ! defined (octave_qrp_h)
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
25 #define octave_qrp_h 1
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
26
21244
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
27 #include "octave-config.h"
1473547f50f5 include octave-config.h in public header files
John W. Eaton <jwe@octave.org>
parents: 20791
diff changeset
28
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
29 #include "PermMatrix.h"
21279
eb1524b07fe3 better use of templates for qr classes
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
30 #include "qr.h"
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
31
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
32 template <typename T>
1881
950825cea083 [project @ 1996-02-05 18:07:21 by jwe]
jwe
parents: 1528
diff changeset
33 class
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
34 qrp : public qr<T>
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
35 {
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
36 public:
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
37
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
38 typedef typename T::real_row_vector_type RV_T;
21279
eb1524b07fe3 better use of templates for qr classes
John W. Eaton <jwe@octave.org>
parents: 21244
diff changeset
39
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
40 typedef typename qr<T>::type type;
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
41
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
42 qrp (void) : qr<T> (), p () { }
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
43
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
44 qrp (const T&, type = qr<T>::std);
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
45
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
46 qrp (const qrp& a) : qr<T> (a), p (a.p) { }
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
47
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
48 qrp& operator = (const qrp& a)
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
49 {
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
50 if (this != &a)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
51 {
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
52 qr<T>::operator = (a);
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
53 p = a.p;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
54 }
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
55
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
56 return *this;
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
57 }
1528
dc527156c38c [project @ 1995-10-05 01:44:18 by jwe]
jwe
parents: 1315
diff changeset
58
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
59 ~qrp (void) { }
1922
8a57554f3142 [project @ 1996-02-11 02:53:20 by jwe]
jwe
parents: 1881
diff changeset
60
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
61 void init (const T&, type = qr<T>::std);
2763
d9d00d7e271e [project @ 1997-03-01 02:14:33 by jwe]
jwe
parents: 1993
diff changeset
62
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
63 PermMatrix P (void) const { return p; }
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
64
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
65 RV_T Pvec (void) const;
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
66
21280
ebdf74c15722 better use of templates for qrp classes
John W. Eaton <jwe@octave.org>
parents: 21279
diff changeset
67 private:
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
68
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 7017
diff changeset
69 PermMatrix p;
538
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
70 };
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
71
8e134d3b21c9 [project @ 1994-07-21 22:40:04 by jwe]
jwe
parents:
diff changeset
72 #endif