Go to the documentation of this file.00001
00002
00003
00004 #ifndef inexactInv_hh
00005 #define inexactInv_hh
00006
00007 #include "eigens.hh"
00008
00009 namespace concepts {
00010
00011 template<typename F>
00012 class Operator;
00013 }
00014
00015 namespace eigensolver {
00016
00017 using concepts::Real;
00018
00019
00020
00033 template<typename F>
00034 class InexactInv : public EigenSolver<F> {
00035 public:
00051 InexactInv(concepts::Operator<F>& A, concepts::Operator<F>& B,
00052 const concepts::Vector<F>& EFguess,
00053 const Real innerTol = 0.5, const uint innerMax = 100,
00054 const Real outerTol = 1e-6, const uint outerMax = 100);
00055
00056 virtual ~InexactInv();
00057 virtual const concepts::Array<F>& getEV() {
00058 compute_();
00059 return returnValue1_; }
00060 virtual const concepts::Array<concepts::Vector<F>*>& getEF() {
00061 compute_();
00062 return returnValue2_;
00063 }
00064 virtual uint iterations() const { return iterations_; }
00065 virtual uint converged() const {
00066 return (epsilon_ < outerTol_) ? 1 : 0;
00067 }
00068 protected:
00069 virtual std::ostream& info(std::ostream& os) const;
00070 private:
00071 concepts::Operator<F>& A_, & B_;
00072 concepts::Array<F> returnValue1_;
00073 F& eigenvalue_;
00074 concepts::Vector<F> eigenfunction_;
00075 concepts::Array<concepts::Vector<F>*> returnValue2_;
00076 Real innerTol_, outerTol_;
00077 uint innerMax_, outerMax_;
00078
00079 uint iterations_, innerIter_;
00080 Real epsilon_;
00081
00082 bool computed_;
00083
00085 void compute_();
00086 };
00087
00088 }
00089
00090 #endif // inexactInv_hh