00001 #ifndef LU_HEADER
00002 #define LU_HEADER
00003
00004
00005
00012
00013
00014
00015
00016 #include <stdlib.h>
00017
00018
00019
00020 #include"Vector.hh"
00021 #include"Rectmat.hh"
00022 #include "Rangedimexc.hh"
00023 #include "Squarexc.hh"
00024
00025
00026
00027 namespace RazorBack {
00028
00033 class Lu_
00034 {
00035
00036 private:
00037
00038 static const double LU_EPSILON;
00039
00040 Rmatdbl_ Lu;
00041 vector<unsigned int> Perm;
00042 int Psign;
00043
00044
00045 public:
00046
00048 explicit Lu_(unsigned int N=3): Lu(N), Perm(N, 0), Psign(0) {}
00049
00051 explicit Lu_(const Rmatdbl_& A): Lu(A.rno()), Perm(A.rno(), 0), Psign(0)
00052 {
00053 decomp(A);
00054 }
00055
00061 int decomp(const Rmatdbl_& A);
00062
00067 double det() const;
00068
00076 Vecdbl_ solve(const Vecdbl_& B) const;
00077
00088 int lineq(const Rmatdbl_& A, const Vecdbl_& B, Vecdbl_& X, unsigned int Maxit=0);
00089
00090 };
00091
00092
00093 }
00094
00095
00096
00097 #endif // LU_HEADER