| Line 19... |
Line 19... |
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
|
*/
|
*/
|
|
|
#include <slepc-private/psimpl.h> /*I "slepcps.h" I*/
|
#include <slepc-private/psimpl.h> /*I "slepcps.h" I*/
|
#include <slepcblaslapack.h>
|
#include <slepcblaslapack.h>
|
|
|
PetscErrorCode PSSolve_HEP_QR(PS,PetscScalar*,PetscScalar*);
|
|
PetscErrorCode PSSolve_HEP_MRRR(PS,PetscScalar*,PetscScalar*);
|
|
typedef PetscErrorCode (*solvefun)(PS,PetscScalar*,PetscScalar*);
|
|
static const solvefun solve[] = {
|
|
PSSolve_HEP_QR,
|
|
PSSolve_HEP_MRRR
|
|
};
|
|
static const char *methodname[] = {
|
|
"Implicit QR method (_steqr)",
|
|
"Relatively Robust Representations (_stevr)"
|
|
};
|
|
|
|
#undef __FUNCT__
|
#undef __FUNCT__
|
#define __FUNCT__ "PSAllocate_HEP"
|
#define __FUNCT__ "PSAllocate_HEP"
|
PetscErrorCode PSAllocate_HEP(PS ps,PetscInt ld)
|
PetscErrorCode PSAllocate_HEP(PS ps,PetscInt ld)
|
{
|
{
|
| Line 113... |
Line 101... |
{
|
{
|
PetscErrorCode ierr;
|
PetscErrorCode ierr;
|
PetscViewerFormat format;
|
PetscViewerFormat format;
|
PetscInt i,j,r,c;
|
PetscInt i,j,r,c;
|
PetscReal value;
|
PetscReal value;
|
|
const char *methodname[] = {
|
|
"Implicit QR method (_steqr)",
|
|
"Relatively Robust Representations (_stevr)"
|
|
};
|
|
|
PetscFunctionBegin;
|
PetscFunctionBegin;
|
ierr = PetscViewerGetFormat(viewer,&format);CHKERRQ(ierr);
|
ierr = PetscViewerGetFormat(viewer,&format);CHKERRQ(ierr);
|
if (format == PETSC_VIEWER_ASCII_INFO || format == PETSC_VIEWER_ASCII_INFO_DETAIL) {
|
if (format == PETSC_VIEWER_ASCII_INFO || format == PETSC_VIEWER_ASCII_INFO_DETAIL) {
|
ierr = PetscViewerASCIIPrintf(viewer,"solving the problem with: %s\n",methodname[ps->method]);CHKERRQ(ierr);
|
ierr = PetscViewerASCIIPrintf(viewer,"solving the problem with: %s\n",methodname[ps->method]);CHKERRQ(ierr);
|
| Line 705... |
Line 697... |
#undef __FUNCT__
|
#undef __FUNCT__
|
#define __FUNCT__ "PSCreate_HEP"
|
#define __FUNCT__ "PSCreate_HEP"
|
PetscErrorCode PSCreate_HEP(PS ps)
|
PetscErrorCode PSCreate_HEP(PS ps)
|
{
|
{
|
PetscFunctionBegin;
|
PetscFunctionBegin;
|
ps->nmeth = 2;
|
|
ps->ops->allocate = PSAllocate_HEP;
|
ps->ops->allocate = PSAllocate_HEP;
|
ps->ops->view = PSView_HEP;
|
ps->ops->view = PSView_HEP;
|
ps->ops->vectors = PSVectors_HEP;
|
ps->ops->vectors = PSVectors_HEP;
|
ps->ops->solve = solve[ps->method];
|
ps->ops->solve[0] = PSSolve_HEP_QR;
|
|
ps->ops->solve[1] = PSSolve_HEP_MRRR;
|
ps->ops->sort = PSSort_HEP;
|
ps->ops->sort = PSSort_HEP;
|
ps->ops->cond = PSCond_HEP;
|
ps->ops->cond = PSCond_HEP;
|
ps->ops->transrks = PSTranslateRKS_HEP;
|
ps->ops->transrks = PSTranslateRKS_HEP;
|
PetscFunctionReturn(0);
|
PetscFunctionReturn(0);
|
}
|
}
|