| Line 18... |
Line 18... |
along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
|
along with SLEPc. If not, see <http://www.gnu.org/licenses/>.
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
*/
|
*/
|
|
|
#include <slepc-private/psimpl.h> /*I "slepcps.h" I*/
|
#include <slepc-private/psimpl.h> /*I "slepcps.h" I*/
|
|
|
|
extern PetscErrorCode EPSDenseHessenberg(PetscInt,PetscInt,PetscScalar*,PetscInt,PetscScalar*);
|
|
extern PetscErrorCode EPSDenseSchur(PetscInt,PetscInt,PetscScalar*,PetscInt,PetscScalar*,PetscScalar*,PetscScalar*);
|
|
|
#undef __FUNCT__
|
#undef __FUNCT__
|
#define __FUNCT__ "PSAllocate_NHEP"
|
#define __FUNCT__ "PSAllocate_NHEP"
|
/*
|
|
*/
|
|
PetscErrorCode PSAllocate_NHEP(PS ps,PetscInt ld)
|
PetscErrorCode PSAllocate_NHEP(PS ps,PetscInt ld)
|
{
|
{
|
PetscErrorCode ierr;
|
PetscErrorCode ierr;
|
|
|
PetscFunctionBegin;
|
PetscFunctionBegin;
|
ierr = PSAllocateMat_Private(ps,PS_MAT_A);CHKERRQ(ierr);
|
ierr = PSAllocateMat_Private(ps,PS_MAT_A);CHKERRQ(ierr);
|
ierr = PSAllocateMat_Private(ps,PS_MAT_Q);CHKERRQ(ierr);
|
ierr = PSAllocateMat_Private(ps,PS_MAT_Q);CHKERRQ(ierr);
|
|
PetscFunctionReturn(0);
|
|
}
|
|
|
|
#undef __FUNCT__
|
|
#define __FUNCT__ "PSSolve_NHEP"
|
|
PetscErrorCode PSSolve_NHEP(PS ps,PetscScalar *eigr,PetscScalar *eigi)
|
|
{
|
|
PetscErrorCode ierr;
|
|
|
|
PetscFunctionBegin;
|
|
if (ps->state<PS_STATE_INTERMEDIATE) { /* reduce to upper Hessenberg form */
|
|
ierr = EPSDenseHessenberg(ps->n,ps->l,ps->mat[PS_MAT_A],ps->ld,ps->mat[PS_MAT_Q]);CHKERRQ(ierr);
|
|
//ierr = EPSDenseHessenberg(nv,eps->nconv,T,ncv,U);CHKERRQ(ierr);
|
|
}
|
|
if (ps->state<PS_STATE_CONDENSED) { /* compute the (real) Schur form */
|
|
ierr = EPSDenseSchur(ps->n,ps->l,ps->mat[PS_MAT_A],ps->ld,ps->mat[PS_MAT_Q],eigr,eigi);CHKERRQ(ierr);
|
|
//ierr = EPSDenseSchur(nv,eps->nconv,T,ncv,U,eps->eigr,eps->eigi);CHKERRQ(ierr);
|
|
}
|
|
PetscFunctionReturn(0);
|
|
}
|
|
|
|
#undef __FUNCT__
|
|
#define __FUNCT__ "PSSort_NHEP"
|
|
PetscErrorCode PSSort_NHEP(PS ps,PetscScalar *eigr,PetscScalar *eigi)
|
|
{
|
|
PetscErrorCode ierr;
|
|
|
|
PetscFunctionBegin;
|
|
//ierr = EPSSortDenseSchur(eps,ps->n,ps->l,ps->mat[PS_MAT_A],ps->ld,ps->mat[PS_MAT_Q],eigr,eigi);CHKERRQ(ierr);
|
|
//ierr = EPSSortDenseSchur(eps,nv,eps->nconv,T,ncv,U,eps->eigr,eps->eigi);CHKERRQ(ierr);
|
PetscFunctionReturn(0);
|
PetscFunctionReturn(0);
|
}
|
}
|
|
|
EXTERN_C_BEGIN
|
EXTERN_C_BEGIN
|
#undef __FUNCT__
|
#undef __FUNCT__
|
| Line 41... |
Line 72... |
PetscErrorCode PSCreate_NHEP(PS ps)
|
PetscErrorCode PSCreate_NHEP(PS ps)
|
{
|
{
|
PetscFunctionBegin;
|
PetscFunctionBegin;
|
ps->ops->allocate = PSAllocate_NHEP;
|
ps->ops->allocate = PSAllocate_NHEP;
|
//ps->ops->computevector = PSComputeVector_NHEP;
|
//ps->ops->computevector = PSComputeVector_NHEP;
|
//ps->ops->solve = PSSolve_NHEP;
|
ps->ops->solve = PSSolve_NHEP;
|
//ps->ops->sort = PSSort_NHEP;
|
ps->ops->sort = PSSort_NHEP;
|
PetscFunctionReturn(0);
|
PetscFunctionReturn(0);
|
}
|
}
|
EXTERN_C_END
|
EXTERN_C_END
|
|
|
|
|