00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #if defined (__GNUG__) && defined (USE_PRAGMA_INTERFACE_IMPLEMENTATION)
00024 #pragma implementation
00025 #endif
00026
00027 #ifdef HAVE_CONFIG_H
00028 #include <config.h>
00029 #endif
00030
00031 #include "dbleLU.h"
00032 #include "f77-fcn.h"
00033 #include "lo-error.h"
00034
00035
00036
00037 #include <base-lu.h>
00038 #include <base-lu.cc>
00039
00040 template class base_lu <Matrix, double, Matrix, double>;
00041
00042
00043
00044 extern "C"
00045 {
00046 F77_RET_T
00047 F77_FUNC (dgetrf, DGETRF) (const int&, const int&, double*,
00048 const int&, int*, int&);
00049 }
00050
00051 LU::LU (const Matrix& a)
00052 {
00053 int a_nr = a.rows ();
00054 int a_nc = a.cols ();
00055 int mn = (a_nr < a_nc ? a_nr : a_nc);
00056
00057 ipvt.resize (mn);
00058 int *pipvt = ipvt.fortran_vec ();
00059
00060 a_fact = a;
00061 double *tmp_data = a_fact.fortran_vec ();
00062
00063 int info = 0;
00064
00065 F77_XFCN (dgetrf, DGETRF, (a_nr, a_nc, tmp_data, a_nr, pipvt, info));
00066
00067 if (f77_exception_encountered)
00068 (*current_liboctave_error_handler) ("unrecoverable error in dgetrf");
00069 else
00070 ipvt -= 1;
00071 }
00072
00073
00074
00075
00076
00077