Mercurial > hg > octave-nkf
annotate liboctave/CmplxLU.cc @ 8589:0131fa223dbc
make length invariant in range-scalar ops
author | Jaroslav Hajek <highegg@gmail.com> |
---|---|
date | Mon, 26 Jan 2009 07:49:04 +0100 |
parents | 445d27d79f4e |
children | eb63fbe60fab |
rev | line source |
---|---|
457 | 1 /* |
2 | |
7017 | 3 Copyright (C) 1994, 1995, 1996, 1997, 1999, 2002, 2003, 2004, 2005, |
4 2007 John W. Eaton | |
457 | 5 |
6 This file is part of Octave. | |
7 | |
8 Octave is free software; you can redistribute it and/or modify it | |
9 under the terms of the GNU General Public License as published by the | |
7016 | 10 Free Software Foundation; either version 3 of the License, or (at your |
11 option) any later version. | |
457 | 12 |
13 Octave is distributed in the hope that it will be useful, but WITHOUT | |
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | |
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License | |
16 for more details. | |
17 | |
18 You should have received a copy of the GNU General Public License | |
7016 | 19 along with Octave; see the file COPYING. If not, see |
20 <http://www.gnu.org/licenses/>. | |
457 | 21 |
22 */ | |
23 | |
24 #ifdef HAVE_CONFIG_H | |
1192 | 25 #include <config.h> |
457 | 26 #endif |
27 | |
28 #include "CmplxLU.h" | |
1847 | 29 #include "f77-fcn.h" |
457 | 30 #include "lo-error.h" |
31 | |
1992 | 32 // Instantiate the base LU class for the types we need. |
33 | |
34 #include <base-lu.h> | |
35 #include <base-lu.cc> | |
36 | |
8367
445d27d79f4e
support permutation matrix objects
Jaroslav Hajek <highegg@gmail.com>
parents:
7482
diff
changeset
|
37 template class base_lu <ComplexMatrix>; |
1992 | 38 |
39 // Define the constructor for this particular derivation. | |
40 | |
457 | 41 extern "C" |
42 { | |
4552 | 43 F77_RET_T |
5275 | 44 F77_FUNC (zgetrf, ZGETRF) (const octave_idx_type&, const octave_idx_type&, Complex*, |
45 const octave_idx_type&, octave_idx_type*, octave_idx_type&); | |
457 | 46 } |
47 | |
48 ComplexLU::ComplexLU (const ComplexMatrix& a) | |
49 { | |
5275 | 50 octave_idx_type a_nr = a.rows (); |
51 octave_idx_type a_nc = a.cols (); | |
52 octave_idx_type mn = (a_nr < a_nc ? a_nr : a_nc); | |
1919 | 53 |
4329 | 54 ipvt.resize (mn); |
5275 | 55 octave_idx_type *pipvt = ipvt.fortran_vec (); |
1919 | 56 |
1992 | 57 a_fact = a; |
58 Complex *tmp_data = a_fact.fortran_vec (); | |
1919 | 59 |
5275 | 60 octave_idx_type info = 0; |
457 | 61 |
4329 | 62 F77_XFCN (zgetrf, ZGETRF, (a_nr, a_nc, tmp_data, a_nr, pipvt, info)); |
457 | 63 |
7482
29980c6b8604
don't check f77_exception_encountered
John W. Eaton <jwe@octave.org>
parents:
7017
diff
changeset
|
64 ipvt -= static_cast<octave_idx_type> (1); |
457 | 65 } |
66 | |
67 /* | |
68 ;;; Local Variables: *** | |
69 ;;; mode: C++ *** | |
70 ;;; End: *** | |
71 */ |