annotate liboctave/fCmplxLU.h @ 14557:e8e86ae3abbc

make diag (x, m, n) return a proper diagonal matrix object (bug #36099) * Array.h, Array.cc (Array<T>::diag (octave_idx_type, octave_idx_type) const): New function. * CMatrix.h, CMatrix.cc (ComplexMatrix::diag (octave_idx_type, octave_idx_type) const): New function. * dMatrix.h, dMatrix.cc (Matrix::diag (octave_idx_type, octave_idx_type) const): New function. * fCMatrix.h, fCMatrix.cc (FloatComplexMatrix::diag (octave_idx_type, octave_idx_type) const): New function. * fMatrix.h, fMatrix.cc (FloatMatrix::diag (octave_idx_type, octave_idx_type) const): New function. * CNDArray.cc, CNDArray.h (ComplexNDArray::diag (octave_idx_type, octave_idx_type) const): New forwarding function. * boolNDArray.cc, boolNDArray.h (boolNDArray::diag (octave_idx_type, octave_idx_type) const): New forwarding function. * chNDArray.cc, chNDArray.h (charNDArray::diag (octave_idx_type, octave_idx_type) const): New forwarding function. * dNDArray.cc, dNDArray.h (NDArray::diag (octave_idx_type, octave_idx_type) const): New forwarding function. * fCNDArray.cc, fCNDArray.h (FloatComplexNDArray::diag (octave_idx_type, octave_idx_type) const): New forwarding function. * fNDArray.cc, fNDArray.h (FloatNDArray::diag (octave_idx_type, octave_idx_type) const): New forwarding function. * intNDArray.cc, intNDArray.h (intNDArray<T>::diag (octave_idx_type, octave_idx_type) const): New forwarding function. * Cell.cc, Cell.h (Cell::diag (octave_idx_type, octave_idx_type) const): New function. * ov.h (octave_value::diag (octave_idx_type, octave_idx_type)): New function. * ov-base.h, ov-base.cc (octave_base_value::diag (octave_idx_type, octave_idx_type) const): New virtual function and default implementation. * ov-base-mat.h (octave_base_matrix<T>::diag (octave_idx_type, octave_idx_type) const): New function. * ov-base-scalar.cc, ov-base-scalar.h (octave_base_scalar<T>::diag (octave_idx_type, octave_idx_type)): New function. * ov-complex.cc, ov-complex.h (octave_complex::diag (octave_idx_type, octave_idx_type) const): New function. * ov-cx-mat.cc, ov-complex.h (octave_complex_matrix::diag (octave_idx_type, octave_idx_type) const): New function. * ov-float.cc, ov-float.h (octave_float_scalar::diag (octave_idx_type, octave_idx_type) const): New function. * ov-flt-complex.cc, ov-flt-complex.h (octave_float_complex::diag (octave_idx_type, octave_idx_type) const): New function. * ov-flt-cx-mat.cc, ov-flt-cx-mat.h (octave_float_complex_matrix::diag (octave_idx_type, octave_idx_type) const): New function. * ov-flt-re-mat.cc, ov-flt-re-mat.h (octave_float_matrix::diag (octave_idx_type, octave_idx_type) const): New function. * ov-range.cc, ov-range.h (octave_range::diag (octave_idx_type, octave_idx_type) const): New function. * ov-re-mat.cc, ov-re-mat.h (octave_matrix::diag (octave_idx_type, octave_idx_type) const): New function. * ov-scalar.cc, ov-scalar.h (octave_scalar::diag (octave_idx_type, octave_idx_type) const): New function. * data.cc (Fdiag): Use two-arg octave_value::diag method for dispatching. New tests.
author John W. Eaton <jwe@octave.org>
date Thu, 12 Apr 2012 16:27:39 -0400
parents 72c96de7a403
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
1 /*
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
2
14138
72c96de7a403 maint: update copyright notices for 2012
John W. Eaton <jwe@octave.org>
parents: 11586
diff changeset
3 Copyright (C) 1994-2012 John W. Eaton
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
4
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
5 This file is part of Octave.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
6
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
7 Octave is free software; you can redistribute it and/or modify it
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
8 under the terms of the GNU General Public License as published by the
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
9 Free Software Foundation; either version 3 of the License, or (at your
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
10 option) any later version.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
11
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
12 Octave is distributed in the hope that it will be useful, but WITHOUT
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
15 for more details.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
16
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
18 along with Octave; see the file COPYING. If not, see
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
19 <http://www.gnu.org/licenses/>.
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
20
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
21 */
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
22
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
23 #if !defined (octave_FloatComplexLU_h)
8018
8487847eb092 fCmplxLU.h, CmplxLU.h: fix typo in definition of multiple-inclusion guard macro
John W. Eaton <jwe@octave.org>
parents: 7811
diff changeset
24 #define octave_FloatComplexLU_h 1
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
25
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
26 #include "base-lu.h"
7811
12c8b195508f minor additional fix
David Bateman <dbateman@free.fr>
parents: 7789
diff changeset
27 #include "dMatrix.h"
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
28 #include "fCMatrix.h"
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
29
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
30 class
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
31 OCTAVE_API
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8018
diff changeset
32 FloatComplexLU : public base_lu <FloatComplexMatrix>
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
33 {
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
34 public:
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
35
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
36 FloatComplexLU (void)
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8018
diff changeset
37 : base_lu <FloatComplexMatrix> () { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
38
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
39 FloatComplexLU (const FloatComplexMatrix& a);
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
40
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
41 FloatComplexLU (const FloatComplexLU& a)
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 8018
diff changeset
42 : base_lu <FloatComplexMatrix> (a) { }
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
43
11586
12df7854fa7c strip trailing whitespace from source files
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
44 FloatComplexLU (const FloatComplexMatrix& l, const FloatComplexMatrix& u,
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
45 const PermMatrix& p)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
46 : base_lu <FloatComplexMatrix> (l, u, p) { }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
47
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
48 FloatComplexLU& operator = (const FloatComplexLU& a)
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
49 {
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
50 if (this != &a)
10312
cbc402e64d83 untabify liboctave header files
John W. Eaton <jwe@octave.org>
parents: 10158
diff changeset
51 base_lu <FloatComplexMatrix> :: operator = (a);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
52
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
53 return *this;
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
54 }
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
55
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
56 ~FloatComplexLU (void) { }
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
57
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
58 void update (const FloatComplexColumnVector& u, const FloatComplexColumnVector& v);
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
59
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
60 void update (const FloatComplexMatrix& u, const FloatComplexMatrix& v);
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
61
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
62 void update_piv (const FloatComplexColumnVector& u, const FloatComplexColumnVector& v);
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
63
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
64 void update_piv (const FloatComplexMatrix& u, const FloatComplexMatrix& v);
7789
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
65 };
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
66
82be108cc558 First attempt at single precision tyeps
David Bateman <dbateman@free.fr>
parents:
diff changeset
67 #endif