/* ARPACK++ v1.2 2/20/2000 c++ interface to ARPACK code. MODULE ARLGComp.h. Arpack++ class ARluCompGenEig definition (superlu version). ARPACK Authors Richard Lehoucq Danny Sorensen Chao Yang Dept. of Computational & Applied Mathematics Rice University Houston, Texas */ #ifndef ARLGCOMP_H #define ARLGCOMP_H #include #include #include "arch.h" #include "arlnsmat.h" #include "arlnspen.h" #include "arrseig.h" #include "argcomp.h" template class ARluCompGenEig: public virtual ARCompGenEig, ARFLOAT >, ARluNonSymPencil, ARFLOAT > > { private: // a) Data structure used to store matrices. ARluNonSymPencil, ARFLOAT > Pencil; // b) Protected functions: virtual void Copy(const ARluCompGenEig& other); // Makes a deep copy of "other" over "this" object. // Old values are not deleted (this function is to be used // by the copy constructor and the assignment operator only). public: // c) Public functions: // c.1) Functions that allow changes in problem parameters. virtual void ChangeShift(arcomplex sigmap); virtual void SetRegularMode(); virtual void SetShiftInvertMode(arcomplex sigmap); // c.2) Constructors and destructor. ARluCompGenEig() { } // Short constructor. ARluCompGenEig(int nevp, ARluNonSymMatrix, ARFLOAT>& A, ARluNonSymMatrix, ARFLOAT>& B, const std::string& whichp = "LM", int ncvp = 0, ARFLOAT tolp = 0.0, int maxitp = 0, arcomplex* residp = NULL, bool ishiftp = true); // Long constructor (regular mode). ARluCompGenEig(int nevp, ARluNonSymMatrix, ARFLOAT>& A, ARluNonSymMatrix, ARFLOAT>& B, arcomplex sigma, const std::string& whichp = "LM", int ncvp = 0, ARFLOAT tolp = 0.0, int maxitp = 0, arcomplex* residp = NULL, bool ishiftp = true); // Long constructor (shift and invert mode). ARluCompGenEig(const ARluCompGenEig& other) { Copy(other); } // Copy constructor. virtual ~ARluCompGenEig() { } // d) Operators. ARluCompGenEig& operator=(const ARluCompGenEig& other); // Assignment operator. }; // class ARluCompGenEig. // ------------------------------------------------------------------------ // // ARluCompGenEig member functions definition. // // ------------------------------------------------------------------------ // template inline void ARluCompGenEig:: Copy(const ARluCompGenEig& other) { ARCompGenEig, ARFLOAT >, ARluNonSymPencil, ARFLOAT> >:: Copy(other); Pencil = other.Pencil; this->objOP = &Pencil; this->objB = &Pencil; if (this->mode > 2) this->objOP->FactorAsB(this->sigmaR); } // Copy. template inline void ARluCompGenEig::ChangeShift(arcomplex sigmap) { this->objOP->FactorAsB(sigmap); ARrcStdEig >::ChangeShift(sigmap); } // ChangeShift. template inline void ARluCompGenEig::SetRegularMode() { ARStdEig, ARluNonSymPencil, ARFLOAT> >:: SetRegularMode(&Pencil, &ARluNonSymPencil, ARFLOAT>::MultInvBAv); } // SetRegularMode. template inline void ARluCompGenEig:: SetShiftInvertMode(arcomplex sigmap) { ARCompGenEig, ARFLOAT>, ARluNonSymPencil, ARFLOAT> >:: SetShiftInvertMode(sigmap, &Pencil, &ARluNonSymPencil,ARFLOAT>::MultInvAsBv); } // SetShiftInvertMode. template inline ARluCompGenEig:: ARluCompGenEig(int nevp, ARluNonSymMatrix, ARFLOAT>& A, ARluNonSymMatrix, ARFLOAT>& B, const std::string& whichp, int ncvp, ARFLOAT tolp, int maxitp, arcomplex* residp, bool ishiftp) { Pencil.DefineMatrices(A, B); this->NoShift(); this->DefineParameters(A.ncols(), nevp, &Pencil, &ARluNonSymPencil, ARFLOAT>::MultInvBAv, &Pencil, &ARluNonSymPencil, ARFLOAT>::MultBv, whichp, ncvp, tolp, maxitp, residp, ishiftp); } // Long constructor (regular mode). template inline ARluCompGenEig:: ARluCompGenEig(int nevp, ARluNonSymMatrix, ARFLOAT>& A, ARluNonSymMatrix, ARFLOAT>& B, arcomplex sigmap, const std::string& whichp, int ncvp, ARFLOAT tolp, int maxitp, arcomplex* residp, bool ishiftp) { Pencil.DefineMatrices(A, B); this->DefineParameters(A.ncols(), nevp, &Pencil, &ARluNonSymPencil, ARFLOAT>::MultInvAsBv, &Pencil, &ARluNonSymPencil, ARFLOAT>::MultBv, whichp, ncvp, tolp, maxitp, residp, ishiftp); SetShiftInvertMode(sigmap); } // Long constructor (shift and invert mode). template ARluCompGenEig& ARluCompGenEig:: operator=(const ARluCompGenEig& other) { if (this != &other) { // Stroustrup suggestion. this->ClearMem(); Copy(other); } return *this; } // operator=. #endif // ARLGCOMP_H