comparison liboctave/floatLU.cc @ 7789:82be108cc558

First attempt at single precision tyeps * * * corrections to qrupdate single precision routines * * * prefer demotion to single over promotion to double * * * Add single precision support to log2 function * * * Trivial PROJECT file update * * * Cache optimized hermitian/transpose methods * * * Add tests for tranpose/hermitian and ChangeLog entry for new transpose code
author David Bateman <dbateman@free.fr>
date Sun, 27 Apr 2008 22:34:17 +0200
parents
children 5420b8cf011a
comparison
equal deleted inserted replaced
7788:45f5faba05a2 7789:82be108cc558
1 /*
2
3 Copyright (C) 1994, 1995, 1996, 1997, 1999, 2002, 2003, 2004, 2005,
4 2007 John W. Eaton
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
10 Free Software Foundation; either version 3 of the License, or (at your
11 option) any later version.
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
19 along with Octave; see the file COPYING. If not, see
20 <http://www.gnu.org/licenses/>.
21
22 */
23
24 #ifdef HAVE_CONFIG_H
25 #include <config.h>
26 #endif
27
28 #include "floatLU.h"
29 #include "f77-fcn.h"
30 #include "lo-error.h"
31
32 // Instantiate the base LU class for the types we need.
33
34 #include <base-lu.h>
35 #include <base-lu.cc>
36
37 template class base_lu <FloatMatrix, float, FloatMatrix, float>;
38
39 // Define the constructor for this particular derivation.
40
41 extern "C"
42 {
43 F77_RET_T
44 F77_FUNC (sgetrf, SGETRF) (const octave_idx_type&, const octave_idx_type&, float*,
45 const octave_idx_type&, octave_idx_type*, octave_idx_type&);
46 }
47
48 FloatLU::FloatLU (const FloatMatrix& a)
49 {
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);
53
54 ipvt.resize (mn);
55 octave_idx_type *pipvt = ipvt.fortran_vec ();
56
57 a_fact = a;
58 float *tmp_data = a_fact.fortran_vec ();
59
60 octave_idx_type info = 0;
61
62 F77_XFCN (sgetrf, SGETRF, (a_nr, a_nc, tmp_data, a_nr, pipvt, info));
63
64 ipvt -= static_cast<octave_idx_type> (1);
65 }
66
67 /*
68 ;;; Local Variables: ***
69 ;;; mode: C++ ***
70 ;;; End: ***
71 */