annotate liboctave/numeric/CmplxLU.cc @ 17769:49a5a4be04a1

maint: Use GNU style coding conventions for code in liboctave/ * liboctave/array/Array-C.cc, liboctave/array/Array-b.cc, liboctave/array/Array-ch.cc, liboctave/array/Array-d.cc, liboctave/array/Array-f.cc, liboctave/array/Array-fC.cc, liboctave/array/Array-util.cc, liboctave/array/Array-util.h, liboctave/array/Array.cc, liboctave/array/Array.h, liboctave/array/Array3.h, liboctave/array/CColVector.cc, liboctave/array/CColVector.h, liboctave/array/CDiagMatrix.cc, liboctave/array/CDiagMatrix.h, liboctave/array/CMatrix.cc, liboctave/array/CMatrix.h, liboctave/array/CNDArray.cc, liboctave/array/CNDArray.h, liboctave/array/CRowVector.cc, liboctave/array/CRowVector.h, liboctave/array/CSparse.cc, liboctave/array/CSparse.h, liboctave/array/DiagArray2.h, liboctave/array/MArray.cc, liboctave/array/MArray.h, liboctave/array/MDiagArray2.cc, liboctave/array/MDiagArray2.h, liboctave/array/MSparse.cc, liboctave/array/MSparse.h, liboctave/array/MatrixType.cc, liboctave/array/MatrixType.h, liboctave/array/PermMatrix.h, liboctave/array/Range.cc, liboctave/array/Range.h, liboctave/array/Sparse.cc, liboctave/array/Sparse.h, liboctave/array/boolMatrix.cc, liboctave/array/boolMatrix.h, liboctave/array/boolNDArray.cc, liboctave/array/boolNDArray.h, liboctave/array/boolSparse.cc, liboctave/array/boolSparse.h, liboctave/array/chMatrix.cc, liboctave/array/chMatrix.h, liboctave/array/chNDArray.cc, liboctave/array/chNDArray.h, liboctave/array/dColVector.h, liboctave/array/dDiagMatrix.cc, liboctave/array/dDiagMatrix.h, liboctave/array/dMatrix.cc, liboctave/array/dMatrix.h, liboctave/array/dNDArray.cc, liboctave/array/dNDArray.h, liboctave/array/dRowVector.h, liboctave/array/dSparse.cc, liboctave/array/dSparse.h, liboctave/array/dim-vector.cc, liboctave/array/dim-vector.h, liboctave/array/fCColVector.cc, liboctave/array/fCColVector.h, liboctave/array/fCDiagMatrix.cc, liboctave/array/fCDiagMatrix.h, liboctave/array/fCMatrix.cc, liboctave/array/fCMatrix.h, liboctave/array/fCNDArray.cc, liboctave/array/fCNDArray.h, liboctave/array/fCRowVector.cc, liboctave/array/fCRowVector.h, liboctave/array/fColVector.h, liboctave/array/fDiagMatrix.cc, liboctave/array/fDiagMatrix.h, liboctave/array/fMatrix.cc, liboctave/array/fMatrix.h, liboctave/array/fNDArray.cc, liboctave/array/fNDArray.h, liboctave/array/fRowVector.h, liboctave/array/idx-vector.cc, liboctave/array/idx-vector.h, liboctave/array/intNDArray.cc, liboctave/array/intNDArray.h, liboctave/cruft/misc/blaswrap.c, liboctave/cruft/misc/quit.cc, liboctave/numeric/CmplxCHOL.cc, liboctave/numeric/CmplxCHOL.h, liboctave/numeric/CmplxGEPBAL.cc, liboctave/numeric/CmplxGEPBAL.h, liboctave/numeric/CmplxHESS.h, liboctave/numeric/CmplxLU.cc, liboctave/numeric/CmplxLU.h, liboctave/numeric/CmplxQR.cc, liboctave/numeric/CmplxQRP.cc, liboctave/numeric/CmplxQRP.h, liboctave/numeric/CmplxSCHUR.h, liboctave/numeric/CmplxSVD.cc, liboctave/numeric/CmplxSVD.h, liboctave/numeric/CollocWt.h, liboctave/numeric/DAE.h, liboctave/numeric/DAEFunc.h, liboctave/numeric/DAERT.h, liboctave/numeric/DAERTFunc.h, liboctave/numeric/DASPK.cc, liboctave/numeric/DASRT.cc, liboctave/numeric/DASRT.h, liboctave/numeric/DASSL.cc, liboctave/numeric/DET.h, liboctave/numeric/EIG.cc, liboctave/numeric/EIG.h, liboctave/numeric/LSODE.cc, liboctave/numeric/ODE.h, liboctave/numeric/ODEFunc.h, liboctave/numeric/ODES.h, liboctave/numeric/ODESFunc.h, liboctave/numeric/Quad.cc, liboctave/numeric/Quad.h, liboctave/numeric/SparseCmplxCHOL.h, liboctave/numeric/SparseCmplxLU.cc, liboctave/numeric/SparseCmplxLU.h, liboctave/numeric/SparseCmplxQR.cc, liboctave/numeric/SparseCmplxQR.h, liboctave/numeric/SparseQR.cc, liboctave/numeric/SparseQR.h, liboctave/numeric/SparsedbleCHOL.h, liboctave/numeric/SparsedbleLU.cc, liboctave/numeric/SparsedbleLU.h, liboctave/numeric/base-aepbal.h, liboctave/numeric/base-dae.h, liboctave/numeric/base-de.h, liboctave/numeric/base-lu.cc, liboctave/numeric/base-lu.h, liboctave/numeric/base-min.h, liboctave/numeric/base-qr.h, liboctave/numeric/bsxfun.h, liboctave/numeric/dbleCHOL.cc, liboctave/numeric/dbleCHOL.h, liboctave/numeric/dbleGEPBAL.h, liboctave/numeric/dbleHESS.h, liboctave/numeric/dbleLU.cc, liboctave/numeric/dbleLU.h, liboctave/numeric/dbleQR.cc, liboctave/numeric/dbleQRP.cc, liboctave/numeric/dbleQRP.h, liboctave/numeric/dbleSCHUR.cc, liboctave/numeric/dbleSCHUR.h, liboctave/numeric/dbleSVD.cc, liboctave/numeric/dbleSVD.h, liboctave/numeric/eigs-base.cc, liboctave/numeric/fCmplxAEPBAL.cc, liboctave/numeric/fCmplxAEPBAL.h, liboctave/numeric/fCmplxCHOL.cc, liboctave/numeric/fCmplxCHOL.h, liboctave/numeric/fCmplxGEPBAL.cc, liboctave/numeric/fCmplxGEPBAL.h, liboctave/numeric/fCmplxHESS.h, liboctave/numeric/fCmplxLU.cc, liboctave/numeric/fCmplxLU.h, liboctave/numeric/fCmplxQR.cc, liboctave/numeric/fCmplxQR.h, liboctave/numeric/fCmplxQRP.cc, liboctave/numeric/fCmplxQRP.h, liboctave/numeric/fCmplxSCHUR.cc, liboctave/numeric/fCmplxSCHUR.h, liboctave/numeric/fCmplxSVD.h, liboctave/numeric/fEIG.cc, liboctave/numeric/fEIG.h, liboctave/numeric/floatCHOL.cc, liboctave/numeric/floatCHOL.h, liboctave/numeric/floatGEPBAL.cc, liboctave/numeric/floatGEPBAL.h, liboctave/numeric/floatHESS.h, liboctave/numeric/floatLU.cc, liboctave/numeric/floatLU.h, liboctave/numeric/floatQR.cc, liboctave/numeric/floatQRP.cc, liboctave/numeric/floatQRP.h, liboctave/numeric/floatSCHUR.cc, liboctave/numeric/floatSCHUR.h, liboctave/numeric/floatSVD.cc, liboctave/numeric/floatSVD.h, liboctave/numeric/lo-mappers.cc, liboctave/numeric/lo-mappers.h, liboctave/numeric/lo-specfun.cc, liboctave/numeric/lo-specfun.h, liboctave/numeric/oct-convn.cc, liboctave/numeric/oct-fftw.cc, liboctave/numeric/oct-fftw.h, liboctave/numeric/oct-norm.cc, liboctave/numeric/oct-rand.cc, liboctave/numeric/oct-rand.h, liboctave/numeric/randgamma.c, liboctave/numeric/randgamma.h, liboctave/numeric/randmtzig.c, liboctave/numeric/randpoisson.c, liboctave/numeric/randpoisson.h, liboctave/numeric/sparse-base-chol.h, liboctave/numeric/sparse-base-lu.h, liboctave/numeric/sparse-dmsolve.cc, liboctave/operators/Sparse-diag-op-defs.h, liboctave/operators/Sparse-op-defs.h, liboctave/operators/mx-inlines.cc, liboctave/system/dir-ops.h, liboctave/system/file-ops.cc, liboctave/system/file-stat.cc, liboctave/system/file-stat.h, liboctave/system/lo-sysdep.cc, liboctave/system/lo-sysdep.h, liboctave/system/mach-info.cc, liboctave/system/mach-info.h, liboctave/system/oct-env.cc, liboctave/system/oct-group.cc, liboctave/system/oct-syscalls.cc, liboctave/system/oct-syscalls.h, liboctave/system/oct-time.h, liboctave/system/tempname.c, liboctave/util/action-container.h, liboctave/util/base-list.h, liboctave/util/cmd-edit.cc, liboctave/util/cmd-edit.h, liboctave/util/cmd-hist.cc, liboctave/util/cmd-hist.h, liboctave/util/data-conv.cc, liboctave/util/data-conv.h, liboctave/util/kpse.cc, liboctave/util/lo-array-gripes.cc, liboctave/util/lo-cieee.c, liboctave/util/lo-regexp.cc, liboctave/util/lo-utils.cc, liboctave/util/oct-alloc.cc, liboctave/util/oct-base64.cc, liboctave/util/oct-binmap.h, liboctave/util/oct-cmplx.h, liboctave/util/oct-glob.cc, liboctave/util/oct-inttypes.cc, liboctave/util/oct-inttypes.h, liboctave/util/oct-locbuf.cc, liboctave/util/oct-locbuf.h, liboctave/util/oct-mem.h, liboctave/util/oct-mutex.cc, liboctave/util/oct-refcount.h, liboctave/util/oct-shlib.cc, liboctave/util/oct-shlib.h, liboctave/util/oct-sort.cc, liboctave/util/oct-sort.h, liboctave/util/pathsearch.cc, liboctave/util/pathsearch.h, liboctave/util/sparse-util.cc, liboctave/util/str-vec.cc, liboctave/util/str-vec.h, liboctave/util/unwind-prot.h, liboctave/util/url-transfer.cc, liboctave/util/url-transfer.h: Use GNU style coding conventions.
author Rik <rik@octave.org>
date Sat, 26 Oct 2013 18:57:05 -0700
parents d63878346099
children 8e056300994b
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
17744
d63878346099 maint: Update copyright notices for release.
John W. Eaton <jwe@octave.org>
parents: 15374
diff changeset
3 Copyright (C) 1994-2013 John W. Eaton
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
4 Copyright (C) 2009 VZLU Prague, a.s.
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
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
28 #include "CmplxLU.h"
1847
2ffe49eb95a5 [project @ 1996-02-03 12:47:55 by jwe]
jwe
parents: 1368
diff changeset
29 #include "f77-fcn.h"
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
30 #include "lo-error.h"
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
31 #include "oct-locbuf.h"
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
32 #include "CColVector.h"
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
33
1992
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
34 // Instantiate the base LU class for the types we need.
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
35
15374
b5f28cc401b9 Use double quotes, not angle brackets, for '#include "base-lu.cc"'.
Rik <rik@octave.org>
parents: 15271
diff changeset
36 #include "base-lu.h"
b5f28cc401b9 Use double quotes, not angle brackets, for '#include "base-lu.cc"'.
Rik <rik@octave.org>
parents: 15271
diff changeset
37 #include "base-lu.cc"
1992
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
38
8367
445d27d79f4e support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents: 7482
diff changeset
39 template class base_lu <ComplexMatrix>;
1992
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
40
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
41 // Define the constructor for this particular derivation.
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
42
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
43 extern "C"
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
44 {
4552
6f3382e08a52 [project @ 2003-10-27 20:38:02 by jwe]
jwe
parents: 4329
diff changeset
45 F77_RET_T
11518
141b3fb5cef7 style fixes
John W. Eaton <jwe@octave.org>
parents: 10350
diff changeset
46 F77_FUNC (zgetrf, ZGETRF) (const octave_idx_type&, const octave_idx_type&,
141b3fb5cef7 style fixes
John W. Eaton <jwe@octave.org>
parents: 10350
diff changeset
47 Complex*, const octave_idx_type&,
141b3fb5cef7 style fixes
John W. Eaton <jwe@octave.org>
parents: 10350
diff changeset
48 octave_idx_type*, octave_idx_type&);
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
49
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
50 #ifdef HAVE_QRUPDATE_LUU
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
51 F77_RET_T
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
52 F77_FUNC (zlu1up, ZLU1UP) (const octave_idx_type&, const octave_idx_type&,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
53 Complex *, const octave_idx_type&,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
54 Complex *, const octave_idx_type&,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
55 Complex *, Complex *);
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
56
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
57 F77_RET_T
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
58 F77_FUNC (zlup1up, ZLUP1UP) (const octave_idx_type&, const octave_idx_type&,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
59 Complex *, const octave_idx_type&,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
60 Complex *, const octave_idx_type&,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
61 octave_idx_type *, const Complex *,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
62 const Complex *, Complex *);
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
63 #endif
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
64 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
65
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
66 ComplexLU::ComplexLU (const ComplexMatrix& a)
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
67 {
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
68 octave_idx_type a_nr = a.rows ();
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
69 octave_idx_type a_nc = a.cols ();
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
70 octave_idx_type mn = (a_nr < a_nc ? a_nr : a_nc);
1919
b582f7f765e0 [project @ 1996-02-11 01:58:47 by jwe]
jwe
parents: 1882
diff changeset
71
11574
a83bad07f7e3 attempt better backward compatibility for Array resize functions
John W. Eaton <jwe@octave.org>
parents: 11523
diff changeset
72 ipvt.resize (dim_vector (mn, 1));
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
73 octave_idx_type *pipvt = ipvt.fortran_vec ();
1919
b582f7f765e0 [project @ 1996-02-11 01:58:47 by jwe]
jwe
parents: 1882
diff changeset
74
1992
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
75 a_fact = a;
5668c00f9c7a [project @ 1996-03-03 00:40:53 by jwe]
jwe
parents: 1926
diff changeset
76 Complex *tmp_data = a_fact.fortran_vec ();
1919
b582f7f765e0 [project @ 1996-02-11 01:58:47 by jwe]
jwe
parents: 1882
diff changeset
77
5275
23b37da9fd5b [project @ 2005-04-08 16:07:35 by jwe]
jwe
parents: 5105
diff changeset
78 octave_idx_type info = 0;
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
79
4329
d53c33d93440 [project @ 2003-02-18 20:00:48 by jwe]
jwe
parents: 4192
diff changeset
80 F77_XFCN (zgetrf, ZGETRF, (a_nr, a_nc, tmp_data, a_nr, pipvt, info));
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
81
9694
50db3c5175b5 allow unpacked form of LU
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
82 for (octave_idx_type i = 0; i < mn; i++)
50db3c5175b5 allow unpacked form of LU
Jaroslav Hajek <highegg@gmail.com>
parents: 8920
diff changeset
83 pipvt[i] -= 1;
457
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
84 }
3d4b4f0fa5ba [project @ 1994-06-06 00:33:33 by jwe]
jwe
parents:
diff changeset
85
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
86 #ifdef HAVE_QRUPDATE_LUU
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
87
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
88 void ComplexLU::update (const ComplexColumnVector& u,
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
89 const ComplexColumnVector& v)
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
90 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
91 if (packed ())
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
92 unpack ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
93
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
94 ComplexMatrix& l = l_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
95 ComplexMatrix& r = a_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
96
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
97 octave_idx_type m = l.rows ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
98 octave_idx_type n = r.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
99 octave_idx_type k = l.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
100
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
101 if (u.length () == m && v.length () == n)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
102 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
103 ComplexColumnVector utmp = u, vtmp = v;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
104 F77_XFCN (zlu1up, ZLU1UP, (m, n, l.fortran_vec (), m, r.fortran_vec (), k,
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
105 utmp.fortran_vec (), vtmp.fortran_vec ()));
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
106 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
107 else
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
108 (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
109 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
110
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
111 void ComplexLU::update (const ComplexMatrix& u, const ComplexMatrix& v)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
112 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
113 if (packed ())
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
114 unpack ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
115
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
116 ComplexMatrix& l = l_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
117 ComplexMatrix& r = a_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
118
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
119 octave_idx_type m = l.rows ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
120 octave_idx_type n = r.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
121 octave_idx_type k = l.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
122
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
123 if (u.rows () == m && v.rows () == n && u.cols () == v.cols ())
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
124 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
125 for (volatile octave_idx_type i = 0; i < u.cols (); i++)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
126 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
127 ComplexColumnVector utmp = u.column (i), vtmp = v.column (i);
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
128 F77_XFCN (zlu1up, ZLU1UP, (m, n, l.fortran_vec (),
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
129 m, r.fortran_vec (), k,
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
130 utmp.fortran_vec (), vtmp.fortran_vec ()));
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
131 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
132 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
133 else
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
134 (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
135 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
136
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
137 void ComplexLU::update_piv (const ComplexColumnVector& u,
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
138 const ComplexColumnVector& v)
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
139 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
140 if (packed ())
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
141 unpack ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
142
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
143 ComplexMatrix& l = l_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
144 ComplexMatrix& r = a_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
145
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
146 octave_idx_type m = l.rows ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
147 octave_idx_type n = r.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
148 octave_idx_type k = l.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
149
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
150 if (u.length () == m && v.length () == n)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
151 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
152 ComplexColumnVector utmp = u, vtmp = v;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
153 OCTAVE_LOCAL_BUFFER (Complex, w, m);
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
154 for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
155 F77_XFCN (zlup1up, ZLUP1UP, (m, n, l.fortran_vec (),
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
156 m, r.fortran_vec (), k,
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
157 ipvt.fortran_vec (),
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
158 utmp.data (), vtmp.data (), w));
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
159 for (octave_idx_type i = 0; i < m; i++) ipvt(i) -= 1; // decrement
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
160 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
161 else
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
162 (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
163 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
164
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
165 void ComplexLU::update_piv (const ComplexMatrix& u, const ComplexMatrix& v)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
166 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
167 if (packed ())
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
168 unpack ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
169
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
170 ComplexMatrix& l = l_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
171 ComplexMatrix& r = a_fact;
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
172
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
173 octave_idx_type m = l.rows ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
174 octave_idx_type n = r.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
175 octave_idx_type k = l.columns ();
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
176
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
177 if (u.rows () == m && v.rows () == n && u.cols () == v.cols ())
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
178 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
179 OCTAVE_LOCAL_BUFFER (Complex, w, m);
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
180 for (octave_idx_type i = 0; i < m; i++) ipvt(i) += 1; // increment
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
181 for (volatile octave_idx_type i = 0; i < u.cols (); i++)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
182 {
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
183 ComplexColumnVector utmp = u.column (i), vtmp = v.column (i);
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
184 F77_XFCN (zlup1up, ZLUP1UP, (m, n, l.fortran_vec (),
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
185 m, r.fortran_vec (), k,
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
186 ipvt.fortran_vec (),
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
187 utmp.data (), vtmp.data (), w));
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
188 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
189 for (octave_idx_type i = 0; i < m; i++) ipvt(i) -= 1; // decrement
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
190 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
191 else
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
192 (*current_liboctave_error_handler) ("luupdate: dimensions mismatch");
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
193 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
194
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
195 #else
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
196
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
197 void ComplexLU::update (const ComplexColumnVector&, const ComplexColumnVector&)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
198 {
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
199 (*current_liboctave_error_handler)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
200 ("luupdate: not available in this version");
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
201 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
202
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
203 void ComplexLU::update (const ComplexMatrix&, const ComplexMatrix&)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
204 {
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
205 (*current_liboctave_error_handler)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
206 ("luupdate: not available in this version");
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
207 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
208
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
209 void ComplexLU::update_piv (const ComplexColumnVector&,
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
210 const ComplexColumnVector&)
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
211 {
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
212 (*current_liboctave_error_handler)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
213 ("luupdate: not available in this version");
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
214 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
215
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
216 void ComplexLU::update_piv (const ComplexMatrix&, const ComplexMatrix&)
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
217 {
17769
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
218 (*current_liboctave_error_handler)
49a5a4be04a1 maint: Use GNU style coding conventions for code in liboctave/
Rik <rik@octave.org>
parents: 17744
diff changeset
219 ("luupdate: not available in this version");
9708
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
220 }
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
221
6f3ffe11d926 implement luupdate
Jaroslav Hajek <highegg@gmail.com>
parents: 9694
diff changeset
222 #endif